Permutations without repetitions (exclude repeated permutations) [duplicate]

$\begingroup$

The formula to calculate all permutations without repetitions of the set {1,2,3} is $\dfrac{n!}{(n-r)!}$ But how to calculate it if the set (or rather array in programming terms) includes repeated numbers {1,2,2,3,3} so that you don't add up same permutations?

$\endgroup$ 4

3 Answers

$\begingroup$

First, to clear something up: the formula $\frac{n!}{r!(n-r)!}$ is for a combination (i.e., the number of ways you can choose $r$ elements from a set of $n$ disregarding order), not a permutation. The formula for the number of permutations of a set with $n$ elements is simply $n!$.

Now, let's say we have your set $\{1,2_1,2_2,3_1,3_2\}$. It has $5$ elements, so there are $5!=120$ ways of permuting it $-$ or there would be, if we could tell every element apart. However, we don't actually want to consider two orderings different if they only differ by the swapping around of $2_1$ and $2_2$ and/or $3_1$ and $3_2$. So first let's say that we only care about the sequences where $2_1$ comes before $2_2$. Then we can throw away half of our 120 permutations (because every permutation that has $2_1$ before $2_2$ comes with a partner that is the same except with the two swapped), so we're down to $60$ permutations. We can use the same logic with $3_1$ and $3_2$ to cut our answer down to $30$ unique permutations, which is our final answer.

In general, if we have a set $\{a_1,a_2,\dots,a_n\}$, for each group of $k$ indistinguishable elements, we need to divide our initial result of $n!$ permutations by $k!$ (which you can justify using the same "ordering" argument as presented in the paragraph above).

$\endgroup$ $\begingroup$

If the set includes repeated terms it is actually not that different.

Take for example you want to find all different combinations of 'aabbcc'. What you would do is $\dfrac{6!}{2!2!2!}$, the numerator comes from the number of letters in 'aabbcc' and the denominator comes from all the repeated letters (we have 2 a's, 2 b's, and 2 c's).

You can do the same for numbers. To calculate the number of different permutations of {1,1,2,2,3,3}. It is just $\dfrac{6!}{2!2!2!}$, which is $\boxed{90}$ different permutations.

$\endgroup$ $\begingroup$

There is a standard formula to deal with such cases.

If n total objects have $k_1$ of one kind, $k_2$ of another, ......

number of permutations = $\dfrac{n!}{k_1!\cdot k_2!...}$

For your particular case, for instance, it would be $\dfrac{5!}{1!2!2!}$

The 1's in the denominator can conveniently be left out. so $\dfrac{5!}{2!2!}$

$\endgroup$

You Might Also Like