Friday, July 17, 2009

Math in the Movies: Revolutionary Road

This past week I watched Revolutionary Road, the Oscar nominated 2008 film directed by Sam Mendes. The film stars Leonardo DiCaprio and Kate Winslet as a highly dysfunctional couple named the Wheelers, who live in 1950s suburban Connecticut. For those of you who may not have seen this feel-good picture, here's a trailer:



The trailer doesn't address the question of what this film has to do with mathematics. The answer lies in the character of John Giving, a "mathematician" played in the film by Michael Shannon (who turned in an Oscar-nominated performance).

We first hear of John Giving from his mother, who informs Mrs. Wheeler that her son has a brilliant mind, as evidenced by his PhD in mathematics, but that he has been institutionalized, and his doctors have suggested that it would be good for him to go out and make some friends. This introduction did not bode well for the film's representation of the mathematically inclined, but how did the rest turn out?

Let's explore the usual stereotypes.

- To be good at math, you must be insane.

This is probably the most common stereotype in films about mathematicians, and this film would certainly have us initially believe that it is no different. To be fair, we're never told that Dr. Givings was ever an especially gifted mathematician, but the first facts we learn about him is that he is a mathematician, and he is insane.

But is he really? He's certainly outspoken, and doesn't fit in with the established conformity that has become synonymous with 1950s American life, but we're never given any clear indication as to whether he truly did or did not belong in an asylum. Indeed, the film seems to play on the convention of the insane mathematician - Dr. Givings is told by society that he is insane, but his outspoken attitude sometimes makes him seem like the only sane one in the film.

In fact, it's not at all clear that he is even a mathematician - perhaps he has just been given this label by a mother who yearns to take pride in her son. When Frank Wheeler asks Givings about his background as a mathematician in the book on which the film was based, Givings asserts that he is not a mathematician. "Taught it for awhile, that's all."

I've decided to give the film a pass on this stereotype. Givings may be insane, but he certainly seems more lucid than anyone else living in the suburbs. +0.


- People who are good at math are socially awkward.

Givings is awkward, but not in the way one would expect in a portrayal of a mathematician. Instead of being nervous in social situations, he seems to relish them, and is quite outspoken in his opinions. The awkwardness therefore stems from his seeming inability to keep his mouth shut.

He does create awkward situations, but not in the way you'd expect given the stereotypes about mathematicians. So I'll give this one a pass as well.


One of two scenes featuring John Givings.

Related to the notion of social awkwardness is the idea that people who do well in math or science are not good at picking up on nonverbal cues. However, as the clip above illustrates, Givings is quite good at picking up on these cues - better than anyone else in the film, in fact. That he can observe these cues and still do mathematics is a good thing, although to be fair, Givings says that his mathematical abilities disappeared following his shock therapy treatments. +1.

Givings is certainly not your stereotypical mathematician. I worried that this film would play in to all of the stereotypes surrounding folks who do math, and so I was surprised to find that the film played with these stereotypes in a way that one doesn't usually see. I prefer this performance to other Oscar nominated crazy mathematician roles, but I still long for the film that shows me a mathematician who's just a normal dude (or, even better, dudette).

Thursday, July 9, 2009

Math Gets Around: On Birthdays and Trading Cards

Today marks the 1 year anniversary of Math Goes Pop! I started on somewhat of a whim after reading an article about compulsory Algebra I education for all California 8th graders (although what with our finances down the toilet, who knows what the current status is here). When I started writing I wasn't sure there was enough content out there to sustain a blog with this one's focus. Once I started digging, though, I found that the rabbit hole went quite deep, and so here I am a year later with plenty left to talk about (the recent obsession with pointless math holidays certainly has helped with my output).

Given the date, it seems fitting to begin by mentioning the birthday problem. This is a standard problem given in any introductory probability course, but many people find the result counter intuitive at first.

The birthday problem asks a simple question: if you have a room full of people, how many people do you need so that there's a 50% probability that at least two of them share the same birthday? In the simplest setting, we make a few assumptions: for example, we usually ignore the presence of leap years, and we assume that each day of the year is equally likely to be someone's birthday.

With these assumptions, solving the problem is not difficult. The probability that at least 2 people in a group of n share a birthday is 1 minus the probability that all n people have different birthdays. In other words, the probability is

1 - (1 - 1/365)(1 - 2/365)...(1 - (n-1)/365).

This is because the second person has a 1 - 1/365 = 364/365 chance of having a birthday different from the first person, the third person has a 363/365 chance of having a birthday different from the first two people, and so on.

