### July 2009

I felt ill on Friday and decided to stay home; my sickness was minor (and legitimate), but reminded me of fodder for my blog. Fodder. My blog is cow-like, grazing on ideas like a ruminating ruminant. I’m sure there is a corresponding analogy for the udder, but in the interest of my readers I will avoid going down that path!

My wellbeing, or rather my estimation of my wellbeing, is easily influenced. My brain, upon hearing about illness or encountering a sick person, immediately begins to suggest, to hint, to my body that it also suffers from the same affliction. I am aware of this problem – I do not actually believe that I am sick, but somewhere deep in the grey folds of my brain a few synapses decide that I will respond accordingly, regardless.

Synapse Fred: So… hear about that swine flu?
Synapse Charlie: Ah, yes, swine flu.
Synapse Fred: Nate doesn’t seem too worried about it.
Synapse Charlie: Nope, seems not.
Synapse Fred: I was thinking…
Synapse Charlie: It takes at least two of us to call it thought. That’s why there’s two of us in this story Nate is making up!
Synapse Fred: We were thinking, how about making Nate feel sick? You know, nothing serious, just a general malaise with associated effects.
Synapse Charlie: Let’s do it. You call the stomach and get things unsettled while I check in with the lungs and work up a tightened chest.

As I said, I am well aware that these devious synapses fire as they do. Interestingly, that knowledge is not sufficient to prevent the feelings. Instead I am forced to outsmart my own brain. (Who, then, is doing the outsmarting? Perhaps my estimation of my own intelligence is equally unbalanced!)

There are some symptoms of illness that the brain cannot fake, and I check these whenever I am feeling sick; if these symptoms are not present I ignore those that are.

1. Muscle tone: when you fall sick, in general, muscle tone increases. This means that when in a resting position your muscles are slightly more tensed than they would ordinarily be. As I am very thin this is easily detectable.
2. Wheezing: I become slightly asthmatic when I get sick, a minor inconvenience that I’ve had since I was a baby. I have an inhaler for this purpose. The difference between a tight chest and asthmatic effects are easily distinguishible.
3. Fever: Fevers, I have read, are related to confusion of the glands that control temperature monitoring in the body; as they recalibrate and tell the body to cool, the sufferer feels alternately hot and cold. As this is an unintentional feature of a sick body, my brain does not fake it and the hot-cold feverish feeling is a true signal of illness.

Some signals I cannot trust, and have learned to ignore as they can come and go as quickly as the duration of a new pharmaceutical advertisement on television.

1. Headache: my brain will summon a headache if I so much as think about the words “head” and “ache” in a 30 minute timeframe.
2. Nausea and related stomach annoyances: did I read about someone falling ill? Meet someone who coughed? Eat a piece of meat that spent more than 30 seconds on the plate between cooking and consumption? How about a nice upset stomach to go along with it?
3. Dizziness: the illness in question need not even include dizziness as a symptom for my mind to induce the same.

Now after all this one might think of me as a hypochondriac. That is untrue however; after a long time dealing with a brain that inflicts symptoms on a whim I have become astute at distinguishing between the two. Originally (when I became aware of this issue) I hoped that as I became used to ignoring false witnesses to my health I would naturally stop reacting in such a way. Unfortunately this seems not to be the case.

Does my body want to be sick? Does my brain have it in for my body? Is this all leading up to a fatal retelling of the tale of the boy who cried wolf? Am I to be done in by a cold after long ignoring annoying minor symptoms? Let’s hope not: I’m not likely to start listening to my brain’s diagnosis now!

I am a computer engineer by degree. You might think that makes me proficient at modern technology, at gadgetry. If in fact you thought this I’ll grant you an opportunity to make a retraction; while the use of computers and specialized electronic devices abounds in computer engineering, the study itself does not confer any worldly skills of the sort an outsider might expect.

Perhaps you might now think that a correlation still exists, but it is by association and not causation – that self-identifying as a computer engineer implies technological prowess. The construction of this suggestion belies the innocence it pretends; clearly I intend more deception!

That is the case: I am terribly inept at popular electronics. I browse Facebook with the mouse at arm’s length, leaning back in my chair squinting, as if by distance I can avoid the complexies contained within. I punch at the buttons on my phone with thick fingers, grunting the rude language of prehistoric man. Sweat drips down my sloped forehead as I confront a television’s remote control. Befuddling.

