Someone asked me an interesting question today. When I say interesting, I mean interesting if you are a code monkey, have an inquisitive mind or OCD (I fall into all three categories). Imagine there is a car park which is 100 stories high. You have a bag of marbles and want to know what is the highest level that you can drop a marble from and have it not smash. Assuming a worse case scenario and an optimum algorithm, what is the minimum number of marbles you would need?
I will post my method and answer later this week and who knows, we may even get the Mythbusters to test it out!
Disclaimer: There is little no chance of Adam and Jamie testing my method out. To quote Keith Barret, “it’s a bit of fun”, so enjoy – but no hurting marbles.
7.
I’m sure Sarah would tell you that there are marks available for your working out!
50
25
13
7
4
2
1
Yes 7. Binary search my arse.