So, to answer the question, we just need to find the smallest n such that the expression above is greater than 1/2. The punchline is that n only needs to be 23 or more in order for this inequality to hold. In other words, in any room with at least 23 people, there's a better than 50% chance that two of them have the same birthday.

For many people, this number seems too low - after all, you may have been in several groups of 23 or more and never or rarely met someone with your birthday. The problem with this argument is that it addresses a different question. The reason why we only need 23 people to have a 50% chance of finding a common birthday is that we are placing no restriction on the date of the shared birthday. Requiring that someone share the same birthday as you fixes the date, and this changes the problem.

If instead you want to know how many people you need in a room so that there's a 50% chance one of them will have the same birthday as you, this probability is given by the new expression

1 - (364/365)n.

To make this greater than 1/2, we need to take a much larger n: n = 253, to be precise.

As I said, this is a well-known problem in probability theory. A few months ago, however, I was asked about a variant of the birthday problem by my friend Gabe over at Motivated Grammar. Rather than looking for identical birthdays, what if you look for different birthdays? More specifically, how many people do you need in a room to guarantee with, say, a 90% certainty, that every day of the year is someone's birthday?

Of course, you could always pick poorly so that everyone in the room has the same birthday, but the odds of this happening are quite low. In fact, this problem is more commonly known by another name: the coupon collector's problem.

For this problem, suppose you are clipping coupons from a newspaper (any newspaper except for USA Today). There are n different coupons you can collect, but each newspaper only has 1 coupon, and you can't see which coupon the newspaper has until you've bought the newspaper. In this context, the question becomes: what's the probability that you'll need to buy at least newspapers to collect n coupons?

If you prefer, you can think about this problem in terms of trading cards as well. Each pack of cards is akin to buying a set of newspapers, and you want to know the probability that you'll need to buy at least a certain number of packs in order to collect all the cards. From baseball players to Pokemon, this same problem governs the distribution (assuming that all cards in the back are equally likely to be in the pack, which may not always be the case).

What's known about this problem? Well, as I said above, even if you buy hundreds of thousands of cards, or stuff millions of people in a room, there's no guarantee that you'll collect every card or every date. However, on average, the number of cards you'll need to go through to complete a set of size n is about n*logn.

In terms of birthdays, this says that if you want to collect every date, on average you'll need to pool together around 2,153 people. Why such a large number? It's not unreasonable to expect something like this - when you first begin collecting people, it won't be hard to get people with different birthdays. However, as your numbers increase, you'll get a new birthday less and less frequently. Finding that last birthday could prove to be quite elusive.

The same analysis works for trading cards. Trying to complete your collection of series 2 Teenage Mutant Ninja Turtles Animated Series trading cards? Well, my friend, with 88 cards total and 5 cards per pack, you can expect to buy around 79 packs of cards. Perhaps this box set would be a better investment.

Mondo to the max, indeed.

While the expected values are easy to calculate, it may be that you need to greatly exceed the expected value in order to complete your collection. However, one can use Markov inequalities to get bounds on the probabilities. For example, there's a 90% chance that you'll be able to hit every birthday if you take no more than about 21,535 people. To bump those odds up to 95%, take 43,069 people.

So, for parents whose children who have gotta catch 'em all, you can use these methods to get a rough estimate for how much that completion will cost you. And if you're trying to get a room full of people together so that every day of the year is someone's birthday, I'd strongly suggest not picking people at random. What an awkward party that would be.

Wednesday, July 8, 2009

USA Today, you are also on my list

It bothered me when USA Today, in an article celebrating "math holidays" centered on the numerology of certain dates, linked to a post I had written about how these holidays are stupid, without even mentioning my contrary opinion. However, I was willing to let it slide, since I was able to say that I was linked in an article from USA Today.

However, an article posted today is just too much. USA Today, you have officially made it onto my list.

The headline for the article really speaks for itself: "Rare time/date alignment could mean opportunities." This refers to the fact that in the wee hours of the morning today, it was 4:05:06 on the date 07/08/09.

Money quote:

Although the alignment may not mean anything specific, it could be a good day to do something for yourself and others, said Betsy Carlson, a Palm Springs tarot card reader and numerology expert.

"It's a good day to make money and have good health," she said.

When is it not a good day to have good health? Who wakes up, looks out the window, and decides that no, today is really a day for rather poor health? What does this even mean?

And how can someone be a "numerology expert?" Would any self-respecting newspaper publish a story from a phrenology expert? Why does numerology so often seem to get a pass? If you want to know why nobody reads newspapers anymore, this serves as an excellent indication. Is this seriously what passes for journalism in 2009? I guess because it's in the "Offbeat" section, that makes it all ok.

