You are on page 1of 30

Chapter 8

Wednesday, June 2nd

R d
Random variable
i bl
A random variable assigns a number to
each outcome of a random event.
Classes of random variables:
Discreterandom variables
Continuous random variables
For discrete random variables we can find
probabilities for exact outcomes
For continuous random variables we can
find probabilities only for intervals
Discrete Random
Variables
Notation for Discrete Random
Variables
X is how we denote a random variable
k is a possible outcome for the discrete
random variable
P(X=k) is the probability that X equals k
P b bilit di
Probability distribution
t ib ti ffunction
ti
The probability distribution function
(pdf)) for a discrete random variable is the
(p
rule that assigns probabilities to the
possible outcomes of a random variable.
p
Examples:
The toss of a coin.
coin The pdf is
is

The roll of a die

die. The pdf is
is.
Conditions for Probabilities of
discrete random variables

P X k 1
k

F every k we have
For h

0 P X k 1
C
Cumulative
l ti DiDistribution
t ib ti ffunction
ti
The cumulative distribution function (cdf)
for a random variable X ((that can take
quantitative values) is the rule that assign
probabilities P X k for any
p yppossible
value k
Example: Roll a die
E
Expected
t d value
l
The expected value of a random variable
X is the mean value of the variable in the
sample space.
Example:
I play a game and the probability of winning
\$2 dollars is 0
0.3
3 and the probability of losing
\$1 dollar is 0.7. What is my expected gain in
this game?
Expected value=2*0.3+(-1)*0.7=0.6-0.7=-0.1
F
Formula
l off Expected
E t d value
l
To find the expected value you multiply
each outcome with its p
probability
y and yyou
sum everything.
That is
is,

E X xi P X xi
i
V i
Variance and
d St
Standard
d dD Deviation
i ti

To calculate the variance of a random

p y each xi E X with
2
variable yyou multiply
its probability and then you sum the result.
That is,,
xi E X P X xi
2

Remember to find the standard deviation

j t ttake
just k the
th square roott off the
th variance
i
E
Example
l
A car insurance wants to know on average
how many y car accidents a customer has
each year. They collect data for one year
and the result is as follows.
0 accidents 70% of the customers
1 accident 23% of the customers
2 accidents 6% of the customers
3 accidents 1% of the customers
E
Example
l
What is going to be the expected number
of accidents for each customer based on
those data?

What is going to be the standard deviation

of the accidents of each customer?
Bi
Binomial
i l random
d variables
i bl
Binomial Experiments are those that have only
two possible outcomes that are denoted by 0
and 1 or failure and success.
A binomial experiment is defined as follows:
Number of trials, denoted by n
Two possible outcomes, success and failure
Each
E h ttrial
i l iis iindependent
d d t off th
the other
th
Probability of success denoted by p, and probability of
failure is denoted byy 1-p.p
We denote with X the number of successes
E
Examples
l
Toss of a coin:
Roll of a die:
Possible outcomes: Even number
number, odd
number
Birth of a child:
Possible outcomes: Boy, Girl
Fi di Bi
Finding Binomial
i lPProbabilities
b biliti
Use the formula:

n!
P X k p 1 p
k nk

k ! n k !
E
Expected
t d value
l and
d variance
i
When we have a Binomial distribution, the
expected
p value is calculated as:
E X np

The variance is calculated as:

Var X np 1 p
E
Example
l
I play a game 10 times. The probability I
win the ggame is 0.2.
I denote with X the number of times I won
the game
game.
What is n?
What
Wh t isi p?
?
How to calculate P(X=3)?
E
Example
l
What is going to be E(X)?

Wh t iis going
What i tto b
be V
Var(X)?
(X)?
Continuous Random
Variables
C ti
Continuous R
Random
d V
Variables
i bl
Continuous random variable are those for
which the outcome can be any y value in an
interval.
The probability density function for a
continuous random variable is a curve so
that the area under the curve is the
probability that the random variable
belongs to that interval
P b bilit ffor continuous
Probability ti variables
i bl

If X is a continuous variable then:

P(X
P(X=k)=0
k) 0
We can measure the probability in intervals.
For example:
p We want to measure the
probability that a man has height between 60
and 65 inches, that is:
P 60 X 65
U if
Uniform di
distribution
t ib ti
One way to describe probabilities for
continuous random variables is by using
uniform distribution
One example is for example, if you know
that there is a bus coming to a bus station
every 20 minutes, then there is a constant
probability for waiting time in the interval 0
to 20.
E
Example
l
If we use the probability example:
Draw the probability distribution function.

Find the probability you are waiting between 4

and 12 minutes.
N
Normal
l curves
Remember Normal curve from Chapter 2.
Normal curve is used to describe some
continuous random variables
Properties:
Symmetric, bell shaped
We
W describe
d ib it using
i ththe mean value
l andd
the standard deviation
P X d P X d
E ii lR
Empirical Rule
l

P X 0.68
0 68
P 2 X 2 0.95
0 95
P 3 X 3 0.997
0 997
C l l ti a z-score
Calculating
Remember from Chapter 2 what we need
to do to convert any
y value from a normal
curve to the standard normal curve. We
need to standardize it using
g the formula
Score mean x
z
S d d deviation
Standard d
T bl
Tables
Example:
Let say, that the height of women have a normal
curve with mean 65 and standard deviation of 5
inches.
What is the probability of a woman being shorter than
60 iinches?
h ?
What is the probability that a woman is taller than 67
inches?
What is the probability that a woman is between 60
and 67 inches?
What is the probability that a woman is taller than 70
inches?
T bl
Tables
What is the height so that 25% of the women
are shorter than that height?
What the height of a woman should be in
order to be taller than at least 30% of all
women
Approximating binomial distribution
probabilities using normal distribution
If I flip a coin 100 times and denote with X
the number of times I g get a Head.
What is the distribution of X?

What difficulties we might have in this case?

Normal approximation to the
Binomial Distribution
So if X is a Binomial Distribution with n
number of tries and p probability
y of success
p then X can be approximated by a normal
distribution with mean npp and standard
deviation np 1 p

CONDITIONS:
10 n 1 p 10
np 10,