Pie Machine Report, 2007
Contest Report
November, 2007
One of my favorite Late Show with David Letterman traditions occurs each Thanksgiving, when Dave fires up the satellite to chat with his Mom (Dorothy), and attempts to guess what kind of pies she has made for Thanksgiving. To add to the fun of playing along at home, since 1999 the alt.fan.letterman Pie Committee (Traci, James, and myself) have been running an annual AFL Dave's Mom's Thanksgiving Pie Thanksgiving-Pie-Guessing-Contest. The object of the game is to correctly predict what pies Dave's Mom will bake for Thanksgiving. As a tie-breaker, we traditionally use the number of pie-utterances, that is, the number of times anyone on the show (Dave, Dave's Mom, Paul, guests on the show, et al.) audibly utters the word pie or pies during the Thanksgiving day broadcast of the show. The grand prize is a homebaked pie, baked by AFL's own Pie Goddess, Traci.
Unfortunately, due to the writers' strike, there would be no Thanksgiving day show this year, only a repeat from the last year. Rather than cancel the Pie Contest, the Pie Committee cooked up a little something called the Pie Machine 314159. The basic idea was for us (well, me) to run a computer program that would produce a random selection of virtual pies, and a random number of virtual pie utterances. Participants in the game would have to try to predict the virtual pies virtually baked by the Pie Machine, with the number of virtual pie utterances to be used as a tie-breaker. As an added twist, the Pie Committee decided that Pumpkin and Cherry would not be participating this year, in a show of support for the striking writers.
I spent the better part of two days writing the code for the Pie Machine in the latest version of the computer algebra system Mathematica, in what was perhaps the most frivolous use of high level mathematics software ever. The guts of the Pie Machine program were pretty straightforward, but I spent a huge amount of time and effort programming sound effects, some of which were based on playing digits of the number π as musical notes, and adding lots of other bells and whistles. I even put in carefully timed pauses to slow down the output, so that everything printed to the screen would be perfectly synchronized with the sound effects. If you're going to do this, you may as well do it right, even if nobody else will ever see it. The funniest part of all this (well, one funny part at any rate), was the day I had someone at my house ripping out the water softener and replacing it with a new and improved unit. The entire time he was here, I was working on sound effects for the Pie Machine. Strange, loud noises emanated from my computer, over and over and over, as I experimented with various sounds. I have no idea what Water Softener Guy thought of all this, and fortunately he didn't ask. There is no way I could possibly have explained.
Around 11:00 p.m. local time on Thanksgiving, 2007, I had just put the last finishing touches on the Pie Machine program when Traci called me and James for our annual Pie Committee conference call. Normally the call takes place around 12:30 a.m., after the show has aired on the east coast, so that we can go over the pies that Dorothy has baked, compare notes on the pie-utterances, and determine the Pie Guessing Grand Champion. This year, with nothing tying us to the show itself, we began a little earlier, as soon as Traci and I were through with our Thanksgiving day obligations. James, three hours behind us on the west coast, was with his wife at the home of friends, and excused himself to take the call and use the friends' computer to post to AFL in real time as we ran the Pie Machine. I'm not sure what exactly he told the friends about all this, but somehow they were okay with it.
Once we had everyone on the line, I put Traci and James on speakerphone so that I could operate the Pie Machine, and turned on a digital audio recorder (which I have for recording my various musical groups) to capture the proceedings. I also took a short video clip on my camera, and got a few screenshots of my computer's monitor as things progressed.
The Pie Machine, I am pleased to report, functioned exactly as designed. At the end of Regulation Play (i.e., the first three pies), none of the contest participants were anywhere near the score required for winning, so we went into Sudden Death Pie Overtime. At this point, the Pie Machine began misfiring, which was all part of the plan, in tribute to the old Quiz Machine on the Late Show. The baking routine was set to misfire at random intervals, with the misfires becoming more and more frequent as the game progressed. On each misfire, we were treated to an awful sound effect, error messages, strange non-pie output, and one of two audio clips of Jose Feliciano singing Old Turkey Buzzard (one is the standard English version we have all heard on the LS, the other is the exact same thing but in Spanish, because as Dave likes to say, everything is funnier in Spanish). I had a way to stop the misfires when it got to be too much, but I had told Traci and James we were going to let the misfires go on until we heard the Spanish Old Turkey Buzzard at least once. I had weighted the random choice of audio clips so that the English version had twice the probability of the Spanish version. Well, we got misfire after misfire, always coming up with the English version. And each and every time, we had to listen to all 18 seconds of the Old Turkey Buzzard. You might barely make out Traci yelling over the misfire audio, asking if we have to listen to all 18 seconds, a la Dave on the show. (And the answer was yes, we did. Once Mathematica's EmitSound starts up, there isn't a way to stop it short of a forced shutdown of the system.) When the Spanish misfire finally came up -- we were getting punchy by then -- my audio recorder was on pause by mistake, and I didn't find out until later that I'd completely missed recording it! So, finally, I ran my seekAndDestroy script (this also didn't get recorded), which smoked out a rogue Donz3 process that had infiltrated the system. After that, there were no further misfires.
The scoring for the game proved challenging. We had intentionally made it difficult to win, just to make things more fun, but we didn't quite anticipate just how difficult it would be. With three guesses for each contestant, and each pie worth 3.14 points with a score of 8 points required to win, someone would have to pretty much nail two of their three guesses, and get substantial partial credit on the third. And with pumpkin and cherry out of the running, the field was wide open. Once the misfires (which burned a lot of time) were taken care of, we cranked out pie after pie, and still nobody reached 8 points. Poor James had been blowing off his Thanksgiving hosts all this time. Finally, after 36 pies (including misfires), we decided to bake at most 4 more. If at that point nobody had reached 8 points, we would go to the tie-break. So after the 40th pie (counting misfires), we had six people tied for first place...with 7.85 points each. We declared this close enough, and went on to the pie utterances.
The virtual pie utterances were based on the number π . The Pie Machine was programmed to select a random integer n between 100000 and 314159, and compute a sequence of 3 digits from the decimal expansion of π beginning with the nth digit. The chosen integer ended up being 273070, so the Pie Machine computed digits 273070 through 273072 of π , which turned out to be the sequence 511. After computing (and printing) the first 273072 digits of π, it printed Pie! 511 times (all with snazzy sound effects, needless to say).
At long last, a little after 1:00 a.m. -- a good two hours after we started -- we finally had a winner, Pat Fleet. Congratulations, Pat!
After the contest, Keith Rose and some others from AFL awarded the Pie Committee with The Nobel Pi Prize.