What is the probability that a person wearing a blue t-shirt will sit next to one wearing red? 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. 


*

*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.


*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.
 A: 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.
A: Following Graham Kemp's suggestion, first line up the yellow shirts in a row, creating 5 gaps.
1) If the red shirts are in the same gap, there are 5 choices for their gap and then $\binom{6}{3}$ ways to place the 3 blue shirts in the remaining 4 gaps; so this gives $5\binom{6}{3}$ possibilities.
2) If the red shirts are in different gaps, there are $\binom{5}{2}$ choices for their gaps and then $\binom{5}{3}$ ways to place the 3 blue shirts in the remaining 3 gaps; so this gives $\binom{5}{2}\binom{5}{3}$ possibilities.
Therefore the probability that a blue shirt is next to a red one is given by
$\hspace{.3 in}\displaystyle 1-\frac{5\binom{6}{3}+\binom{5}{2}\binom{5}{3}}{\binom{9}{4}\binom{5}{3}}=1-\frac{100+100}{1260}=1-\frac{10}{63}=\frac{53}{63}$
A: Hint: It might be easier to count the complement. 
How many equally probable ways can you arrange two red and three blue shirts such that they are separated into five colour-separated boxes (with the four yellow shirts forming 'walls' so there is at least one between any red and blue shirt)
A: Comment: (If I understand the problem properly.)
In case it is of assistance checking analytical results, here is
a simulation in R that approximates the distribution of $X,$ the number of red-blue adjacencies, for people randomly
seated in a row. The program uses a trick in assigning numbers
to colors so that the absolute difference is 1 whenever a red
shirt is next to a blue one. I believe $P(X \ge 1)$ is the answer
to your problem.
 shirts = c(1,1,2,2,2,5,5,5,5) # 1=Red, 2=Blue, 5=Yellow
 m = 10^6; rb.adj = numeric(m) # rb.adj = nr red-blue adjacencies
 for (i in 1:m) {
  perm = sample(shirts, 9)
  rb.adj[i] = (sum(abs(diff(perm))==1)) }
 mean(rb.adj >= 1)  # aprx P(X >= 1)
 ##  0.841706  
 table(rb.adj)/m   # aprx dist'n of X
 ## rb.adj
 ##        0        1        2        3        4 
 ## 0.158294 0.436611 0.321367 0.079765 0.003963 

A million performances of the experiment should give results
accurate to two (maybe three) places. Any arrangement with BRBRB
has $X = 4$ and $P(X = 4) = 12(5!)/9! \approx 0.004,$ which
is a little too small reliably to approximate with small relative error. (I 'cheated' by showing the best of three simulation runs.)
