How can I calculate the total number of possible anagrams for a set of letters? How can I calculate the total number of possible anagrams for a set of letters?
For example:
"Math" : 24 possible combinations.
math
maht
mtah
mtha
mhat
mhta
amth
amht
atmh
athm
ahmt
ahtm
tmah
tmha
tamh
tahm
thma
tham
hmat
hmta
hamt
hatm
htma
htam
Total: 24

I generated this by actually generating each combination, one by one, but I want to know the formula for calculating the total possible number of combinations of any group of letters.

$n!$, that is factorial of $n$, where $n$ is the number of digits.
If $n=4$, then $4! = 1\times 2\times 3\times 4$
$n! = 1\times 2\times 3\dots\times n$
