Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Probability Distributions
Finite Random Variables
Probability Distributions
Recall a Random Variable was:
numerical value associated with the outcome of an
experiment that was subject to chance
Examples:
The number of heads that appear when flipping three coins
The sum obtained when two fair dice are rolled
Value of an attempted loan workout
Finite Random Variables
Types of random variables:
Finite Random Variable:
Can only assume a countable number of values (i.e.
they can all be listed)
Examples
Flipping a coin three times & recording # of heads
Rolling a pair of dice & recording the sum on each roll
Finite Random Variables
Types of Random Variables (cont):
Continuous Random Variable:
Can assume a whole range of values which cannot be
listed:
Examples:
Arrival times of customers using an ATM at the start of the
hour
Time between arrivals
Length of service at an ATM machine
We’ll first look at finite random variables
Finite Random Variables
Ex: Suppose we flip a coin 3 times and record
each flip. Let X be a random variable that
records the # of heads we get.
S HHH , HHT , HTH, HTT ,THH,THT ,TTH,TTT
What are the possible values of X?
Finite Random Variables
X can be 0, 1, 2, or 3
Notice that we can list all possible values of the
random variable X
This makes X a finite random variable
Finite Random Variables
Recall
P X x
Told us the probability the random variable X
(upper case) assumed a certain value x (lower case)
List all possible values of x (lower case) and
their probabilities in table
x
0
1
2
3
P (X=x )
0.125
0.375
0.375
0.125
Finite Random Variables
Notice each value of the random variable has
one probability associated with it
For a finite random variable we call this the
probability mass function
Abbreviated (p.m.f.)
x
0
1
2
3
P (X=x )
0.125
0.375
0.375
0.125
Finite Random Variables
Why a function?
Each value of the random variable has exactly one
probability assigned to it
Since this is a function, the following are equivalent
for a finite random variable:
fX x P X x
Finite Random Variables
Like any function, the p.m.f. for a finite random
variable has several properties:
Domain: discrete numbered values
(e.g. {0, 1, 2,3} )
Range:
Sum:
0 fX x 1
f x 1
X
All x
Finite Random Variables
If we graph a p.m.f., should be a histogram with sum
of all heights equal to 1
P(X=x)
0.4
0.3
0.2
P(X=x)
0.1
0
0
1
2
3
X=x
Each bar height corresponds to P(X=x)
Finite Random Variables
Cumulative Distribution Function
Abbreviated c.d.f.
Determines probability of all events occurring up to
and including a specific event
FX x P X x
Finite Random Variables
Ex: Find FX 0 from our coin problem. Do the
same for FX 2 and FX 1.7
Sol:
FX 0 P X 0 0.125
FX 1.7 P X 1.7 P X 0 P( X 1) 0.5
FX 2 P X 2 P X 0 P X 1 P X 2 0.875
Finite Random Variables
Notice:
Interval
(-∞,0)
FX(x) = P(X≤x)
0
[0,1)
0.125
[1,2)
0.125 + 0.375=0.500
[2,3)
0.125+0.375+0.375=0.875
[3,∞)
0.125+0.375+0.375+0.125=1
Finite Random Variables
The last table is describing a piece-wise
function:
0
0.125
FX x 0.500
0.875
1
if
x0
if 0 x 1
if 1 x 2
if
2 x3
if
x3
Finite Random Variables
The graph of the c.d.f.
F(X)
-6
-5
-4
-3
-2
1.125
1
0.875
0.75
0.625
0.5
0.375
0.25
0.125
0
-1
0
X=x
1
2
3
4
5
6
Finite Random Variables
Notice for the c.d.f. of a finite random variable
Graph is a step-wise function
Domain is all real #s
Graph never decreases
Approaches 1 as x gets larger
Finite Random Variables
Ex. Use the sample space for rolling two dice to
graph P X x .
(1,1)
( 2 ,1)
( 3,1)
S
( 4 ,1)
(5,1)
( 6,1)
(1, 2 )
(2, 2)
( 3, 2 )
(4, 2)
(5, 2 )
( 6, 2 )
(1, 3)
( 2 , 3)
( 3, 3)
( 4 , 3)
(5, 3)
( 6, 3)
(1, 4 )
(2, 4)
( 3, 4 )
(4, 4)
(5, 4 )
( 6, 4 )
(1, 5)
( 2 , 5)
( 3, 5)
( 4 , 5)
(5, 5)
( 6, 5)
(1, 6) ü
( 2 , 6)
( 3, 6)
ý
( 4 , 6)
(5, 6)
( 6, 6) þ
Finite Random Variables
Soln.
x
1
2
3
4
5
6
7
8
9
10
11
12
13
P (X =x )
0.0000
0.0278
0.0556
0.0833
0.1111
0.1389
0.1667
0.1389
0.1111
0.0833
0.0556
0.0278
0.0000
0.18
0.16
0.14
0.12
0.10
0.08
0.06
0.04
0.02
0.00
1
2
3
4
5
6
7
8
9
10
11
12
13
Finite Random Variables
Ex. Find fX 3 in the previous example. Find fX 7
in the previous example. Find fX 2.7 in the
previous example.
Soln.
x
1
2
3
4
5
6
7
8
9
10
11
12
13
P (X =x )
0.0000
0.0278
0.0556
0.0833
0.1111
0.1389
0.1667
0.1389
0.1111
0.0833
0.0556
0.0278
0.0000
fX 3 0.0556
fX 7 0.1667
fX 2.7 0
Finite Random Variables
Remember: Cumulative distribution function
adds probabilities up to and including a certain
value
Ex. FindFX 3 in the previous example. Find FX 7
in the previous example. Find FX 2.7 in the
previous example.
Finite Random Variables
Soln.
x
1
2
3
4
5
6
7
8
9
10
11
12
13
P (X =x )
0.0000
0.0278
0.0556
0.0833
0.1111
0.1389
0.1667
0.1389
0.1111
0.0833
0.0556
0.0278
0.0000
FX 3 P X 3
0 0.0278 0.0556
0.0833
FX 7 P X 7
0 0.0278 ... 0.1667
0.5833
FX 2.7 P X 2.7
0 0.0278
0.0278
Finite Random Variables
• Sample c.d.f.
Cummulative Distribution Function
1.2
1
0.8
0.6
0.4
0.2
0
-0.2
0
1
2
3
4
5
6
7
8
9
10
Finite Random Variables
Notice the graph starts at height 0
Notice the graph ends at height 1
The graph “steps” to next height
The size of each “step” corresponds to the value
of the p.m.f. at that x-value
Finite Random Variables
The bullet on the last slide gives us the ability
to:
p.m.f.
c.d.f
Finite Random Variables
Binomial Random Variable
Special type of finite r.v.
Collection of Bernoulli Trials
Bernoulli Trial is an experiment with only 2 possible
outcomes
Each trial is independent
Finite Random Variables
Excel has a built in Binomial R.V. function
BINOMDIST
Finite Random Variables
Ex: Suppose we flip a biased coin whose probability of
landing heads is 0.7. Let’s say we do this 3 times and
record each flip. Let X be a random variable that
records the # of heads we get.
S HHH , HHT , HTH, HTT ,THH,THT ,TTH,TTT
This is an example of a binomial random variable
Finite Random Variables
In Excel:
X=x
0
1
2
3
P(X=x)
0.027
0.189
0.441
0.343
This is the p.m.f
How many
times you
perform the
experiment
Value of Random
Variable
Probability of
success on
each trial
FALSE (p.m.f) ;
TRUE (c.d.f)
Finite Random Variables
In Excel:
X=x
0
1
2
3
This is the c.d.f
F(X)
0.027
0.216
0.657
1
Finite Random Variables
Ex. Historically, 83% of all students pass a
particular class. If there are 34 students in the
class, what is the probability that exactly 28 will
pass? What is the probability that at least 28
students pass? What is the probability that at
most 28 students pass?
Finite Random Variables
What is the probability that exactly 28 students pass?
fX 28 P X 28
Soln: 0.1760
Finite Random Variables
What is the probability that at least 28 students pass?
P X 28 1 P X 28
1 P X 27
1 FX 27
Soln: 1 - 0.3545
0.6455
Finite Random Variables
What is the probability that at most 28 students pass?
P X 28 FX x
Soln: 0.5305
Finite Random Variables
Sample p.m.f.
Probability Mass Function
0.2
0.16
0.12
0.08
0.04
0
0
4
8
12
16
20
24
28
32
Finite Random Variables
Mean of a finite random variable
same as expected value in project 1
add product of each value and it’s respective
probability
X E X
x f x
X
all possible x
Finite Random Variables
Ex. Historically, 83% of all students pass a
particular class. If there are 34 students in the
class, find the mean number of students that
will pass.
Soln. Approximately 28.22 students will pass
(Two ways this can be found)
X=x
Finite Random Variables
Method 1:
Use BINOMDIST to make
p.m.f.
Then use:
X E X
x f x
X
all possible x
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
P(X=x)
6.84326E-27
1.13598E-24
9.15134E-23
4.76587E-21
1.80332E-19
5.28267E-18
1.24661E-16
2.43455E-15
4.01164E-14
5.65825E-13
6.90639E-12
7.35696E-11
6.88453E-10
5.68831E-09
4.16585E-08
2.71188E-07
1.5723E-06
8.12806E-06
3.74794E-05
0.000154095
0.000564259
0.001836607
0.005298661
0.013497356
0.030203643
0.058985939
0.099688905
0.144212272
0.176023803
0.177809034
0.144687744
0.091150533
0.041721476
0.012345392
0.001772781
E(X)
x*P(X=x)
0
1.14E-24
1.83E-22
1.43E-20
7.21E-19
2.64E-17
7.48E-16
1.7E-14
3.21E-13
5.09E-12
6.91E-11
8.09E-10
8.26E-09
7.39E-08
5.83E-07
4.07E-06
2.52E-05
0.000138
0.000675
0.002928
0.011285
0.038569
0.116571
0.310439
0.724887
1.474648
2.591912
3.893731
4.928666
5.156462
4.340632
2.825667
1.335087
0.407398
0.060275
28.22
Finite Random Variables
Method 2:
There is a special formula that ONLY works for
random variables that are binomially
distributed:
X E X n p