AsleepInYorkshire wrote:100 chicks sit peacefully in a circle in a barn. Each chick suddenly pecks the chick randomly once to its left or right. What is the expected number of unpecked chicks.
There's insufficient information to answer that question, in two different ways. In all that follows, I'll assume that the chicks are all facing the centre of the circle and are numbered clockwise around the circle, so that chick N pecking to its right means it pecks chick N-1 (with 1-1 wrapping around to 100) and chick N pecking to its left means it pecks chick N+1 (with 100+1 wrapping around to 1) - other assumptions don't change anything essential, they just create a messy set of "left"/"right" wording swaps depending on which way a chick is facing and whether the chicks are numbered clockwise or anticlockwise around the circle:
Firstly, as already mentioned in the thread, we're only told that the chicks' choices of pecking direction are made randomly, not that they're made independently of each other. If for example the mother hen says to her (rather implausibly) large number of offspring "I'm about to toss a coin - if it comes up heads, then you're all to peck to the right; if it comes up tails, you're all to peck to the left", and she then tosses a fair coin and the chicks all obey her (and know the difference between their left and their right!), then every chick's choice of pecking direction has been determined randomly. But there are only two possible results of the coin toss, and for both of them no chick is left unpecked, so the expected number of unpecked chicks is 0 in this case.
Secondly, even if the chicks' choices of pecking direction are made both randomly and independently of each other, we're not told that they choose the two directions with equal probabilities. If for example every chick makes their random choice by throwing a fair die and pecking to the left if a 6 is thrown and to the right otherwise, then each chick has a 5/6ths chance of being pecked by the chick on its left and an independent 1/6th chance of being pecked by the chick on its right, so a (1-5/6)*(1-1/6) = 5/36ths chance of remaining unpecked, and so the expected number of unpecked chicks is 100 * 5/36 = 13.888...
If the chicks' choices of pecking direction are made independently of each other, and all with equal 1/2 chances of being a leftwards peck and a rightwards peck, then as others have said, the chance of a chick remaining unpecked is (1-1/2)*(1-1/2) = 1/4, and so the expected number of unpecked chicks is 100 * 1/4 = 25.
GoSeigen wrote:I did a quick google and came up with "the expectation of the sum equals the sum of the expectations even if the events are not independent". Or something like that, it dredged up ancient memories of A level. Just a matter of time before Geng writes a ridiculously lucid summary of the maths.
Yes, that's exactly the mathematical result required to justify my "... and so the expected number of unpecked chicks is X" statements at the ends of the last two paragraphs of the previous section of this reply.
One does need to be careful about which pairs of events are independent of each other. The arguments in those paragraphs about the chance of a chick N remaining unpecked depend on chick N-1 not pecking to its left and chick N+1 not pecking to its right being independent events, which follows from the assumptions at the start of those paragraphs that the chicks' choices of pecking direction are made independently of each other. The final "... and so the expected number of unpecked chicks is X" statements follow from applying the result you've found to the number of unpecked chicks, which is the sum from N=1 to 100 of U(N), where U(N) = 1 if chick N is unpecked and 0 if it is pecked. As jfgw has observed, the event that U(N) = 1 is not independent of the events that U(N+2) and U(N-2) are 1, because both U(N) and U(N+2) depend on chick N+1's choice of pecking direction and both U(N) and U(N-2) depend on chick N-1's choice of pecking direction. But as the result you've found says, it doesn't depend on independence.
So one part of the argument does depend on "chick N-1 pecks to its right" and "chick N+1 pecks to its left" being independent events, which they are assumed to be in those arguments, and a later part of the argument does involve both "chick N+1 pecks to its right" and "chick N+1 pecks to its left" events, which are definitely not independent events, but doesn't care about that lack of independence (and similarly it involves both "chick N-1 pecks to its right" and "chick N-1 pecks to its left" events, but doesn't care that they're not independent of each other).
GoSeigen wrote:Can I call him a good egg?
Yes, I think you've just demonstrated that you're entirely capable of that feat! ;
-)
Gengulphus