Factorials are useful in many practical and theoretical fields. They can show how many different ways there are to order or arrange a set of things. For example, if you have 4 glasses on a shelf, and want to know how many different ways there are to order or arrange them, simply find the factorial of 4. 4!=4*3*2*1=24.
The function fact(number) returns the factorial of a number. As shown above the factorial of a number is equal to 1*2*3*…* number. Number is the non-negative number for which you want the factorial. If number is not an integer, it is truncated. Factorial of the integer of 1.9 is 1. Factorial of (0) is 1. Negative numbers cause an error value (#NUM!).
Let’s also calculate the percentage chance of getting 3 heads in a row if we flip a coin 10 times. In the process we learn more about use of factorials.