Entropic gravity

Posted in Astronomy, General physics, Math by Mike Stay on 2010 July 19

Erik Verlinde has been in the news recently for revisiting Ted Jacobson’s suggestion that gravity is an entropic force rather than a fundamental one. The core of the argument is as follows:

Say we have two boxes, one inside the other:

|               |
| +----------+  |
| |          |  |
| |          |  |
| |          |  |
| +----------+  |

Say the inner box has room for ten bits on its surface and the outer one room for twenty. Each box can use as many “1”s as there are particles inside it:

|      X        |
| +----------+  |
| |          |  |
| |  X       |  |
| |          |  |
| +----------+  |

In this case, the inner box has only one particle inside, so there are 10 choose 1 = 10 ways to choose a labeling of the inner box; the outer box has two particles inside, so there are 20 choose 2 = 190 ways. Thus there are 1900 ways to label the system in all.

If both particles are in the inner box, though, the number of ways increases:

|               |
| +----------+  |
| |          |  |
| |  X  X    |  |
| |          |  |
| +----------+  |

The inner box now has 10 choose 2 ways = 45, while the outer box still has 190. So using the standard assumption that all labelings are equally likely, it’s 4.5 times as likely to find both particles in the inner box, and we get an entropic force drawing them together.

The best explanation of Verlinde’s paper I’ve seen is Sabine Hossenfelder’s Comments on and Comments on Comments on Verlinde’s paper “On the Origin of Gravity and the Laws of Newton”.

A first attempt at re-winding Escher’s “Ascending and Descending”

Posted in Uncategorized by Mike Stay on 2010 May 19

And he dreamed, and behold a ladder set up on the earth, and the top of it reached to heaven: and behold the angels of God ascending and descending on it.

Edit (May 20):

Even though it’s not a conformal transformation, this version looks better in a lot of ways.

Rather than cramming the whole picture into a single window frame, it presumes there’s a concentric set of these castles, each half as small as the previous, and built within its open internal patio. Doing it really well would involve extending the walls out to the edge of the outer wall that obscures them.

I’m not this guy

Posted in Uncategorized by Mike Stay on 2010 May 18


Posted in Uncategorized by Mike Stay on 2010 May 13

Blind faith is the best antisceptic.

Tag clouds

Posted in Uncategorized by Mike Stay on 2010 May 7

Tag clouds are cumulonymous.


Posted in Poetry by Mike Stay on 2010 May 7

With a stroke, the pilot glides forward across the lake.
He does not know the names of the vortices cast off by his oar;
Neither is he known to the Sun.

Simple activity for teaching about radiometric dating

Posted in General physics, Quantum by Mike Stay on 2010 May 3

This works best with small groups of about 5-10 students and at least thirty dice. Divide the dice evenly among the students.

  1. Count the number of dice held by the students and write it on the board.
  2. Have everyone roll each die once.
  3. Collect all the dice that show a ‘one’, count them, write the sum on the board, then set them aside.
  4. Go back to step 1.

A run with 30 dice will look something like this:

dice number of ones
30 5
25 4
21 4
17 3
14 1
13 3
10 2
8 1
7 1
6 0
6 1
5 0
5 1
4 1
3 0
3 0
3 0
3 1
2 1
1 0
1 0
1 0
1 0
1 1

Point out how the number of dice rolling a one on each turn is about one sixth of the dice that hadn’t yet rolled a one on the previous turn. Also, that you lose about half of the remaining dice after about four turns.

Send someone out of the room; do either four or eight turns, then bring them back and ask them to guess how many turns the group took. The student should be able to see that if half the dice are left, there were only four turns, but if a quarter of the dice are left, there were eight turns.

If the students are advanced enough to use logarithms, try the above with some number other than four or eight and have the student use logarithms to calculate the number of turns:

turns = log(number remaining/total) / log(5/6),

or, equivalently, in terms of the half-life (which is really closer to 3.8 than 4):

turns = 3.8 * log(number remaining/total) / log(1/2).

When Zircon crystals form, they strongly reject lead atoms: new zircon crystals have no lead in them. They easily accept uranium atoms. Each die represents a uranium atom, and rolling a one represents decaying into a lead atom: because uranium atoms are radioactive, they can lose bits of their nucleus and turn into lead–but only randomly, like rolling a die. Instead of four turns, the half-life of U238 is 4.5 billion years.

Zircon forms in almost all rocks and is hard to break down. So to judge the age of a rock, you get the zircon out, throw it in a mass spectrometer, look at the proportion of uranium to (lead plus uranium) and calculate

years = 4.5 billion * log(mass of uranium/mass of (lead+uranium)) / log(1/2).

Problem: given a zircon crystal where there’s one lead atom for every ninety-nine uranium atoms, how long ago was it formed?

4.5 billion * log(99/100) / log(1/2) = 65 million years ago.

In reality, it’s slightly more complicated: there are two isotopes of uranium and several of lead. But this is a good thing, since we know the half-lives of both isotopes and can use them to cross-check each other; it’s as though each student had both six- and twenty-sided dice, and the student guessing the number of turns could use information from both groups to refine her guess.

