The Chick Peck Problem

So, my plans for my blog through 2017 have not quite gone to plan, but things have been horrendously busy, and it seems like the rest of the year is likely to continue this way.

But I did get a chance to do some recreational mathematics, spurred on my a story in the news. It's to do with a problem presented at the 2017 Raytheon MATHCOUNTS® National Competition and reported in the New York Times. Here's the question as presented in the press:



Kudos to 13 year old Texan, Luke Robitialle, who got this right.

With a little thought, you should be able to realise that the answer is 25. For any particular chick, there are four potential out comes, each with equal probability. Either the chick is
  • pecked from the left
  • pecked from the right
  • pecked from left and right
  • not pecked at all
Only one of these options results in the chick being unpecked, and so the expected number of chicks unpecked in a circle of 100 is one quarter of this number, or 25.

ABC journalist and presenter extraordinaire, Leigh Sales, tweeted 
But it's the kind of maths that makes me ask more questions. 

While 25 is the expected number of unpecked chicks, what is the distribution of unpecked chicks? What I mean by this is that they peck left or right at random, there might be 24 unpecked chicks for one group of a hundred chicks, 25 for the next, and 23 for the next. So, the question is, given a large number of 100 chick experiments, what's the distribution of unpecked chicks?

I tried to find an analytic solution, but my brain is old, and so I resorted to good old numerical methods. Generate lots of experiments on a computer, and see what the outcomes look like. But there is an issue that we have to think about, namely the question of how many different configurations of chicks pecking left and right can have?

Well, left and right are two options, and for 100 chicks, the number of possible left and right configurations is 


That's a lot of possibilities! How are we going to sample these? 

Well, if we treat a 0 as "chick pecks to the left", and 1 as "check pecks to the right", then if we choose a random integer between 0 and 2100-1,  and represent it as a binary number, then that will be a random sampling of the pecking order (pecking order, get it!) As an example, all chicks peck to the left would be 100 0s in binary, where as all the chicks peck to the right would be 100 1s in binary. 

Let's try a randomly drawn integer in the range. We get (in base 10) 333483444300232384702347234. In binary this is


