Conditional probability and independent events; Bernoulli trial (CSCI 2824, Spring 2015)

Topic covered:

  • conditional probability

  • independent events

  • Bernoulli trial

(Sections 6.2 and 6.3 of the book)

Conditional probability

Often times we are interested in the probability of an event under the assumption that some other event happens. This can be encapsulated by the notion of conditional probability.

Conditional probability

Given two events E_1 and E_2 in the same sample space, the probability of E_1 given that E_2 happens is defined as the ratio

    mathrm{Prob}(E_1,|, E_2)    triangleq     mathrm{Prob}(E_1,text{ given }, E_2)    triangleq     frac{mathrm{Prob}(E_1cap E_2)} {mathrm{Prob}(E_2)}.

Example 1

Suppose that from a standard deck of 52 playing cards, we draw five cards without ordering. What is the probability of getting a straight flush if one of the cards has to be a diamond 5?

(A straight flush is a set of 5 consecutive cards from the same suit. This excludes the case where we have 10, J, Q, K, A from the same suit (a.k.a. royal flush).)

Note that the probability of getting a straight flush is

    frac{4times, #text{ straight flush from a specific suit}}    {#text{ 5-combinations from a standard deck}}    = frac{4times 9}{C(52,5)}.
Answer
  • Define the following notations for the two events:

    • E_1: getting a straight flush;

    • E_2: getting a diamond 5.

  • There are only 5 straight flushes that contain a diamond 5. So |E_1 cap E_2|=5. Hence mathrm{Prob}(E_1 cap E_2)= displaystylefrac{5}{C(52,5)}.

  • On the other hand, mathrm{Prob}(E_2)=frac{1}{52}.

  • Hence

    mathrm{Prob}(E_1,|, E_2) =     frac{mathrm{Prob}(E_1 cap E_2)}{mathrm{Prob}(E_2)}    = frac{52times 5}{C(52,5)}.

Independent events

Intuitively, we say that two events are independent if the occurrence of one event is independent of the occurrence of the other event. We can formalize this idea using conditional probability.

Independent events

Two events E_1 and E_2 from the same sample spaces are said to be independent if one of the following conditions holds:

  • mathrm{Prob}(E_1,|,E_2) = mathrm{Prob}(E_1).

  • mathrm{Prob}(E_2,|,E_1) = mathrm{Prob}(E_2).

  • mathrm{Prob}(E_1cap E_2) = mathrm{Prob}(E_1)mathrm{Prob}(E_2).

Simple examples of independent and dependent events:

  • Experiment: throwing a die for 2 times in a row

    • Event 1: The first number is even.

    • Event 2: The second number is even.

    • These two events are independent.

  • Experiment: drawing two cards from a deck without replacement

    • Event 1: One card is a face

    • Event 2: One card is not a face

    • These two events are not independent. (See Example 3 below.)

Example 2

Suppose we throw a fair die and draw a card at random from a standard deck. What is the probability that in both cases we get an even number?

Answer

The number of possible outcomes where we get an even number in both cases is 3times 20.

Hence the required probability is

 frac{3times 20}{6times 52} = frac{3}{6}frac{20}{52},

which equals the probability of getting an even number from the die times the probability of getting an even numbered card.

In particular (as we would expect), the events of getting an even number from a die and getting an even numbered card are independent.

Example 3

Suppose we draw two cards from a standard deck without order. Consider the following two events:

  • E_1: one card is red.

  • E_2: one card is black.

Obviously,

 mathrm{Prob}(E_1)=mathrm{Prob}(E_2)=frac{26}{52}.

On the other hand,

 mathrm{Prob}(E_1cap E_2) = frac{26times 26}{52times 51} neq mathrm{Prob}(E_1)mathrm{Prob}(E_2).

So the two events (in the experiment of drawing two cards) are not independent!

Example 4

Let's say we randomly pick a person from the Colorado population. Of course, exactly one of the following holds for that person:

  • E_1: He/she has lung cancer and is a smoker.

  • E_2: He/she has lung cancer and is not a smoker.

  • E_3: He/she does not have lung cancer and is a smoker.

  • E_4: He/she does not have lung cancer and is not a smoker.

Suppose we know the probability of that a randomly drawn person falls into one of these categories, as follows:

lung cancer no lung cancer
smoker mathrm{Prob}(E_1)=0.12mathrm{Prob}(E_3)=0.04
non-smoker mathrm{Prob}(E_2)=0.03mathrm{Prob}(E_4)=0.81

While in our example, these probabilities are entirely hypothetical, in real life we do often hear of probabilities as such. They usually are estimates based on statistics drawn from a fraction of the population. We will not go into details on the frequentist approaches in ‘‘estimating’’ the ‘‘probabilities’’ of real life events, but once the ‘‘probabilities’’ are available we can compute conditional probabilities etc.

Then what is the probability that a person has lung cancer given that heshe is a smoker/?

Answer

The required probability is

    mathrm{Prob}( E_1cup E_2 ,|, E_1cup E_3 )  = frac{mathrm{Prob}(E_1)}{mathrm{Prob}(E_1cup E_3)}  = frac{0.12}{0.12+0.04} = 0.75.

Note that mathrm{Prob}( E_1cup E_2 ,|, E_1cup E_3 )=0.75 is much bigger than mathrm{Prob}(E_1cup E_2)=0.15.

Bernoulli trials

First we look at an example.

Example 5: flipping a loaded coin multiple times

Suppose we have a loaded coin, where

  • mathrm{Prob}(H) = frac{1}{3},

  • mathrm{Prob}(T) = frac{2}{3}.

What is the probability of getting exactly one head in four consecutive flips of the coin?

Note that there are four different outcomes that can produce exactly one H:

  • HTTT,

  • THTT,

  • TTHT,

  • TTTH,

each occuring with the probability frac{1}{3}timesfrac{2}{3} timesfrac{2}{3}timesfrac{2}{3}. Hence the probability of getting one head in four consecutive flips is

 4timesfrac{1}{3}left(frac{2}{3}right)^3.

General Bernoulli trials

In general, suppose we perform repeatedly n independent trials, each of which has exactly two outcomes, success (s) and failure (f), with respective probability

    mathrm{Prob}(s) = alpha,       mathrm{Prob}(f) = 1-alpha,

for some alphain [0,1]. We can talk about the probability of getting exactly k successes out of the n independent trials — which turns out to depend on the binomial coefficients.

Independent trials with Boolean outcome

Let ngeq1 and 0leq kleq n be integers. The probability of getting exactly k successes in n independent trials, each with success probability alpha, is

    C(n,k) alpha^k (1-alpha)^{n-k}.

Example 6

We again consider the loaded coin from Example 5. The probability of getting exactly 4 heads out of ngeq4 consecutive flips is

 C(n,4) left(frac{1}{3}right)^4 left(frac{2}{3}right)^{n-4} =frac{n(n-1)(n-2)(n-3)}{24} frac{2^{n-4}}{3^n}.

Example 7

Suppose we flip a fair coin 10 times. Then the probability of getting exactly 3 heads is

    C(10,3)left(frac{1}{2}right)^3left(frac{1}{2}right)^7,

and the probability of getting at most 3 heads is

    left(frac{1}{2}right)^{10}left(C(10,0)+C(10,1)+C(10,2)+C(10,3right).

Note that the probability of getting at most 10 heads out of 10 flips is

    left(frac{1}{2}right)^{10}left(C(10,0)+C(10,1)+cdots+C(10,10)right),

which equals 1 (in line with our intuition) because in general

    sum_{r=0}^n C(n,r) = 2^n,   text{for any positive integer }n.