Dynamic programming
Egg dropping puzzle

The following is a description of the instance of this famous puzzle involving N=2 eggs and a building with H=36 floors:

To derive a dynamic programming functional equation for this puzzle, let the state of the dynamic programming model be a pair s = (n,k), where

For instance, s = (2,6) indicates that two test eggs are available and 6 (consecutive) floors are yet to be tested. The initial state of the process is s = (N, H) where N denotes the number of test eggs available at the commencement of the experiment. The process terminates either when there are no more test eggs (n = 0) or when k = 0, whichever occurs first. If termination occurs at state s = (0, k) and k > 0, then the test failed.

Now, let

Then it can be shown that

with W (n,0) = 0 for all n > 0 and W (1, k) = k for all k. It is easy to solve this equation iteratively by systematically increasing the values of n and k.
startend:end_checker, change_case:english_lowercase