Episode Guide to the Math
Episode 1: Charlie invents an algorithm for determining the likely location of the residence and workplace of a criminal by analyzing the crime patterns. Not only is this realistic, it is real. The only unreal part is that it was not invented by Professor Eppes. If the show was not fictional, it would probably have mentioned D. Kim Rossmo, former Vancouver detective and now a professor of criminology. It is clearly his Criminal Geographic Profiling (CGT) which formed the basis for Charlie's discovery on the show. A complete description of the method can be found in his book Geographic Profiling.
Episode 2: Charlie again works out a method of analyzing crime patterns. This time he predicts the location of the next crime. (Can anyone suggest a good link for real mathematics that can be included here?) However, his prediction leads to a shoot-out and deaths. Unable to deal with the guilt, Charlie hides in a difficult mathematics problem. In particular, he starts working on P vs. NP. This is a real, famous open problem on the border between mathematics and computer science. Loosely put, it has to do with how long it would take to solve certain problems. More specifically, it has to do with how much longer it will take to solve the problem as some integer parameter, n increases. We classify problems as being in the set P if the length of time necessary to solve the problem is less than the value of a polynomial in the parameter n. For instance, if we have a whole number that is n digits long, we can determine whether it is a prime number in less than p(n) minutes where p is a polynomial. This means that determining if a number is prime is a problem in P. There is another set called NP which includes more difficult problems, such as factoring an n digit number into its prime factors or playing Minesweeper (the example used in the show) on an n by n grid. These are harder in the sense that any of the ways we know how to do these things will take longer to solve than the value of any polynomial...they just get too hard too fast. The question is: is that because these problems are really harder, or is it only because we don't yet know the best way to solve them? That is the question of P vs. NP and it is an important one because, for instance, the reliability of the codes that protect your credit card number in internet purchases depends upon the difficulty of the problems in NP. If there is some easier way to do it, then it is possible that these codes could be easy to break as well!
Episode 3: This time, Charlie models the spread of a disease. The history of using mathematics to understand the spread of disease goes back to Bernoulli's study of smallpox in 1766 and the more famous example of John Snow using simple statistics to, for the first time, identify poor well water as the cause of a cholera epidemic (where popular belief held that it was low morality that was the cause). Since that time, mathematics has been an essential tool in the analysis and modeling of the spread of disease. Also in this episode, Charlie comes up with an algorithm for comparing DNA sequences. This is a more recent contribution of mathematics to the biological sciences, but because of the huge amount of data generated by molecular biologists sequencing genomes today, mathematics has become an indispensable tool for this reason, spawning the growing field of "bioinformatics", which combines the power of computer science with the mathematical sciences to address open problems in biology. Although, as in the case of Geographic Profiling of criminals, many mathematicians contributed to this research, a name worth associating to it is that of Dr. Eric Lander of MIT who was trained in mathematics and was there at the right time to help foster its applications in the analysis of DNA sequences.
Episode 4: A student uses mathematics to analyze the structural stability of a famous building and discovers that it is in danger of falling if winds torque around it. He contacts the designer with his discovery, and then the student winds up dead.

This is obviously based on a story that lies somewhere between reality and urban legend. The undisputed facts are that building designers, especially those building skyscrapers, do in fact use mathematics to demonstrate structural stability. It is also true that one famous building in NYC was only recognized as being structurally unstable after it was already built and in use, and that a student's computations had something to do with the discovery.

In the real version of the story, the building was the famous Citicorp building in New York City (the one with the slanty top). It had a strange structure because they had to build it in such a way as to preserve one corner for a freestanding church which had been at that corner and did not want to move. The structural engineer William LeMessurier must have used some mathematical analysis in making such a strange looking building stand in any case, but he did not check for its stability against winds coming from different angles at the same time. In the popularly circulated version of the story, this potential problem was brought to his attention by a student who identified it in his computations. LeMessurier gives what is probably a more accurate but less interesting account: that a student's inquiry started him thinking further about the building but that he noticed the problem himself. In any case, the resulting situation is well documented in the BBC documentary All Fall Down. As in NUMB3RS, the situation was solved by adding extra supports to the building, which in reality were done secretly so as not to concern the people working in and near the building with the possibility that they could die suddenly if the winds that day happened to be just right.

