I've come across a challenging twist on the classic egg drop problem, and I'm really trying to wrap my head around it. Usually, the goal is to determine the fewest number of attempts needed to find the highest floor from which an egg can be dropped without breaking, given a certain number of eggs and floors. For example, with 2 eggs and 100 floors, the minimum number of drops needed is 14, or T(2,100) = 14.
However, this new variation requires me to find the smallest possible accumulated sum of floor numbers to ensure that the egg survives being dropped from a specific critical floor. Here, T(n, k) still reflects this scenario, but k represents the target floor, and I need to optimize for the sum of floor numbers to safely reach this critical floor.
The simplest case is with one egg, where you have to drop from each floor starting at 1 up to k. So for T(1,6), the sum is 21. I've been given that T(2,10) = 28, and I need help figuring out other cases. For instance, I calculated T(2, 21) to be 83, but someone argues it should be 84. For T(2,91), I got 746, whereas they say it should be 725. I have some code that works for T(2,10), but I'm unsure about these other cases. Can anyone help replicate these results?
2 Answers
I think you're on the right track with your calculations! The key to this variation seems to involve carefully using your drops to minimize the sum. I can help you refine your code and maybe find where your numbers are getting off.
I just threw together some code myself and it matches those results—84 and 725. I can show you my logic once I get a moment, as I didn't save the process right now. Let’s figure this out together!
Related Questions
Online Hash Generator - String to Hash Converter
Random Number Generator – Create Multiple Random Numbers Instantly
Instant Online Dice Roller