(no subject)

The passage in my last post came from The Lord of the Rings: the first sentence of the climactic paragraph where Sam stands on Mount Doom and sees Sauron's works fall to ruin. I just reformatted it.

That came out of my verse-detection program: I've tried it so far on LotR and Jane Austen's novels. Austen shows substantially less of the iambic pentameter, reaching 3 lines in only two places. Here's Elizabeth Bennett turning down Mr. Darcy's first marriage proposal:
. . . my forming any serious design.
These bitter accusations might have been
Suppressed, had I, with greater policy,
Concealed my struggles. . .
Tolkien produced many more hits -- the longest were all songs and poems, naturally (Ents have the most iambicity, followed by hobbits and everyone else). These verse bits gained a kind of polyrhythm from the pentameter -- being written for a different number of beats per line ("O rowan fair, upon your hair how white the blossom lay") -- and I wonder if anyone's consciously gone for that effect.

The verse I quoted was the longest prose passage to come up (though the first few lines of it were not joined up by my program, with its rather robotically-strict idea of meter). In Tolkien's case at least I think this is no coincidence, this blank-versish prose showing up at a climax of the story. I wonder if it'd be fun to try to quantify that question over a bigger sample of fiction.

A couple more bits from this never-yet-seen Miltonic epic:
. . . He made the end fast round his waist, and then
He grasped the line with both hands. Sam stepped back
And braced his feet against a stump a yard
Or two from the edge. Half hauled, half scrambling,
Frodo came up and threw himself on the ground.
. . . I've got them both still. But lend them to me
A little longer, Mr. Frodo. I
Must go and see what I can find. You stay
Here. Walk about a bit and ease your legs.
I shan't be long. I shan't have to go far."
"Take care, Sam!" said Frodo. "And be quick!

