Binary Candy

Logic Level 3

I'm sort of copying another problem from problems of the day but it's framed differently:

There are 8 children that are going to play a game to learn how to follow rules. They're all lined up, each facing the back of whoever is in front. The first child sees everyone else. All of them are handed exactly one candy except for the first and last kid. The first one has two and the last one has none. The rules are:

  1. If you have two candies, you must eat one and hand over the other one to the kid in front of you.
  2. If you have one and have not eaten one, you keep it.

After the game, if you were to represent the line of kids according to the number of candies they're holding, in a binary code (zero being no candy and 1 being one candy), with the first kid being the first digit and so on, what would be the correct code?


The answer is 10000000.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Jay B
Jan 28, 2019

The original question asked us to add 101010 1 2 + 10101 1 2 1010101_{2}+101011_{2} . Adding these two numbers is analogous to answering the binary candy problem where the rules are 1 + 1 = 10 1+1=10 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...