# Factorial Calculator

## Don't forget to share this tool!

## What is a factorial?

A factorial is defined as the product of all positive divisors of a number. For example, 5! (read as 5 factorial) = 5 x 4 x 3 x 2 x 1 = 120.

## How is a factorial calculated ?

There are several methods you can use to calculate a factorial:

Using a loop:Create a loop and continue the operation from 1 to the number. Update the product at each step.

Using a recursive function:Create a recursive function and decrease the number by 1 at each call. If the number is equal to 0, the function returns 1. Otherwise, it returns the number multiplied by the value returned by the called function.

Using pre-defined functions available. For example, in Python, math.factorial() function can be used for calculating factorial.

## What is 0! equal to?

0! is equal to 1. Because 0 factorial is defined as zero factorial and the factorial of zero is 1. This is a rule accepted in mathematics.

## What is 1! equal to?

1! is equal to 1. Because 1 factorial only takes in the number 1 itself, and therefore 1! = 1.

## What are some example applications of factorials ?

Factorials are used in many areas of mathematics and science. Below are some example applications:

Permutation and Combination:Factorials are used in permutation and combination operations. For example, to select r elements from a set of n elements, the formula n!/(n-r)! is used.

Binomials:Factorials are used in the usage of binomials. For example, (x+y)^n = x^n+y^n + (n choose 1)*x^(n-1)*y + (n choose 2)*x^(n-2)*y^2+...

Combinatoric Problems:Factorials are used in solving combinatoric problems. For example, to find out how many different ways a group can be formed, factorials are used.

Parabola:Factorials are used in probability. For example, to calculate the possible outcomes of an experiment, factorials are used.

Calculus:Factorials are used in chemistry and physics for applications related to integral and derivatives.