5

If n birds are sitting in circle, each pecks its left or right bird with equal probability.

What is the distribution of number of pecked birds?

Note at least $\frac{n}{2}$ birds get pecked, so it cannot be binomial.

Also note that analysis for number of unpecked birds is $\frac{n}{4}$ for $n > 2$, which is actually just a coincidence if you assume binomial. For $n=1$ and $n=2$ all birds are necessarily pecked.

Also if there are $5$ birds a,b,c,d,e in order, if c is not pecked then both a and e must be pecked, so treating them as independent events are also not correct.

The distribution looks like this for various values of $n$. (Divide by $2^n$ as to get probability)

1   {1 -> 2}
2   {2 -> 4}
3   {2 -> 6, 3 -> 2}
4   {2 -> 4, 3 -> 8, 4 -> 4}
5   {3 -> 10, 4 -> 20, 5 -> 2}
6   {4 -> 36, 5 -> 24, 6 -> 4}
7   {4 -> 14, 5 -> 70, 6 -> 42, 7 -> 2}
8   {4 -> 4, 5 -> 48, 6 -> 152, 7 -> 48, 8 -> 4}
9   {5 -> 18, 6 -> 168, 7 -> 252, 8 -> 72, 9 -> 2}
10  {6 -> 100, 7 -> 400, 8 -> 440, 9 -> 80, 10 -> 4}
11  {6 -> 22, 7 -> 330, 8 -> 924, 9 -> 660, 10 -> 110, 11 -> 2}
12  {6 -> 4, 7 -> 120, 8 -> 1020, 9 -> 1808, 10 -> 1020, 11 -> 120, 12 -> 4}
13  {7 -> 26, 8 -> 572, 9 -> 2574, 10 -> 3432, 11 -> 1430, 12 -> 156, 13 -> 2}
14  {8 -> 196, 9 -> 1960, 10 -> 6076, 11 -> 5936, 12 -> 2044, 13 -> 168, 14 -> 4}
15  {8 -> 30, 9 -> 910, 10 -> 6006, 11 -> 12870, 12 -> 10010, 13 -> 2730, 14 -> 210, 15 -> 2}
16  {8 -> 4, 9 -> 224, 10 -> 3696, 11 -> 15904, 12 -> 25880, 13 -> 15904, 14 -> 3696, 15 -> 224, 16 -> 4}
17  {9 -> 34, 10 -> 1360, 11 -> 12376, 12 -> 38896, 13 -> 48620, 14 -> 24752, 15 -> 4760, 16 -> 272, 17 -> 2}
18  {10 -> 324, 11 -> 6048, 12 -> 37296, 13 -> 87264, 14 -> 87768, 15 -> 36960, 16 -> 6192, 17 -> 288, 18 -> 4}
19  {10 -> 38, 11 -> 1938, 12 -> 23256, 13 -> 100776, 14 -> 184756, 15 -> 151164, 16 -> 54264, 17 -> 7752, 18 -> 342, 19 -> 2}
20  {10 -> 4, 11 -> 360, 12 -> 9780, 13 -> 77280, 14 -> 252360, 15 -> 369008, 16 -> 252360, 17 -> 77280, 18 -> 9780, 19 -> 360, 20 -> 4}
21  {11 -> 42, 12 -> 2660, 13 -> 40698, 14 -> 232560, 15 -> 587860, 16 -> 705432, 17 -> 406980, 18 -> 108528, 19 -> 11970, 20 -> 420, 21 -> 2}
22  {12 -> 484, 13 -> 14520, 14 -> 149556, 15 -> 638880, 16 -> 1294216, 17 -> 1292368, 18 -> 640200, 19 -> 148896, 20 -> 14740, 21 -> 440, 22 -> 4}
23  {12 -> 46, 13 -> 3542, 14 -> 67298, 15 -> 490314, 16 -> 1634380, 17 -> 2704156, 18 -> 2288132, 19 -> 980628, 20 -> 201894, 21 -> 17710, 22 -> 506, 23 -> 2}
24  {12 -> 4, 13 -> 528, 14 -> 21384, 15 -> 268752, 16 -> 1471932, 17 -> 3920928, 18 -> 5410160, 19 -> 3920928, 20 -> 1471932, 21 -> 268752, 22 -> 21384, 23 -> 528, 24 -> 4}
25  {13 -> 50, 14 -> 4600, 15 -> 106260, 16 -> 961400, 17 -> 4085950, 18 -> 8914800, 19 -> 10400600, 20 -> 6537520, 21 -> 2163150, 22 -> 354200, 23 -> 25300, 24 -> 600, 25 -> 2}
26  {14 -> 676, 15 -> 29744, 16 -> 461032, 17 -> 3123120, 18 -> 10626044, 19 -> 19311968, 20 -> 19318832, 21 -> 10620896, 22 -> 3125980, 23 -> 459888, 24 -> 30056, 25 -> 624, 26 -> 4}
27  {14 -> 54, 15 -> 5850, 16 -> 161460, 17 -> 1776060, 18 -> 9373650, 19 -> 26075790, 20 -> 40116600, 21 -> 34767720, 22 -> 16872570, 23 -> 4440150, 24 -> 592020, 25 -> 35100, 26 -> 702, 27 -> 2}
28  {14 -> 4, 15 -> 728, 16 -> 41132, 17 -> 752752, 18 -> 6218212, 19 -> 26242216, 20 -> 60849516, 21 -> 80226336, 22 -> 60849516, 23 -> 26242216, 24 -> 6218212, 25 -> 752752, 26 -> 41132, 27 -> 728, 28 -> 4}
29  {15 -> 58, 16 -> 7308, 17 -> 237510, 18 -> 3121560, 19 -> 20030010, 20 -> 69194580, 21 -> 135727830, 22 -> 155117520, 23 -> 103791870, 24 -> 40060020, 25 -> 8584290, 26 -> 950040, 27 -> 47502, 28 -> 812, 29 -> 2}
Anita
  • 150
  • 4
    This situation is discussed at some length in Brian Hayes' blog, http://bit-player.org/2017/counting-your-chickens-before-theyre-pecked – Gerry Myerson Oct 12 '17 at 08:30
  • 1
    See also https://math.stackexchange.com/questions/2282622/expected-number-of-unpecked-chicks-nyt-article – Gerry Myerson Oct 12 '17 at 08:34
  • The other stack exchange analysis is wrong even though n/4 is correct, they are not really independent right? If I don't get pecked one of my 2-neighbours is necessarily pecked. – Anita Oct 12 '17 at 08:35
  • How did you approach it, what were your efforts? – Raghukul Raman Oct 12 '17 at 08:40
  • I wrote a brute force computation up to 30 birds, which is more accurate than simulations as described in that blog, but won't scale that easily. – Anita Oct 12 '17 at 08:52
  • The number of birds pecked twice is the same as the number not pecked at all. You can see this in various ways - e.g. counting the number of pecks or considering the situation where all the birds peck the other way. Also note you can argue that (regardless of independence) for an individual bird the chance of being unpecked is $1/4$, so across all distributions of pecks, bird $1$ will be unpecked in a quarter (keep all the pecks the same aside from the pecks of the direct neighbours - this groups outcomes into batches of $4$). Since this is true of all birds ... – Mark Bennet Oct 12 '17 at 09:15
  • First part I agree pecked twice equals pecked never. I am not clear about the second part, how does that argument fail for n=1 and 2? – Anita Oct 12 '17 at 10:25
  • Also question is actually asking for specific distribution not just expected number or unpecked birds. – Anita Oct 12 '17 at 10:33
  • 1
    It is not 1=2, it is two solutions for exactly 1 bird pecked :D I can improve on formatting if you wish. – Anita Oct 12 '17 at 10:39

