0% found this document useful (0 votes)
6 views

Lecture 9

This document discusses probability concepts including independent and non-independent events, Bayes' rule, random variables, and discrete and continuous random variables. It provides examples of applying probability concepts to situations like medical testing, drawing cards from a deck, and making free throws in basketball.

Uploaded by

Luna eukharis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Lecture 9

This document discusses probability concepts including independent and non-independent events, Bayes' rule, random variables, and discrete and continuous random variables. It provides examples of applying probability concepts to situations like medical testing, drawing cards from a deck, and making free throws in basketball.

Uploaded by

Luna eukharis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

ECON 225: Data and

Statistics for Economics


Lecture 9
Review: Breast cancer screening example
If a woman in her 20s gets screened for breast cancer and receives a positive
test result, what is the probability that she does have breast cancer?
Review: Breast cancer screening example
If a woman in her 20s gets screened for breast cancer and receives a positive
test result, what is the probability that she does have breast cancer?

She could either have a positive test and have breast cancer or have a positive test but not
have cancer (false positive).
Review: Breast cancer screening example
We use Bayes’s rule, where
A1 is cancer, A2 is no cancer,
and B is a positive test
result.
Review: Breast cancer screening example
• We determined that the probability that a person has cancer given
that they tested positive is only about 0.3% (or 3 in 1000). This seems
very low!
• How do we rationalize this low probability?
• Let's step back a little. Before any screening (testing) was done, there
was only a 4-in-10,000 chance that a randomly selected person in this
population would have cancer.
• The test did its job relative to the unconditional probability in the
population.
Plan for today
• Formal definition of independent events
• Introduction to random variables
• Excel: Normal quantile plot
Definition of independent events
• Recall: A and B are independent when they have no
influence on each other’s occurrence.
• The formal definition of independence is:
• Definition: Two events A and B that both have positive
probability are independent iff P(B|A) = P(B).
• Notice that the multiplication rule for independent events is
a special case of the general multiplication rule. P(A and B) =
P(A)P(B|A) = P(A)P(B).
Example of non-independent events
Let’s use a deck of cards to illustrate independence and dependence.
Suppose that two cards are drawn from a standard deck of playing
cards without replacement. What is the probability that both cards
are spades?
Let A = first card is a spade and let B = next card is a spade.
We want P(A and B).
The multiplication rule tells us that P(A and B) = P(A)*P(B|A).
In this case, we have P(A and B) = (13/52)*(12/51) = 0.0588.
Example of independent events
Now, suppose that two cards are drawn from a standard deck of
playing cards with replacement. What is the probability that both cards
are spades?
Let A = first card is a spade and let B = next card is a spade.
We want P(A and B).
The multiplication rule tells us that P(A and B) = P(A)*P(B|A).
In this case, we have P(A and B) = (13/52)*(13/52) = 0.0625.
You see that the probability of the second card being a spade is not
affected by the first draw. This demonstrates the independence of the
draws when the cards are sampled with replacement.
Example 1: Probability Review
Suppose that a medical test has a 92% chance of detecting a disease if
the person has it and a 94% chance of correctly indicating that the
person does not have the disease when they actually don’t.
Suppose that it is known that 10% of the population have the disease.
What is the probability that a randomly selected person will test
positive? Have disease = 0.1
0.92
Positve 0.092 P (Have disease and Positive)

0.08 Negative 0.008 P (Have disease and Negative)

Population

0.06
Don’t Have disease = 0.9 Positve 0.054 P (Don’t Have disease and Positive)

0.94 Negative 0.846 P (Don’t Have disease and Negative)


Total = 1
Example 1 Solution
Strategy: draw a tree diagram to organize the information given in the
question.

From the tree diagram:


𝑃(𝑃) = 𝑃(𝑃 𝑎𝑛𝑑 𝐷) + 𝑃(𝑃 𝑎𝑛𝑑 𝑛𝑜𝑡 𝐷)
= 𝑃(𝑃|𝐷)×𝑃(𝐷) + 𝑃(𝑃|𝑛𝑜𝑡 𝐷)×𝑃(𝑛𝑜𝑡 𝐷)
= (0.92×0.10) + (0.06×0.90) = 0.146.
Additional Question:
P (Have disease I Positive) = P (Have disease and Positive) / P(Positive)
Summary of probability
• A probability model is composed of: sample space, event
space, and a function defined on the event space that satisfies
the 3 axioms of probability (the probability function)
• Relations between events: disjoint events, independent events,
complement of an event
• Types of probability: joint, marginal, and conditional
• Rules of probability: addition rule (applies to “or”, union);
multiplication rule (applies to “and”, intersection); Bayes’s rule
(for calculating conditional probabilities)
• Formal definition of independence
Random variables
• We use random variables to summarize in a more convenient
way the structure of random experiments
• Recall that a random experiment produces one of several
different outcomes
• All the outcomes are listed in the sample space of the
experiment
• Definition: A random variable is a function that assigns a
real number to each outcome in the sample space
Example of a random variable
• In other words, a random variable is a function from the
sample space S into the real numbers
• E.g. A basketball player shoots three free throws. We define
the random variable X to represent the number of baskets
successfully made.
• The outcome {H, M, M} is mapped to the real number 1.
Other examples of random variables

Experiment Random variable