Escher and Mandelbrot

Posted in Math by Mike Stay on 2010 May 3

If you take a complex number z with argument θ and square it, you double θ. The Mandelbrot/Julia iteration

z ↦ z2 + c

does pretty much the same thing, but adds wiggles to the curve. Since the iterations stop when |z| > 2, the boundary at the zeroth iteration is a circle; after the first it’s a pear shape, and so on. We can map any point in the region between bands to a point in a rectangular tile that’s periodic once along the outside edge and twice along the inside edge. Here’s a site with a few different examples.

The transformation Escher used in “Print Gallery” takes concentric circles at r=1/rn to a logarithmic spiral. The concentric boundaries between iterations for the Julia set at c = 0 are circles. There ought to be a transformation for Mandelbrot / Julia sets similar to the Droste effect but spiraling inward so that the frequency is smoothly increasing just as the distance can be made to smoothly increase.

The animated gif of Dorian Grey

Posted in Uncategorized by Mike Stay on 2010 May 3

My friend Jas wrote a Perl module, Perl::Visualize, that makes Perl/Gif polyglots. He later adapted his technique to Javascript/Gif polyglots. Some guy generalized a quine to print out the source code of the program together with a comment containing the next frame in Conway’s Game of Life. So we have programs that can age themselves, as well as programs that double as pictures. The “aging” process can repeat. So someone make a JS/Gif polyglot quine that renders consecutive frames of Dorian Grey!


Posted in Borges, Fun links, General physics, Perception, Quantum by Mike Stay on 2010 April 27

Lazulinos are quasiparticles in a naturally occurring Bose-Einstein condensate first described in 1977 by the Scottish physicist Alexander Craigie while at the University of Lahore [3]. The quasiparticles are weakly bound by an interaction for which neither the position nor number operator commutes with the Hamiltonian. A measurement of a lazulino’s position will cause the condensate to go into a superposition of number states, and a subsequent measurement of the population will return a random number; also, counting the lazulinos at two different times will likely give different results.

Their name derives from the stone lapis lazuli and means, roughly, “little blue stone”. Lazulinos are so named because even though the crystals in which they arise absorb visible light, and would otherwise be jet black, they lose energy through surface plasmons in the form of near-ultraviolet photons, with visible peaks at 380, 402, and 417nm. Optical interference imparts a “laser speckle” quality to the emitted light; Craigie described the effect in a famously poetic way: “Their colour is the blue that we are permitted to see only in our dreams”. What makes lazulinos particularly interesting is that they are massive and macroscopic. Since the number operator does not commute with the Hamiltonian, lazulinos themselves do not have a well-defined mass; if the population is N, then the mass of any particular lazulino is m/N, where m is the total mass of the condensate.

In a recent follow-up to the “quantum mirage” experiment [2], Don Eigler’s group at IBM used a scanning tunneling microscope to implement “quantum mancala”—picking up the lazulino ‘stones’ in a particular location usually changes the number of stones, so the strategy for winning becomes much more complicated. In order to pick up a fixed number of stones, you must choose a superposition of locations [1].

  1. C.P. Lutz and D.M. Eigler, “Quantum Mancala: Manipulating Lazulino Condensates,” Nature 465, 132 (2010).
  2. H.C. Manoharan, C.P. Lutz and D.M. Eigler, “Quantum Mirages: The Coherent Projection of Electronic Structure,” Nature 403, 512 (2000). Images available at
  3. A. Craigie, “Surface plasmons in cobalt-doped Y3Al5O12,” Phys. Rev. D 15 (1977). Also available at

NY Times article on conditional probability

Posted in Uncategorized by Mike Stay on 2010 April 27

There’s actually very good justification for this method of reasoning: it maximizes entropy.


Posted in Category theory, Math, Quantum by Mike Stay on 2010 April 11

Coends are a categorified version of “summing over repeated indices”. We do that when we’re computing the trace of a matrix and when we’re multiplying two matrices. It’s categorified because we’re summing over a bunch of sets instead of a bunch of numbers.

Let C be a small category. The functor \mbox{hom}:C^{\mbox{op}} \times C \to Set assigns

  • to each pair of objects the set of morphisms between them, and
  • to each pair of morphisms (f:c \to c', h:d\to d') a function that takes a morphism g \in \mbox{hom}(c', d) and returns the composite morphism h \circ g \circ f \in \mbox{hom}(c, d'), where c, c', d, d' \in \mbox{Ob}(C).

It turns out that given any functor S:C^{\mbox{op}} \times D \to \mbox{Set}, we can make a new category where C and D are subcategories and S is actually the hom functor; some keywords for more information on this are “collages” and “Artin glueing”. So we can also think of S as assigning

  • to each pair of objects a set of morphisms between them, and
  • to each pair of morphisms (f:c \to c', h:d\to d') a function that takes a morphism g \in S(c', d) and returns the composite morphism h \circ g \circ f \in S(c, d'), where c,c' \in \mbox{Ob}(C) and d,d' \in \mbox{Ob}(D).

