wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> hard >> partial algorithm to dropping eggs
(Message started by: summersolstice on Oct 5th, 2012, 1:12pm)

Title: partial algorithm to dropping eggs
Post by summersolstice on Oct 5th, 2012, 1:12pm
hello I'm new here (first post)

I saw a simliar problem to this on another site (with snookerballs instead of eggs) and actually figured out multiple ball puzzles

though like I said it the title its incomplete atm but I thought I'd share the progress

[hide]

there exists some (very complicated) formula that I think might be expressed as a continued product, for now I'll write it as f(e,d) = F

e is number of eggs

d is number of drops

F is the maximum number of floors that you can investigate

now if you have F and e you put them into the formula and find d, (however it might need trial and error but it doesn't matter, because its a whole number)

what you need is the smallest integer value for d so that the result is greater than/equal to the number of floors you have (i.e. if you lowered d by one it would be less than the number of floors)

now once you find d you can call this the initial d

everytime you drop an egg, d (the current value) goes down by one if it breaks then e also goes down by one.

at each step you have 3 values

current value of e (number of eggs left)

current value of d (number of drops left)

lowest it didn't break (this doesn't have to be the previous drop just the last time it didn't break) I'll call this g

take e-1 and d-1 and put them into the formula add g then add 1

now go the the floor whose number correponds to the result

and do this on every step and this means that on or before d drops and breaking no more than e eggs you'll find the correct floor
[/hide]

I'll be interested to hear what you think
now



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board