Numb3rs 504: Jack of All Trades

In this episode, the FBI is helping to track down a young man who charms his way into different companies, only to break into their computer system and steal money. He starts with small amounts, then he cleans out the accounts. He also hacks into the personnel records and social security information, before moving on to the next job. The team suspects he might be involved with an Eastern European syndicate, as the inside man. Charlie suggests applying a belief propagation model, also known as a Bayesian network, to try to connect the suspect back to known syndicates. The idea of this modeling is to take all the information you have, and create a graph showing which factors affect which others, and how strongly.

In order to understand belief propagation models, we first need to go over some basic probability. Say we have two coins to toss. Each has an equal probability of landing on either heads or tails. Let event A be “coin 1 lands on heads” and event B be “coin 2 lands on tails.” Then we use the notation P(A)=1/2 and P(B)=1/2. We have the following possible outcomes:

1 heads

1 tails

2 heads



2 tails



Say we flip coin 2 first. We want to consider the conditional probability of event A occurring, given that event B has occurred, that is we want to know how likely it is that coin 1 lands on heads, knowing that coin 2 has landed on heads. We use the notation P(A|B) to mean "the probability of A, given B". Here of course, coin 1 is independent of coin 2, so P(A|B) =1/2.

Next we will consider the joint probability that two events occur at the same time, denoted P(A,B). Looking at the chart, we can see that there is only one outcome that satisfies both A and B, so P(A,B)=1/4. These two types of probability are related by the following formula:

Note that by symmetry, we also have the formula

We can solve this for P(A,B) and substitute into the previous formula to get Bayes’ Theorem:

Let’s do some examples. Say that you are a student, and there is a 20% chance that the teacher will be absent and have a substitute.

We also know that on the days that the teacher is present, there is a 50% chance of her giving a pop quiz. If she is absent, there is a 75% of a pop quiz. Now, the question we want to answer is, what is the overall probability that there will be a pop quiz today? We want to create a table of information to help us understand all of the probabilities involved.




Pop Quiz

No Quiz


Now let’s check your answers:




Pop Quiz

(0.50) (80) = 40

(0.75)(20) = 15


No Quiz

(0.50)(80) = 40

(0.25)(20) = 5






Let’s write a formula for the answer we wanted:

P(quiz) = P(quiz|present) P(present) +P(quiz|absent)P(absent)

A Bayesian Network is a graphical model that represents variables and their relationships. We use arrows to indicate which variables affect others. Let us expand our previous example to include more factors:

Without calculating anything, we can figure out relationships between variables. For example, whether or not it is snowing affects the chances of there being a pop quiz today, but there is no correlation between the teacher’s car being broken and school being cancelled.

Similar (but more involved) calculations to the ones you did earlier give answers to questions like “If there is a pop quiz, then what is the probability that it is snowing?”