Computer Science
Two ropes and 45 minutes
You have two ropes. Each takes exactly an hour to burn, but they burn unevenly, so half a rope need not take half an hour. With a lighter, how do you measure exactly 45 minutes?
- Hint 1What happens if you light one rope at both ends?
- Hint 2You can light the second rope at different times.
- Lighting a rope at both ends burns it in 30 minutes, however unevenly: the two flames together cover the hour's worth of rope at twice the rate.
- At time 0, light rope A at both ends and rope B at one end.
- When A is gone, 30 minutes have passed and B has 30 minutes left.
- Now light B's other end: it burns out in 15 minutes.
- When B is gone, 45 minutes have passed.
Where it lands: Light A at both ends and B at one end; when A finishes, light B's other end; stop when B finishes.
The trap: Cutting a rope in half: uneven burning means half the length is not half the time.
What a tutor might ask next: Which times can you measure with three such ropes?
Now do one out loud. In the interview you think aloud with a tutor. Try a Computer Science problem with hints, follow-ups and Mia's feedback on how you think.