Monthly Archive: February 2015

Language and Metaphor

Why do we quote movies?  I often think about this fascination we have as a culture to repeat and relive moments from our favorite films.  Large number of clips exist on YouTube devoted to capturing that magical moment when a character utters an unforgettable line.  But why? What is it that drives us to remember a great line or identify with the person who uttered a quote?

This question came up over the dinner table one night and, as I reflected on this question, my thoughts were drawn to an explanation about speed reading that I had once come across.  The author went to great trouble to make the point that that the trick to speed reading was to see groups of words in a sentence as a single chunk of information.

To understand that point, consider the words you read in a sentence. To make it concrete, let’s take the word ‘understand’.  When you read the word ‘understand’, you are seeing a group of 11 individual letters, but are you really conscious of each letter at a time?  Do you really see a ‘u’ followed by an ‘n’ followed by a ‘d’ and so on?  No.  What each of us with any sophistication in reading accomplishes is to perceive these 11 letters as a unit that conveys the word ‘understand’.  Of course, this is why we can read a sentence with a misspelling quite comfortably and often we may not even notice.

This idea of chunking and clumping comfortably scales upward to where common phrases can be consumed with a glance without a detailed examination of the individual words.  Two common approaches are to either abbreviate the phrase into some short form.  Expressions like ‘LOL’ or ‘BTW’ or any of the other text and chat speak concepts are excellent examples.  The other approach is to pick lyrical or repetitive expressions to encapsulate a phrase.  The famous ‘rosy-fingered dawn’ from the Homeric epics or ‘ready, set, go!’ are examples of these kinds, respectively.

But there is an even more compelling approach – the concept of the metaphor.  The idea here being that we liken an object to another object, one with well-known properties.  The properties of the second object are then inherited by the first simply by the equating of the name.  Some examples of this include the following sentences.

  • ‘That guy’s a Benedict Arnold for leaving our team for that other one.’
  • ‘How was the date last night, Romeo?’
  • ‘Stay away from her, she’s Mata Hari through and through!’
  • ‘That man is death itself’.

I think that our desire to quote movies is indicative of this.  That by repeating the dialog of the movie, the quote itself becomes a cultural metaphor for the feelings and experiences expressed in the movie.  This idea was brilliantly explored in the Star Trek: The Next Generation episode Darmok.

In this episode, the crew of the Enterprise are coaxed into a meeting with a Tamarian ship in orbit around a mostly unexplored planet.  Despite their universal translator, no ship of the Federation had ever been able to crack the Tamarian language.  The words themselves could be translated, but the syntax and context seemed to be utterly devoid of meaning.  The Tamarian captain, Dathon, seeing that this meeting was no different from previous encounters and that the ordinary avenues for communication were not working, arranged for himself and Captain Picard to be trapped on a planet.

On that planet, both captains were confronted by a dangerous creature.  This shared danger spurred a meeting of the minds and eventual understanding dawned on Picard.  The Tamarian race thought and communicated in metaphors.  They would say statements like ‘Tember, his arms wide’ to mean the concept of giving or generosity.  Back on the Enterprise, the crew had also come to a similar epiphany.  By analogy, they constructed a Tamarian-like way of expressing romance by saying ‘Juliet on her balcony’, but they lamented that without the proper context, in this case Shakespeare’s tragic play about Romeo and Juliet, one didn’t know who Juliet was and why she was on her balcony.

The episode closes with Dathon dying from the wounds inflicted by the creature, and with Picard arriving back aboard the Enterprise just in time to make peace between the Tamarians and the Federation by speaking their language.

The episode left some dangling ideas.  How do the Tamarians specify an offer that involves a choice between many things, or how an abstract idea, like giving someone his freedom, would be expressed.  Nonetheless, it was a creative and insightful way of exploring how powerful metaphor can be and how abstracted can be the thought that lies behind it.

So, the next time you quote a movie, give a thought to the metaphor that you are tapping into and take a moment to marvel at the miracle of speech and thought.

Aces High

This week’s column has a three-fold inspiration.  First off, most of the most exciting and controversial philosophical endeavors always involve arguing from incomplete or imprecise information to a general conclusion.  These inferences fall under the heading of either inductive or abductive reasoning, and most of the real sticking points in modern society (or any society for that matter) revolve around how well a conclusion is supported by fact and argument.  The second source comes from my recent dabbling in artificial intelligence.  I am currently taking the edx course CS188.1x, and the basic message is that the real steps forward that have been taking shape in the AI landscape came after the realization was made that computers must be equipped to handle incomplete, noisy, and inconsistent data.  Statistical analysis and inference deals, by design, with such data, and its use allows for an algorithm to make a rational decision in such circumstances.  The final inspiration came from a fall meeting of my local AAPT chapter in which Carl Mungan of the United States Naval Academy gave a talk.  His discussion of the two aces problem was nicely done, and I decided to see how to produce code in Python that would ‘experimentally’ verify the results.

Before presenting the various pieces of code, let’s talk a bit about the problem.  This particular problem is due to Boas in her book Mathematical Methods for the Physical Sciences, and goes something like this:

What is the probability that, when being dealt two random cards from a standard deck, the two cards will be two aces?  Suppose that one of the cards is known to be an ace, what is the probability?  Suppose that one of the cards is known to be the ace of spades, what is the probability?

 

The first part of this three-fold problem is very well defined and relatively simple to calculate.  The second two parts require some clarification of the phrase ‘is known to be’.  The first possible interpretation is that the player separates out the aces from the deck and either chooses one of them at random (part 2) or he chooses the ace of spades (part 3).  He returns the remaining 3 aces to the deck, which he subsequently shuffles prior to drawing the second card.  I will refer to this method as the solitaire option.  The second possible interpretation (due to Mungan) is that a dealer draws two cards at random and examines them both while keeping their identity hidden from the player.  If one of the cards is an ace (part 2) or is the ace of spades (part 3), the dealer then gives the cards to the player.  Parts 2 and 3 of the question then ask for the probability that the hands that pass this inspection step actually have two aces.  Since this last process involves assistance from the dealer, I will refer to it as the assisted option.  Finally, all probabilities will be understood from the frequentist point of view.  That is to say that each probability will be computed as a ratio of desired outcomes to all possible outcomes.

With those preliminary definitions out of the way, let’s compute some probabilities by determining various two-card hand outcomes.

First let’s calculate the number of possible two-card hands.  Since there are 52 choices for the first card and 51 for the second, there are 52×51/2 = 1326 possible two-card hands.  Of these, there are 48×47/2 = 1128 possible two-card hands with no aces, since the set of cards without the aces is comprised of 48 cards.  Notice that, in both of these computations, we divide by 2 to account for the fact that order doesn’t matter.  For example, a 2 of clubs as the first card and a 3 of diamonds as the second is the same hand as a 3 of diamonds as the first card and a 2 of clubs as the second.

no_aces

Likewise, there are 48×4 = 192 ways of getting a hand with only 1 ace.  Note that there is no need to divide by 2, since the two cards are drawn from two different sets.

one_ace

Finally, there are only 6 ways to get a two-ace hand.  These are the 6 unique pairs that can be constructed from the green set shown in the above figure.

As a check, we should sum the size of the individual set and confirm that it equals the size of the total number of two-card hands. This sum is 1128 + 192 + 6 for no-ace, one-ace, and two-ace hands, and it totals 1326, which is equal to the size of the two-card hands.  So, the division into subsets is correct.

With the size of these sets well understood, it is reasonably easy to calculate the probabilities asked for in the Boas problem.  In addition, we’ll be in a position to determine something about the behavior of the algorithms developed to model the assisted option.

For part 1, the probability is easy to find as the ratio of all possible two-ace hands (6 of these) to the number of all possible two-card hands (1326 of these).  Calculating this ratio gives 6/1326 = 0.004525 as the probability of pulling a two-ace hand from a random draw from a well-shuffled standard deck.

For parts 2 and 3 in the solitaire option, the first card is either given to be an ace or the ace of spades.  In both cases, the probability of getting another ace is the fraction of times that one of the three remaining aces is pulled from the deck that now holds 51 cards.  The probability is then 3/15 or 0.05882.

The answers for the assisted option for parts 2 and 3 are a bit more subtle.  For part 2, the dealer assists by winnowing the possible set down from 1326 possibilities associated with all two-card hands, to only 192 possibilities associated with all one-ace hands, plus 6 possibilities associated with all two-ace hands.  The correct ratio is 6/198 = 0.03030 as the probability for getting a single hand with two aces when it is known that one is an ace.  For part 3, the dealer is even more zealous in his diminishment of the set of possible hands with one card, the ace of spades.  After he is done, there are only 51 possibilities, of which 3 are winners, and so the correct ratio is 3/51 = 0.05882 as the probability of getting a single hand with two aces when it is known that one is the ace of spades.

All of these probabilities are easily checked by writing computer code.  I’ve chosen python because it is very easy to perform string concatenation and to append and remove items from lists.  The basic data structure is the deck, which is a list of 52 cards constructed from 4 suits (‘S’,’H’,’D’,’C’), ranked in traditional bridge order, and 13 cards (‘A’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’,’10’,’J’,’Q’,’K’).  Picking a card at random is done importing the random package and using random.choice, which returns a random element of a list passed into it as an argument.  Using the random package in the code turns the computer modeling into a Monte Carlo simulation.  For all cases modeled, I input the number of Monte Carlo trials to be N = 1,000,000.

Code to model part 1 and parts 2 and 3 for the solitaire option is easy to implement and understand, so I don’t include it here.  The Monte Carlo results (10 cases each with N trials) certainly support the analysis done above, but, if one didn’t know how to do the combinatorics, one would only be able to conclude that the results are approximately 0.0045204 +/- 0.00017.

The code to model parts 2 and 3 for the assisted option is a bit more involved because the dealer (played by the computer) has to draw a hand then either accept or reject it.  Of the N Monte Carlo trials drawn, what percentage of them will be rejected?  For part 2, this amounts to determining what the ratio of two-card hands that have at least one ace relative to all the possible two-card hands.  This ratio is 192/1326 = 0.1448.  So, roughly 85.5 % of the time the dealer is wasting my time and his.  This lack of economy becomes more pronounced when the dealer rejects anything without an ace-of-spades.  In this case, the ratio is 51/1326 = 1/52 = 0.01923, and approximately 98% of the time the dealer is throwing away the dealt cards because they don’t meet the standard.  In both cases, the Monte Carlo results support the combinatoric analysis with 0.03031 +/- 0.0013 and 0.05948 +/- 0.0044.

import random                

suits   = ['S','H','C','D']
cards   = ['A','2','3','4','5','6','7','8','9','10','J','Q','K']

def make_deck():
    deck = []
    for s in suits:
        for c in cards:
            deck.append(c+s)
    return deck
  
def one_card_ace(num_mc):
    num_times = 0
    num_good  = 0
    deck     = make_deck()
    for i in range(0,num_mc,1):
        card1 = random.choice(deck)
        deck.remove(card1)
        card2 = random.choice(deck)
        deck.append(card1)
        if card1.find('A') == 0 or card2.find('A') == 0:
            num_times = num_times + 1
            if card1.find('A') == 0 and card2.find('A') == 0:
                num_good = num_good + 1
    print deck
    return [num_times, num_good]

def ace_of_spades(num_mc):
    num_times = 0
    num_good  = 0
    deck     = make_deck()
    for i in range(0,num_mc,1):
        card1 = random.choice(deck)
        deck.remove(card1)
        card2 = random.choice(deck)
        deck.append(card1)
        if card1.find('AS') == 0:
            num_times = num_times + 1
            if card2.find('A') == 0:
                num_good = num_good + 1
    print deck
    return [num_times,num_good]

Notice that the uncertainty in the Monte Carlo results grows larger in part 2 and even larger in part 3.  This reflects the fact that the dealer only really affords us about 150,000 and 19,000 trials of useful information due to the rejection process.

Finally, there are a couple of philosophical points to touch on briefly.  First, the Monte Carlo results certainly support the frequentist point of view, but they are not actual proofs of the results.  Even more troubling is that a set enumeration, such as given above, is not a proof of the probabilities, either.  It is a compelling argument and an excellent model, but it presupposes that the probability should be calculated by the ratios as above.  Fundamentally, there is no way to actually prove the assumption that set ratios give us the correct probabilities.  This assumption rests on the belief that all possible two-card hands are equally likely.  This is a very reasonable assumption, but it is an assumption nonetheless. Second, there is often an accompanying statement along the lines that, the more that is known, the higher the likelihood of the result.  For example, knowing that one of the cards was an ace increased the likelihood that both were an ace by a factor of 6.7.  While true, this statement is a bit misleading, since, in order to know, the dealer had to face the more realistic odds that 82 percent of the time he would be rejecting the hand.  So, as the player, our uncertainty was reduced only at the expense of a great deal of effort done on our behalf by another party.  This observation has implications for statistical inference that I will explore in a future column.

Random Thoughts on Randomness

One of the questions I like to indulge, from time to time, is “what would Aristotle’s reaction be to some fixture of modern life?” This week I decided to ponder what the famous Macedonian would say about the use of randomness, statistics, and probabilistic reasoning that pervades our daily existence.

On one hand, I think that he would be intrigued by the very way that randomness is built into nature and our interactions with her. Quantum mechanics has randomness at its very core. This type of randomness, sometimes referred to as aleatory (meaning depending on the dice) uncertainty, is (or at least seems to be) an inescapable facet of how matter works at its most basic level. The outcome of any experiment is probabilistic no matter how precisely controlled was the setup. I imagine the fascination and, perhaps, the disbelief that he would have displayed when first encountering the Heisenberg uncertainty principle. In fact, since I am fantasizing here, it would be really interesting to see these two great men sit down for lunch and a long philosophical discussion about the meaning of uncertainty and causality.

I also think that Aristotle would have quickly grasped how we apply uncertainty in our knowledge, sometimes referred to as epistemological uncertainty, to a host of important everyday activities.

I envision him nodding his head in approval to the sciences of chemistry, thermodynamics, and statistical mechanics. In each of these disciplines, the sheer amount of data needed to describe the motion of the individual atoms, molecules, or components is overwhelming, and one must sacrifice complete knowledge of the small in order to get good knowledge of the all. No doubt, the connection between information and entropy would consume much of his attention as he explored the combinatoric possibilities of very large numbers of objects.

Aristotle would also be at home in the how discipline of statistics and estimation theory. As a skeptic of the universal validity of the Platonic forms, he well knew the individual differences in development and form of everything on the Earth. I picture him exclaiming, with satisfaction, “Yes! That’s how it should be done,” when he saw how statistical estimation theory is applied to turning noisy measurements into adequate conclusions. All the modern applications, from quality control to data fitting, would have caught his fancy.

Computing application of randomness and uncertainty would also meet with his approval. Numerical techniques, such as the Monte Carlo method, that use random samples as a way of ferreting out details of a process would hold a particular fascination for him and I imagine him spending hours playing with cellular automata simulations, such as Conway’s game of life. Most of all, the growing consensus in the artificial intelligence community that uncertainty is the vital component to producing machines that make rational decisions would have been pure delight for the Philosopher.

All that said, I think Aristotle would recoil in horror with that one, very large, component of randomness in modern life – the public’s approach to the scientific study.

Everywhere we go we are confronted by a headline, radio broadcast, news report, or tweet that says some study performed somewhere has determined something. Often times the public, even that component that is highly educated, consumes these studies with little or no heed. Most are unaware of how these studies are performed and how weak the inferences (i.e., conclusions) actually are.

If Aristotle were sitting amongst us when the news of the latest study were to break, he would be the first to caution us to be clear in our thinking and skeptical of the results. As a logician, he would know the difficulty in inferring a cause from the observed effect. And as a member of the Athenian polis, he would know better than we the various conflicting political agendas that drive people to various conclusions.

But the most grievous complaint that Aristotle would level against modern scientific studies would come only after he returned to the academy to see just how ‘the sausage is made’. He would be shocked and repulsed by the bastardization of the academic process. Not because of the political pressures and the conflicts of interest due to funding or the lack of it. No, he would be repulsed with how little regard our institutions of higher learning have for the concept of critical thinking.

To be a skeptic, to doubt a conclusion, to question and probe are no longer virtues (in the strictest Aristotelian sense). These traits brand their bearer not as a philosopher but as dullard or, worse, a denier. Graduate students, post docs, and professors worldwide are increasingly drifting further away from intellectual integrity. It is enough, they say, to find a positive or negative correlation in some data, perform a hypothesis test, and publish a result (see, e.g., the critiques leveled by Michael Starbird in Meaning from Data: Statistics Made Clear). Damn critical thinking and the discomfort that it brings they say. Aristotle, or course, would say different.

The Dangers of Being Equal

One of the favorite themes of this blog is how language and reasoning affect each other, sometimes to the detriment of both.  The overlap between logical reasoning and mathematical language is particularly ripe with possibilities of confusion because of the way certain concepts are used contextually.  In an earlier post I discussed the seductive properties of the humble symbol $\infty$.  A far more deadly symbol is the highly overloaded glyph described by two parallel horizontal lines – the equal sign ‘$=$’.

There are so many contextual uses of the equal sign that it is hard to know where to start.  And each and every one of them is sinister to the untrained.  Like some kind of bizarre initiation ritual, we subject students of all stripes to this ambiguous notation, and then we get frustrated when they don’t grasp the subtle distinctions and shaded nuances of meaning that we take for granted.  This situation closely parallels the experiences many of us have had learning how to swim, or ride a bike, or ice-skate, or drive.  Those of us who know how to do something, often can’t remember how hard it is to learn when you don’t know.

Of course, this situation is not unprecedented in language.  A simple internet search using the string ‘word with the most definitions’ returns the following statement from Dictionary.com

“Set” has 464 definitions in the Oxford English Dictionary. “Run” runs a distant second, with 396. Rounding out the top ten are “go” with 368, “take” with 343, “stand” with 334, “get” with 289, “turn” with 288, “put” with 268, “fall” with 264, and “strike” with 250.

So, functionally overloading a word with numerous meanings, some of them very closely related and some of them quite distinct, is commonplace.

What makes the equal sign so frustrating is that it is mostly applied in highly technical fields where shades of meaning in thought can have large implication in outcomes.  Consider the differences in meaning in the following equations:
\[ \pi = \frac{C}{D} = \frac{C}{2 r} \]
and
\[ \pi = \ln\left( i^{-2i} \right) \]
and
\[ \pi = \sqrt{6 \sum_{n=1}^{\infty} \frac{1}{n^2}} \; . \]

Each of them tells us something about the irrational number $\pi$, but in very different ways.  In the first equation, we think of $\pi$ as the assigned value for the correlation between the diameter of a circle, $D$, and its circumference, $C$.  This concept is purely geometric, and can be explored with rulers and compasses and pieces of paper. In some sense, it can even be regarded as a causative relation, telling us that, if we make a circle of radius $r$, then we are making an object whose perimeter is a distance $C$.  The second equation is an identity in the purest sense of that term.  It boldly states that one of the many disguises of $\pi$ is an algebraic expression involving the natural logarithm and the imaginary number .  The final equation is neither an assignment nor an identity, but a set of instructions saying ‘if you want to know how to compute $\pi$ to some accuracy, then set up a computing process that takes the first  integers and combines them in this funny way.’

The science of computing has long recognized that the usual ambiguity of human language would be inadequate for machine instructions.  All programming languages to which I’ve been exposed clearly distinguish between the concepts of assignment, equivalence, and function definition.  Using the pi equations above, one might express them in the programming languages Python and Maxima as

Pi equation Python Maxima
\[ \small  \pi = \frac{C}{2r} \]
pi = C/(2*r)
pi : C/(2*r)
\[ \small \pi = \ln\left(i^{-2i}\right) \]
pi == ln(i**(-2*i))
pi = ln(i**(-2*i))
\[ \small \pi = \sqrt{6 \sum_{n=1}^{\infty} \frac{1}{n^2}} \]
def sum_sqr(n):
    sum = 0
    for i in range(1,n+1):
        sum = sum + 1.0/(i*i)
    return temp

def approx_pi(n):
    sum = sum_sqr(n)
    return (6*sum)**(0.5)
calc_pi(n) := 
block([sum],
 sum : 0,
 for i: 1 thru n do
 sum : sum + 1/(i*i),
 ans : sqrt(6*sum));

Note that, in each case, there is a clear syntactical difference between assignment (‘$=$’ or ‘$:$’), the conditional test for identity (‘$==$’ or ‘$=$’), and functional definition (‘def’ or ‘$:=$’).  For anyone who’s been programming for some time, switching back and forth between these ideas of assignment, equivalence, and definition is relatively effortless, but for the beginner it is one of the hardest concepts he will have to learn.

The situation is even more complex in the physical sciences, for two primary reasons.  First, and foremost, because man has been investigating the physical world longer than he has been writing computer programs.  As a result, there has been more time for man to layer different meanings and subtle distinctions.  Second, computers are intrinsically stupid and require a high degree of precision and clarity to function.  A nice discussion of this last point can be found in the prologue of the book Functional Differential Geometry by Sussman and Wisdom.

As an example, let’s look at perhaps the most famous physical statement – Newton’s second law.  Many people, even those lacking formal training in science, know that the expression of the law is ‘force equals mass times acceleration’ or, in mathematical terms,

\[ \vec F = m \vec a \; . \]

But what does the equal sign here mean?  The concept of a force tells us that it is a vector quantity that transforms like a position vector.  That means that a force relationship is the same in all frames.  For example, the balancing of the pulls from three ropes tied to an object such that the object doesn’t move is an equilibrium condition that is independent of the frame in which it is expressed.  An accelerating observer will make the same conclusion as an inertial observer. So the force on the left-hand side of $f=ma$ is geometric in its meaning.

On the other hand, we understand that the acceleration appearing on the right-hand side is kinematic.  It describes an object’s motion and it’s the kind of thing measured with rulers and clocks.  It is fundamentally frame dependent when described by an accelerating observer.  Just imagine the visual perception of someone on a merry-go-round.  The mass, which measures the object’s unwillingness to move under influence of a force, simply scales the acceleration and can be regarded as constant.

So how do we reconcile what the equal sign is meaning here?   On one side is a geometric quantity as immutable and placid as a mountain.  The other side is as ephemeral as rising mist or running water, flowing to and fro.  How can they actually be equal?

Well, the answer is that the equal sign should be regarded as relating cause and effect.  If we regard the force as known (e.g., Newton’s universal law of gravity), then the equal sign allows us to deduce the resulting motion once the force is applied.  If we regard the acceleration as known (e.g., we film the motion and do a frame analysis), we can infer (via abductive reasoning) the force that caused it.

Clearly, the innocent-looking ‘$=$’ packs a lot more meaning than at first it appears. It is interesting to ponder why it is that the shortest of strings, such as ‘$\infty$’, or ‘set’, or ‘$=$’, have the longest and deepest of meanings. Maybe it reflects on the subtly of the human mind.