Probability – Udacity


Here you learned some fundamental rules of probability. Using notation, we could say that the outcome of a coin flip could either be T or H for the event that the coin flips tails or heads, respectively.

Then the following rules are true:

  1. \bold{P(H)} = 0.5
  2. \bold{1 – P(H) = P(\text{not H})} = 0.5
    where \bold{\text{not H}} is the event of anything other than heads. Since, there are only two possible outcomes, we have that \bold{P(\text{not H}) = P(T)} = 0.5. In later concepts, you will see this with the following notation: \bold{\lnot H}.
  3. Across multiple coin flips, we have the probability of seeing n heads as \bold{P(H)^n}. This is because these events are independent.

We can get two generic rules from this:

  1. The probability of any event must be between 0 and 1, inclusive.
  2. The probability of the compliment event is 1 minus the probability of an event. That is the probability of all other possible events is 1 minus the probability an event itself. Therefore, the sum of all possible events is equal to 1.
  3. If our events are independent, then the probability of the string of possible events is the product of those events. That is the probability of one event AND the next AND the next event, is the product of those events.

The Binomial Distribution

The Binomial Distribution helps us determine the probability of a string of independent ‘coin flip like events’.

The probability mass function associated with the binomial distribution is of the following form:

P(X = x) = \frac{n!}{x!(n-x)!}p^x(1-p)^{n-x}

where n is the number of events, x is the number of “successes”, and p is the probability of “success”.

We can now use this distribution to determine the probability of things like:

  • The probability of 3 heads occurring in 10 flips.
  • The probability of observing 8 or more heads occurring in 10 flips.
  • The probability of not observing any heads in 20 flips.

Conditional Probability

In this lesson you learned about conditional probability. Often events are not independent like with coin flips and dice rolling. Instead, the outcome of one event depends on an earlier event.

For example, the probability of obtaining a positive test result is dependent on whether or not you have a particular condition. If you have a condition, it is more likely that a test result is positive. We can formulate conditional probabilities for any two events in the following way:

P(A|B) = \frac{P(A\text{ }\cap\text{ }B)}{P(B)}

In this case, we could have this as:

P(positive|disease) = \frac{P(\text{positive }\cap\text{ disease})}{P(disease)}

where | represents “given” and \cap represents “and”.

Learning Objectives – Conditional Probability

We use the notation where

  • P(A) means “the probability of A”
  • P(\neg A) means “the probability of NOT A”
  • P(A,B) means “the probability of A and B” and
  • P(A|B) means “the probability of A given B.