With the proper time and equipment I could certainly construct a mobile phone of some worth. But once constructed, my lack of ability to use the same would convince one not having read the previous sentence that I am a man that does not belong in this time. The watcher would shake his head; “give this man a rock and a stick with which to hit it – modern technology pains his primitive brain.”

What is the cause of this deficiency? I don’t know. I am simply much more comfortable working with abstract mathematical constructs than with an MP3 player. Unfortunately I am too young to draw on the “absent-minded professor” image or to take on a Knuth-like ascetism about the subject matter with which I work. For the time being I will simply scratch my head with a crooked finger and continue carving my research into convenient rocks.

As noted in an earlier post, I am playing Sim Tower. I have successfully crafted a building worthy of the “Tower” classification – that is, a permanent population of 15,000 sims, sufficient parking, recycling, security, and medical facilities, an underground metro station, and on the 100th story, a majestic cathedral in which weddings are held.

The cathedral atop Corporate Hell

I eschewed the normal strategy of interleaving floors of offices and hotels and retail establishments and instead built a tower which I named “Corporate Hell”. Inside its metal skin are 100 floors of offices packed side-to-side, with thousands of sims eking out a living in a nest of cubicles. Stairs and elevators snake through the building, surrounded at every stop by gangs of workers desperate to leave for their 30 minute unpaid lunch breaks. It reeks of misery, money, and the American way.

The game imposes a limitation on the number of elevators, which provides most of the challenge at later stages of play. Early on, one is most concerned with money – everything has a price, and to achieve a higher star rating (one star, two stars, etc. to 5 stars, then “Tower”) one must meet various population and facility requirements. However once the player (or mogul, as I prefer to see myself) elevates the establishment to 3 stars the money is pouring in far faster than it can be spent. For reference, installing an office costs $40,000; Corporate Hell now makes over$5 M a day.

Therefore as the game progresses the problem is one of population control. With few elevators and limited stair access, the sims are forced to queue in long lines to get in or out of the building. This causes them stress which in turn confers a low evaluation to the office in which they work. Too low of an evaluation and the denizens will leave the building permanently… and we can’t have that.

It turns out, however, that if the rent on an office is lowered to its minimum – $2,000 a quarter (2 weekdays and 1 weekend in the Sim Tower world) – the sims will put up with any amount of abuse from their corporate overlords. So long as there is a path from every office to every place a sim might want to go – the lobby, the outside world, the medical facilities, the metro – they will continue to show up day after day, even as their stress levels are nearing the point of mental instability. Sims are represented by tiny silhouettes. The game adjusts a sim’s color to demonstrate his stress, from black (calm) to pink (stressed) to red (aneurysmic). The early birds have a chance of getting inside, despite the long elevator queues Thus, Corporate Hell has 100 floors of the cheapest offices, with a single elevator shaft serving every set of 15 floors. For added degradation of the bread-winners there is only one car per elevator shaft. The lines are brutal. Sims that arrive at dawn (6 AM) will most likely make it to their office by noon; those arriving after will still be queued for the elevators when the lucky few clock out in the afternoon. At 3 AM there are hordes of burnt-out shells of men and women still waiting to reach the lobby for their lunch breaks. The upper level offices are never inhabited (yet their workers graciously pay the rent every quarter) – there’s just no possible way to scale the 100 torturous floors in less than 12 hours. Workers that do manage to reach offices above the 50th floor enter, turn on the lights, and immediately turn them off and get in line for the elevator back down. They can be found there as dawn breaks on the next day, at which point the game doles out the slightest bit of mercy and removes them from the building in a single, rapture-like evacuation. Quarter after quarter the money pours in. On the weekends the building is dead (except for those trapped in the lobby). Occasionally weddings are held in the chapel, but any marriage that is initiated on the roof of this Brazil-esque workplace is as hopeless as the zombies that inhabit the fluorescent-lit cubicles within. The brutality of the simulation, the ruthlessness that it allows the player, is astounding. A two-dimensional building becomes a conduit for corporate cruelty. But it’s not schadenfreude if you turn a profit, right? Just another day at the office: 12 hours waiting for the elevator to take a lunch break Today’s post is a competition: I have code running, the results of which I need to see to proceed. When the program terminates I will wrap up this post; thus the briefer this update, the faster (and better) my program must be! Thrice I’ve attempted to write up comprehensive summaries of what I do, both at school and at work. Thrice I failed; I think that the topics are too involved to summarize succinctly. I always find it difficult to choose a “stopping point” in any explanation: ask me a technical question and I may open with “In the beginning…” At school I am writing code to prove a particular statement. Originally my goal was to prove error bounds on an existing program that used an approximate technique; I would have shown that no amount of rounding error that could have occurred was great enough to cause the program to say “no” when it meant “yes”. At some point I determined that the program could be written to answer the question exactly, without approximation, and so started work on a new version. Tap on the hourglass and it’s several weeks (months? I don’t have a good grasp of time estimation.) later. As of today, all of the functionality is in the program and theoretically it is a complete “first run”. (My boss likes to say that a program is only “done” when you can’t stand to look at it anymore, so this code is far from finished!). The new program answers the question without approximating and also runs significantly faster than the old program. The next step is to write a paper on the purpose, methodology and results of the program. I have yet to establish the exact scope of this paper; I am very new to this work and most of what I do involves ten steps of gathering background information before taking one step forward. Today, then, is a bit of a milestone as I have a somewhat complete suite of programs that produce some actual results. Granted, I’ll probably look back in 6 months and think “gee, that took me how long?”, but there it is. Things are progressing slower at work. One of the the company’s main products relies on a component for which production has ceased (but will remain available for a while); my job right now is to design the next version of the product, replacing the component in question, and supporting an additional feature (a faster speed). I have been working on this since January and reached my second functional prototype a few weeks ago. I should stop and say something about school-versus-work: my main priority is school and my research. I work part-time, which accounts for some of the slow progress. Research is more intellectually stimulating and interesting, while work is more physically rewarding. I can prove a theorem at school and then go home and see my device function – the combination keeps both subjects fresh. I find that when I’m just getting tired of looking at my code run at school I’m ready to go home and start work, and when I’m just starting to grow weary of paging through the USB spec at work I’m ready to head to school and get back to math. Back to the subject of work. I finished my second prototype and began the next stage of design. Unfortunately I am being bogged down by intermittent bugs that are dependent on external behavior. For the past few days I have been fighting with this problem and have yet to make any headway. I find that my progress at work comes in short bursts of enormous productivity which are then halted by difficult-to-detect mistakes. I will likely spend the next few days working on the current problem, but then complete the rest of the third iteration of the code in a series of marathon sessions over the weekend. Knowing this doesn’t make the bugs any less frustrating, however. So while work moves slowly I have reached an important point in my research. With any luck I’ll find a breakthrough at work in the next few days and make progress on writing the paper for school. My code has terminated, telling me I am finished with this post. The program yielded the expected answer: 12. Gee, all that work for 12? I could have told you that! It is my wont to spread information as I acquire it: hence, my desire to teach. When I was in third grade I had a large blue hardcover book entitled “The Big Book of Facts”: the bible from which I preached, incessantly, gems of knowledge to my family. Sitting at my pulpit (the lunch table, typically) I would open with “Here’s something you didn’t know…” Feel free to take a moment to appreciate my family’s restraint, as evident by my continued existence! I have long since outgrown such childish evangelism; now I have a large repetiore of phrases with which to begin the enlightenment of my captive congregation! Take another moment to appreciate my fiancee’s restraint. One such piece of information (there should be a noun: informatum, as for data / datum) involves walking with a full coffee mug. I was taught at some point (in keeping with the theme I should say it came to me in a dream, borne by blue hardcover angels) that it is best to keep one’s eyes straight ahead while carrying coffee. One’s natural inclination is to watch the liquid to ensure it doesn’t spill, but as per The Big Book of Facts, or whichever prophet wore its mantel that day, this leads to overcompensation. The best strategy is to walk slowly without looking at the coffee. I have rigorously adhered to this “fact” and repeated it many times. It was only during the last few weeks, while walking between buildings with my daily second cup (the first being at home with breakfast) that I dared question its validity. You see, for as long as I have been faithfully marching, eyes front and center, I have also been routinely covering myself in coffee. I attributed the spillage to my own clumsiness, or perhaps simply walking too fast. But during my second cup ritual I have noticed that when I transgress and stare intently into the mug as I walk, I reach my office with nary a drop upon my shirt. Heresy! cries The Big Book of Facts. Heresy! echoes the congregation. And so my faith, my unblinking adherence, to the Big Book is shattered. My apostasy is apparent, my excommunication imminent. I am no doubt damned to an eternal coffee cup of bitter grounds; no sweet brew awaits my passing. Will this disproof of coffee cup canon lead to a stop in my obscure fact evangelism? Of course not! “The coffee cup passage is a metaphor”, I will apologize. “The liquid is symbolic; the mug, a vessel representing the soul. Let thine eyes dwell not upon thine soul or surely thou will stumble.” Go ahead, take another moment for my fiancee; her patience is incredible! Yesterday I rediscovered an old game that I used to enjoy. As it happens to be, I still enjoy this game, much to the detriment of my household chores! The game is SimTower, in which the enterprising player constructs a skyscraper floor by floor. The game is 2-dimensional in graphics and mainly revolves around balancing elevators with office space, providing adaquate housekeeping stations for hotel rooms, and maximizing weekend profits with restaurants. It has all the usual accoutrements of a Sims game: complaining Sims, quarterly income and costs, tradeoffs between packing guests like sardines in tins and wasting precious space, and so on. I am currently (well, the tower is running on its own on my desk in my apartment) building a major office building – no hotel rooms or condos. I may eventually put a series of penthouse floors on the upper levels, but currently it’s all office, all the time. This makes construction easy: offices are the cheapest of all room types. With each new block of offices I also install a restaurant or two to catch the lunch crowd and to bring in weekend profits (when the rest of the building sits dormant). I started the tower yesterday when I finished work (my second job) and let it run overnight. I glanced at it this morning but didn’t disturb it: apparently I accrued$30+ million between dusk and dawn! The building is very small right now, and only earns two stars (out of five), but it’s growing.