Money-er quote:

Joy Meredith, owner of Crystal Fantasy in Palm Springs, Calif., noticed the alignment, but she's more focused on this morning's lunar eclipse, she said.

Nonetheless, she's a fan of numerology and sometimes tries to determine if numbers have meaning.

"I feel they could be significant, so I'm looking for that," she said. "If they're not, they're not. But I am looking to see if there is any significance."

Dear Joy, I think I can help you out. I have discovered that numbers do indeed have meaning. The meaning of the number 12, for example, is the number of eggs you'll get if you go to the store and buy a dozen eggs. The number 1 represents the number of newspapers that thought such a crackpot story was worth publishing. And so on.

Here's another question: how does one go about "looking" for significance in a given "time/date alignment?" What oracle does one consult in search of insights into the mysterious nature of 4:05:06 07/08/09? God, I hope USA Today follows up on this article, so that all of my burning questions can be answered.

The worst thing about this article is that if you're going to post garbage, at least post the most interesting garbage possible. The fact that 4:05:06 07/08/09 occurs today (or slightly less than a month from today, for those of us outside of the states) is not nearly as interesting as the fact that 12:34:56 07/08/09 occurs (twice!) today. If you're into this sort of thing, I see no reason to find the first time/date alignment more interesting than the second. I must admit, even I cannot resist publishing this post at the appropriate time.

Number partyyy!!! Courtesy of Kitsune Noir, by way of Meebobebo.

Watch out, USA Today, because I've got you in my sights. My influence is vast, and my resources infinite. Let's dance.

Sunday, July 5, 2009

Ron Gordon, you are on my list

Not this again. I've now discovered that the mastermind behind these so-called math "holidays" is a teacher named Ron Gordon. Not only was he the one to spearhead the Odd Day initiative 2 months ago, but he's gone so far as to double dip and call today Odd Day as well, citing the fact that standard date notation for most of the world is DD/MM/YY, rather than MM/DD/YY.

Thanks for double dipping, Mr. Gordon, so that I can read these pointless articles yet again. Mr. Gordon has even set up a web page and a contest, with cash prizes for those who can celebrate Odd Day the most enthusiastically. Needless to say, I don't think I will be the recipient of any such prize.

The road to hell is paved with good intentions, Mr. Gordon. I'm just sayin'.

Thursday, July 2, 2009

Decimal Point Fail, Ctd

I apologize for my silence over the past few weeks - I have been out of the country learning math and eating pancakes. While I get back into the swing of things, I've got a couple of points to mention that relate to earlier posts regarding our collective inability to correctly use the decimal point.

The first is a picture from a flyer advertising maid service. Here's the ad (sent in to me by a dedicated foot soldier in the army that is my readership, a.k.a. my mother):

Names and phone numbers have been cropped out to protect the innocent.  But in a case such as this, are there really any innocents?

Although we've seen decimal point errors on signs before, this one is arguably the most egregious of all. Presumably the intended price is $100 - if that's the case, then not only is the decimal point in the wrong place, it's not even necessary. It's hard to imagine how this mistake could've been made and then gone unchecked, but if you live in San Francisco and are looking for some cheap maid service, I can definitely hook you up. Also, if anyone else has pictures which evidence a lacking in mathematical proficiency, feel free to send them my way.

On a related note, while we all knew that Verizon employees suck at math, apparently this low tolerance for mathematical ability among cell phone providers spreads even wider. More specifically, there is evidence that AT&T employees suck at math, too.

This fact has been brought to us courtesy of MythBusters co-host Adam Savage. According to this article, at the end of last month Mr. Savage was charged $11,000 for a few hours of web browsing while in Canada. This figure alone should be enough to make us skeptical of the math at work, but what's worse is that when customer service tried to explain the charges, they told savage that “data is charged at .015 cents, or a penny and a half, per kb.”

Depicted here is the effortless charm and confident sophistication that comes with a knowledge of mathematics.

Sigh. Perhaps it's time to switch to T-Mobile?

Friday, June 12, 2009

Math Gets Around in the Big City

Math has gotten a bit of a visibility boost recently, in the form of posts by professor Steven Strogatz at the New York Times blog. For three weeks, starting at the end of May, Professor Strogatz filled in for usual blogger Olivia Judson, and during that time he used the platform to write some highly readable musings that show the presence of mathematics in unlikely places, and touch on some of the directions math is headed in the 21st century.

