A family with a mother, father, two daughters and three sons lines up in a random order for a photo. (a) Let D be the random variable denoting the number of daughters who are standing next to the mother and for i = 1,2 let Di be the indicator variable that is 1 if daughter i is next to the mother and 0 otherwise. What is the relationship between D, D1, and D2? Solution: D = D1 + D2
Well, I don't really get the logic here...
The possible positions of the mother and two daughters are as follows: (where $x$ represents a person other than the daughters) \begin{align*} \ldots,x,m,d_i, x,x,\ldots\\ \ldots,d_i,m,x,x,\ldots\\ \ldots,d_i,m,d_j, x,x,\ldots\\ \ldots,x,m,x,x,\ldots\\ \end{align*} In the first two cases, $D=1$, in the third case $D=2$, and in the last case $D=0$.
Likewise, in the first two cases, one of the indicator functions takes on the value $1$ and the other $0$. So $D=D_1+D_2$.
You can deal with the remaining cases similarly.