JavaScript Factorial
- Started
- Last post
- 7 Responses
- dMullins0
Enter Q into the prompt to stop the prompt box btw.
- kingsteven0
your function works. no? you just have to enter the same argument for both x and y.
- kingsteven0
BTW: here's the two standard methods of calculating factorials and (if you understand the recursive approach and it's pros/cons, use it. it'll probably get you some bonus points)
- dMullins0
Thanks, buddy. I was trying to get it to work with the product of two numbers instead of having to enter the same number twice. We'll see what happens today.
- dbloc0
is it bad that I don't even know what factorial is?
- kingsteven0
You want to find out how many possible ways you can arrange 3 objects = 3! (exclamation is notation for the factorial) = 3x2x1 = 6
52 objects (ie. a deck of cards) = 52! = 80658175170943878571660636856403...
To find out the probability of any possible hand in 5 card draw = 5!*47!/52! = 2598960
- 'supkingsteven
- obvs you don't need to multiply by 1 and the second answer has been cropped, but you get the idea.kingsteven