Chapter 5: Random Variables and Discrete Probability Distributions

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 50

Chapter 5: Random Variables and Discrete

Probability Distributions

http://www.landers.co.uk/statistics-cartoons/

5.1 1
5.1-5.2: Random Variables - Goals
• Be able to define what a random variable is.
• Be able to differentiate between discrete and
continuous random variables.
• Describe the probability distribution of a discrete
random variable.
• Use the distribution and properties of a discrete
random variable to calculate the probability of an
event.

5.1 2
Random Variables
A random variable, r.v., is a function that assigns a
unique numerical value to each outcome in a
sample space.
Random variables are listed as A, B, etc.
The rule for a random variable may be given by a
formula, a table, or words.
Random variables can either be discrete or
continuous.

5.1 3
Probability Distribution of a Random
Variables
• The probability distribution of a random
variable gives all of its possible values and the
probabilities for each of them.

5.2a 4
Probability Distribution of a Random
Variables
• Probability mass function (pmf) is the
probability that a discrete random variable is
equal to some specific value.

In symbols, p(x) = P(X = x)


Outcome x1 x2 …
probability p1 p2 …

5.2a 5
Examples: Probability Histograms
#1

5.2a 6
Properties of a Valid Probability Distribution

1. 0 ≤ pi ≤ 1

5.2b 7
Example: Discrete Random Variable
In a standard deck of cards, we want to know
the probability of drawing a certain number of
spades when we draw 3 cards with replacement.
Let X be the number of spades that we draw.
a)What is the distribution?

5.2c 8
Example: Discrete Random Variable
Probability Probability
SSS
NSS
SSN
SNS NNS
SNN
NSN

NNN

Value 0 1 2 3
Probability

5.2c 9
Example: Discrete Random Variable
Value 0 1 2 3
Probability

Spades Example
Probability

0.5
0.3
0.1
-0.1
0 1 2 3
Number of Spades

5.2c 10
Example: Discrete Random Variable
Value 0 1 2 3
Probability

b) Is this a valid distribution?

5.2c 11
Example: Discrete Random Variable
Value 0 1 2 3
Probability

c) What is the probability that you will draw at


least one spade?

5.2c 12
Example: Discrete Random Variable
Value 0 1 2 3
Probability

d) What is the probability that you draw more


than two spades?

5.2c 13
5.3: Mean, Variance, and Standard Deviation for a
Discrete Variable - Goals
• Be able to use a probability distribution to find the mean of
a discrete random variable.
• Calculate means using the rules for means (not in the book)
• Be able to use a probability distribution to find the variance
and standard deviation of a discrete random variable.
• Calculate variances (standard deviations) using the rules for
variances for both correlated and uncorrelated random
variables (not in the book)

14
Formula for the Mean of a Random Variable

n≥m

15
Rules for Means
Rule 1: If X is a random variable and a and b are
fixed numbers, then:
µa+bX = a + bµX

Rule 2: If X and Y are random variables, then:


µXY = µX  µY

Rule 3: If X is a random variable and g is a function


of X, then:

5.3a2 16
Example: Expected value
What is the expected value of a fair 4-sided die?
X 1 2 3 4
Probability 0.25 0.25 0.25 0.25

E(X) = (1)(0.25) + (2)(0.25) + (3)(0.25) + (4)(0.25)


= 2.5

5.3b 17
Example: Expected Value 1
An individual who has automobile insurance from a
certain company is randomly selected. Let X be the
number of moving violations for which the individual was
cited during the last 3 years. The distribution of X is
X 0 1 2 3
px 0.60 0.25 0.10 0.05
a) Verify that E(X) = 0.60.
E(X) = (0)(0.60) + (1)(0.25) + (2)(0.10) + 3(0.05) = 0.6

5.3c 18
Example: Expected Value 1
An individual who has automobile insurance from a
certain company is randomly selected. Let X be the
number of moving violations for which the individual was
cited during the last 3 years. The distribution of X is
X 0 1 2 3
px 0.60 0.25 0.10 0.05
b) If the cost of insurance depends on the following
function of accidents, g(x) = 400 + (100x -15), what is
the expected value of the cost of the insurance?
E(a + bx) = 400 + 100(E(X)) – 15 = 400 + 100(0.6) – 15 = 445