The program itself was originally written for Windows 3.1 and supposedly plays fine up through Vista. I’m running it on Linux under Wine, which required some fiddling (doesn’t it always?). I had to disable sound card support in Wine and must touch (literally, with the touch command) a file before I can save to it. Other than that it runs fairly well – well enough for me to slowly grow Nate-Corp world headquarters!

There isn’t a “winning” moment in the game; many players consider themselves to have won when their building earns five-star “tower” status, which requires a huge number of floors and money and a giant population. Often times the goal is to further establish a cathedral on top of the tower and have a wedding in it, which is, technically speaking, the most difficult acheivement in the game.

I don’t think I’ve ever gotten past a three-star building, but I enjoy just playing around with it. And of course it’s a Sims game, so that means that sooner or later I’m going to build 20 stories of hotels and then demolish the elevator and watch how stressed the people get when they can’t make it to the below-ground shopping mall!

Screenshot coming later, when I’m home.

I realized while reading the last post that I sounded awfully negative about my research! I should note that I find what I’m doing fascinating; it’s my descriptions and attempts to convey that excitement that bore.

I guess I could just edit that post, but WordPress utilizes what may be the most complicated blogging software known to man. I’m not sure whether I’m writing a post or controlling a satellite. For instance, where might you expect to find the blog subtitle? Maybe under “Dashboard”? “Appearance”? “Settings”? “Blog info”? I worry that if I delve too deeply I will literally become lost in the pages. So the post stays.

Back to the item at hand. I made a little graphical thing that I think describes the grammar problem in a different way.

Grammar problem

Notice how the referential arrows cross in the first case and do not cross in the second case. (The order in which I listed the cases is reversed from how I wrote it in my previous post.)

From here you can imagine larger constructions. Let’s say that the non-confusing form of the clause is The seeing of men about horses on Tuesdays. If the “split” form is proper at all, there are only two choices.

1. Men, horses, Tuesdays, and the seeing thereof, thereabouts, thereon
2. Men, horses, Tuesdays, and the seeing thereon, thereabouts, thereof

This cases correspond to the same sort of diagrams. For the first, the arrows are all crossing. For the second, the arrows are all nested. It is obviously wrong to mix the two; at least it certainly feels wrong, as it would imply that the rules of grammar being applied are dependent on the number of prepositional phrases, which is a little silly. For example, we can say via intuition that “men, horses, Tuesdays, and the seeing thereon, thereof, thereabouts” is incorrect.

The first form (crossing arrows) is akin to FIFO behavior: first in, first out. The second is LIFO: last in, first out. It’s this mathy, computer-sciency connection that interests me – are split prepositional phrases (making up the terminology) ordered FIFO or LIFO in English? What about other languages?

My vote is on LIFO, mainly because I think it feels niftier on the tongue.

Now if you’ll excuse me, there are men, horses, Tuesdays, barns, profit, and the seeing therefor, therein, thereon, thereabouts, thereof to which I must attend.

The other day I was writing a very long post about what I do here at school, but I gave up halfway as I realized I was boring myself. This is not a good sign.

I’m sitting here watching my code run. It runs, and eventually I stop it and I check what it’s doing. I then shake my head sadly and change a few lines of code and try again. Very exciting! I have some thoughts on Haskell, the programming language in which I’m working, that I’ll share at a later time.

Today, however, I’m going to write about grammar. I am an engineer by degree and so you mite expect me too right like this. I’m not particularly thrilled by language, but some parts of it interest me. This post may or may not interest you. Read on and find out!

In English there is a colloquialism: going to see a man about a horse. The subject of the trip can be adjusted (“going to see a man about a dog”, for example) and sometimes the noun too (“going to see a dog about a man” is sometimes used). The act denotes a private errand; the phrase is used to brush off a question regarding the same.

A: Sorry, I must leave now.
B: Where are you going?
A: I have to see a man about a horse.

It’s suggested that originally the phrase was used literally – as in, gambling on horse or dog races. Nowadays it is rare to have to see anyone about a horse and so unless you live on a farm you can be fairly certain that the speaker is avoiding discussing their personal business with you.

It’s a gentle euphamism, however – it doesn’t imply any impropriety in the asking. If you’re looking for something that rebukes the asker, I’d suggest none of your beeswax!

On to the grammar question. Now that we understand the phrase itself, let’s put it to use. Suppose we wanted to construct a noun clause that referred to the general act of seeing men about horses. Which of the following two options is correct?

1. Men, horses, and the seeing thereabouts, thereof
2. Men, horses, and the seeing thereof, thereabouts

If it’s unclear, thereabouts refers to the horses, who are the subject of the meeting. Thereof refers to the men, who will be met.

We could rearrange the clause as the seeing of men about horses. “Seeing” is a gerund, followed by two prepositional phrases: “of men” and “about horses”. While less accessible, we could exchange the two prepositional phrases: the seeing about horses of men.

In each of these we can split the last prepositional phrase, leading to the following:

1. Horses, and the seeing of men thereabouts
2. Men, and the seeing about horses thereof

But if we wished to split the remaining preposition, what do we do? In #1, should “men” be put after or before “horses”, and should “thereof” be placed before or after “thereabouts”? In #2 it is the same dilemma.

So what do you think? Which do we use?

1. Men, horses, and the seeing thereabouts, thereof
2. Men, horses, and the seeing thereof, thereabouts

I know very little about English grammar and I don’t have the answer. It could be that neither clause is grammatically sensible. After all, the listener needs to be able to determine that we do not mean that we are going to see a horse about a man.

I may pose the question to a professor in the field, if I find one wandering the streets looking for confusing clauses to dissect. Otherwise I’ll continue using whichever pops into my head first and encourage you to do the same.

Today’s post is something a little mathier than the linux stuff I wrote about during the past few days. A p-beauty contest is a game (in the real and mathematical sense of the word) in which $n$ players must simultaneously and secretly guess an integer between $0$ and $m$, inclusive. The judge then computes the average $x$ of all the guesses. The winners are those players who guessed the integer closest to $p x$ of the average, where $0 < p < 1$.

Let's see an example with real numbers before we go on. Let's say that $p=0.5$ and we have $n=20$ players choosing integers between $0$ and $m=100$, inclusive. Suppose all the players choose at random; the average is $x=50$. Then $p x = 0.5 \cdot 50 = 25$. The winners are all those players who chose $25$ as their guess. If nobody chose $25$ exactly, then the winners are those that chose $24$ or $26$ (and so on).

The reason this is called a "beauty contest" is because it is very closely related to a game called a "Keynesian beauty contest" (after John Maynard Keynes, the famous economist who first described it). In a Keynesian beauty contest, a newspaper publishes pictures of beautiful women. The readers are then told to vote on which one is the most beautiful. The woman who gets the most votes wins a prize, and the readers who voted for that woman also win a small prize.