Toss two dice X = sum of the numbers

Toss a coin 25 times X = number of heads in 25 tosses

Apply different amounts of fertilizer to X = yield/acre

corn plants
The induced probability function
• The random variable 𝑋 defines a new sample space that is
situated in the real numbers
• We use our probability function 𝑃, defined on the original
sample space, to obtain an induced probability function 𝑃! for
the random variable:
• 𝑃! 𝑋 = 𝑥" = 𝑃 𝑠# ∈ 𝑆: 𝑋 𝑠# = 𝑥"
• The above just says that the probability of getting 𝑥" equals the
probability of all the original outcomes that get mapped to 𝑥"
• We call the new probability function the probability distribution
of the random variable
Example of induced probability function
A basketball player shoots three free throws. The random
variable X represents the number of baskets successfully made.
The tree lists all the possible outcomes in terms of
hits and misses. The sample space has 8 elements.

HMM HHM
MHM HMH
MMM MMH MHH HHH

Value of X 0 1 2 3
M = Fail
Probability 1/8 3/8 3/8 1/8 H = success
𝑷𝒙

This table, assigning probabilities to the possible


values of X, is the probability distribution of X.
Free throw example - continued
HMM HHM We can use the probability
MHM HMH distribution to compute the
MMM MMH MHH HHH probability of certain events: What
Value of X 0 1 2 3
is the probability that the player
Probability
successfully makes at least two
1/8 3/8 3/8 1/8
𝑷𝒙 baskets (“at least two” means“two
or more”)?
P(X ≥ 2) = P(X = 2) + P(X = 3) = 3/8 + 1/8 = 1/2

What is the probability that the player successfully makes fewer than three baskets?

P(X < 3) = P(X = 0) + P(X = 1) + P(X = 2) = 1/8 + 3/8 + 3/8 = 7/8 or

P(X < 3) = 1 − P(X = 3) = 1 − 1/8 = 7/8


Discrete random variables
• A discrete random variable 𝑋 has either a finite number of
possible values or a countably infinite number of values
• In general, the probability distribution of a discrete random
variable lists the values and their probabilities. The probabilities
𝑝" must add up to 1.
Note: The probability
distribution of discrete r.v is
also called a probability
mass function (pmf)

• The probability of any event is the sum of the probabilities of


the values of 𝑋 that make up the event.
Continuous random variables
• A continuous random variable 𝑋 takes all values in an interval
• E.g. There is an infinite number of values between 0 and 1
(including 0.4, 0.401, 0.401387777)
• It has an infinite number of possible values.
• The probability distribution of 𝑋 is described by a density curve (or a
probability density function, pdf) pdf = probability density function

• The probability that 𝑋 takes on a specific value is equal to 0. Instead,


we need to consider an interval of values that 𝑋 can take on.
What kind of random variable is it?
Random variable Type of random
Experiment
variable

Toss two dice X = sum of the numbers Discrete

Toss a coin 25 times X = number of heads in 25 tosses Discrete

Apply different X = yield/acre Continuous

amounts of fertilizer

to corn plants
Assigning probabilities: intervals of outcomes
• The probability distribution for a continuous random variable is represented by
a density curve
• The area under the entire density curve is equal to 1
• In order for a curve to represent the probability distribution of a
continuous random variable (a pdf), the total area beneath the curve must
be 1.

normal dist.
Probability of an event with a continuous
random variable
• An event for a continuous random variable is an interval or a union of
intervals
• The probability of any event is given by the area under the density
curve for the interval of values of 𝑋 that make up the event
Example of continuous distribution
• Consider the experiment of asking a random number generator
in software to produce a random number between 0 and 1
• The sample space is S = {all numbers between 0 and 1}
• All possible outcomes are equally likely. The results of many
trials are represented by the density curve of the uniform
distribution.

Total always = 1
Example of continuous distribution -
continued
Probabilities are computed as areas.

P(0.3 £ X £ 0.7) = 0.4 P(X < 0.5 or X > 0.8) = 0.5 + 0.2 = 0.7
Example of continuous distribution -
continued Formula:
P(X = 1) = k-a / b-a

The probability of a single event is zero:


it’s only a line, so that’s
P(X = 1.0) = (1 − 1)*1 = 0 why the area is 0

The probability is unaffected if boundary values


are included or excluded:

P(0 ≤ X ≤ 0.5) = (0.5 − 0)*1 = 0.5

P(0 < X < 0.5) = (0.5 − 0)*1 = 0.5

P(0 ≤ X < 0.5) = (0.5 − 0)*1 = 0.5

We can use complementary events to calculate probability:

P(X < 0.5 or X > 0.8) = P(X < 0.5) + P(X > 0.8) = 1 − P(0.5 < X < 0.8) = 0.7
Continuous random variable and population
distribution
The shaded area under a density
curve shows the proportion, or %, of
individuals in a population with
values of X between x1 and x2.

Because the probability of drawing one


individual at random depends on the
frequency of this type of individual in
the population, the probability is also
the shaded area under the curve.
For next class
• Reading: Alwan 5.4
• For practice: 5.97, 5.99
• Reminder: for the group project, sign your group up on Canvas
• The first midterm is next Tuesday, February 13th
• Midterm topics will be posted on Canvas
• Remember to bring calculator and writing utensils to the midterm

You might also like