Reverse Balls

Computer Science Level pending

Consider the binary tree below:

It has a height of 2 and has 4 leaves. You are going to pass down a ball from the root (the topmost node). Every node other than the leaves has a switch. If a node is switched off , the ball will pass to its left child; if a node is switched on , the ball will pass to its right child. After passing the ball, the switch will toggle (if it's on it becomes off and vice versa). Initially, every node is switched off.

Chris built a similar tree of infinite height and he wants a ball to pass through the 1234567 8 th 12345678^\text{th} node. What is the minimum number of balls he must throw such that he can achieve his goal?

Output your answer modulo 1000.


You are advised to solve the Original version of this problem first.


The answer is 735.

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.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...