5.3c 19
Example: Expected Value 2
Five individuals who have automobile insurance from a
certain company are randomly selected. Let X and Y be two
different accident profiles in this insurance company:
X 0 1 2 3
px 0.60 0.25 0.10 0.05 E(X) = 0.60
Y 0 1 2 3
E(Y) = 0.95
pY 0.40 0.35 0.15 0.10
What is the expected value of the total number of accidents
of the people if 2 of them have the distribution in X and 3
have the distribution in Y?
E(2X + 3Y) = 2E(X) + 3E(Y) = 2(0.60) + 3(0.95) = 4.05

5.3c 20
Example: Expected Value 3
An individual who has automobile insurance form a
certain company is randomly selected. Let X be the
number of moving violations for which the individual
was cited during the last 3 years. The distribution of
X is
X 0 1 2 3
px 0.60 0.25 0.10 0.05 E(X) = 0.60
Calculate E(X2).
E(X2) = (0)2(0.60) + (1)2(0.25) + (2)2(0.10) + 32(0.05) =
1.1

5.3c 21
Variance of a Random Variable

= E(X2) – (E(X))2

5.3d 22
Rules for Variance

Rule 1: If X is a random variable and a and b are fixed


numbers, then:
σ2a+bX = b2σ2X
Rule 2: If X and Y are independent random variables,
then:
σ2XY = σ2X + σ2Y

Rule 3: If X and Y have correlation ρ, then:


σ2XY = σ2X + σ2Y  2ρσ5.3dXσY 23
Example: Variance 1
An individual who has automobile insurance form a
certain company is randomly selected. Let X be the
number of moving violations for which the individual
was cited during the last 3 years. The distribution of X
is X 0 1 2 3
px 0.60 0.25 0.10 0.05
a) Calculate Var(X).
E(X) = 0.60 E(X2) = 1.1
Var(X) = E(X2) – (E(X))2 = 1.1 – 0.62 = 0.74

5.3e 24
Example: Variance 2
An individual who has automobile insurance form a certain
company is randomly selected. Let X be the number of
moving violations for which the individual was cited during
the last 3 years. The distribution of X is
X 0 1 2 3
px Var(X) = 0.74
0.60 0.25 0.10 0.05
b) If the cost of insurance depends on the following function
of accidents, g(x) = 400 + (100x -15), what is the standard
deviation of the cost of the insurance?
Var(g(X)) = 1002(Var(X)) = 1002(0.74) = 7400

5.3e 25
Example: Variance 3
5 individuals who have automobile insurance from a certain
company are randomly selected. Let X and Y be two different
independent accident profiles in this insurance company:
X 0 1 2 3
px 0.60 0.25 0.10 0.05 Var(X) = 0.74

Y 0 1 2 3 Var(Y) = 0.9475
pY 0.40 0.35 0.15 0.10
What is the standard deviation of the (2X – 3Y)?

5.3e 26
5.4/5.5: Binomial and Poisson Distributions - Goals
• Determine when the random variable X can be
modeled using the binomial or Poisson
Distributions.
• Calculate the probability, mean and standard
deviation when X has a binomial or Poisson
distribution.

5.4a 27
Properties of a Binomial Experiment - BInS
• Binary: There are only two possible outcomes
for each trial.
• Independent: The outcomes of the trials are
independent.
• n: The experiment consists of n identical trials
where n is fixed.
• Success: For each trial, the probability p of
success must be the same. P(S) = p

5.4a 28
Binomial Experiment: Example
Do the following use the Binomial Experiment?
1. Rolling a fair 4-sided die five times and observing
whether the number showing is a 1 or not.

B: yes
I: yes
n: yes
S: yes

5.4b 29
Binomial Experiment: Example
Do the following use the Binomial Experiment?
2. In a drug trial, 20 patients with the same
condition are given either a drug or a placebo to
see if the drug is effective or not.

B: no
I: yes
n: yes
S: yes

5.4b 30
Binomial Experiment: Example
Do the following use the Binomial Experiment?
3. In quality control, we want to see if a particular
product is ‘not acceptable’. We take 15 random
samples from an assembly line that uses different
machines to produce the product.

B: yes
I: yes
n: yes
S: no

5.4b 31
Binomial Distribution
The binomial random variable maps each
outcome in a binomial experiment to a real
number, and is defined to be the number of
successes in n trials.
• X ~ B(n, p)

