I've found this problem on transpositions absolutely intractable.

69 Views Asked by At

A University bike shed contains n cubicles in a row. Each cubicle stores one bicycle.

One morning, Professor Ponte places his bicycle in one of the cubicles. At night Priyanka attempts to steal his bike by opening one and only one of the cubicles. The next morning Professor Ponte moves his bike from the cubicle it is currently in to one of the cubicles adjacent to the one it was in before, and closes the cubicle that Priyanka opened. Note that if the bicycle is in one of the cubicles at the end then there is only one possible cubicle for it to be moved to the follow morning. This repeats every morning and corresponding night.

Devise a general strategy for Priyanka to successfully steal Professor Ponte’s bike. Note that your strategy must work for any number n of cubicles in the bike shed.

This is the statement of the problem that's given and I know it's a bit of slog and even unclear. So I'm assuming it means there is only one bicycle among the n cubicles, namely the Professor's bicycle.

I could solve the problem for the n=4 case but could go no further. For the 4-case, my sequence of cubicle picks is 22332 (number corresponding to the given cubicle) and at some point during this Priyanka would gain the bicycle, e.g. she may gain it at 2, 22 but the maximum length is 22332.