CLass 4 Random Variable
CLass 4 Random Variable
1 Random Variables
and Probability Distributions
Exampl
e 2: Let
us flip 3
coins.
“pro
babi
lity
of
gett ©Stanley Chan 2020. All Rights Reserved.
2 / 12
Everything you need to know about a random
variable
Question: What are random variables?
Answer: Random variables are functions that translate words to
numbers.
Example: “Head” is a word description. “X = 1” is numerical
description.
Definition
A random variable X is a function X : Ω → R that maps an
outcome
ξ ∈ Ω to a number X (ξ) on the real line.
Ω=
{(HH),
(HT),
(TH),
(TT)}.
In Words In Symbols
Example:
Graph the following probability distribution using a histogram.
x P (x) P(x
2 0.0625 0.6 )
3 0.375
0.5
4 0.5625
0.4
Probability
0.3
0.2
0.1
0
x
2 3 4
X
Graphing a Discrete Probability Distribution
Example:
Graph the following probability distribution using a histogram.
x P (x) P(x
2 0.0625 0.6 )
3 0.375
0.5
4 0.5625
0.4
Probability
0.3
0.2
0.1
0
x
2 3 4
X
Cumulative Distribution Functions (Discrete)
Example
Exercise
Given the CDF F(x) for the discrete random variable X, Find:
(a) P(X = 3) (b) P(X > 2) (c) P(X)
Expectation (Mean)
Example:
Find the mean of the probability distribution for the sum of the two
spins.
x P (x) xP (x)
2 0.0625 2(0.0625) = 0.125 ΣxP(x) = 3.5
3 0.375 3(0.375) = 1.125
The mean of X is
4 0.5625 4(0.5625) = 2.25 3.5.
Moments and Variance
Example:
Find the variance of the probability distribution for X. The mean
is 3.5.
Assume that the pair of dice is thrown and the random variable X is
the sum of numbers that appears on two dice. Find the mean or the
expectation of the random variable X which is the sum of numbers
that appear on two dice.
Exercise
Assume that the pair of dice is thrown and the random variable X is the
sum of numbers that appears on two dice. Find the probability distribution
and the mean or the expectation of the random variable X
Solution:
If two dice are thrown, then the total number of sample spaces
obtained is 36.
Given that, the random variable X is the sum of numbers that appear
on two dice, such as 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 or 12.
σ = σ 2.
Example:
Find the standard deviation of the probability distribution for X.
The variance is 0.376.
σ σ2
x P (x) x–μ (x – μ)2 P (x)(x – μ)2
0.376 0.613
2 0.0625 –1.5 2.25 0.141
3 0.375 –0.5 0.25 0.094 Most of the values
differ from the mean
4 0.5625 0.5 0.25 0.141 by no more than 0.6
points.
Binomial
Distributions
Binomial Experiments
Symbol Description
Example:
Decide whether the experiment is a binomial experiment. If it is,
specify the values of n, p, and q, and list the possible values of the
random variable x. If it is not a binomial experiment, explain why.
• You roll a die 10 times and note the number the die lands
on.
Example:
A bag contains 10 chips. 3 of the chips are red, 5 of the chips are
white, and 2 of the chips are blue. Four chips are selected, with
replacement. Create a probability distribution for the number of red
chips selected.
3
p = the probability of selecting a red chip 0.3
10
q = 1 – p = 0.7
n=4 x P (x)
x = 0, 1, 2, 3, 4 0 0.240
The binomial
1 0.412 probability
2 0.265 formula is used
3 0.076 to find each
4 0.008 probability.
Finding Probabilities
Example:
The following probability distribution represents the probability of
selecting 0, 1, 2, 3, or 4 red chips when 4 chips are selected.
x P (x) a.) Find the probability of selecting no
0 0.24
more than 3 red chips.
1 0.412
2 0.265
3 0.076 b.) Find the probability of selecting
4 0.008 at least 1 red chip.
a.) P (no more than 3) = P (x 3) = P (0) + P (1) + P (2) + P (3)
= 0.24 + 0.412 + 0.265 + 0.076 = 0.993
b.) P (at least 1) = P (x 1) = 1 – P (0) = 1 – 0.24 = 0.76
Complement
Binomial Probability Distribution
Exercise
Solution
Let X be the number of defective screws out of 10.
Then X can be considered as a binomial r.v. with
parameters (10, 0.01). Hence, using the binomial pf p(x), we
obtain
Mean, Variance and Standard Deviation
Example:
The mean of number of students failed per year in a particular
subject is 4. Find the probability that in a given year,
a.) there are exactly 3 students failed,
b.) there are more than 3 students failed.
a .) 4, x 3 b.) P (m or e t h a n 3)
1 P (x 3)
3 -4
4 (2.71828)
P (3) 1 [P (3) P (2) + P (1) + P (0)]
3!
Exercise:
As only 3 students came to attend the class today, find the
probability for exactly 4 students to attend the classes tomorrow
Poisson Distribution
Solution
Example:
A fast food chain puts a winning game piece on every fifth
package of French fries. Find the probability that you will win a
prize,
a.) with your third purchase of French fries,
b.) with your third or fourth purchase of French fries.
p = 0.20 q = 0.80
a.) x = 3 b.) x = 3, 4
P (3) = (0.2)(0.8)3 – 1 P (3 or 4) = P (3) + P (4)
= (0.2)(0.8)2 0.128 + 0.102
= (0.2)(0.64) 0.230
= 0.128
More exercises
(a) Assume that the pair of dice is thrown and the random variable X
is the sum of numbers that appears on two dice. Find the
Probability distribution, CDF of the random variable X which is
the even number on the first die.
σ controls smoothing
Gaussian image( Blurring or smoothing)
Questions?