Pick a Pair of Packets


My friend Jeff likes his coffee sweet, so I wasn't surprised when I met him at the cafeteria, and on the table in front of him was a line of six packets of sweetener in a row, three pink followed by three blue:


        P P P B B B
      

As we were talking, my eyes rested on his fingers, which were idly shuffling the packets around the table in pairs. After a while, I noticed that he had rearranged the packets so that they alternated:


        P B P B P B
      

I thought nothing of it. But that night, I couldn't sleep, and I tried to relax by recalling how the packets had been shifted. All I could remember was that:

How did Jeff do it?

I give up, show me the solution.


This puzzle is sometimes known as Tait's counter puzzle after the British mathematician Peter Guthrie Tait, who described it in 1884.


Last revised on 08 June 2008.