Jumping in Puddles

Tue Feb 15

Tuesday Teaser #29

You have a playlist of 11 tracks on the MP3 player connected to your stereo. Each track in the playlist is clearly numbered, but there are just three buttons. The “+” button takes you to the next track in ascending order, looping back to track #1 after the highest numbered track. The “-” button takes you through the tracks in descending order, looping back to the highest numbered track after track #1. The “shuffle” button randomly selects a track on the playlist other than the one that was just playing.

Suppose track #1 is currently playing. You have an irresistible urge to listen to track #6 next. What strategy will select the right track in the smallest number of button presses, on average?

Bonus Question: Now let’s try the above problem for a longer playlist, of 101 tracks. What’s the least number of button presses on average, to get from track #1 to track #51?

Comments (View)
blog comments powered by Disqus