nCr results in too big numbers
Answered
Hi,
I have a problem with factorial producing too big number
func(n, k) = n! / (n - k)! / k! b^k (1 - b)^(n - k)
As n is the big number (around 0 to 500) and k the small one (interval 0 to 5) in my bernoilli experiment I would like to have a function that tells geogebra to (the following is Java-Code):
myFunction(int n, int k) { int product = 1; for (int i = n; i > n-k; n--) product *= i; return product; }to simplify this part of the equation and avoid the big numbers above '171!'
n! / (n - k)!
Is this possible with some javascript trickery or is it useless because GeoGebra is already smart enough to optimize it and this would not do anything at all?
Thanks in advance
Please explain overall what you are trying to do
This almost works, sadly nPr gives 0 for non-integers
What do you want to do with it? Just plot graph, or calculate?
Try like this using the CAS View and a trick...
Veo que no entendí la petición correctamente cuando contesté con el anterior post en el que daba una herramienta que hacía pequeño el cálculo de nCr
viendo el truco de Michael no era tan complicado encontrar la llamada nPr2(x) porque basta con usar
g(x) = Polynomial(Product(Sequence(x - k, k, 0, n - 1))) que es lo mismo pero sin CAS y sin integrar
así b_k(x)=g(x)/k! p^k (1-p)^(x-k)
Comments have been locked on this page!