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.

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