If I have a set of 2 characters (1, 2) its quite simple to work out the number of combinations of those 2 characters given the following rules:

  1. Each combination must be 2 characters
  2. The order of the combination does matter i.e. 12 is not the same as 21
  3. A character can be used more than once e.g. 11

The answer to the above would be:
11,12,21,22 = 4 combinations

Note: the formula below cant be used because it does not take into account rule #2 or rule #3


Now, what if the set of available characters increased to 4 (1, 2, 3, 4) and the same rules applied

The answer would be:
11,12,13,14,21,22,23,24,31,32,33,34,41,42,43,44 = 16 combinations

I am trying to determine a formula to work out the number of combinations given:

  1. The number of available characters (4 in my example above)
  2. The length of each combination (2 in my example above)

I need to use the formula to work determine how many combinations of 6 characters there are from a set of 36 available characters.

Any assistance would be most appreciated. I am feeling dumb.

  • 1
    $\begingroup$ Look at it as each place in the string having a choice of $n$ characters where each character can repeat. So if the length of the string is $k$, you will have $k^n$ distinct strings. $\endgroup$
    – Math Lover
    Commented Feb 11, 2021 at 4:54
  • $\begingroup$ @MathLover the answer from Stacker below suggests the formula should be $n^k$ - would you be able to answer in defence? $\endgroup$
    – Jimbo
    Commented Feb 11, 2021 at 8:23
  • $\begingroup$ No I explained correctly but mistyped in the end :) each place has $n$ choices so it is $n \times n \times ....n = n^k$. $\endgroup$
    – Math Lover
    Commented Feb 11, 2021 at 8:28

1 Answer 1

Slots 1-6:
_  _  _  _  _  _
36 36 36 36 36 36

some examples:

36 choices for the first character, 36 choices for the second, ..., 36 choices for the 6th.


2 billion.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .