Sunday 11 September 2016

On the Narcissism of Small Differences


In his 1929 book Civilization and Its Discontents, Sigmund Freud commented on "the narcissism of small differences", the idea that people who are very similar to each other become extremely attentive to the very small distinctions that differentiate them. When I came across a reference to this idea recently, it reminded me of a discussion in Milan Kundera's novel Immortality, in which Kundera discusses two ways of differentiating ourselves from others: by addition (highlighting a positive characteristic that makes us unique) or by subtraction (highlighting how we are unique in lacking a negative characteristic). In his usual wordy way, Kundera writes:
"The method of addition is quite charming if it involves adding to the self such things as a cat, a dog, roast pork, love of the sea or of cold showers. But the matter becomes less idyllic if a person decides to add love for communism, for the homeland, for Mussolini, for Catholicism or atheism, for fascism or antifascism. [...] Here is that strange paradox to which all people cultivating the self by way of the addition method are subject: they use addition in order to create a unique, inimitable self, yet because they automatically become propagandists for the added attributes, they are actually doing everything in their power to make as many others as possible similar to themselves; as a result, their uniqueness (so painfully gained) quickly begins to disappear. We may ask ourselves why a person who loves a cat (or Mussolini) is not satisfied to keep his love to himself and wants to force it on others. Let us seek the answer by recalling the young woman [...] who belligerently asserted that she loved cold showers. She thereby managed to differentiate herself at once from one-half of the human race, namely the half that prefers hot showers. Unfortunately, that other half now resembled her all the more. Alas, how sad! Many people, few ideas, so how are we to differentiate ourselves from one another? The young woman knew only one way of overcoming the disadvantage of her similarity to that enormous throng devoted to cold showers: she had to proclaim her credo 'I adore cold showers!' as soon as she appeared in the door of the sauna and to proclaim it with such fervor as to make the millions of other women who also enjoy cold showers seem like pale imitations of herself. Let me put it another way: a mere (simple and innocent) love for showers can become an attribute of the self only on condition that we let the world know we are ready to fight for it."
The narcissism of small differences (and the unfortunate human drive for it) explains much of the insanity in the world in general, and in the current US election cycle in particular.

Tuesday 30 August 2016

On Why Croatia and Jamaica Are the Best Olympians

[Note: A small error in the original posted tables has been corrected.]

The Olympic medal rankings are silly because they are not adjusted for population. Obviously countries with a larger pool of talent to draw from will do better than countries with a smaller pool. I have calculated the population-adjusted rankings for the top 20 countries by raw medal count. I stopped at 20 because that is where my own country, Canada, fell.

G = Gold; S = Silver; B = Bronze; SUM = All Medals. 
The 'ACTUAL RANKING' is the ranking by raw medal count, the usual way.
'ADJUSTED' is the population adjusted ranking.
'DIFFERENCE' is the ranking by the difference between 'ACTUAL RANKING' and 'ADJUSTED' ranking.
Ties are given the same value.

The table is sorted by the average of all the difference rankings, i.e. by a measure of how much a better a country did in overall ranking compared to what would be expected given its population.

As you can see, by this measure (which to me is much more rational than raw medal count) the countries that did the best are Jamaica, Croatia, and New Zealand. Canada is 8th. The United States and China are big fat losers, 19th and 20th respectively once we adjust for the huge pool of talent they had to draw from.

Saturday 6 August 2016

On Emotion as Math


