How to arrange 1000 cows in 10 pens to obtain any total from 1 to 1000

  • Level: Undergrad 
  • Thread starter Thread starter keemosabi
  • Start date Start date
  • Tags Tags
    Riddle
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 3K views
keemosabi
Messages
109
Reaction score
0
Given 1000 cows and 10 pens, you want to arrange the cows in the pens such that any number of cows from 1 to 1000 can be obtained by opening certain pens and taking all the cows in those pens. How do you arrange the cows in the pens?
 
Mathematics news on Phys.org
This is equivalent to finding a binary representation for a number. Arrange the cows like this

1, 2, 4, 8, 16, 32, 64, 128, 256 and the remaining 489

If the given number is smaller than 489, then simply open the first 9 pens according to the binary representation of the number. If the number is larger then open the 489 pen, and open the remaining again in binary.
 
Concerning the solution to the riddle. The use of the binary notation is interesting.When I was younger and we weighed in lbs and ozs we had a set of scales with weights that stacked neatly by the side of the scales The weights were 1,2,4,8 and 1 lb =16oz then the same with lb weights stopping at7lb , I think.
My mother could weigh any weight with these. Question. Was the 16 ounces =One pound deliberately chosen for the given reason or was it accidental??