Struggling with a Variation of the Egg Drop Problem

0
3
Asked By CuriousCoder42 On

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

Answered By ProblemSolver88 On

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.

Answered By CodeCracker99 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.