How many permutations given some condition(s)

105 Views Asked by At
Say you have six colored pencils: 2 green, 2 blue and 2 yellow 
and a given condition that no pencil of the same color can be next 
to each other

How many ways to arrange the pencils if
 a. The pencils of the same color are identical.
 b. The pencils of the same color are unique.

I tried solving by going from left to right and finding how many possibilities are in each slot and multiplying but it doesn't seem like my calculation is correct.

e.g. for a. I did something like

3 * 2 *....

because there are 3 choices for the first pencil 2 for the second etc

2

There are 2 best solutions below

2
On BEST ANSWER

a. Pencils of the same color are identical.

Number the positions from left to right. Let's start by counting the arrangements with a blue pencil in position 1. There are four places to put the other blue pencil; then the number of arrangements of the other pencils depends on the position of the blue pencils.

Case I. B-B--- 2 arrangements: we can put a green or a yellow pencil in position 5, then the rest is forced.

Case II. B--B-- 4 arrangements: a green and yellow pencil (in either order) in positions 2 & 3, and the same for positions 5 & 6.

Case III. B---B- 2 arrangements: this is similar to Case I.

Case IV. B----B: 2 arrangements: we put a green and a yellow pencil in the two middle positions, and then the rest is forced.

So there are $2+4+2+2=10$ arrangements with a blue pencil in at the left end. By symmetry (because there are the same number of pencils of each color), there are also $10$ arrangements with a green pencil and $10$ arrangements with a yellow pencil at the left end, for a total of $10+10+10=30$ arrangements.

b. All pencils are distinguishable.

Each of the $30$ arrangements from a gives rise to $2\cdot2\cdot2=8$ arrangements by interchanging the two blue pencils, the two green pencils, and the two yellow pencils; so the number of arrangements is now $30\cdot8=240$.

Alternative solution to part a:

Let $A$ be the set of all possible arrangements of the six pencils, assuming that pencils of the same color are indistinguishable; in other words, $A$ is the set of all $6$-letter words containing $2$ Bs, $2$ Rs, and $2$ Y's. The cardinality of $A$ is given by a trinomial coefficient: $$|A|=\binom6{2,2,2}=\frac{6!}{2!2!2!}=90.$$ We want to find $|A\setminus(B\cup R\cup Y)|$ where $B$ is the set of all arrangements with the two blue pencils adjacent, $R$ the set of all arrangements with the two red pencils adjacent, and $Y$ the set of all arrangements with the two yellow pencils adjacent. The in-and-out principle, also known as the inclusion-exclusion principle, tells us that $$|A\setminus(B\cup R\cup Y)|=|A|-|B|-|R|-|Y|+|B\cap R|+|B\cap Y|+|R\cap Y|-|B\cap R\cap Y|.$$ By symmetry (since we have two pencils of each color), we have $|B|=|R|=|Y|$ and $|B\cap R|=|B\cap Y|=|R\cap Y|$, so we can write the in-and-out formula more simply: $$|A\setminus(B\cup R\cup Y)|=|A|-3|B|+3|B\cap R|-3|B\cap R\cap Y|.$$ Now, if we glue the two blue pencils together and regard them as a unit, we can figure $|B|$ the same way we figured $|A|$, namely, $$|B|=\binom5{1,2,2}=\frac{5!}{1!2!2!}=30.$$ Likewise, $$|B\cap R|=\binom4{1,1,2}=\frac{4!}{1!1!2!}=12,$$ and $$|B\cap R\cap Y|=\binom3{1,1,1}=\frac{3!}{1!1!1!}=3!=6,$$ and so finally $$|A\setminus(B\cup R\cup Y)|=\binom6{2,2,2}-3\binom5{1,2,2}+3\binom4{1,1,2}+\binom3{1,1,1}=90-90+36-6=30.$$

0
On

Try to analyse the cases which you might get while arranging these pencils. Assume six slots.$$------$$ and the pencils as G,G,B,B,Y,Y. We'll consider the first part, where pencils of same colour are identical.

Now, for the first slot, you have $3$ options - G,B,Y. Say you put G. $$G-----$$For the second slot, you have 2 options - B,Y. Say you put B. $$GB----$$ Now, you will get $2$ cases.

Case $1$: Say you put G in the third slot. $$GBG---$$Now, in the fourth slot, you cannot put B, otherwise, you will be left with Y,Y, and we cannot put them together. So, you have only $1$ choice for the fourth slot in this case, i.e, Y. After this, you again have only one choice each for the fifth and the sixth slots, i.e, B and Y respectively. So, finally, the possibilities are $3*2*1*1*1*1$, which is your answer for this case.

Case $2$: Say you put Y in the third slot. $$GBY---$$ Now, you have $2$ choices each again for the fourth slot, fifth slot, and $1$ choice for the sixth slot. So, the possibilities are $3*2*1*2*2*1$, which is your answer for this case.

Work out the second part. The cases will remain same. The number of choices will change.