Let me highlight the first post, titled "Math and the City." Professor Strogatz begins this article by describing Zipf's law, an observation attributed to linguist George Zipf regarding the distribution of words in a language (for a linguistic motivation, you can check the Wikipedia article on Zipf's law).

One of these things is not like the other.

In the context of cities, the law states the following: in a given country, if you rank the cities within that country by population, the largest city should be about twice as large as the second largest city, about three times as large as the third largest city, and so on. In other words, a city's population is inversely proportional to its rank.

Using the power of the internet, it's not too hard to find current population data to try and verify this observation. Here's a table illustrating Zipf's law for U.S. cities (I pulled the population data from here):

City Estimated Population (July 2007) Zipf Law Ratio Ranking
New York, NY 8,274,527 1 1
LA, CA 3,834,340 2.158 2
Chicago, IL 2,836,658 2.917 3
Houston, TX 2,208,180 3.747 4
Phoenix, AZ 1,552,259 5.331 5
Philadelphia, PA 1,449,634 5.708 6
San Antonio, TX 1,328,984 6.226 7
San Diego, CA 1,266,731 6.532 8
Dallas, TX 1,240,499 6.670 9
San Jose, CA 939,899 8.804 10


Those with a visual bent can also take a look at a graph of the data:

Professor Strogatz doesn't provide heuristics for why Zipf's law should be true, but he does observe that this phenomenon has been around for more than a century, and can be observed in countries throughout the world (with varying degrees of agreement). He then goes on to discuss more recent mathematical observations regarding urban development, including the observation that cities, as with many other things, enjoy economies of scale. For example:
If one city is 10 times as populous as another one, does it need 10 times as many gas stations? No. Bigger cities have more gas stations than smaller ones (of course), but not nearly in direct proportion to their size... the bigger a city is, the fewer gas stations it has per person...

The same pattern holds for other measures of infrastructure. Whether you measure miles of roadway or length of electrical cables, you find that all of these also decrease, per person, as city size increases.
In other words, the distribution of infrastructure is not quite the same as the distribution of the population - as population grows, so too does infrastructure, but it can grow more slowly. Further discussion can be found in the article.

Of course, there are many questions here. First of all, a little digging will show you that this trend is stronger in some countries rather than others. Why is this? Also, why must we break down our analysis by country to look at these trends? Why don't we see this pattern emerge if we simply rank cities independent of country?

Moreover, this Zipfian trend depends of course on one's definition of the word "city." If one extends the notion to municipal areas, the trends become less clear. So, how should we define what it means to be a city?

As I learned from a recent article on The Daily Dish, Tim Gulden of George Mason University has recently tried to answer some of these questions. By using nighttime satellite data, Professor Gulden and his coauthors were able to more rigorously and consistently measure city sizes globally, and were able to use these measurements to compare rankings for population, economic activity, and patented innovations.


In their paper (the abstract of which can be found here), the authors give evidence supporting a Zipf-type distribution for all three statistics, and use this data to argue against the idea that globalization is making the world "flatter," i.e. more equidistributed with regards to things like population or economic activity. Instead, they argue that the world of the future will feature global ranks that follow more of a Zipf distribution, and that one reason why this hasn't happened already is because it currently can be difficult to migrate between the barriers of different countries.

For more math in the spotlight, I'd encourage you to read Dr. Strogatz's other posts (here and here). Happy reading!

Monday, June 8, 2009

The Cheapest Salad Bar in the World

Last week, I went to a number theory conference in Utah. The conference was very good, and I learned quite a lot, which I suppose is the goal of any such conference. The location of the conference itself was also quite nice - it was close to the mountains, a lake, and the home of Blendtec, famous for their "Will it Blend" series of videos.


As you might expect, most of what I learned on this conference pertained to number theory. However, there were lessons outside of this sphere of knowledge as well. The one lesson I will share with you is best encapsulated in this picture:

That's right - Ghiradelli now makes salad.

It was my friend Jack who pointed out the placement of the decimal point. Apparently the people who work in cafeterias in Utah are the same people who work at Verizon call centers. If you ever want cheap salad, I guess this is the place to go - $0.0029 per ounce is a price that can't be beat!

It's unlikely that anyone will try to exploit this small misprint to score a pound of salad for just under 5 cents, but someone would certainly be within his or her rights to do so. The lesson I learned is that even when you are surrounded by mathematicians, you are never truly safe from the consequences of an insufficient math education. Of course, at the end of the day, the typo really is inconsequential, but as highlighted in the Verizon call I posted earlier, even simple misunderstandings such as these can have significant consequences.

Then again, maybe the salad really was that cheap, in which case I really should have stuffed my luggage with vegetables.