1

Let's say that I have a pool of 24 tokens: 4 each of 6 unique colors: RRRR,BBBB,YYYY,GGGG,OOOO,PPPP.

I'm try to determine how many different ways I can pick (i.e. order matters) 4 tokens from that pool. Tokens of the same color are treated as duplicates (ex. $R_1B_1Y_1G_1$ is the same as $R_2B_1Y_1G_1$; $R_1R_2Y_1G_1$ is the same as $R_2R_1Y_1G_1$).

If all the tokens were unique it would be: $^{24}P_4$.

And if I were to pick all 24 tokens it would be: $\frac{24!}{(4!)^6}$.

However I'm not sure how to combine those two formulas to address the scenario where I'm only arranging some of the items in the pool and the pool contains duplicates.

Any help would be greatly appreciated!

  • 1
    Well, if order matters, what's the problem? There are $6$ choices for each color. You have enough of each color so the cap doesn't matter. – lulu Apr 01 '23 at 19:18
  • @lulu. Do you mean that the answer would be $6^4$? If so, then I've been over-complicating things way too much in my head! – Jasper1378 Apr 01 '23 at 19:48
  • Yes, that's the answer. Note: it gets considerably harder if the string length exceeds the cap. If, say, you have to choose $10$ tokens, then of course you can't choose $10$ yellow ones because you haven't got enough of those. – lulu Apr 01 '23 at 19:49
  • Thank you so much for your help! I think I was focusing too much on trying to come up with general formula for this kind of scenario (arranging some items with duplicates) without realizing that for this example, that's overkill. Just out of curiosity, how would you go about solving the scenario that you mentioned (length > availability)? Would you have to break it into cases? – Jasper1378 Apr 01 '23 at 20:01
  • Probably easiest to use Inclusion Exclusion. The unrestricted case is easy, now subtract those that violate each individual cap. Likely to get quite messy in practice. – lulu Apr 01 '23 at 20:05
  • Thank you once again for your help. If you want to post an answer, I'll mark it as accepted. – Jasper1378 Apr 01 '23 at 21:34
  • As @lulu indicated, when the string length exceeds the cap, you need Inclusion-Exclusion. See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula. – user2661923 Apr 01 '23 at 21:52
  • @lulu Actually, re my previous comment, when the string length exceeds the cap, I think that the choice between Inclusion-Exclusion and the direct approach is not so clear cut. Given a cap of $~4,~$ if the string length is (for example) less than $~16,~$ then Inclusion-Exclusion is probably best, because at most 3 of the colors can exceed their cap. However, if (instead), the string length is (for example) 20, then the direct approach is probably best. – user2661923 Apr 01 '23 at 21:57

1 Answers1

1

Case 1: All the tokens picked are of different colours

First we select 4 colours out of the 6 in C(6,4) ways and since the order in which we pick them matters, so the 4 unique colors can swap positions in 4! ways.

That's essentially equal to 4! × C(6,4) or simply P(6,4) = 360

Case 2: 2 tokens are identical of 1 colour and the other 2 are of 2 different colours (other than the 2 identical ones)

The colour for the 2 identical tokens can be chosen in C(6,1) = 6 ways and the other 2 tokens can pick their colours from the remaining 5 colours in C(5,2) = 10 ways

Total combinations = 6 × 10 = 60

Now we have 4 tokens of which 2 are identical

So they can be arranged in 4!/2! = 12 ways

Total permutations= 60 × 12 = 72

Case 3: 2 tokens are identical of 1 colour and other 2 are also identical, but of a colour different from the other 2

The 2 colours for these 4 tokens can be chosen in C(6,2) = 15 ways

Now we have 4 identical tokens, 2 of 1 colour and 2 of another colour

They can be arranged in 4!/(2!2!) = 6 ways

Total permutations = 15 × 6 = 90

Case 4: 3 tokens are identical of 1 colour and 1 left is of a different colour

The colour for the 3 identical tokens can be selected in C(6,1)= 6 ways and the 1 token left can have any of the 5 colours left

Total combinations= 6 × 5 = 30

Now we have 4 tokens out of which 3 are identical

We can arrange them in 4!/3! = 4 ways

Total permutations= 30 × 4 = 120

Case 5: All 4 tokens are of the same colour

Here we only have to choose the colour, which can be done in C(6,1) = 6 ways

So the final answer,

360 + 720 + 90 + 120 + 6 = 1296

Now here's the catch,

When the number of tokens needed to be picked are less than or equal to the number of tokens available of each type, basically we do not have any restriction for any of the 4 tokens that we need to select

Each can have 6 possibilities.

Hence the answer = 6⁴ = 1296

The first method is useful when the number of tokens that need to be selected exceed the number of tokens which are available of any one of the given 6 types

PS: I'm sorry if I wasted your time by providing such a long method. But as I saw in the comments that you were curious to know how to solve it otherwise. So the answer is by manual selecting and then arranging them

Fredrick
  • 132
  • This is a similar question: Find the total number of ways of selecting five letters from the letters of the word INDEPENDENT. How many words can be formed from these five letters? – Fredrick Apr 30 '23 at 13:40