You have two identical crystal orbs. you need to figure out how high an orb can fall from a 100 story building before it breaks. you know nothing about the toughness of the orbs: they may be very fragile and break when dropped from the first floor, or they may be so tough that dropping them from the 100th floor doesn’t even harm them.
What is the largest number of orb-drops you would ever have to do in order to find the right floor? (i.e. what’s the most efficient way you could drop the orbs to find your answer?)
You are allowed to break both orbs, provided that in doing so you uniquely identify the correct floor.
Solution
14.
Drop first orb from floors 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100… (ie move up 14 then 13, then 12 floors, etc) until it breaks (or doesn’t at 100). Call the first floor at which it breaks n and the previous tested floor n’. Then try the intervening floors (n’+1 .. n’-1) with the other orb.
Worst case is if correct floor is 13,14,26,27, etc which require m drops with the first orb and 14-m drops with the second.
2026 Update: Binary Search and Decision Problems
Orb-breaking puzzles (find the highest safe floor to drop an orb from, using minimum drops) are a classic DP/binary search problem. With unlimited orbs, binary search works (O(log n) drops). With k orbs, you need dynamic programming to minimize worst-case drops. This exact problem appears on LeetCode as “Egg Drop Problem” (LeetCode 887).
def egg_drop(k, n):
"""
k orbs (eggs), n floors. Find minimum drops needed to determine
the critical floor (below which orbs always survive) in worst case.
dp[t][k] = max floors we can check with t trials and k orbs.
"""
# dp[t][k] = max floors testable with t tries and k eggs
dp = [[0] * (k + 1) for _ in range(n + 1)]
t = 0
while dp[t][k] < n:
t += 1
for j in range(1, k + 1):
# If orb breaks: check dp[t-1][j-1] floors below
# If orb survives: check dp[t-1][j] floors above
# Plus the floor we just tried
dp[t][j] = dp[t-1][j-1] + dp[t-1][j] + 1
return t
print(egg_drop(1, 100)) # 100 drops (must go floor by floor)
print(egg_drop(2, 100)) # 14 drops (optimal: floor 14, 27, 39, ...)
print(egg_drop(3, 100)) # 5 drops
print(egg_drop(100, 100)) # 7 drops (log2(100) rounded up)
Real-world application: Canary deployments use the same logic — you want to find the “breaking point” (how much traffic makes a service fail) with minimum costly experiments. Binary search works with unlimited patience; limited orbs mirrors limited rollback budget.