0
$\begingroup$

I'm having trouble with the following problem.

Consider a random arrangement of $20$ boys and $16$ girls in a line. Let $X$ be the number of boys with girls on both sides. Let $Y$ be the number of girls with boys on both sides. Find $E(X+Y)$.

Any help would be greatly appreciated.

P.S. Here $E(\cdot)$ denotes expectation. For a discrete random variable $Z$ that takes the values $z_1,z_2,\ldots,z_n$ with the corresponding probabilities $p_1,p_2,\ldots,p_n$, the expectation of $Z$ is defined as $E(Z)=\sum_{i=1}^n z_ip_i$.

  • 5
    Hint: work with indicator variables. Let, say, $X_i$ be the indicator variable for the event "the child in slot $i$ is a boy with girls on both sides" and $Y_i$ the variable for the event "the child in slot $i$ is a girl with boys on both sides". Then use Linearity of Expectation.2017-02-21

1 Answers 1

1

Use indicator functions and the Linearity of Expectation.

Let $(X_i)_{i\in\{2,..,35\}}$ be a sequence of indicators where $X_i$ is $0$ unless $1$ when the $i^{th}$ member of the line is a boy and adjacent to a girl on either side.  

Then $X=\sum_{i=2}^{35} X_i$ and $\mathsf E(X_i) = \mathsf P(X_2=1)$ for $i=2,\ldots,35$

So use Linearity of Expectation to find $\mathsf E(X)$.

Do likewise for $\mathsf E(Y)$.

Finally use Linearity of Expectation once more: $\mathsf E(X+Y)=\mathsf E(X)+\mathsf E(Y)$