A man has two ropes of varying thickness, those two ropes are not identical, they aren’t the same density nor the same length nor the same width. Each rope burns in 60 minutes. How can he measure 45 mins using only these two ropes.
He can’t cut the one rope in half because the ropes are non-homogeneous and he can’t be sure how long it will burn.
2026 Update: Burning Ropes — Measuring Time with Non-Uniform Objects
Classic setup: Two ropes, each burns completely in exactly 60 minutes, but burns non-uniformly (so you can’t just use half a rope for 30 minutes). How do you measure exactly 45 minutes?
Solution: Light both ends of rope 1 AND one end of rope 2 simultaneously. Rope 1 burns in 30 min (from both ends). The moment rope 1 finishes, light the other end of rope 2. The remaining half of rope 2 now burns in 15 more minutes. Total: 30 + 15 = 45 minutes.
Key insight: Lighting both ends halves the total burn time regardless of non-uniformity — because fire from both ends always converges, and the total burn “work” stays constant.
def simulate_rope_burn(segments_minutes, light_both_ends=False):
"""
Simulate a non-uniform rope burn.
segments_minutes: list of time each segment takes to burn left-to-right.
Returns total burn time.
"""
total = sum(segments_minutes)
if light_both_ends:
# Burn from both ends simultaneously
# Regardless of distribution, time = total/2
return total / 2
return total
# Verify: non-uniform rope still burns in T/2 from both ends
rope = [5, 25, 10, 8, 12] # Segments: 5+25+10+8+12 = 60 min
print(simulate_rope_burn(rope)) # 60.0
print(simulate_rope_burn(rope, both=True)) # 30.0
def measure_45_min():
"""Simulation of the 45-minute measurement."""
print("t=0: Light both ends of rope1, one end of rope2")
rope1_done = 30 # Burns from both ends
print(f"t={rope1_done}: Rope1 done. Light other end of rope2")
rope2_remaining = 30 # Half of rope2 left (30 min one-ended)
rope2_done = rope1_done + rope2_remaining / 2 # Now burning from both ends
print(f"t={rope2_done}: Rope2 done. Elapsed = 45 minutes ✓")
measure_45_min()
Extensions asked in 2025-2026 interviews:
- Measure 15 minutes? (Light both ends of one rope → 30 min done; at that exact moment light both ends of second → 15 more min)
- Measure 22.5 minutes? (Requires 3 ropes)
- What times are achievable with n ropes? (Any time of the form k/2^n × 60 minutes)
This puzzle maps to real computer science: measuring latency budgets in distributed systems, where you have non-uniform network segments but need to enforce a total SLA.