Also in the episode is the use of a pendulum to identify the motion of the building. I'm not certain whether this counts as mathematics or whether it is just physics. There was a nice article in the latest issue of Math Horizons (February 2005) explaining Foucault's Pendulum as being nothing other than mathematics, but this may not be the standard way of thinking about it.

Episode 5: In this episode, an amateur mathematician's daughter is kidnapped. As ransom, the kidnappers want an algorithm made from his proof of the Riemann Hypothesis that will allow them to break the encryption algorithms used on the internet and for personal security.

First, a reality check: It really is true that internet security and other popular encryption algorithms are based on number theory. It is also true that the Riemann Hypothesis is an open problem in number theory (or, at least, with connections to number theory) which mathematicians are now actively trying to resolve and for which the Clay Institute has offered a $1 million prize. However, the connection between these two things is much less certain than this episode of NUMB3RS would have you believe!

First, let's look at number theory and codes. The thing that makes this new breed of code, technically called public key encryption algorithms, different is that you can give everyone the information necessary to send you coded messages without giving them the information to read them. (Think about it. With an old fashioned code, if I told you enough about the code you would not only be able to send me messages but would also be able to read any messages other people send me.) This is important in internet applications, for instance, because a company like Amazon.com wants to have lots of people send them encrypted messages (with credit card info, for example) but do not want all of those people also to be able to read those messages! That's where the difficulty of factoring huge numbers into their prime factors comes into play! In the RSA algorithm anyone who knows some really large number (an integer with thousands of digits) can encrypt a message just by turning it into a number, raising it to a power, and finding the remainder when you divide by the large number. However, in order to decode the message one needs to know the prime factors of that number. If the number is large enough, it could take years, decades or centuries to find those prime factors. Here's how the RSA encryption algorithm works:

  • If I want to receive a coded message (whether I'm a person or a computer, it doesn't matter), I pick three numbers. Two prime numbers p and q and a third number r which has no factors in common with (p-1)(q-1). So, for example, if I want to get a message from you, I can pick p=11 and q=3. Then, I could pick r=3 because 3 and 20=(11-1)(3-1) have no common factors. In reality, these numbers are much too small, but for this example let's ignore that problem.
  • Then I must also find the number d less than (p-1)(q-1) with the property that the remainder when you divide rd by (p-1)(q-1) is 1. In the example, d must be 7. Note that 3 X 7=21 which leaves a remainder of 1 when divided by 20.
  • Now comes the interesting part. I publicly announce to you and everyone else both the product p X q and the number r. However, I don't tell anyone what p or q or d are! So, I would announce to you that the product of p and q is 33 and that the value of r is 3.
  • Now comes your part. You want to send me a message and encode it using the knowledge of those two numbers. In fact, your message has to be a number too. However, that's not too hard. Everything in a computer is numbers in the end. However, as it has to be a number less than p X q, we are sort of restricted here. But, as a simple example, let's suppose the message you want to send me is the number ``18''. But first, you encode the message by raising it to the power of r dividing by the product p X q. In fact, the coded message is just the remainder in that division! Even though you want to tell me `18'', what you'll send me is the remainder when you divide 183 by 33. That is, you'll send the message 24.
  • Don't forget that anyone who was listening to our previous conversation knows the two numbers I sent you, and they know the number you sent me as the coded message. But, they cannot decode it unless they know the numbers that I've kept secret! (The factors of 33 and especially the number d...that's the secret, right?)
  • Now, to turn the encoded message back to its original form, I need to raise the message you sent me to the power d and get the remainder when that is divided by p X q. In the example, this means I will compute 247 and divide it by 33...or rather just find the remainder. And, guess what, this gives me back the message 18!
  • Of course, there is something silly in the above example. The math is all correct, whatever message you start with I will be able to decode it back to your original just because of the way the number theory works. However, if I tell everyone my number 33 then there is no real secret what its factors are! 33=11 X 3 is the only way to factor it! The thing is, when this gets used for real, the numbers involved are super huge. They use numbers that are thousands of digits long, and the fact is that at the moment we have no way to factor those numbers in a short time. In twenty to one hundred years someone could factor it and break the code...but by then the information in the message will probably be obsolete.
Okay, so now. What is the Riemann Hypothesis? Many real mathematicians are trying to prove the Riemann Hypothesis (not called just ``Riemann'' by any real mathematicians I know, although they did that in the show). As they say in the show, there is even a $1 million prize offered by the Clay Institute for its proof. However, even though the hypothesis does relate to the distribution of prime numbers, there is no reason to assume that its resolution would lead to a way to break codes!

Berhard Riemann found a formula that can be written in lots of interesting ways. The same formula can be written as an integral with exponential functions, as a product involving all of the prime numbers, or as a sum involving a function that counts all of the primes less than a given integer. The point being that if we understood this function well we could learn about prime numbers from it because despite the fact that we can write down these formulas we don't know all of the primes or the number of primes less than a given number!

The Riemann Hypothesis is just an unproven conjecture Riemann had about where the zeroes of this function (like x=+1,-1 are the zeroes of p(x)=x2-1) are located. His conjecture is that all of the non-obvious zeroes lie in a certain location (``on the critical line'') and if they do not then his conjecture is wrong. However, regardless of whether the conjecture is right or wrong, it does not automatically tell us how to break a code like the RSA algorithm above.

On the other hand, depending on how it is proved, such a consequence (making the codes useless) is truly possible. When I was working at MSRI, we were following approaches to proving the RH that related to mathematical physics. In particular, when one looks at large matrices filled with random numbers, a bunch of startling coincidences occur. The properties of these matrices begin to look strangely like those found by mathematical physicists studying waves and particles (as I do) and also like the patterns of prime numbers found by number theorists. This leads to the hope of proving RH and getting a better understanding of the prime numbers by thinking of them as possible energy levels of a physical system. Obviously, this has not been done yet, but if it was it could not only prove the hypothesis but give us a new technique for factoring large integers that would render RSA-type encryption algorithms obsolete.

On a less technical note, let me just make two more comments relating to this episode: (1) It is not reasonable to think that Charlie Eppes, who has not given any indication of being a number theorist, would immediately recognize a brilliant proof of the Riemann Hypothesis after just a moment's glance. (His brother was right to be skeptical.) I'd be willing to believe he could recognize that it was an attempt to prove RH, but the supposed evaluation of its quality would require greater expertise than I think he would have. (2) Although I know that mathematician's have a reputation for being workaholics, the idea that he could not spare an hour for his daughter's birthday party because of a problem he'd been working on for 15 years is pretty ridiculous.

Episode 6: Well, there was less math than usual in this episode. (To replace the math they added more romantic tension between Charlie and his grad student.) A grid of numbers is left behind as a clue at the scene of terrorist attacks. At first, the mathematicians are looking for some cryptographic interpretation. Not something as mathematical as the public key encryption algorithms described above, but just old fashioned mathematical cryptography in the sense of Sinkov's classic book. However, it turns out that this is not the correct approach. In fact, Charlie's intuition fails him here again. Two other characters note that the number of people who died in a previous accident (37) is very close to the number 36 which appears frequently in the number grid...but to Charlie the number 37 and 36 are very different since one is prime and the other composite. Charlie then looks through a list of data trying to spot -- by eye -- the train in that days schedule that is most similar to the one in the historic accident. Although I'm not sure if this itself is mathematical, it looks quite similar to an implementation of Discovery Informatics -- a union of mathematics and computer science that allows for analysis of high dimensional data sets. Perhaps the most interesting mathematical tidbit in the show is Charlie's defense against the common charge that mathematics is difficult to see "in the real world". His attempt to explain how Fibonacci numbers show up in plant biology is tempting, but I recommend Thinkquests approach as one that has more "meat" to it.
Episode 7: Pretty good episode. This time the LAPD specifically asks for help from the FBI because they've heard about Charlie and his new technique for enhancing video. (They need it to improve the images from surveillance cameras at crime scenes.) As Charlie describes it, his technique is "a mathematical equation to help the computer guess at what's between the dots. Extrapolations of information based on the surrounding pixels." But, he never gets to show us the formula (the agents say they aren't really interested and "can't really appreciate it").

Of course, mathematics does have an important role to play in image processing. Many different areas of mathematics are involved. To get a decent idea of what real mathematicians do in this area, check out these two PDF files: 1 and 2.

Charlie also mentions using wavelet analysis to analyze the forged bills. Wavelets are a really cool new technique in mathematics which is analogous to the way sound waves can be analyzed by breaking them down into frequencies but which analyzes by little localized phenomena rather than the wide repetitive patterns that can be analyzed by the classical (Fourier) technique. As Charlie says in the show, one application which got a lot of attention recently was its use in finding counterfeit artists that was published by Dartmouth professors including Dan Rockmore.

Episode 10: This is the episode in which some badguys steal a truckload of nuclear waste and threaten to detonate a "dirty bomb". The mathematics early in the episode, where they try to predict where the bomb will be set off, is a bit lame. But, the hilarious bit at the end more than makes up for it (from a mathematical point of view)! The three criminals are arrested and -- as so often happens in TV dramas if not in reality -- the cops are trying to get one of them to "spill the beans". However, they are all remaining completely silent. Charlie points out that it is like the famous mathematical problem from game theory called "The Prisoner's Dilemma". But in this instance, the lack of symmetry in the situations of the three criminals changes things. If the criminals understood game theory well enough, they would see that one of them (the mastermind's brother) has more to gain by becoming an informant than by remaining silent. Unfortunately, of course, the guy does not know much mathematics. So, Charlie comes into the prison, sets of an impromptu "classroom" with the three prisoners as students, and gives them a math lesson! At first, the three badguys do not understand why they are being forced to learn math in a federal prison, but they eventually start to see its relevance to their present situation...with dramatic consequences.
Episode 11: The murder victim in this episode had developed a mathematical theory in economics that he claimed would support the "wise" use of resources in educating only those students with high potentials. In particular, money would be directed only to "good" schools. (Hey, isn't that the policy that Bush has been touting? ; ) Anyway, Charlie is supposedly shocked at the end by the thought that mathematics -- including his own work -- could have such dramatic political consequences. This struck me as a bit unrealistic. Certainly, someone who knows as much useful math as Charlie does is aware of many applications and can imagine his work being used for unpleasant purposes as well as good ones.

This all reminds me of a story I heard at the 100th anniversary of the famous 1895 paper by Dutch mathematicians Korteweg and deVries. We were welcomed to the conference with a lecture which included some history. Among the things we learned was that in the 19th century, a group of people supporting the notion of training all children in public schools had finally won some major victories over those who thought schools should only be for the elite. (The latter group, like the victim in this episode of NUMB3RS, believed that it was a waste of time to educate the children of poor farmers because they "obviously" did not have the brains to make use of it.) Well, as it turns out, the schools to educate all children were a tremendous success, and many of Holland's most famous scientists from the late 19th and early 20th centuries (including Nobel laureates and DJ Korteweg himself) were products of this program who would otherwise never have received a formal education! (Needless to say, I'm a big supporter of the idea of public schools for all children.)

Episode 12: Charlie uses mathematics to pull a clean image from noisy radar data of an unidentified flying object. Signal analysis, on the boundary of mathematics and engineering, is a hot field in which amazing things like this really are possible. However, I was not able to find any actual references to a "Squish-squash" algorithm as he called it on the show. Does anyone know if this is a reference (explicit or implied) to some real algorithm? Anyway, just to give you something to look at, I'll give a link to a famous textbook in the field which you probably won't understand, but since Amazon will let you look at some of the pages you can get the idea that this stuff is real and not just "made for TV": Detection of Signals in Noise.
Episode 13: This episode had a nice segment on what mathematicians call The Monty Hall Problem. As Charlie explains to his class, this is a situation in which normal intuition fails most people and relatively simple mathematics reveals a strategy for winning that works better than you might expect. To try it out yourself, click here to play it for yourself on a page I wrote.

Charlie talks about two other real mathematical things in the show: Markov Chains and Bayesian Analysis. The first of these, as the show explains, is a sequence of events each of which is determined by probability in a way that also depends on the outcome of the prior one. (In some ways, it is the opposite of the extreme case of events which are probabilistically independent.) As for the Bayesian stuff, it was a very contentious topic for a long time! The probability and statistics that most people learned in school and is still used by most scientists is now considered obsolete by many working mathematicians. In the Bayesian approach one keeps track of what one thinks the probability of some statement being true before an experiment to test it is conducted, and then modifies that probability according to the results of the experiment. In theory, this is the way it was always done before...but nobody ever thought about or mentioned the probability before the experiment. Perhaps there is still not 100% agreement, but it now appears that most people would argue that the "classical" approach is inferior in that it makes use of unstated and unevaluated assumptions of the prior probabilities. The main results in Bayesian theory ensure that if you keep track of these probabilities and do enough experiments, you will quickly find the correct answer.


Return to Math in the Arts Page