The implication is obvious; you are not voting for the most beautiful woman, but for the woman whom you think will be voted most beautiful. But if everyone figures this out, then you’re really voting on the woman whom you think everyone else will think will be voted most beautiful. But if everyone figures this out too…

The p-beauty contest is the same idea. Let’s see how it works in our previous example. Bob is playing the game, and the judge says “Go!” and everyone begins writing down their answers. Bob looks around and sees Alice, who appears to be counting the number of polka dots on her shirt as a method for coming up with her guess. “Oh ho, you rube!”, thinks Bob. “If everyone is just like Alice and picks their number randomly, the average will be $50$. $0.50$ times $50$ is $25$ and so if I guess $25$ I’ll win!” Bob writes down $25$ and smirks.

Carol is sitting next to Bob. She sees the smirk on his face and thinks “Hmm, you know, I bet Bob thinks he’s really clever. I bet he figured out that if everyone guesses randomly, the winning guess will be that closest to $25$. But I don’t think Bob is all that smart. In fact, I think that everyone is that smart, and they’ll all guess $25$.” She bites the eraser on her pencil and thinks a bit more. “If everybody guesses $25$ then the average will be, well, $25$. So then $0.50$ times $25$ is $17.5$, which rounds to $18$. Therefore I will guess $18$, and I’ll win!”.

Little does Carol know that Dave is sitting just behind her and sees her chewing on her pencil. Dave applies the same thought process and concludes that if everyone is as smart as Carol, everyone will pick $18$. Accordingly, he picks $0.5 \cdot 18 = 9$.

You can see where this is going. If everyone playing the game follows this logic forever, the numbers keep dividing by $2$ forever. And since $\lim_{k \rightarrow \infty} a / (2^k) = 0$, the only possible outcome for such a game played by rational players is for all players to choose $0$, at which point all players win.

Of course in real life, the players are not rational. If all but one of the players are rational, they will all choose $0$, but the remaining player will throw the average off by choosing something else. It may still be close to $0$ (making the rational players the winners), but that depends on how many irrational players are in the game and what numbers they choose. It doesn’t take many before the rational players will almost always lose.

But then in real life, the players (even the rational ones) know that their competitors are not necessarily rational. This is a very different game now! Being rational will almost certainly cause you to lose – you must be irrational, but cleverly so.

In the example given, Alice was a “level 0” player: she chose randomly. Bob was a level 1 player: he chose believing that everyone else was a level 0 player. Carol was a level 2 player: she chose believing that everyone else was like Bob, a level 1 player. And Dave was a level 3 player.

Are higher level players better than lower level players? Well, that depends how accurate their estimation is. Dave chose $9$ because he assumed that everyone is a level 2 player. And Carol chose $18$ because she assumed that everyone is a level 1 player. But what if it was really Bob that was right, and everyone (except for Bob, Carol, and Dave) picked randomly? In this case we have an average of $(17 \cdot 50 + 1 \cdot 25 + 1 \cdot 18 + 1 \cdot 9) / 20 = 45.10$. The winning guess is that closest to $0.5 \cdot 45.10 = 22.55$. Out of the “advanced” players, Bob came closest with his guess of $25$!

Carol and Dave overestimated the ability of the majority. Bob underestimated Carol and Dave, but estimated correctly the majority, and so his guess was closest. Note that Bob still might not have won, since a level 0 player could have randomly guessed closer to $23$ than Bob, but Bob’s strategy was best in this situation.

The point here is that when the players take into account the strategies of the other players, that itself becomes part of their “meta-strategy”, if you will. And they need to realize that other players may very well be taking that meta-strategy into account in their own. In the perfectly rational game, everyone takes this concept so far that they all end up guessing $0$ (and winning). In real life, however, you need to make some estimate of the rationality of the group.

I’ll end this post with a related riddle that I like. There’s probably an “official” name for the this, but I don’t know it so I’ll just tell it.

A logician is arrested on a Sunday afternoon by the Spanish Inquisition. The magistrate tells him that he is to be put to death at exactly noon on one of the upcoming 5 weekdays. Furthermore the magistrate tells him that there will be no prior warning of the moment of execution; at noon on the chosen day the executioner will appear outside the logician’s cell. He ensures the poor logician that it will be a shock, saying “you will be completely and utterly surprised when the moment comes.”