1 Answers1

2

Assume that the number $n$ of birds is odd. The behavior of the birds is encoded in a circular word $w$ of length $n$ over the alphabet $\{L,R\}$. A particular bird is not pecked iff in the neighborhood of that bird the word looks like $\ldots L*R\ldots$, whereby the $*$ marks the letter of that bird. We therefore rearrange the word $w$ such that the numbers of the birds appear in the new (circular) order $$1,\ 3,\ 5,\ \ldots,\ n,\ 2,\ 4,\ \ldots,\ (n-1)\ .$$ Let $w'$ be the resulting word. The number of unpecked birds then is equal to the number of $LR$-subwords in $w'$.

There are $2^n$ possible words $w'$, all of them equiprobable. How many of them have exactly $k$ subwords $LR$? If there are $k$ subwords $LR$ then there have to be $k$ subwords $RL$ as well, and the two types alternate. We can choose the $2k$ jump spots in ${n\choose 2k}$ ways, and then identify the $LR$-jumps in $2$ ways. It follows that the probability $p(k)$ for exactly $k$ unpecked birds is given by $$p(k)={2\over2^n}{n\choose2k}\qquad\bigl(0\leq k\leq\lfloor n/2\rfloor\bigr)\ .\tag{1}$$ Note: $\ 2\sum_{k\geq0}{n\choose 2k}=(1+1)^n+(1-1)^n=2^n$. – I checked a few cases of $(1)$. The results corroborated your data.

If $n=2m$ is even one has to split the word $w$ into two circular words $w'$ and $w''$ of length $m$ each. The final formula for $p(k)$ then involves a convolution of binomial coefficients, which can perhaps be simplified.