Solution: Perplexing Pencil Puzzle
To solve The Perplexing Pencil Puzzle all you need to do is to reverse the process you used to attach the pencil and loop to the buttonhole. To do this, loosen the knot so that the loop surrounds the buttonhole. Pull the material around the buttonhole up though the loop so that the material is several centimeters above the loop. Next, poke the eraser end of the pencil through the buttonhole. Once the pencil is through the buttonhole, pull on it from below and it should come out quite easily. If there is not enough slack in the string to free the pencil, pull more material up through the loop and try again.
See image below for illustration.