solvethis

It’s a Puzzlement

By Jon Evans
The Programmer’s Eternal Loop
L

ila, a lead software architect at an AI research lab, is debugging a self-modifying neural-network training script. Every second, the remaining unreviewed portion of the code grows by exactly 1% of its current length as new training data continuously streams in. Lila can examine and fix code at a constant rate of 100 lines per second. When she sits down to begin, there are exactly 1,000,000 lines left to review.

Will Lila ever finish debugging the entire script? If so, exactly how many seconds will it take her?

Illustration of one hand passing a large stack of cash to another hand.
Extra credit
Suppose instead that the code grows by r% per second, where r can be any positive real number. For which values of r does Lila finish in finite time, and what is the general formula for the time required?
A friendly circle of debt
This solution was submitted by Stsiapan Dziamentsyeu.

No one was cheated, because we can think of an identical situation where everyone in the circle agrees to clear their mutual debt. Ex: Alice owes $100 to Bob and Charlie owes Alice $100, so Alice can clear her debt by having Charlie owe Bob $100. Everyone does this until there are two people left who owe each other $100; they agree to clear it.

Now Alice wins $50 from a scratch off. The end result is the same—Alice keeps $50, no one has debt.

Digital graphic of a programmer's hands on a keyboard surrounded by flowing data and code.
Know the answer? Send your solution to ar@casact.org.