0
How to get simplified equation in code without using any library from pip? Pascal Triangle and exponential equation ?
Below is code how to get result without using Library simplify https://code.sololearn.com/cYcDGXmC27Mq/?ref=app
2 Answers
0
Is this a question you need answered?
https://www.sololearn.com/discuss/3021159/?ref=app
0
You are talking about binomial coefficients, also expressed as "n choose k".
You can find a couple of calculation methods on Wikipedia.
I think the easiest one is using recursion.
You can also use factorial in Python too.
But both of these approaches will become inefficient when the n or k are large numbers.
https://en.wikipedia.org/wiki/Binomial_coefficient
Alternatively you could just tap into the sympy library and use the binomial() function.
https://www.geeksforgeeks.org/python-sympy-binomial-method/
https://docs.sympy.org/latest/modules/functions/combinatorial.html