Note: please do not edit the title! It originates in a challenge in Stack Overflow chat.
I have rounded up all ten (currently) of the Puzzling SE users named Kevin and trapped them in my labyrinth. The only way out is across a narrow bridge which can bear the weight of at most two Kevins at a time. It is pitch dark and the bridge has no handrails, so they will need a torch in order to be able to cross at all. Each Kevin will take a different amount of time to cross the bridge; let these times be $t_1,t_2,\dots,t_{10}$ in increasing order. Moderator Kevin is the slowest, taking time $t_{10}$ to cross, because he has to carry his diamonds with him. I'll supply them with a torch so that they can see to cross the bridge, but it will only last for a finite period of time.
My aim is to allow all the Kevins except the slowest to escape the labyrinth (if the moderator escapes, he'll give me a 365-day suspension for moderator entrapment as soon as he gets back to his computer). I want to ensure the torch will last exactly long enough to allow the nine non-moderator Kevins to escape but not all ten. How long (in terms of the times $t_1,\dots,t_{10}$) should I make the torch last?
Answer
You should make the torch last the minimum amount of time to allow nine of the Kevins to escape. This will ensure that all ten cannot escape. We will compute this time in terms of $t_1,\ldots,t_9$. Actually, we will describe a computation that is valid for any finite number of Kevins.
Suppose there are $n$ Kevins, call them $K_1$, $\ldots$, $K_n$ from fastest to slowest. Let $K_i$ and $K_j$ be a pair of Kevins, with $3\leq i
Set Kevins $K_1$ and $K_2$ aside, and group the remaining Kevins into pairs: $\{K_n,K_{n-1}\}$, $\{K_{n-2},K_{n-3}\}$, and so on (there may be an odd Kevin out who is unpaired). Call a pair of Kevins slow if the faster member of the pair takes longer than $2t_2-t_1$ to cross the bridge, otherwise call the pair fast (the odd Kevin out, if there is one, will be considered fast).
Each slow pair of Kevins will cross the bridge using Strategy A. After all of the slow pairs have crossed, $K_1$ will escort every remaining Kevin across the bridge one by one. The total time for this is $$ (n-2-k)t_1 + (2k+1)t_2 + \sum_{i=1}^k t_{n+1-2i} + \sum_{i=3}^{n-2k}t_i, $$ where $k$ is the number of slow pairs. The paper [1] gives a rigorous proof that this is optimal.
[1] Rote, Günter. Crossing the bridge at night. Bulletin of the European Association for Theoretical Computer Science, no. 78, 2002, pp. 241--246.
No comments:
Post a Comment