[Math] the probability that a person wearing a blue t-shirt will sit next to one wearing red

combinatoricsprobabilitystatistics

9 people sit in a row linearly. 2 dressed in Red, 3 blue and 4 in yellow. What is the probability that a person in blue will sit next to a person in red? Why?

RRBBBYYYY this sequence from what I gather can be arranged in 9! ways.

  1. Attempt

There are 2 groups R and Y we want to seat together. The Y(people wearing yellow) can be arranged in 4! ways and people wearing red in 2! ways.
Therefore 2 x 3! x 2! should be the right answer.

Times 2 because we only want to consider two groups. (I think this is where I am going wrong because there are 3) If there were two groups of people the. i am guessing it would be right. However there are 3 groups and I have no idea how to show it.

  1. Attempt

There is a total lf 9!/2!x3!x4 = 1260 ways they can be seated. These however will be in random order and I can't figure out how to put them in an order that R sits next to Y.

Best Answer

Since an incorrect execution of Graham Kemp's hint has been posted, I'll post what I believe to be a correct one.

First, add a fifth yellow person and close the row into a circle. Each of the linear arrangements is obtained in exactly one way by removing one of the yellow people from a circular arrangement, and the corresponding arrangements agree on whether a red and a blue person sit next to each other, so we get the same probability by considering the circular arrangements, which obviates cumbersome case distinctions for the margins.

Now we have five compartments. If the two reds are in the same compartment, glue them together in one of $2$ orders, glue a yellow to either side of them, choosing the yellows in $5\cdot4=20$ ways, and permute the resulting $7$ objects in $(7-1)!=6!$ cyclically inequivalent ways. If they're in adjacent compartments, choose one of $2$ orders for them, glue a yellow to either side and one between them, choosing the yellows in $5\cdot4\cdot3=60$ ways, and permute the resulting $6$ objects in $(6-1)!=5!$ cyclically inequivalent ways. If they're in non-adjacent compartments, glue two yellows on either side of each of them, choosing the yellows in $5!=120$ ways, and permute the resulting $6$ objects in $(6-1)!=5!$ cyclically inequivalent ways. The total is $2\cdot20\cdot6!+2\cdot60\cdot5!+120\cdot5!=57600$. Without restrictions, we have $(10-1)!=9!=362880$ cyclically inequivalent arrangements. Thus the probability not to have a red and a blue adjacent is $\frac{57600}{362880}=\frac{10}{63}$, and the complementary probability to have a red and a blue adjacent is $1-\frac{10}{63}=\frac{53}{63}\approx84\%$, in agreement with BruceET's simulation.