0000000000010001001111011001110111011011110101101010111100001100011100100110100100000111011111100010
So, the first bunch of chicks peck to the left, then we have a mix of right to left pecks. 
But how many of these chicks are unpecked (remembering what the original question)? Well, for any particular chick, it will be unpecked if the chick to its left pecks to the left, and the chick to its right pecks to the right. So, we're looking for sequences of '001' and '011', with the middle digit representing the chick we are interested in. 
So, we can chick this into a little python code (had to learn it, all the cool kids are using it these days) and this is what I have
There is a little extra in there to account for the fact that the chicks are sitting in a circle, but as you can see, the code is quite compact.
OK. Let's run for the 100 chicks in the question. What do we get?
Yay! The unpecks peak at 25, but there is a nice distribution (which, I am sure, must have an analytic solution somewhere. 
But given the simplicity of the code, I can easily change the number of chicks. What about 10 chicks in circle?
Hmmm. Interesting. What about 1000 chicks?
And 33 chicks?
Most likely number of unpecked chicks is 8, but again, a nice distribution. 
Now, you might be sitting there wondering why the heck I am doing this? Well, firstly, because it is fun! And interesting! It's a question and it is fun to find the answer. 
Secondly it is not obvious what the distribution would be, and how complex it would be to derive, or even if it exists, and so a numerical approach allows us to find an answer. 
Finally, I can easily generalize this to questions like "what if the left pecks are more likely than right pecks by a factor of two, what would the distribution be like?" It would just take a couple of lines of code and I would have an answer. 
And if you can't see how such curiosity led examinations are integral to science, then you don't know what science is.

Comments

  1. I have re-blogged this at https://newtonexcelbach.wordpress.com/2017/06/16/counting-non-pecked-chicks/ with some added Excel and VBA versions.

    You probably won't be very impressed with the pure Excel versions (which are much slower), but you might like the Excel/xlwings link to your Python code.

    ReplyDelete

  2. I cannot truly enable but admire your weblog, your weblog is so adorable and great.It has given me courage to try scarier things. I tend to steer clear of them but not anymore.
    Packers And Movers Hyderabad

    ReplyDelete

  3. I cannot truly enable but admire your weblog, your weblog is so adorable and great.It has given me courage to try scarier things. I tend to steer clear of them but not anymore.
    Packers And Movers Hyderabad

    ReplyDelete


  4. I cannot truly enable but admire your weblog, your weblog is so adorable and great.It has given me courage to try scarier things. I tend to steer clear of them but not anymore.
    Packers And Movers Hyderabad

    ReplyDelete
  5. really a vry nice blog i really appreciate all your efforts ,thank you so mch for sharing this valuable information with all of us. Packers And Movers Jaipur

    ReplyDelete
  6. really a vry nice blog i really appreciate all your efforts ,thank you so mch for sharing this valuable information with all of us. Packers And Movers Jaipur

    ReplyDelete
  7. Hire Best Packers And Movers Mumbai for hassle-free Household Shifting, ***Office Relocation, ###Car Transporation, Loading Unloading, packing Unpacking at affordable ✔✔✔ Price Quotation. Top Rated, Safe and Secure Service Providers who can help you with 24x7 and make sure a Untroubled Relocation Services at Cheapest/Lowest Rate
    Packers And Movers Mumbai

    ReplyDelete
  8. Packers and Movers Ahmedabad - We Provide ***Best Service Providers, Safe, Reliable, Affordable, Trusted ###Movers and Packers in Ahmedabad List, Household Shifting, Office Relocation: Choose Top Verified Packers and Movers Ahmedabad Compare ???Shifting Service Chrages, Price Quotation, Rate List Charts and Save Money and Time @ Packers and Movers Ahmedabad

    ReplyDelete
  9. Packers and Movers Gurgaon Provide Reliable, Safe and Certified Service Provider list, Get Free ***Best Price Quotaition and Compare Charges. ???Hassle free Household Shifting Services, High Quality packing Material, Office Relocation, Car Transportaion, ###Local and Domestic Shifting Service @
    Packers And Movers Gurgaon

    ReplyDelete
  10. Excellent and decent post. I found this much informative, as to what I was exactly searching for. Thanks for such post and please keep it up.
    Transportation Service Packer & Mover in Gurgaon

    ReplyDelete
  11. Hey, Wow all the posts are very informative for the people who visit this site. Good work! We also have a Blog.Please feel free to visit our site. Thank you for sharing.
    @ Packers And Movers Gurgaon
    Packers And Movers Gurgaon to Bangalore
    Packers And Movers Gurgaon to Ahmedabad
    Packers And Movers Gurgaon to Jaipur

    ReplyDelete
  12. Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog
    Packers And Movers Gurgaon
    Packers And Movers Mirpur Gurgaon
    Packers And Movers Khor Gurgaon
    Packers And Movers Jawasi Gurgaon
    Packers And Movers Indir Mewat Gurgaon

    ReplyDelete
  13. Packers and Movers Hyderabad Give Certified and Verified Service Providers, Cheap and Best ###Office Relocation Charges, ***Home Shifting, ✔✔✔Goods Insurance worth Rs. 10,000, Assurance for Local and Domestic House Shifting. Safe and Reliable Household Shifting Services in Hyderabad with Reasonable Packers and Movers Price Quotation @ Packers And Movers Hyderabad

    ReplyDelete
  14. Packers and Movers Chennai Give Safe and Reliable ***Household Shifting Services in Chennai with Reasonable ###Packers and Movers Price Quotation. We Provide Household Shifting, Office Relocation, ✔ ✔ ✔ Local and Domestic Transportation Services, Affordable and Reliable Shifting Service Charges. @ Packers And Movers Chennai

    ReplyDelete
  15. A suggested Incall or Outcall Mumbai Escorts Service ability in five star Hotels (Dial-9100000000).A wide variety of Independent Escorts in Mumbai

    Mumbai Escorts Models | Mumbai Model Escorts | Cheap Mumbai Escorts | Mumbai Independent Escorts | Escorts Girls in Mumbai | Mumbai Escorts Girls | Call Girls Mumbai | College Escort in Mumbai | Escorts Service Mumbai| Mumbai Escorts

    ReplyDelete
  16. Superb post, we enjoyed each and everything as per written in your post. Thank you for this informative article because it’s really helpful, I really like site.
    Please visit our website: @ Packers and Movers Kolkata

    ReplyDelete
  17. Astogurutips is the top best Online Astrology website in India with more than 500+ astrologer on the portal. He gives a Best Astrology solutions from the Best Astrologers . You can connect with our astrologer through call or chat and ask you any question about your carrier, health, future, love partner etc. Free astrology service on phone

    ReplyDelete
  18. this is really nice and effective blog, i found lots of information in this blog and sites for commenting is best.Very nice I like a lot of these topics...@ Packers and Movers Ahmedabad

    ReplyDelete
  19. Packers and Movers Bangalore as a Services providing company can make all the difference to your ###Home Relocation experience. Bangalore based Company which offers versatile solutions, Right team that easily reduce the stress associated with a ???Household Shifting, ***Vehicle Transportation. we help things run smoothly and reduce breakages and offer you seamless, Affordable, Reliable Shifting Services, Compare Shifting Charges. @ Packers And Movers Bangalore

    ReplyDelete
  20. Packers and Movers Bangalore - Reliable and Verified Household Shifting Service Providers Give Reasonable ###Packers and Movers Charges. Cheap and Best Office Relocation Compare Quotation for Assurance for Local and Domestic House Shifting and Get estimates today to save upto 20%, ***Read Customer Reviews - @ Packers And Movers Bangalore

    ReplyDelete
  21. Thanks on your marvelous posting! I really enjoyed reading it, you’re a great author.Please visit here: @Packers And Movers Chennai

    ReplyDelete
  22. QuickBooks Error 12152 is most common errors that everyone may face these problems ,
    our team at QuickBooks Customer Service provide solutions for your quickbooks accounting software

    ReplyDelete
  23. Nice blog !! Are You looking for QuickBooks Solution QuickBooks Software For any issue then
    connect our team at QuickBooks Customer Service

    ReplyDelete
  24. Really I m feeling very happy after read your article just click get QuickBooks Solution information at QuickBooks Customer Service

    ReplyDelete
  25. Your post is truly awesome. It is appreciable piece of efforts done by you.

    Kirti Pathak

    ReplyDelete
  26. Such a Nice and Informative Post. Thanks for Sharing
    Pakistan Cargo Dubai

    ReplyDelete

Post a Comment

Popular posts from this blog

Falling into a black hole: Just what do you see?

Could physics predict a giraffe?

The origin of the split red clump in the Galactic bulge of the Milky Way