My colleagues and I published a paper a few months ago on a strange topic, which is: Why are some nonwords funny? (I blogged about this previously when I wrote about Schopenhauer's expectation violation theory of humor.) The study got a lot of press, in part because the paper included the graph above, which shows that Dr. Seuss's silly nonwords (like wumbus, skritz and yuzz-a-ma-tuzz) were predicted to be funny by our mathematical analysis. You can read about the study in many places (for example, in The Guardian and The Walrus) or, if you have access, get the original paper here.


A lot of people got confused about the way we measured how a NW was funny, in part because we were loose about how we used the term 'entropy' in the paper (though very clear about what we had measured). Journalists understood that we had shown that words were funnier to the extent that they were improbable, and that we had used this measure 'entropy', but most journalists did not report the measure we used correctly. Most thought that we had said strings with higher entropy are funnier, which is incorrect. Here I explain what we actually measured and how it relates to entropy.

Shannon entropy was defined (by Shannon in this famous paper, by analogy to the meaning in physics of the term 'entropy') over a given signal or message. It is presented in that paper as a function of the probabilities of all symbols across the entire signal, i.e. across a set of symbols whose probabilities sum to 1. I italicize this because it emphasizes that entropy is properly defined over both rare and common symbols, by definition, because it is defined over all symbols in the signal.

Under Claude Shannon’s definition, a signal like ‘AAAAAA’ (or, identically, ‘XXXXXX’) has the lowest possible entropy, while a signal like ‘ABCDEF’ (or, identically, ‘AABBCCDDEEFF’, which has identical symbol probabilities) has the highest possible entropy. The idea, essentially, was to quantify information (a synonym for entropy in Shannon's terminology) in terms of unpredictability. A perfectly predictable message like ‘AAAAAA’ has the lowest information, for the same reason you would hit me if I walked into your office and said “Hi! Hi! Hi! Hi! Hi! Hi!”. After I have said it once, you have my point–I am saying hello–and repeating it adds nothing more = it is uninformative.

So, Shannon entropy is defined across the signal that is the English language as a function of the probabilities of the 26 possible symbols, the letters A-Z (we can ignore punctuation and case; we could include them easily enough but they don’t change the general idea and played no role in our nonwords). 

If we do the math (by summing -p(X)log(X), for every letter in the alphabet, which is how Shannon entropy is defined), the entropy of English is 4.2 bits. What this means is that I could send any message in English using a binary string for each letter of length 5. This makes perfect sense if you know binary code: 2^5 = 32, which gives us more codes than we need to code just 26 symbols…so concretely, A = 00000, B = 00001, C = 00010, and so on until we get to Z = 11010).

What we computed in our paper can be conceived of as the contribution of each nonword to this total entropy of the English language, that string's own -p(X)log(X). In essence, we treated each nonword as one of part of a very long signal that is the English language. This is indeed a measure of how unlikely a particular string is, but that is not entropy, because entropy is measure of summed global unpredictability, not local probability. 

Think of it this way: If I am speaking and I say 'I love the cat, I love the dog, and I love snunkoople’, you will be struck by snunkoople because it is surprising, which is a synonym for unexpected. We quantified how unexpected each nonword was (the local probability of that part of the signal), in the context of a signal that is English as she is spoken (or written). 

Our main finding was that the less likely the nonword is to be a word of English—basically, the lower the total probability of the letters the nonword contains–the funnier it is. This is not just showing that 'weird strings are funny', but something more interesting that: that strings are funny to the extent that they are weird.

There is an interesting implicit corollary (not discussed in the paper), which is that we are the kind of creatures that use emotion to do probability judgments. Our feelings about how funny a nonword string is are correlated with the probability of that string. If you think about that, it may seem deeply weird, but I think it is not so weird. One of the main functions of emotion is to alert us embodied creatures to unusual, dangerous, or unpredictable aspects of the world that might harm us. Unusualness and unpredictability are statistical concepts, since they are defined by exceptions to the norm. So it makes good sense that emotion and probability estimation would be linked for embodied creatures.

Sunday 19 June 2016

On the Odds that an American Muslim is a Terrorist

Hi Mr. Trump,

I wrote on Twitter that someone needed to teach you about Bayes' Rule so you could understand why your idea of profiling Muslims is stupid. It is very obvious from your public statements that thinking rationally is not your strong suit, but brew yourself a cup of coffee (I know you don't drink it, but I think you should take help anywhere you can get it) and see if you might be able to follow along here, buddy.


Bayes' Rule is a pretty simple rule in probability. It's not an opinion, Mr. Trump: it's a fact. I know the difference between opinions and facts is not obvious to you. Let me explain. Occasionally there are ideas in the world that are definitely true, no matter what anyone's feelings about them may be. We call these true ideas facts. I could show you a mathematical proof of Bayes' Rule, but I don't want to strain you too hard, as I know this is probably your first foray into rational thinking. 


