Exercise
https://texercises.com/exercise/how-strong-is-an-egg/
Question
Solution
Short
Video
\(\LaTeX\)
No explanation / solution video to this exercise has yet been created.

Visit our YouTube-Channel to see solutions to other exercises.
Don't forget to subscribe to our channel, like the videos and leave comments!
Exercise:
You have two identical eggs. Standing in front of a floor building you wonder what is the maximum number of floors from which the egg can be dropped without breaking it. What is the minimum number of tries needed to find out the solution?

Solution:
The easiest way to do this would be to start from the first floor and drop the egg. If it doesn’t break move on to the next floor. If it does break then we know the maximum floor the egg will survive is . If we continue this process we will easily find out the maximum floors the egg will survive with just one egg. So the maximum number of tries is that is when the egg survives even at the th floor. Can we do better? Of course we can. Let’s start at the second floor. If the egg breaks then we can use the second egg to go back to the first floor and try again. If it does not break then we can go ahead and try on the th floor in multiples of . If it ever breaks say at floor x then we know it survived floor x-. That leaves us with just floor x- to try with the second egg. So what is the maximum number of tries possible? It occurs when the egg survives or floors. It will take tries to reach floor and one more egg to try on the th floor so the total is tries. Wow that is almost half of what we had last time. Can we do even better? Yes we can. What if we try at ervals of ? Applying the same logic as the previous case we need a max of tries to find out the information tries to reach th floor and more on th and th floor. Interval-Maximum tries: multicols – – – – – – – – – – – – – – – – multicols So picking any one of the ervals with maximum tries would be fine. bf Another Solution: Instead of taking equal ervals we can increase the number of floors by one less than the previous increment. For example let’s first try at floor . If it breaks then we need more tries to find the solution. If it doesn’t break then we should try floor + . If it breaks we need more tries to find the solution. So the initial tries plus the additional tries would still be tries in total. If it doesn’t break we can try + and so on. Using as the initial floor we can reach up to floor + + + … + before we need more than tries. Since we only need to cover floors tries is sufficient to find the solution. Therefore is the least number of tries to find out the solution.
Meta Information
\(\LaTeX\)-Code
Exercise:
You have two identical eggs. Standing in front of a floor building you wonder what is the maximum number of floors from which the egg can be dropped without breaking it. What is the minimum number of tries needed to find out the solution?

Solution:
The easiest way to do this would be to start from the first floor and drop the egg. If it doesn’t break move on to the next floor. If it does break then we know the maximum floor the egg will survive is . If we continue this process we will easily find out the maximum floors the egg will survive with just one egg. So the maximum number of tries is that is when the egg survives even at the th floor. Can we do better? Of course we can. Let’s start at the second floor. If the egg breaks then we can use the second egg to go back to the first floor and try again. If it does not break then we can go ahead and try on the th floor in multiples of . If it ever breaks say at floor x then we know it survived floor x-. That leaves us with just floor x- to try with the second egg. So what is the maximum number of tries possible? It occurs when the egg survives or floors. It will take tries to reach floor and one more egg to try on the th floor so the total is tries. Wow that is almost half of what we had last time. Can we do even better? Yes we can. What if we try at ervals of ? Applying the same logic as the previous case we need a max of tries to find out the information tries to reach th floor and more on th and th floor. Interval-Maximum tries: multicols – – – – – – – – – – – – – – – – multicols So picking any one of the ervals with maximum tries would be fine. bf Another Solution: Instead of taking equal ervals we can increase the number of floors by one less than the previous increment. For example let’s first try at floor . If it breaks then we need more tries to find the solution. If it doesn’t break then we should try floor + . If it breaks we need more tries to find the solution. So the initial tries plus the additional tries would still be tries in total. If it doesn’t break we can try + and so on. Using as the initial floor we can reach up to floor + + + … + before we need more than tries. Since we only need to cover floors tries is sufficient to find the solution. Therefore is the least number of tries to find out the solution.
Contained in these collections:

Attributes & Decorations
Tags
denken, denksel, google, interview, job, logic, logical, logik, question, think, thinkquest
Content image
Difficulty
(4, default)
Points
4 (default)
Language
ENG (English)
Type
Both
Creator uz
Decoration
File
Link