The logician is taken away and put in a cell. To further the torment, a large clock is erected just outside the bars. As the rest of that Sunday passes, the logician stares fearfully as the hands of the clock slowly move. At midnight the clock booms; he sits in the corner of the cell and shakes with the fear of being completely and utterly surprised by the moment of execution. “If I only had some idea when it would happen, it would be much easier to bear! But the judge said I would be completely and utterly surprised.”

Monday morning comes and the hands continue to turn. At 10 o’clock he is fearful; at 11 he is terrified; at 11:59 he is shaking, and as the clock strikes noon he darts to the bars… but no-one is there. He lets out a gasp and sinks to the floor. “Well, I wasn’t executed today, so that leaves Tuesday, Wednesday, Thursday, and Friday. If only I weren’t to be completely and utterly surprised!”

That night the logician is thinking to himself. “I wish I could narrow down the day – the fright would not be as much!” As he paces the cell watching the hands climb over midnight, he comes to a realization. “Ah ha! Suppose it was Thursday night. Were I still alive to ponder the question, I would know that Friday must be the day of my execution. And that would mean that as the minutes grow closer to noon on Friday I would know the executioner is coming. And that would mean that I would not be completely and utterly surprised!” He stops pacing and looks at the clock triumphantly. “Therefore, since I must be completely and utterly surprised, my execution cannot be Friday!”

The logician lays back down on the thin prison mattress. The hands of the clock continue to wind around the face into the early morning of Tuesday, but he can’t sleep. As 6 o’clock comes he suddenly sits upright with another revelation: “Oh ho! Suppose it is Wednesday evening. Were my head still upon my shoulders, I would know that Thursday must be the day of my execution, having already ruled out Friday. And that means that as noon on Thursday approaches I would know the executioner is on his way. And that would mean that I would not be completely and utterly surprised!” Now his mind is working at full speed. “Therefore, since I must be completely and utterly surprised, my execution cannot be Thursday!”

Satisfied that he has narrowed down the day of his execution to Tuesday or Wednesday, he lays down. Before long it is 11 o’clock. Again he stands before the bars, trying to get a glimpse down the hallway. The minutes tick by and he begins to sweat. At 11:45 he is gripping the bars so tight his hands whiten. At 11:59 he grits his teeth, closes his eyes, and waits for the sound of the executioner entering the hall. But as the clock strikes 12 he is still alone.

Frowning, the logician lets go of the bars and walks to the back of the cell. He leans against the stone wall and looks at the clock thoughtfully. Slowly a realization comes upon him and he runs forward and shouts at the clock: “Ah ha! I have figured you out! You see, as I was not executed Monday, nor was I executed today, and I have already proven that it cannot happen Friday, nor Thursday, then the day must be Wednesday!” He is surprisingly happy for a man who has named his own execution date, and he continues: “But when noon approaches tomorrow I will know that the executioner is sharpening his blade, and when you point your hands to 12 I will know that I am to be killed. But that means that I will definitely not be completely and utterly surprised! And therefore Wednesday cannot be the day of my execution!”

He is practically jumping up and down at this point, shouting at the clock with glee. “And since I wasn’t executed Monday, and I wasn’t executed today, and I can’t be executed Wednesday, Thursday, or Friday, then I shan’t be executed at all!” Grinning, he returns to the bed and sits down, having proven conclusively that he will not be executed.

The clock continues to tick, apparently ignoring his demonstration. Tuesday concludes and Wednesday begins. The logician, sure of his safety, is soundly asleep as 9 passes on Wednesday morning, then 10, then 11. At 11:59 he is dreaming of lectures to be given and proofs to be written. But our poor logician has sealed his own fate.

The clock booms, signaling noon on Wednesday, and the logician suddenly wakes to the clanking sound of a key in a lock. He sits upright and rubs his eyes, and then makes out the hooded figure of the executioner standing just within the cell door.

With shock our doomed hero exclaims: “But it cannot be today! Why, I proved it could not be today! I proved it could not be at all! This is impossible! How can this be? I am completely and utterly surprised!”

Hopefully you enjoyed my version of the riddle. The relation to the p-beauty contest is pretty clear; the magistrate thought one step ahead and estimated the intelligence of the logician. The logician’s own estimation was what doomed him, much like Dave losing the contest because his estimate places him far from the correct answer. It’s unfortunate for our logician that game theory wasn’t developed until the 1940’s!