5.4c 32
Binomial Probabilities
Suppose X is a binomial random variable with n
trials and probability of a success p. Then

5.4c 33
=.959

E(X) = np = .13*23=2.99

5.1 34
Example: Binomial Distribution
Suppose 20% of all copies of a particular
textbook fail a certain binding strength test.
Let's check a batch of 15 such textbooks.
a) Is this a binomial distribution?
n = 15 p = 0.2

5.4d 35
Example: Binomial Distribution
Suppose 20% of all copies of a particular
textbook fail a certain binding strength test.
Let's check a batch of 15 such textbooks.
b) What is the probability that there are no
defective textbooks?

5.4d 36
Example: Binomial Distribution
Suppose 20% of all copies of a particular textbook
fail a certain binding strength test. Let's check a
batch of 15 such textbooks.
c) What is the probability that we get less than 3
defective textbooks?

5.4d 37
Example: Binomial Distribution
Suppose 20% of all copies of a particular
textbook fail a certain binding strength test.
Let's check a batch of 15 such textbooks.
d) What is the probability that we get more than
2 defective textbooks?

P(X > 2) = 1 – P(X  2) = 1 – P(X < 3)


= 1 – 0.3980 = 0.6020

5.4d 38
Histograms of Binomial Distributions
0.3
0.25 n = 10 0.25
0.3
n = 10
0.2
p = 0.25
0.2
p = 0.5
P(X=x)

P(X=x)
0.15 0.15
0.1 0.1
0.05 0.05
0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
Number of successes Number of successes

0.3
0.25
0.2
n = 10
p = 0.75
P(X=x)

0.15
0.1
0.05
0
0 1 2 3 4 5 6 7 8 9 10
Number of successes

5.43 39
Cumulative Distribution Function (CDF)

The Cumulative Distribution Function is defined


as the following probability: P(X ≤ x).

5.43 40
Binomial Distribution: Mean and Standard
Deviation
If X ~ B(n,p) then
E(X) = X = np

5.43 41
Example: Binomial Distribution (cont.)
Suppose 20% of all copies of a particular
textbook fail a certain binding strength test.
Let's check a batch of 15 such textbooks.
e) What are the mean and standard deviation of
the number of textbooks that will fail the
binding test?
μ = np = (15)(0.2) = 3

5.4f 42
Poisson Random Variable
• The Poisson random variable is a count of the
number of times the specific event occurs
during a given interval.

5.5a 43
Poisson Random Variable
• Example:
– The number of people who enter the Union
from noon to 1 pm.
– The number of α-particles emitted from
Uranium-238 in 1 minute.
– The number of DNA fragments found from a
sequencing experiment.
– The number of dead trees in a square mile of
forest.

5.5a 44
Poisson Experiment
1. The probability that a particular event will occur
in a given interval (of time, length, volume, etc.) is
the same for all units of equal size and the rate is
proportional to the size of the unit.
2. The number of events that occur in any interval is
independent of the number that occur in any
other non-overlapping interval.
3. The probability that more than one event occurs
in a unit of measure is negligible for very small-
sized units.

5.5b 45
’ = 5.3=5.3*1.9=10.07

5.1 46
Poisson Distribution

 X = 2 = 

’ = 2

5.5b 47
Example: Poisson Distribution
An IT consultant receives an average of 3 calls per
hour. Let X be the number of calls the consultant
receives. Assume X follows a Poisson distribution.
=3
a) What is the probability that the consultant
receives exactly one call during the next hour?

5.5c 48
Example: Poisson Distribution
An IT consultant receives an average of 3 calls per
hour. Let X be the number of calls the consultant
receives. Assume X follows a Poisson distribution.
=3
b) What is the probability that the consultant
receives more than one call during the next hour?
P(X > 1) = 1 – P(X  1) = 1 - P(X = 0) – P(X = 1)
= 1 - - 0.14936 = 1 – 0.04979 – 0.14936
= 0.80085

5.5c 49
Example: Poisson Distribution
An IT consultant receives an average of 3 calls per
hour. Let X be the number of calls the consultant
receives. Assume X follows a Poisson distribution.
=3
c) What is the probability that the consultant
receives exactly 5 calls during the next two
hours?
’ = 2 = 2(3) = 6

5.5c 50

You might also like