# Math Help - Expectation and variance of number of groups

1. ## Expectation and variance of number of groups

Five distinct families, each consisting of 3 people are randomly arranged in a straight line. Let X denote the number of families that are sitting next to each other (that is all three people are sitting together). What is E[X] and Var[X]?

My work:

There are 15 people.

Number of ways all five families sit together
= 5!*(3!)^5 as there are 5! ways to arrange the families and 3! ways to arrange the members of the family

Number of ways four families sit together
= ways four families sit together and one family does not
= ways five families sit together - ways one family does not
= 5!*(3!)^5 - 5C1(???)

I'm unsure how to calculate the number of ways one family does not sit together. Also is there an easier way to calculate expectation and variance (perhaps using indicator variables) than to find E[X] by finding P(X = n) where n = 1,2,3,4,5? The way I'm trying to solve the problem is pretty tedious

2. ## Re: Expectation and variance of number of groups

Originally Posted by Capital
Five distinct families, each consisting of 3 people are randomly arranged in a straight line. Let X denote the number of families that are sitting next to each other (that is all three people are sitting together). What is E[X] and Var[X]
This is almost too tedious a counting question to try.
Do you realize that $X=0,1,2,3,4,\text{ or }5~?$
Let the families be denoted by $A,B,C,D,~\&~E~.$

You know the total number of ways to form this line is $15!$.

The number of ways to form this line with all of family $A$ together is $(13!)(3!)$. But that is not the case $X=1$ In fact, in that number there may be any number of other of the families all together.

The number of ways to form this line with each of the five families is together is $(5!)(3!)^5$

The case where there are exactly two families together is very difficult.

Now we can use the inclusion/exclusion counting principle to find the number of ways to have at least one of the families all together. The complement of that is the case where $X=0$.

I said that it a nightmare. I hope this helps.

3. ## Re: Expectation and variance of number of groups

I don't want to use inclusion/exclusion if I can avoid it. Would it be easier to do it with an indicator variable? This is what I tried.

Let Xi = 1 if the ith person has a family member on both his left and right and 0 otherwise.
where i is the ith person in the line so i = 2, 3, 4, ... 14 (omit i = 1 and 15 because there is nobody on left or right)

P(Xi) = 1/14*1/13*2 as the probability the family members on the left and right of the ith person are 1/14*1/13 and they can be switched so multiply by 2.

X = X2+ X3+ .. + X14

E[X] = Sum of P(Xi) from i = 2 to 14

So E[X] = 13*1/14*1/13*2 = 1/7

Does that seem reasonable?