Call the pegs, from left to right, A, B, and C. I will denote the string's path by using capital letters whenever it goes over the corresponding peg, and small letters whenever it goes under the peg.
For example, the solution to the original "Pegless Painting Plummets!" would be denoted as
AbBAaB
When, for example, peg B is removed, all 'b's and 'B's are removed, leaving AAa. Consecutive pairs like AA are removed because they signify a backtracking in the string's path. We are left with just the sequence a, which signifies that the painting has plummeted.
This notation is necessary because the solution to this problem is much longer. This is the solution that Jer came up with. I hope you have lots of string.
AbBAaBcCBaABbAabC
If we remove all 'a's and 'A's, we are left with
bBBcCBBbbC
which reduces to
bc
If we remove all 'b's and 'B's, we are left with
AAacCaAAaC
which reduces to
ac
If we remove all 'c's and 'C's, we are left with
AbBAaBBaABbAab
which reduces to
ab
Jer has posted an ascii illustration, as well as a general solution for n pegs here. |