0

I want to find the total of possible unique combinations of numbers

example:

  • 1234 = 24 combinations
  • 1233 = 12 combinations
  • 55666 = 10 combinations

can I use math formula to calculate this ?

thanks

Edxz
  • 111
  • 1
  • 1
  • 3

1 Answers1

4

Let's say you have a string of length 5: $$ABCDE$$ How many different permutations of this string exist? You have 5 possible letters for Position 1, 4 for Position 2, 3 for Position 3, 2 for Position 4 and 1 for Position 5. So in total: $5!$

Now look at the following string: AABCD Still, you'd have $5!$ permutations of this string. But not all of them are different as we have 2 A's. The positions of the A's can be switched and the string doesn't change. How many ways are there to switch the A's in a string?

$$2!$$

So the answer would be: $$\frac{5!}{2!} = 60$$

Doc
  • 519
  • I don't understand the second example, what about the combination of 'AABBC' ? – Edxz Jul 22 '15 at 07:52
  • In each of the $5!$ permutations of $AABBC$ you can switch the positions of the 2 A's and the 2 B's and the string does not change. How many permutations(not different) are there of the string 'AA' or the string 'BB'. $2!$. So you get $$\frac{5!}{2!2!}$$.

    One more example. For 'AAABC' you'd get $$\frac{5!}{3!}$$. Does this make it more clear? What don't you understand exactly?

    – Doc Jul 22 '15 at 07:56
  • so for 'ABCCDDD' the formula is 7!/2!3! right ? – Edxz Jul 22 '15 at 08:06
  • You're welcome. – Doc Jul 22 '15 at 08:12
  • I have my doubt with this solution. Correct me if I am wrong. The calculation that in AABCD the combinations of AA are 2! does not consider whole combinations like ABACD, ABCDA, ABCAD. These each have '2!' combination when switching A. So the final unique combinations for 'AABCD' would be far less than 60. – Omkar Khair Jan 15 '17 at 06:29
  • Thats why you divide by $2!$. Look, in total you have $5!$ permutations. But to every single permutation there is another different permutation, that looks exactly the same. This is the one that comes from switching the $A$'s. So you count twice as much permutations as you actually wanted, thus you need to divide by $2$, which is $2!$. Hope this clarifies it. If not, let me know – Doc Jan 15 '17 at 11:55