Monday, February 11, 2013

Discrete Math - Day 18

Today's focus was on conditional probability, independence and Bayes Theorem.

We first looked at some simple examples and students were asked what common characteristics they saw across the problems. Besides making connections to ordinary probability they observed that constraints were being placed on the problem through the given portion of the problem statement.

Conditional probability was defined informally, notation was given, P(A | B), and several examples were provided. The class worked through these and the results were discussed. These problems are intended to build conceptual understanding so students can easily see how their sample space is being altered by the given in the problem.

Students practiced on several problems. These problems set up the ability to explore the idea of independence. Two definitions of independence were given:

     P(A and B) = P(A) x P(B)     or     P(A | B) = P(A)

These are equivalent definitions, using one it can be shown that the other must hold.

Students then were asked to use these definitions to show independence in two of the problems just worked on. They then used the general multiplication rule P(A and B) = P(A) x P(B | A) to calculate the probabilities both way to determine independence. This was followed by calculating probabilities that were not independent.

Although these problems are somewhat simplified, the purpose of having students work through these is so they can connect the formulas, calculations, and results. These problems are building toward Bayes theorem. There needs to be a certain level of comfort with how conditional probabilities work before diving into Bayes theorem.

To get to Bayes theorem, the equivalent forms of P(A and B) are set equal to each other

     P(A and B) = P(B) x P(A | B) = P(A) x P(B | A)

Then, algebraically, we get

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

This effectively reverses the conditional statement, i.e. we start with knowing the probability of B given the event A and we can reverse the relationship to now determine the probability of A given the event B.

A simple example using to boxes containing red and green balls can be used to illustrate the theorem.
We are given a green ball and ask the question, "What is the probability the ball was drawn from the first box?"

In this example, event A is being drawn from the first box and event B is a green ball being drawn. We need to use the fact that box 1 contains 2 green and 5 red balls and box 2 contains 4 green and 5 red balls. We calculate the following:

     P(a ball being drawn from box 1) = P(A) = 7 / 16
     P(a green ball | the ball is drawn from box 1) = P(B | A) = 2/7
     P(a green ball) = 6/16

Bayes theorem states:

     P(a ball drawn from box 1 | a green ball) = 7/16 x 2/7 / 6/16 = 2/6 = 1/3

Students are a bit intimidated the first couple of times working through a problem like this but do build confidence and comfort the more problems they tackle.

I then referenced that email spam filters are based on Bayes theorem. An email is received and based on characteristics that are present in the email a probability is attached as to how likely the email is spam:

     P(spam | characteristics present in the email)

Bayes theorem is used in forensics and investigations as well. This brings back the issues raised in the video we watched on the first day. There was not time to discuss this aspect in today's class but it will make a nice connection as we proceed ahead.

We concluded with students recording their thoughts about conditional probabilities and independence. The next class will focus on working through some problems to gain procedural fluency.

Visit the class summary for a student's perspective and to view the lesson slides.

No comments:

Post a Comment