Count the number of combinations
How to count the number of combinations of a string consisting of 10 characters, where only lowercase Latin letters and numbers are used.
I would really like to know the formula.
4 answers
Total characters - 36.
If there can be repetitions - in the first place, how many ways can you choose a character? 36. For each first one, how many can you choose the second one? 36. Total - 36*36. For every first two... - well, and so on.
Total - 3610.
For an alphabet of N characters and a string length of m -
If there can be no repetitions, then the second place is already only 35 (one has already been selected), the third - 34 (two have already been selected)... And so on. Total - 36*35*34*33*32*31*30*29*28*27 = 36!/26!.
For an alphabet of N characters and a string length of m, the number of placements
Two formulas can be used.
If the characters can be repeated, then any of the 10 characters can take one of 36 values (26 Latin letters plus 10 digits). We can say that this is a 10-digit number in the 36-digit number system. The number of combinations will be equal to 3610 or 3,6561584×1015.
If the characters cannot be repeated, then we are dealing with placements of. There are also combinations of , but in this case they are not suitable, because what is the placement of 123abc
and abc123
will be different, but the combination will be the same.
The number of placements from n to k is calculated by the formula Akn = n!/(n - k)!, that is, in your case it will be 36!/26! or 9,2239326×1014
The alphabet used contains 36 characters: 26 letters and 10 digits.
Number of placements without repetitions = n!/(n-k)! = 36!/26!
Number of repetitive placements = nk = 3610
Number of combinations = C!
I.e. in your case 10! combinations...