(I extended these as well into the surrounding context where it didn't do too much violence to the meter.)

Guess the author. . .

. . . of this passage in blank verse:
One turned to stone. A brief vision he had
Of swirling cloud, and in the midst of it
Towers and battlements, tall as hills,
Founded upon a mighty mountain-throne
Above immeasurable pits; great courts
And dungeons, eyeless prisons sheer as cliffs,
And gaping gates of steel and adamant:
And then all passed.
(It's a trick question.)

The web speaks

Here's the 'best' of the first half-dozen 'poems' from my new program: it babbles at random according to a Markov model using the most common bigrams from Google's whole-web corpus, constrained to a Shakespearean sonnet.

not safe for workCollapse )
A completely safe for work one:
More stable in support that there were some
Type is shown in my products and thought this
Or been in their poor in a large groups from
Their friends and most things that some are still miss
Him well aware of his words to hang out
And his concerns for front of business to
Be paid for such sale or to lie about
The comic book by any light of view
Complete this section that a named on your
Search tips and he threw it will be a thought
I hate to spin on last line shopping for
The first few years there are not have been taught
By other regions where you understand
What you can range of any other hand.

So the program mostly works from the formal point of view, though with a few terrible rhymes like them/em, some mindlessly repeated rhymes, and it never tries for feminine rhymes. I'm surprised at how decent the scansion is, from such a simple algorithm. It sounds out the words using CMU's pronouncing dictionary.

I voted.

And since they're using optical scan machines, my vote probably even got counted.

This post brought to you by the letters F, U, and W and the number -8.

two completely unrelated memes

1. Take a picture of yourself right now. Don’t change your clothes. Don’t fix your hair. Just take a picture. Post that picture with no editing. (Except maybe to get the image size down to something reasonable. Don’t go posting an eight megapixel image.) Include these instructions.

2. When you see this, quote Douglas Adams in your journal.
Worksop (n.) A person who never actually gets around to doing anything because he spends all his time writing out lists headed "Things to Do (Urgent)."
(From Adams and John Lloyd, The Meaning of Liff.)

Gadding about

I'm visiting the SF Bay area over roughly the next week. Want to meet up? Email me or comment here. I'll be staying with a friend for the first few days, but I'd welcome the chance to crash with someone else for the rest of the stay -- wouldn't want to impose on him that long. (I'll find a hotel if there are no volunteers.)

From there I was going to take a trip around the country on Amtrak; they have several-week rail passes at an attractive price, recommended by papersky. They also, it turns out, require photo ID, which I no longer have and certainly won't get just for them. So I'm not sure -- I suppose I'll try and set up a ride to the east coast via craigslist and then get around there somehow or other -- needs some research. Are there regular east-coast trains without this internal-passport silliness?

Spirits from the vasty deep

In Scott McCloud's Understanding Comics: The Invisible Art, the 'invisible art' is in the space between the panels:

I may have drawn an axe being raised, but I'm not the one who let it drop or decided how hard the blow, or who screamed, or why. That, dear reader, was your special crime, each of you committing it in your own style. All of you participated in the murder.

Writers in any medium use tricks like this to enlist you in the storytelling. They skip over actions, as above; leave you puzzles and mysteries and choices; tell the story out of order; or just plain lie. I ran into a new device of this sort in the 2006 ICFP Programming Contest.

Their webpage during the run-up blandly announced that the contest would have to do with computational archaeolinguistics. Some days before the start they released a 'codex', a big file of no known type with peculiar strings amid the random bytes, like 'novus ordo seclorum' and a GIF logo saying 'CBV'. Finally they kicked off with an urgent appeal to their colleagues:

In 1967, during excavation for the construction of a new shopping center in Monroeville, Pennsylvania, workers uncovered a vault containing a cache of ancient scrolls. . .

Based on a translation of these documents, we now know that the society, the Cult of the Bound Variable, was devoted to the careful study of computation, over two millennia before the invention of the digital computer. . .

Two weeks ago, during a visit to the excavation site for a new computer science building at CMU, workers discovered a set of inscribed tablets that proved to be the Rosetta Stone for interpreting the Monroeville codex. The tablets precisely specify the Cult's computing device, known to initiates as the "Universal Machine." Although there is still no evidence that the cult succeeded in constructing their machine, it is a reasonably simple task to emulate it on modern hardware.

. . . We invite you to participate in this investigation. The codex and a translation of the Universal Machine (UM) specification are available for download from our web site. We encourage you to implement the UM and begin your own exploration of the codex.

Well, no way could I resist -- I joined catamorphism's team and coded a buggy UM interpreter over my lunch hour at work that Friday. The rest of the team (Brandon Moore, r6, tgies, and catamorphism) independently whipped up a working, but slow, interpreter in Haskell and started exploring the codex, which proved to hold the encrypted image of a multiuser computer -- they could log in to the guest account and start looking for ways into the rest of the system. After I got home I fixed up my interpreter and we were off -- it was fast enough for real work.

The users of that ancient computer had left files around with puzzles and in-jokes and hints at a story -- who were they, this Cult of the Bound Variable -- whence this struggle with the Cult of the L-Value -- did it start with the Separating Disjunction?

The new thing to me was a story intermediated by this UM interpreter I had to write myself. It's a kind of magic, to get a few pages of code just so, to invoke spirits from a dead civilization. "Do they come when you do call them?" -- Not at all at first, but they would wait through a few rounds of debugging before I could get to an intelligible prompt; then after speeding up memory management and fixing mishandling of text vs. binary I/O there was a login screen, and there we were -- in touch at last. Further tweaks brought further speedups and smoothed the animations -- you see how the experience of the story bore a particular directness to the work I put into it, as if it were my work, only amplified by the authors. That is the new trick in a work of fiction, that could only be done with a computer.

After the contest, submitting our team's solutions, r6 and I were moved to write some 'fanfiction' -- hacking up some tools overnight just before the deadline, to create a self-extracting compressed UM image like the codex, presenting a shell prompt when run -- r6 dropped hints in the style of the work we were responding to to imply that this shell came from the Cult of the L-Value. He developed his assembler afterwards into a neat article for the Monad Reader.

There have been other writeups of the unique excellence of the 2006 contest, but none I've seen emphasizing this response to it as worldbuilding and storytelling. This year's contest starts today! If you're a programmer, do check it out; catamorphism is one of the organizers this time, together with others at Portland State and the University of Chicago.

Zen agora

In the game Zendo, a master makes up an arbitrary, secret rule, and students compete with each other to be the first to guess it. The rule classifies configurations of pyramids into two types. We call a configuration of pyramids a 'koan'. An example rule: a koan 'has Buddha-nature' if it has a red pyramid pointing at a green one.

Play starts with the master setting out two example koans, one of each type, labeled accordingly; then the master picks a student to move first.

The student builds a new koan. Then, if that student wishes, all students separately and simultaneously guess the koan's type, and the master awards a green stone to each student who was correct. Whether there was a guessing round or not, the master labels the koan with its type.

Also, if the student whose move it is has a green stone, they may give it back to the master and guess the rule. A correct guess wins the game. For a wrong guess, the master builds and labels a koan that the guess classifies incorrectly. The student may keep choosing to guess for as long as they have stones. Play passes to the next student on the left.

So that's the game; there are a few more details of play and terminology in the official rules, e.g. the type labels are white and black stones, they use Zen terms instead of my boring English, etc. I've never played it -- I was just reading its very interesting design history last night, via Chris Okasaki.

This morning I thought of a variant: instead of the master picking an initial student, and instead of play passing to the next student on the left, there's an auction on each move for the right to move. (With real money or play money, whichever. A second-price auction with sealed bids seems the right thing, although you'd want to avoid the auction machinery overwhelming the actual play.) The winner of the auction pays the auction-assigned value to the previous mover, then moves. At the end, the student who guessed the rule gets awarded some money; this money was collected from all the players at the beginning of the round when the master made up the rule. I guess for the very first auction, before there's any mover to pay the auction-value to, the payment should go into the prize pot. (Maybe in subsequent rounds the first payment goes to the winner of the previous round.)

The rationale is to reward players for inventing insightful koans whose answer is likely to bring the solution closer. If you think of a 'good experiment', the value of the next move will be higher than you had to pay, and you'll make a profit. Also -- while it's not apparent from my description which deemphasized the "Mondo" and the "Buddha nature" and such -- I think it's hilarious to mix capitalism and Zen.

(This was suggested by Eric Baum's reinforcement learning auction ideas. I suppose you could make a game this way out of any competitive machine-learning algorithm.)

ETA: This has the obvious defect that the first mover can hold onto ownership for the rest of the game. There needs to be some cost to stop that, something like the ante in poker, I guess. Oops. If per-auction antes went to the master, that'd encourage the master to make overcomplicated rules and counterexamples, so that's not the answer. Hmm. Maybe just bite the bullet and say the house takes a cut? Vegas Zen Agora. But then it needs gambling! Argh! Zendo really does sound elegant, doesn't it?

So, another attempt:

We play with funny money managed by a neutral banker. At the start of a session each player gets a stash. Each move, the banker collects 'rent' from each player for the privilege of staying on the trading floor. There's an auction for the move; the price is paid to the previous mover. The new mover builds a koan, which the master labels. The mover then may guess the rule, once. A correct guess wins the set prize money, and ends the round. A wrong guess produces a counterexample from the master, and ends the move.

This variant eliminates the green guessing stones and the all-students-guess option, since they seem sort of redundant with the auction. We could potentially take out the student-built koans, too, and have them just guess the rule every move, but that may be going too far.


The darius endorsement for U.S. president goes to Barack Obama. As pnh puts it:
He’s not an insurgent; he’s the standardbearer for a faction of the country’s political elite. I believe that, on balance, this particular faction happens to comprise many of the the smartest and most conscientious individuals from within that elite. So I’m supporting Obama and his train, people like Samantha Power and Robert Malley and Lawrence Lessig, just as a peasant might cheer for an aristocratic faction made up of reasonably decent individuals against other factions made up of out-and-out thugs. Not because the peasant doesn’t know the game is rigged, or doesn’t have the wit to imagine a better world. But because incremental change matters, and because the right incremental changes can lead, like water flowing downhill, to bigger and more profound ones.

Also, while I am a radical in analysis, I am an incrementalist in practice, because life is short.

(Though I disagree with the reason "because life is short". In genetic algorithms it's important for your fitness function to be reasonably discriminating even in the vast area of the space that's far from optimum. Recent elections brought home to me how much that principle applies to politics.)

ETA: Peter Norvig posted another, quite different endorsement worth reading.


I met Beethoven's piano sonatas and The Lord of the Rings at about the same age, around 10, though they were never especially linked in my mind before.

I've always loved the sound of the piano; in second grade after it was first announced that there'd be lessons after school, I skipped back home with the signup form, playing air keyboard. The class was taught by a sprightly old gent named Fekko von Ompteda, and I enjoyed it, unlike school in general: it was just hard enough to be interesting, and there we were making actual music with our hands on heavy hulking mysterious machines -- plus an old Moog once -- and learning bits of mathy theory and an esoteric visual code. I liked the teacher too: he was an immigrant and charmingly eccentric in his own right, though after mumbledy years I've quite forgotten why I thought so. It seems he was "a very gifted and amazingly progressive musician", and, sadly, is no more; I wish I'd come back to Toronto for a visit before he died.

Moving to California ended all that. But my parents gave me for Christmas, at some point, a multi-record set of Beethoven played by Ivan Moravec, who as far as I'm concerned defines Beethoven -- see, I imprinted on it. The cycle of piano sonatas is my ultimate comfort music now.

This time, as I happened to come back to The Fellowship of the Ring at the same time, I was struck by how much sonata #20 sounds like the Shire. It could be dance music at Bilbo's birthday party. You might plump for the 'Pastoral' sonata instead, but I say no, that one's too Elvish. :)

But that wasn't the really striking discovery. I'd like you to play this clip, the theme of the last movement of sonata #4, and read the opening of Chapter 8, Fog on the Barrow-Downs:

That night they heard no noises. But either in his dreams or out of them, he could not tell which, Frodo heard a sweet singing running in his mind; a song that seemed to come like a pale light behind a grey rain-curtain, and growing stronger to turn the veil all to glass and silver, until at last it was rolled back, and a far green country opened before him under a swift sunrise.

I doubt the young Beethoven could have captured the feeling of the passage this foreshadows at the end of The Return of the King, though; that would be a job for late Beethoven, who, alas, never came back to LotR for inspiration.

Sorry for the lousy fade to end the clip; it's the first time I've tried to use a sound editor. I'm afraid I didn't note down who performed this.