Download Discrete Random Variables

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Overview
Discrete Random
Variables
•
Random Variables – variables that assume numerical
values associated with random outcomes from an
experiment
•
Random variables can be:
•
•
•
Dr Tom Ilvento
•
•
•
Continuous
We will look at the probability Distribution for Random
Variables
•
Department of Food and Resource Economics
Discrete
Expected Values (mean) and Variance of Random
Variables
Special Distributions
Discrete and then the Binomial Distribution
Nitrous Oxide Example
Example of a Random Variable
•
Suppose we were recording the number of dentists that use
nitrous oxide (laughing gas) in their practice
•
We know that 60% of dentists use the gas (a priori for this
problem, but most likely based on a survey result)
•
•
•
•
•
Let X = number of dentists in a random sample of five
dentists that use use laughing gas.
•
0, 1, 2, 3, 4, 5
and then list the probabilities associated with each value
P(X)
P(No) = .4
X is a random variable that can take on the following
values:
We can list the values of this Random Variable
X
P(Yes) = .6
•
2
Continuous: Normal Distribution
3
0
1
2
3
4
5
0.0102 0.0768 0.2304 0.3456 0.2592 0.0778
•
The table shows the probability distribution for the
discrete random variable X
•
•
The table is also referred as probability distribution table
Properties of the probability distribution
•
•
Each probability is between 0 and 1
The sum of the probabilities for all values of x is equal
to 1
4
Nitrous Oxide Example
How did I assign the
probabilities?
•
•
P(X)
•
P(1) = (.6)(.4)(.4)(.4)(.4) x 5 = .0768
5 is the the number of combinations with
only 1 dentist using the gas:
•
•
•
•
•
Or use the nCr formula
Yes No No No No
5!
120
'5$
=
=5
% "=
& 1 # 1!(5 ! 1)! 24
No Yes No No No
No No Yes No No
•
•
No No No Yes No
1
2
3
4
5
0.0102 0.0768 0.2304 0.3456 0.2592 0.0778
Note: we are assuming independence
P(X)
0
1
5
2
3
4
•
The table provides the probability
distribution
•
The graph provides a visual picture
of the probability distribution of our
discrete random variable
I said the expectation is 3: this
reflects the center of the
distribution
•
5
0.4
0.3
0.2
•
•
0.1
1
2
P(X<2) = P(X=0) + P(X=1)
P(X<2) = .0102+.0768 = .0870
If I randomly selected 5 dentists, how many would I
expect to use laughing gas?
Expectation = 3
We don’t have a way to solve this yet, but we will
6
The variable in the dentist example is called a Discrete
Random Variable
3
4
5
7
Finite countable number of distinct possible values
We can assume that the values can be listed or counted
•
Random Variables that fall along points on an interval, and
can’t be fully counted, are call Continuous Random
Variables
•
How can we tell that it is countable?
•
•
0
Just read it from the table: P(X=4) = .2592
What is the probability of less than 2 of 5 using
laughing gas?
•
•
Probability Distribution of X
0
•
Types of Random Variables
0.0102 0.0768 0.2304 0.3456 0.2592 0.0778
P(X)
X
What is the probability of 4 of 5 dentists selected
randomly Using laughing gas?
•
•
No No No No Yes
Nitrous Oxide Example
•
0
P(0) = (.4)(.4)(.4)(.4)(.4) = .45 = .01024
•
•
X
Usually is described as “the number of…”
Tends to be whole numbers
•
•
•
•
Number of students applying to a university
Number of errors on a test
Number of bacteria per cubic centimeter of water
Number of heart beats of a patient
8
Specifying a discrete random variable –
Tossing two coins and noting the
number of Heads
To describe a Discrete Random
Variable
Specify all the possible values it can assume
•
•
•
Assign corresponding probabilities to each value
Example: Toss a coin twice, note the number of Heads
•
Let X=number of Heads observed
•
•
•
•
•
Head
Head
Tails
Tails
Head
Tails
Head
Tails
HH
HT
TH
TT
0
TT
1
HT or TH
2
HH
•
•
# Heads
Sample Points
P(X)
0.500
0
TT
.5 * .5 = .25
0.375
1
HT TH
(.5 * .5)* 2 = .50
2
HH
.5 * .5 = .25
•
Graph
Table
Formula – will come later
Requirements:
P(X) ! 0 and P(X) " 1 for all values of x
#P(X) = 1
11
•
Notation
Specifies the probability associated with each value
•
•
0.250
0.125
0
0
1
2
10
Probability Distribution: P(x) for Flipping
Two Coins and Noting the Number of Heads
The Probability Distribution can be shown by a
•
•
•
Connecting probabilities to the values results in the
probability distribution
9
Probability Distribution: P(X)
•
This completely defines the discrete random variable X
Probability Distribution of X
So X takes on the following values of Heads
•
•
•
We can assign probabilities based on a priori knowledge
P(X)
•
•
•
Probability
P(x = 0) =
.25
P(x = 1) =
.50
P(x = 2) =
.25
P(x < 2) =
.75
P(X=1) + P(X=0) = .50 + .25 = .75
P(x > 1) =
.25
P(X=2) = .25
# Heads
Sample Points
P(X)
0
TT
.5 * .5 = .25
1
HT TH
(.5 * .5)* 2 = .50
2
HH
.5 * .5 = .25
12
The manager of a large computer network has
developed the following probability distribution
of the number of interruptions per day
•
The data and assigned probabilities based on past
experience
•
You try it: Open up Excel and enter these numbers
in a worksheet
•
Graph it using Inset, Graph, Bar Chart
X
0
1
2
3
4
5
6
Mean and Variance of a Discrete
Random Variable
P(X)
0.32
0.35
0.18
0.08
0.04
0.02
0.01
•
We can think of our observed probability distribution for x as
having a mean and variance
•
An expected value is another term for the mean when
dealing with a probability distribution
•
The expected value of a discrete random variable is given
by the following formula
1.000
Probability Distribution for Network Interuptions
•
•
0.40
0.35
0.30
P(X)
0.25
0.20
The sum of each value times the probability of that value
It is a weighted average, where the weights are the
probabilities
n
0.15
E ( x) = " xi ! p ( xi ) = µ
0.10
0.05
0.00
0
1
2
3
4
5
Interuptions per Day
13
The Expectation of a Discrete
Random Variable
2. Multiply by the probability associated with the value
•
X
Look at the results from Excel
n
E ( x) = " xi ! p ( xi ) = µ
i =1
0
1
2
3
4
5
6
P(X)
0.32
0.35
0.18
0.08
0.04
0.02
0.01
X*P(X)
0.00
0.35
0.36
0.24
0.16
0.10
0.06
Sum
1.000
1.270
14
Variance of a Discrete Random
Variable
1. I take each value of the discrete variable
3. Sum the calculations
i =1
6
•
The variance of a discrete random variable is given by the
following formula
•
From this formula, we can see that the Variance is the
Expectation of the squared deviations about the
population mean
•
Sum of the squared deviation of each value about the
mean, multiplied times the probability of the value
2
We expect 1.27 interuptions per day
15
n
E[( x " µ ) ] = # ( xi " µ ) 2 p ( xi ) = ! 2
i =1
16
The Variance of a Discrete
Random Variable
Computational Formula for the
Variance
1. I take each value of the discrete variable
2. Subtract the mean
1. Square each X value
3. Square the result
4. Multiply by the probability associated with the value
X
5. Then sum each of these calculations
Look at the results from Excel
n
0
1
2
3
4
5
6
P(X)
0.32
0.35
0.18
0.08
0.04
0.02
0.01
X*P(X)
0.00
0.35
0.36
0.24
0.16
0.10
0.06
Var Calc
0.516
0.026
0.096
0.239
0.298
0.278
0.224
Sum
1.000
1.270
1.677
E[( x " µ ) 2 ] = # ( xi " µ ) 2 p ( xi ) = ! 2
i =1
3. Add them all together
4. Then subtract µ2
n
" = $ ( x i2 # P(x)) % µ 2
2
i=1
The Variance is 1.677
17
18
!
Probability Distribution of
the number of interruptions per day
The Standard Deviation
•
Remember, we said the variance is the mean squared
deviation about the mean
•
•
•
The standard deviation is the square root of the variance
•
•
•
In our example, !2 = 1.677
X
0
1
2
3
4
5
6
µ = 1.27
$2 = 1.677
$ = 1.295
Probability Distribution for Network Interuptions
$ = (1.677).5 = 1.295
0.40
0.35
0.30
P(X)
0.32
0.35
0.18
0.08
0.04
0.02
0.01
0.25
P(X)
•
2. Then multiply by P(X)
0.20
0.15
0.10
0.05
0.00
19
0
1
2
3
Interuptions per Day
4
5
6
20
Probability Distribution for the
Nitrous Oxide Example
X
0
P(X)
•
1
2
3
4
5
X
0.0102 0.0768 0.2304 0.3456 0.2592 0.0778
P(X)
If I randomly select 5 dentists, how many can I
expect to use nitrous oxide?
E(X)= 0(.0102) + 1(.0768) + 2(.2304) + 3(.3456) + 4(.2592) + 5(.0778)
E(X) = 3.0002
•
If I randomly selected 5 dentists, what is the
variance ($2)?
! = 1.0954
21
We discussed what we mean by a discrete random variable
•
•
•
variables that assume numerical values
associated with random outcomes from an experiment
by discrete we mean the outcomes are not continuous they are countable
•
We showed the probability distribution by a table and by
graphing it
•
We solved for the mean and variance of a discrete random
variable
•
Next we will look at a special class of discrete random
variables - binomial random variables
2
3
4
5
0.0102 0.0768 0.2304 0.3456 0.2592 0.0778
Probability Distribution of X
µ = 3.00
0.4
$2 = 1.20
0.3
$ = 1.01
0.2
0
Summary
•
1
0.1
!2 = (0-3)2(.0102) + (1-3)2(.0768) + (2-3)2(.2304) + (3-3)2(.3456)
+ (4-3)2(.2592) + (5-3)2(.0778)
!2 = 1.1988
•
•
•
0
P(X)
Nitrous Oxide Example
23
0
1
2
3
4
5
22
Related documents