Probability/Linearity of expectation - Foxes and Hounds I came across this question on a probability problems app I found. Can't seem to get my head around it.
"Five foxes and seven hounds run into a foxhole. While they're inside they get all jumbled up, so that all orderings are equally likely.
The foxes and hounds run out of the hole in a neat line. On average, how many foxes are immediately followed by a hound?"
The given hint: Linearity of expectation will help:
frame the foxes 1,2..,5, and X_i be an indicator of whether a fox is followed by a hound. The answer is E[X_1 + ... + X_5] = E[X_1] + .. E[X_5].
I tried to individually frame each term in the aforementioned formula but I can't seem to get it right. The approach was something like this.
So for the first time I assumed a situation where there exists only one such fox-hound pair(let a be foxes and b be hounds):
bbbbbbaaaa ab.
Which is equivalent to calculating the unique ways to place one object in 11 distinguishable boxes. And so on for other number of pairs.
I also tried an approach where I calculated all the orderings with 1,2..5 pairs, i.e, "fox followed by a hound" instances, multiplied them with the respective number of pairs and divided by the total number of possible pairings, however, I wasn't able to get the right answer.
Any hints or direction towards the right approach(s) are appreciated.
Thanks!

Let $X_i$ be the indicator function that canid #$i$ out of the hole is a fox and followed by a hound.
Then the average count of canids who are a fox and followed by a hound is: $\mathsf E(\sum_{i=1}^{12}X_i)$
We note that the 12th canid cannot be followed by any other (end of line), but for all 11 other foxes $\mathsf E(X_i)=\mathsf P(X_i=1)= \tfrac 5{12}\cdot\tfrac 7{11}$.   Then the Linearity of Expectation says, "The expectation of the sum is the sum of the expectations!"

 $$\mathsf E(\sum_{i=1}^{12}X_i) ~=~ \sum_{i=1}^{11} \mathsf P(X_i=1)+0 ~=~ \dfrac {35}{12}$$


Alternatively, let $Y_j$ be the indicator that fox $j$ is followed by a hound.   Now we are after $~\mathsf E(\sum_{j=1}^5 Y_j)~$, though this is the same average count as above.
We observe that there are 11 of 12 positions any fox can be followed by something, and when given such a position, 7 of the 11 possible pursuers are hounds.   Thus: $\mathsf E(Y_j)~=~\mathsf P(Y_j=1) ~=~ \tfrac 7{12}$.   Hence by Linearity of expectation we sum over the five foxes:

 $$\mathsf E(\sum_{j=1}^5 Y_j) ~=~ \sum_{j=1}^5 \mathsf P(Y_j=1) ~=~ \dfrac {35}{12}$$

Same answer, different approach.