So please just take it as given, that this equation (Bayes' Rule) is a true fact (you can get 'the deets' here if you like):


P(A|B) = P(B|A)P(A)/P(B)

What does that mean? Well, P(A|B) is the probability of some event A being true, given that some other event B is true. Bayes' Rule says that we can figure out the (actual, true, mathematically-guaranteed) probability of P(A|B) if you can get the values for some other probabilities (that for various reasons are often easier to get): namely, the probability of event B given event A [= P(B|A)], and the individual probabilities of event A [= P(A)] and event B [= (P(B))].


It all seems very abstract, I am sure. I know that abstract thinking is difficult for you. (Indeed, it often seems like even concrete thinking is difficult for you, as you seem to flip-flop about a bewildering number of highly concrete issues.) Let's make this concrete using an example close to your heart: Let's figure out the probability that an American is a terrorist, given that they are Muslim. If that probability is high, then your idea of profiling Muslims is a good idea. If that probability is low, then your idea is not a good idea.


Bayes' rule tell us: 

P(An American is a terrorist | An American is Muslim)  
= P(An American is Muslim | An American is a terrorist) * P(An American is a terrorist) / P(An American is a Muslim)
Maybe the easiest one to start with is P(An American is a Muslim). Wikipedia says that "According to a new estimate in 2016, there are 3.3 million Muslims living in the United States, about 1% of the total U.S. population." So we have our first probability: P(An American is a Muslim) = 1% or (same thing represented a different way so you won't get confused later when we do some math) 0.01.

What about P(An American is a terrorist)? This one is a little more difficult, because it seems that you think that there are millions and millions of terrorists in the USA right now: every Mexican, every Muslim, every Canadian, the President of the United States, and so on. TechDirt had an article on this a few years ago. They estimated that there are a maximum of 184,000 terrorists in the entire world (which they also called "a ridiculously inflated level"). It's a little harder to know how many of them live in the USA because they are all hiding, biding their time. But we can estimate it roughly by looking at the proportion of terrorist deaths that occur in the USA. It has been estimated that in 2014 (a bad year for terrorism, as you may recall) there was 17,891 deaths worldwide from terrorist attacks, of whom 19 were American. Well, as you know, we had 50 deaths just a few weeks ago in Orlando, so maybe terrorism is getting worse rapidly, as you like to suggest. Let's assume that the 2014 estimate is fully ten times too low and use 190 American deaths due to terrorism per year. If deaths due to terrorism are distributed roughly proportionally to terrorists, then we can estimate that 190/17891 or about 1% of all terrorists are American. 1% of 184,000 is 1840. So now we can get what is surely a very high upper estimate on P(An American is a terrorist): the number of terrorists in the USA divided by the US population, or 1840/318.9 million, which works out to 0.0000058.


Now we only have one number left: P(An American is Muslim | An American is a terrorist). You probably disagree with most people on the planet about this number, because I know you labor under the delusion that all terrorists (including Mr. Obama) are Muslims. Researchers from Princeton University used FBI data to actually estimate this number a few years ago, and they estimated that only 10% of terrorists active in the USA are Muslim (though the estimate for the longer time period of 1970 to 2012 is much lower, just 2.5%). We will go with the larger number: P(An American is Muslim | An American is a terrorist) = 10% or 0.10.


Now we are almost done! All we have to do is plug in our numbers: 


P(An American is a terrorist | An American is Muslim) 
= P(An American is Muslim | An American is a terrorist) * P(An American is a terrorist) / P(An American is a Muslim) 
= 0.10 * 0.0000058 / 0.01 
= 0.000058
This is about 6 per 100,000, or (said another way) there is at most a 6/100,000 chance that that a random American Muslim is a terrorist. If your profilers spent just one hour profiling each random American Muslim, they will have to pass on average about 100000/6 = 16,666 hours before they profile just one terrorist. Assuming a 40 hour work week and 50 weeks of work per year, that is 416.6 person weeks or 8.33 person years per terrorist profiled. This does not strike me as a good use of resources, especially given the fact that such total concentration in identifying only Muslim American terrorists will cause you to miss the 90% of American terrorists that are not Muslim.

Let me know if you have any questions.


Sunday 13 March 2016

On Painting Duchamp Like The Mona Lisa

One of Duchamp's most important contributions to art was his subversion of the meaning of the word art. He achieved his subversion by attacking the meaning simultaneously from two directions, both by treating non-art as art (his ReadyMades) and by treating art as non-art. Perhaps his most famous treatment of art as as non-art was his (1919) L.H.O.O.Q. (reproduced above), a cheap postcard of  Leonardo da Vinci's Mona Lisa on which Duchamp drew a mustache. The title added to the insolence because it makes a pun in French, since it sounds like elle a chaud au cul [she has a hot ass, or, as Duchamp once loosely translated it, she has fire down below], intended to imply that the beautiful lady is horny. Duchamp was not the first artist to make fun of an old master, but he was the first to raise the anti-art gesture to an art form in itself.

I have recently become fascinated with DeepArt.io, a computer program that will attempt to re-do any image in the style of any other. For example, here is its attempt at the Mona Lisa as it might have been painted by Joan Miro:



Duchamp would have approved of this kind of mechanized manipulation of art, I think. It is retinal art, which Duchamp derided, but it is easy to make works that are more about the concept than the product. I thought it would be amusing to strike a blow back at Duchamp on da Vinci's behalf, by having the machine re-do Man Ray's solarized photographic portrait of Duchamp in the style of the Mona Lisa. So here is the mechanized conceptual subversion of Duchamp's L.H.O.O.Q., Duchamp painted in the style of the Mona Lisa:

Saturday 5 March 2016

On Matrix Heaven

Heaven is The Matrix. Everyone is invited to walk through the beautiful gates (the blue pill). Those who will not fall prey to the illusion that God plays favorites get to wake up (the red pill).

Sunday 7 February 2016

On Actualizing an Ivory Statue of the Mind



My novel The Bride Stripped Bare By Her Bachelors, Even begins with my narrator Isaac becoming obsessed with an ivory statue of Abraham, his son Isaac, and an angel, which he sees in a small museum devoted to Germanic art at Harvard University, the Busch-Reisinger Museum
 At the bottom, stands a thick, almost squat Abraham. He raises himself up on two massive, short muscular legs topped with immense powerful hips, visible through the covering of his tunic, which is carved so fine that you can almost see the weave. Following the cone of the ivory, his proportions get smaller towards his head, and he seems to stretch out vertically, as if to portray his yearning to reach up to heaven. His outstretched arms are very slightly too thin, too long for the rest of his body. In his hands, held high above him, he clutches an improbably tiny child, his unfortunate son Isaac, portrayed in the work as a doll-sized baby.
    In order to keep the carving contained with the natural limits of the available medium, the artist had to have Abraham twist his magnificently muscled body unnaturally as he rises up towards God. The fabric of his robe had to billow fantastically down from him, tight to his body because of the natural limits of the tusk, the fluttering of the rough wool cloth incredibly captured in the smooth hard cold cream.
    Flat on the the head of the baby doll son held up so high in Abraham’s mighty hands, almost too tiny to be believably part of the work, is another hand. It is the hand of a tiny buxom angel, carved from the very tip end of the tusk. Her tiny wings flutter out so lightly that the ivory there lets the light shine though. Tiny and nearly transparent herself, she seems hardly there at all.
As far as I could recall, I had never seen an ivory statue of Abraham and Isaac at the museum (though I had been there). I had told many people, including a few friends in Boston who wanted to go and look for it, that it was a figment of my imagination.

However, last week a friend of my mother's was organizing a book club at which they were going to discuss my novel. The friend sent my mother a note asking if the picture above was the ivory statue I had intended. Although the statue is clearly not identical to what I described, it is extremely close and it is part of the collection of the Busch-Reisinger Museum. Moreover, it was very familiar to me, so clearly familiar that I have no doubt I had seen and studied it before I described my fictional carving. I had somehow simply forgotten that it was real, and then re-invented it.

When I saw the picture, I had the uncanny experience that my purely imaginary statue had magically materialized on earth, a strange but very wonderful feeling.