How many permutations of 2 things, each appearing an arbitrary number of times in an arbitrarily sized set?

28 Views Asked by At

Say I have 3 A's and 2 B's, which make up a set of 5 numbers.

How many permutations are there of that set?

Doing it by hand, I can see that there are 10, but with my relatively limited math knowledge, I haven't really been able to see any obvious pattern when you change the numbers.

What's the formula that would tell me how many permutations there are?

1

There are 1 best solutions below

0
On

Preface

This is a simple question, and uses simple binomial calculation. However, it can be generalized. Here, I shall provide two possible solutions. Depending on the situation of the problem, as well as its complexity, you might choose to use which method.

Solution 1

The number of ways to choose 3 out of 5 slots for the A's is $\binom {5}{3} =10$ ways

That is the answer to this problem.

The solution can be generalized as following: Given a set of k character, consider the couple $(a_i,b_i)$ with $a_i$ refers to the character and $b_i$ represents the number of appearances.

Then, the answer is as follow:

$ \binom{b_1+b_2+...b_k}{b_1} + \binom{b_2+b_3+...+b_k}{b_2} + ... + \binom{b_k}{b_k}$

Solution 2

I first assume that the five characters given are different, then I have $5!=120$ ways to arrange them.

Now because the A's are the same, and the B's are the same, changing their situations does not matter. Therefore, the number of repetitions are: $3! \times 2! =12$

This means that actually, there are only: $ \frac{120}{12}=10$ ways to arrange the numbers.

The generalization is as following:

Denote the couples $(a_i,b_i)$ as in solution 1

Denote $S= \sum_{i=1}^{k} b_i$

The total number of solutions is:

$ \frac{S!}{b_1! \times b_2! \times b_3! \times... \times b_k!}$

Post script: I left here two possibles solutions to this question, as it depends on the situation that you chooses to use which solution to the generalised problem