We can think of these functors as adjacency matrices, where the two parameters are the row and column, except that instead of counting the number of paths, we’re taking the set of paths. So S is kind of like a matrix whose elements are sets, and we want to do something like sum the diagonals.

The coend of S is the coequalizer of the diagram

\begin{array}{c}\displaystyle \coprod_{f:c \to c'} S(c', c) \\ \\ \displaystyle S(f, c) \downarrow \quad \quad \downarrow S(c', f) \\ \\ \displaystyle \coprod_c S(c, c) \end{array}

The top set consists of all the pairs where

  • the first element is a morphism f \in \mbox{hom}(c, c') and
  • the second element is a morphism g \in S(c', c).

The bottom set is the set of all the endomorphisms in S.

The coequalizer of the diagram, the coend of S, is the bottom set modulo a relation. Starting at the top with a pair (f, g), the two arrows give the relation

\displaystyle c \stackrel{f}{\to} c' \stackrel{g}{\multimap} c \stackrel{c}{\to} c \quad \sim \quad c' \stackrel{c'}{\to} c' \stackrel{g}{\multimap} c \stackrel{f}{\to} c',

where I’m using the lollipop to mean a morphism from S.

So this says take all the endomorphisms that can be chopped up into a morphism f from \mbox{hom} going one way and a g from S going the other, and then set fg \sim gf. For this to make any sense, it has to identify any two objects related by such a pair. So it’s summing over all the endomorphisms of these equivalence classes.

To get the trace of the hom functor, use S = \mbox{hom} in the analysis above and replace the lollipop with a real arrow. If that category is just a group, this is the set of conjugacy classes. If that category is a preorder, then we’re computing the set of isomorphism classes.

The coend is also used when “multiplying matrices”. Let S(c', c) = T(b, c) \times U(c', d). Then the top set consists of triples (f: c\to c',\quad g:b \multimap c,\quad h:c' \multimap d), the bottom set of pairs (g:b \multimap c, \quad h:c \multimap d), and the coend is the bottom set modulo

(\displaystyle b \stackrel{g}{\multimap} c \stackrel{c}{\to} c, \quad c \stackrel{f}{\to} c' \stackrel{h}{\multimap} d) \quad \sim \quad  (\displaystyle b \stackrel{g}{\multimap} c \stackrel{f}{\to} c', \quad c' \stackrel{c'}{\to} c' \stackrel{h}{\multimap} d)

That is, it doesn’t matter if you think of f as connected to g or to h; the connection is associative, so you can go all the way from b to d.

Notice here how a morphism can turn “inside out”: when f and the identities surround a morphism in S, it’s the same as being surrounded by morphisms in T and U; this is the difference between a trace, where we’re repeating indices on the same matrix, and matrix multiplication, where we’re repeating the column of the first matrix in the row of the second matrix.

5-axis mill

Posted in Uncategorized by Mike Stay on 2010 April 9

I really like the different tones on the metal, from polished to brushed, to whatever cool thing they did to get their name in lettering on the back.


Posted in Uncategorized by Mike Stay on 2010 April 8

Idea for an annotation engine:

  • Annotation has the form (search query, regular expression, content)
    • search query should be in a form where given the content and URL of a page you can tell if it ought to match the query.
    • execute the search query; for each hit
      • run the regex on the result; if it matches
        • attach the content to $1
  • When an annotation is created, cache the first n URLs that the search query and regex succeed on
  • When on a page and you want to know if it has annotations
    • if the URL is in the cache or the current page’s content matches the search query,
      • run the regexp; if it succeeds,
        • attach the content
        • cache the URL
  • automatic linkifying of references?
    • content post-processors
      • automatic linkifying
      • media inclusion
      • translation
      • whatever
  • notes on notes?
    • rather than keep a local database of annotations, publish them on a blog tagged as an annotation
    • then can annotate the blog
  • concept pages?
    • auto-linkify takes you to a concept page on the blog
  • links & trackbacks?
    • auto-linkify adds trackbacks to cached URLs

Ketamine and the near-death experience

Posted in Uncategorized by Mike Stay on 2010 April 5

“All features of a classic NDE [near-death experience] can be reproduced by the intravenous administration of 50 – 100 mg of ketamine… It can reproduce all features of the NDE, including travel through a dark tunnel into light, the conviction that one is dead, ‘telepathic communion with God’, hallucinations, out-of-body experiences and mystical states (see ketamine references above). If given intravenously, it has a short action with an abrupt end. Grinspoon and Bakalar (1981, p34) wrote of: ‘…becoming a disembodied mind or soul, dying and going to another world. Childhood events may also be re-lived. The loss of contact with ordinary reality and the sense of participation in another reality are more pronounced and less easily resisted than is usually the case with LSD. The dissociative experiences often seem so genuine that users are not sure that they have not actually left their bodies.'”


Posted in Uncategorized by Mike Stay on 2010 March 30

Monads for functional JavaScript programming

Posted in Uncategorized by Mike Stay on 2010 March 26


Philip Wadler’s excellent paper “Monads for Functional Programming” is about how to achieve some of the benefits of using side-effecting languages using a purely functional language. Wadler uses Haskell to illustrate his examples. To me, that has the effect of preaching to the choir—you can’t do anything in a purely functional language without a monad, so anyone proficient in Haskell will already have had to understand the point he’s trying to make.

“It’s easier to port programmers than to port programs”, so I’ll take a different tack: purely functional programs are far easier to test. If you are concerned about the reliability of your code, programming in a functional style is something to consider seriously. So in my opinion, the examples should be given in the impure language; I’m going to use JavaScript.

In one example, Wadler assumes that computing 1/0 throws an error. Since JavaScript says 1/0 === Infinity instead, I’m going to use silentmatt’s BigInteger library, which does throw an error.

In what follows, I simply give a direct translation from Wadler’s Haskell code in section 2 of his paper.


A Pietà for the modern age

Posted in Uncategorized by Mike Stay on 2010 March 26

Crochet your own action figures

Posted in Uncategorized by Mike Stay on 2010 March 23

She’s selling the patterns for $3.50 each on her Etsy page. See also this collection of Lord of the Rings characters.

Artificial photosynthesis

Posted in Uncategorized by Mike Stay on 2010 March 19

96% efficiency at turning CO2 and H20 into sugar.

PTSD in Haiti

Posted in Uncategorized by Mike Stay on 2010 March 17

Lucas Williams writes:

[This was written as a response to close friend of mine who is a social worker in the greater Hartford area. She asked me if I had any anecdotes from Haiti that she could share at an upcoming conference on mental health and trauma. I tried to jot down just a few thoughts, but found that I couldn’t stop typing. This is a letter to a friend, not an essay or paper, but I want to share it. I hope that it can be of help to someone else, either to a returning aid worker, or someone who hasn’t been to Haiti yet wants to understand, to feel a little bit of what it is like.]

Dear *****

I’m in Miami right now, I landed last night. I’ve been in Haiti, working as an Emergency Department technician in a field hospital for almost 6 weeks, and it’s more than a little weird to be lying on a friends couch watching TV. I head back to Port-au-Prince on Saturday for another 5 weeks. I tried to write you a short reply about post-trauma and it turned into a novel. By the second paragraph I realized I was really writing it for me, but it just kept on going. I don’t know if this is going to be much help, but I’m sending it anyways, because each time I try and clean it up it just gets messier, and longer.

I think about post-traumatic stress disorder a lot. Before I left for Haiti I thought of it as a Western illness. It wasn’t that I thought it wasn’t real — I just believed that you had to be emotionally “fragile” before the trauma in order to be severely affected by it afterwards. We had a psychologist on the plane with us, and my first thought when I heard she was coming was “what the hell is she going to do?” Haiti is the poorest country in this hemisphere. These people are tough as nails, they won’t need a shrink, and besides, there’s no way she could be effective dealing with such a monstrous language barrier. Less than 48 hours from the time we landed I would feel very differently.


Burninatin’ the countryside

Posted in Uncategorized by Mike Stay on 2010 March 15

With consummate Vs!

Pretty jewelry

Posted in Uncategorized by Mike Stay on 2010 March 9

The artist says the bands of color are due to a diffraction grating; the base is recycled titanium. Is it etched, or ground, or what? The page only says “a multistep process”.

Life imitates Art

Posted in Borges by Mike Stay on 2010 March 8

In “Tlön, Uqbar, Orbis Tertius“, Borges describes a group of dedicated people who describe a world, Tlön, in such detail and produce enough forged artifacts that the whole world adopts their vision and begins to convert itself into Tlön. I attributed a farcical version of Borges’ story “Death and the Compass” to a pseudonymous Umberto Eco in the last post; in that story, the detective’s supposition that there is a pattern induces his prey to begin using the pattern in order to entrap him. In fact, Eco borrowed that idea for his own detective story, The Name of the Rose. The Bible formed the basis for the production of thousands of fraudulent relics, and the Book of Mormon inspired Mark Hoffmann to create forgeries of letters from the early Mormon community (though his were designed to destroy the community instead of build it). Cellphones look like Star Trek communicators, and Bluetooth headsets look like Uhura’s earpiece. Of course, there’s all the merchandising from Star Wars and Lord of the Rings. And my brother David just gave my brother Doug a set of the six signs from Susan Cooper’s The Dark is Rising sequence.

What story has motivated you to create your own artifacts?

Creative ways to ask a girl on a date

Posted in Borges by Mike Stay on 2010 March 8

In Utah, it is expected that high-school students and undergraduates will come up with extravagant ways, often including horrible puns, to ask a girl out on a date and to reply to such an invitation. My cousin’s family, having just moved there, asked on the family list for ideas. My response:

My date read the “police beat” religiously, so I got Umberto Eco to write a story about a detective on the BYU campus police force who believes that two crimes (involving the vandalism of FARMS researchers’ webpages with screeds linking kabbalah to quantum field theory) are related even though, in fact, they are not. The detective was responsible for a student’s conviction of violating the Honor Code and eventual expulsion. The student learns of the detective’s interest and begins to commit crimes that fit the imagined pattern; the detective predicts where the final crime will be committed and stakes out the place, but because the student was expecting him, he is captured by the student and his friends and forced to wear U of U paraphernalia.

I had it published pseudonymously in the Daily Herald, and then used my network of friends to commit 137 minor crimes across campus for the next six months prior to the dance that spelled out “[Name], will you go to the dance with me?” I waited at the place where the point of the question mark would be, but she never showed up.

She did, however, wire my brakes to my horn and leave a sheet with a big “YES” painted on it under the hood. This would have been amusing had the new wiring not caused electrical arcing. The sheet caught fire, which caught other things on fire, which eventually burned out the interior of the car. It wasn’t too much of a loss, though, because it was a 1973 Honda Civic that I’d bought from a graduating senior for $200.

Anyway, neither of us wanted to dance all that much in the first place, so we went down to the underground laser lab where my roommate worked and then explored the steam tunnels.

Birdfeeders in UK are splitting Blackcaps into two species

Posted in Uncategorized by Mike Stay on 2010 March 5

There’s a mutation that sends blackcaps in the wrong direction when migrating for the winter, and they end up in Britain. Before humans started putting out bird feeders, they would merely die. But now, they’re surviving and living to reproduce. They spend part of their time in Europe, but they overlap less with the birds that migrate over the alps; the two groups are now more genetically distinct between groups than within them. This gap arose in around 50 years; if it holds up, the groups may cease to interbreed entirely and will become two different species.

The Murder of Asher Ben-Judah

Posted in Borges by Mike Stay on 2010 March 4

Here’s a story I wrote; it’s inspired by Borges’ collection of stories “A Universal History of Infamy.”

The Murder of Asher Ben-Judah

In the fourth year of the reign of Nebuchadnezzar II, Egypt successfully repelled the invasion by Babylon. Believing Babylon to be weakened, Jehoiakim of Jerusalem stopped paying tribute to Babylon, took a pro-Egyptian position, and promptly died. His son Jeconiah chose to continue the policy; one hundred days later, he was deposed by Nebuchadnezzar II for rebellion. The Babylonian king sacked the temple, took captive all the nobility and craftsmen who had not fled the city—some ten thousand people—and carried them off to Babylon; the prophet Ezekiel was among them. Before leaving, perhaps mockingly, Nebuchadnezzar annointed Jeconiah’s uncle Mattaniah, clothed him in the robes of kingship, and gave him the new name “Righteousness of the LORD.”

Despite the destruction, the harvest that year was a good one for farmers, and the sale of the excess bought capital for rebuilding the city. Those wise and wealthy enough to have fled Jerusalem with their property in anticipation of the inevitable response to Jehoiakim’s stupidity returned; among them was the ward boss Asher Ben-Judah. Asher was a master at organizing labor; he was often and fruitfully compared to Father Jacob’s father-in-law for having the cunning to convince a man to work fourteen years in the hope of being paid someday. However, when cunning failed, Asher was not above resorting to other motivators: he was also a master at organizing crime. If one were to speak to a particular man in the bazaar, he would recite a list of Asher’s prices:

  • Punching – 2 shekels,
  • Both Eyes Blackened – 4 shekels,
  • Nose & Jaw Broken – 10 shekels,
  • Ear Chawed Off – 15 shekels,
  • Leg Or Arm Broken – 19 shekels,
  • Stab – 25 shekels,
  • Doing the Job – 100 shekels and up.

As the armies of Babylon flooded the country, Asher came to rest in the mountains of Ararat. A generation before, the Arartian king Rusa II had built more cities than Solomon, Ramses, Semiramis and Sargon put together; the blind arches of Rusahinili and Teishebaini rivaled the fortifications of Ninevah. Asher knew there would be plenty of work for masons in rebuilding Jerusalem after Babylon was through with it.

Another household returning to Jerusalem that year was that of Asher’s second cousin “Jawbone” Ben-Samson, a merchant dealing in precious metals and a smith in his own right, having received the secrets of metallurgy from his fathers. Ben-Samson had chosen to find refuge in Egypt, where Babylon could not follow, and returned with artifacts of gold, silver, brass, and steel.

Though Asher cared nothing for working metal, he was the firstborn and had inherited the sword forged by their great-grandfather; the iron was cast down from heaven and laid waste to a forest near Damascus. Such iron was very rare and very valuable, since it was pure enough to be strengthened by forging in charcoal; iron extracted from ore already had too much of the black ash in it, and would become brittle.

It’s unclear what happened to spark Ben-Samson’s madness. He began to accuse the king of plotting against Babylon; the king, who owed his throne to Nebuchadnezzar’s grace, ordered his death, but Ben-Samson escaped to the desert. He began to forget key metallurgical processes; he sent his sons to Asher to coerce him into giving them their great-grandfather’s records. Asher turned them away, but they returned and attempted to buy the records; insulted at the prospect of selling his birthright, Asher told his men to kill the intruders. “Jawbone” Ben-Samson was not so named because he was a weakling, and his sons lived up to their name: they fought off the thugs and escaped, but in the scuffle they dropped the keys to their family’s treasury. Since neither Ben-Samson nor his sons could reenter the city to claim their property, Asher became the second-richest man in Jerusalem.

Asher, dressed in his finest, went out on the town to celebrate. He bought everyone drinks at the ward tavern and used his favorite prostitute; near the end of the third watch he stumbled out the door towards home. Asher Ben-Judah was found stripped and decapitated the next day; his sword and his great grandfather’s records were missing. Neither Ben-Samson nor his sons ever returned to Jerusalem.

Theories and models

Posted in Category theory, Math, Programming by Mike Stay on 2010 March 4

The simplest kind of theory is just a set T, thought of as a set of concepts or Platonic ideals. We typically have some other set S, thought of as the set of real things that are described by concepts. Then a model is a function f:T \to S. For example, we could let T = {0, 1}; this is the theory of the number “two”, since it has two elements. Whatever set we choose for S, the models of the theory are going to be pairs of elements of S. So if S = the set of people, models of T in S are going to be pairs of people (where choosing the same person twice is allowed).

Concepts, however, are usually related to each other, whereas in a set, you can only ask if elements are the same or not. So the way a theory is usually presented is as a category T. For example let T be the category with two objects E, V and two parallel nontrivial morphisms \sigma, \tau:E\to V, and let S be the category Set of sets and functions. A model is a structure-preserving map from the category T to Set, i.e. a functor. Each object of T gets mapped to a set; here we think of the image of V as a set of vertices and the image of E as a set of edges. Each morphism of T gets mapped to a function; \sigma and \tau take an edge and produce the source vertex or target vertex, respectively. The category T = Th(Graph) is the theory of a graph, and its models are all graphs.

Usually, our theories have extra structure. Consider the first example of a model, a function between sets. We can add structure to the theory; for example, we can take the set T to be the ring of integers \mathbb{Z}. Then a model is a structure-preserving function, a homomorphism between T and S. Of course, this means that S has to have at least as much structure as T. We could, for instance, take S to be the real numbers under multiplication. Since this ring homomorphism is entirely determined by where we map 1, and we can choose any real number for its image, there would be one model for each real number; each integer x would map to a^x for some a. Another option is to take S = \mathbb{Z}_4, the integers modulo 4. There are three nonisomorphic models of \mathbb{Z} in \mathbb{Z}_4. If we map 1 to 0, we get the trivial ring; if we map 1 to 1 or 3, we get integers modulo 4; and if we map 1 to 2, we get integers modulo 2.

Similarly, we can add structure to a category. If we take monoidal categories T, S, then we can tensor objects together to get new ones. A model of such a theory is a tensor-product-preserving functor from T to S. See my paper “Physics, Topology, Computation, and Logic: a Rosetta Stone” with John Baez for a thorough exploration of theories that are braided monoidal closed categories and models of these.

An element of the set \mathbb{Z}_4 is a number, while an object of the category Th(Graph) is a set. A theory is a mathematical gadget in which we can talk about theories of one dimension lower. In Java, we say “interface” instead of “theory” and “class” instead of “model”. With Java interfaces we can describe sets of values and functions between them; it is a cartesian closed category whose objects are datatypes and whose morphisms are (roughly) programs. Models of an interface are different classes that implement that interface.

And there’s no reason to stop at categories; we can consider bicategories with structure and structure-preserving functors between these; these higher theories should let us talk about different models of computation. One model would be Turing machines, another lambda calculus, a third would be the Java Virtual Machine, a fourth Pi calculus.

Digital compositing

Posted in Uncategorized by Mike Stay on 2010 March 3

Stargate studios shows off:

Phort Tiger

Posted in Uncategorized by Mike Stay on 2010 February 25

When I was seven, my parents gave me the frame of a clubhouse for my birthday; it had two walls and a roof. I and the neighborhood kids added the other walls; when someone down the street replaced the shingles on their roof, we took the discarded ones and shingled ours. We did half of it wrong before figuring out how shingles are supposed to go (start at the bottom!) Someone else found the remains of an alphabet used to put a surname on a mailbox. It was missing the letter “F”, so the clubhouse became “Phort Tiger”, anticipating the F -> PH meme by a decade and a half. We seceded from the union and declared our backyard to be the sovereign nation of Tigeria.

Mechanistic creativity

Posted in Uncategorized by Mike Stay on 2010 February 25

Computers are better now at face recognition than humans. My brother Doug has written photoshop filters that can do a watercolor painting over a pencil sketch given a photo. And now, David Cope has produced really beautiful music from a computer; the genius of it is his grammatical analysis of music:

Again, Cope hit the books, hoping to discover research into what that something was. For hundreds of years, musicologists had analyzed the rules of composition at a superficial level. Yet few had explored the details of musical style; their descriptions of terms like “dynamic,” for example, were so vague as to be unprogrammable. So Cope developed his own types of musical phenomena to capture each composer’s tendencies — for instance, how often a series of notes shows up, or how a series may signal a change in key. He also classified chords, phrases and entire sections of a piece based on his own grammar of musical storytelling and tension and release: statement, preparation, extension, antecedent, consequent. The system is analogous to examining the way a piece of writing functions. For example, a word may be a noun in preparation for a verb, within a sentence meant to be a declarative statement, within a paragraph that’s a consequent near the conclusion of a piece.

This kind of endeavor is precisely what the science of teaching is about; if Cope can teach a computer to make beautiful music, he can teach me to make beautiful music. By abstracting away the particular notes and looking at what makes music Bach-like as opposed to Beethoven-like or Mozart-like, he has shown us where new innovation will occur: first, in exploring the space, and second, in adding new dimensions to that space.

Algorithmic thermodynamics

Posted in Uncategorized by Mike Stay on 2010 February 22

John Baez and I just wrote a paper entitled “Algorithmic Thermodynamics.” Li and Vitányi coined this phrase for their study of the Kolmogorov complexity of physical microstates; in their model, given an encoding x of a macrostate (a measurement of a set of observables of the system to some accuracy), the entropy S(x) of the system is a sum of two parts, the algorithmic entropy K(x) and the uncertainty entropy H(x). The algorithmic entropy is roughly the length of the shortest program producing x, while the uncertainy is a measure of how many microstates there are that satisfy the description x. So roughly the microstates in their model are outputs of Turing machines.

In our model, microstates are inputs to Turing machines, specifically inputs that cause the machine to halt and give an output. Then we specify a macrostate using some observables of the program (computable functions from bit strings to real numbers, like the length, or runtime, or output of the program). Once we’ve specified the macrostate by giving the average values \overline{C_i} of some observables C_i, we can ask what distribution on microstates (halting programs) maximizes the entropy; this will be a Gibbs distribution

\displaystyle p(x) = \frac{1}{Z} \exp\left(-\sum_i \beta_i C_i(x)\right),


\displaystyle Z = \sum_{x \in X} \exp\left(-\sum_i \beta_i C_i(x)\right)


\displaystyle -\frac{\partial}{\partial \beta_i} \ln Z = \overline{C_i}.

The entropy of this system is

\displaystyle S(p) = -\sum_{x \in X} p(x) \ln p(x);

from this formula we can derive definitions of the conjugates of the observables, just like in statistical mechanics.

If we pick some observable C_j—say, the runtime of the program—to play the role of the energy E, then its conjugate \beta_j plays the role of inverse temperature 1/T:

\displaystyle \frac{1}{T} = \left.\frac{\partial S}{\partial E}\right|_{C_{i \ne j}}.

Given observables to play the roles of volume and number of particles—say, the length and output, respectively—we can similarly define analogs of pressure and chemical potential. Given these, we can think about thermodynamic cycles like those that power heat engines, or study the analogs to Maxwell’s relations, or study chemical reactions–all referring to programs instead of pistons.

And since the observables are arbitrary computable functions of the program bit string, we can actually recover Li and Vitányi’s meaning for ‘algorithmic thermodynamics’ by interpreting the output as a description of a physical macrostate; so our use of the term includes theirs as a special case.

Tutorial on how to overlay tiles on Google maps

Posted in Uncategorized by Mike Stay on 2010 February 21

The Science of Benjamin Button

Posted in Uncategorized by Mike Stay on 2010 January 28

England on fasting

Posted in Uncategorized by Mike Stay on 2010 January 27


Posted in Uncategorized by Mike Stay on 2010 January 27


Posted in Uncategorized by Mike Stay on 2010 January 27


Posted in Uncategorized by Mike Stay on 2010 January 27


Posted in Uncategorized by Mike Stay on 2010 January 27

For Aidan’s birthday?

Posted in Uncategorized by Mike Stay on 2010 January 26

Fifty dangerous things you should let your kids do.

Signatures of consciousness

Posted in Perception by Mike Stay on 2010 January 26

Things that happen in the brain that correlate well with being conscious of something.

Incredibly cool essay on morality

Posted in Uncategorized by Mike Stay on 2010 January 26

Aleph and Omega

Posted in Borges, Math, Perception, Theocosmology, Time by Mike Stay on 2010 January 14

I shut my eyes — I opened them. Then I saw the Aleph.

I arrive now at the ineffable core of my story. And here begins my despair as a writer. All language is a set of symbols whose use among its speakers assumes a shared past. How, then, can I translate into words the limitless Aleph, which my floundering mind can scarcely encompass? Mystics, faced with the same problem, fall back on symbols: to signify the godhead, one Persian speaks of a bird that somehow is all birds; Alanus de Insulis, of a sphere whose center is everywhere and circumference is nowhere; Ezekiel, of a four-faced angel who at one and the same time moves east and west, north and south. (Not in vain do I recall these inconceivable analogies; they bear some relation to the Aleph.) Perhaps the gods might grant me a similar metaphor, but then this account would become contaminated by literature, by fiction. Really, what I want to do is impossible, for any listing of an endless series is doomed to be infinitesimal. In that single gigantic instant I saw millions of acts both delightful and awful; not one of them occupied the same point in space, without overlapping or transparency. What my eyes beheld was simultaneous, but what I shall now write down will be successive, because language is successive. Nonetheless, I’ll try to recollect what I can.

On the back part of the step, toward the right, I saw a small iridescent sphere of almost unbearable brilliance. At first I thought it was revolving; then I realised that this movement was an illusion created by the dizzying world it bounded. The Aleph’s diameter was probably little more than an inch, but all space was there, actual and undiminished. Each thing (a mirror’s face, let us say) was infinite things, since I distinctly saw it from every angle of the universe. I saw the teeming sea; I saw daybreak and nightfall; I saw the multitudes of America; I saw a silvery cobweb in the center of a black pyramid; I saw a splintered labyrinth (it was London); I saw, close up, unending eyes watching themselves in me as in a mirror; I saw all the mirrors on earth and none of them reflected me; I saw in a backyard of Soler Street the same tiles that thirty years before I’d seen in the entrance of a house in Fray Bentos; I saw bunches of grapes, snow, tobacco, lodes of metal, steam; I saw convex equatorial deserts and each one of their grains of sand; I saw a woman in Inverness whom I shall never forget; I saw her tangled hair, her tall figure, I saw the cancer in her breast; I saw a ring of baked mud in a sidewalk, where before there had been a tree; I saw a summer house in Adrogué and a copy of the first English translation of Pliny — Philemon Holland’s — and all at the same time saw each letter on each page (as a boy, I used to marvel that the letters in a closed book did not get scrambled and lost overnight); I saw a sunset in Querétaro that seemed to reflect the colour of a rose in Bengal; I saw my empty bedroom; I saw in a closet in Alkmaar a terrestrial globe between two mirrors that multiplied it endlessly; I saw horses with flowing manes on a shore of the Caspian Sea at dawn; I saw the delicate bone structure of a hand; I saw the survivors of a battle sending out picture postcards; I saw in a showcase in Mirzapur a pack of Spanish playing cards; I saw the slanting shadows of ferns on a greenhouse floor; I saw tigers, pistons, bison, tides, and armies; I saw all the ants on the planet; I saw a Persian astrolabe; I saw in the drawer of a writing table (and the handwriting made me tremble) unbelievable, obscene, detailed letters, which Beatriz had written to Carlos Argentino; I saw a monument I worshipped in the Chacarita cemetery; I saw the rotted dust and bones that had once deliciously been Beatriz Viterbo; I saw the circulation of my own dark blood; I saw the coupling of love and the modification of death; I saw the Aleph from every point and angle, and in the Aleph I saw the earth and in the earth the Aleph and in the Aleph the earth; I saw my own face and my own bowels; I saw your face; and I felt dizzy and wept, for my eyes had seen that secret and conjectured object whose name is common to all men but which no man has looked upon — the unimaginable universe.

I felt infinite wonder, infinite pity…

(Jorge Luis Borges, The Aleph)

A finitely-refutable question is one of the form, “Does property X holds for all natural numbers?” Any mathematical question admitting a proof or disproof is in this category. If you believe the ideas of digital physics, then any question about the behavior of some portion of the universe is in this category. We can encode any finitely refutable question as a program that iterates through the natural numbers and checks to see if it’s a counterexample. If so, it halts; if not, it goes to the next number.

The halting probability of a universal Turing machine is a number between zero and one. Given the first n bits of this number, there is a program that will compute which n-bit programs halt and which don’t. Assuming digital physics, all those things Borges wrote about in the Aleph are in the Omega. There’s a trivial way–the Omega is a normal number, so every sequence of digits appears infinitely often–but there’s a more refined way: ask any finitely-refutable question using an n-bit program and the first n bits of Omega contain the proper information to compute the answer.

The bits of Omega are pure information; they can’t be computed from a fixed-size program, like the bits of \pi can.


Posted in Uncategorized by Mike Stay on 2009 December 29

Scott Aaronson’s work in computational complexity

Posted in Uncategorized by Mike Stay on 2009 November 30

A really fun paper by Scott Aaronson, part of which considers the physical implications of P != NP.


Posted in Uncategorized by Mike Stay on 2009 November 22

Gallery here.


Posted in Uncategorized by Mike Stay on 2009 November 22


Posted in Uncategorized by Mike Stay on 2009 November 1

Burning bright

Posted in Uncategorized by Mike Stay on 2009 October 29

Bengal tiger portrait shoot, with all four varieties.

Devils on Mars

Posted in Uncategorized by Mike Stay on 2009 October 29