Prob Random Variables
Prob Random Variables
Random Variables and Random Vectors A variable that associates a number X(u) with the outcome u of a
random experiment is called a random variable.
X :Ω → R
u → X(u)
Uppercase letters (X, Y, Z): Random variables.
Lowercase letters (x, y, z): Measured values of random variables
(after the experiment is conducted). Eg. x = 70 milliamperes.
Dung Nguyen Probability and Statistics3 / 41 Dung Nguyen Probability and Statistics4 / 41
Probability Mass/Density Functions Discrete random variables
Probability Mass/Density Functions Discrete random variables Probability Mass/Density Functions Discrete random variables
Dung Nguyen Probability and Statistics7 / 41 Dung Nguyen Probability and Statistics8 / 41
Probability Mass/Density Functions Discrete random variables Probability Mass/Density Functions Discrete random variables
Example Example
2 Uniform distribution: Ω = {1, 2, 3, · · · , n} 2 Uniform distribution: Ω = {1, 2, 3, · · · , n}
1 1
f(k) = P(X = k) = f(k) = P(X = k) =
n n
each outcome has equal probability each outcome has equal probability
λk λk
3 Is f(k) = P(X = k) = k! e−λ (k = 0, 1, 2 . . . ) a probability mass 3 Is f(k) = P(X = k) = k! e−λ (k = 0, 1, 2 . . . ) a probability mass
function? function?
Dung Nguyen Probability and Statistics8 / 41 Dung Nguyen Probability and Statistics8 / 41
Probability Mass/Density Functions Continuous random variables Probability Mass/Density Functions Continuous random variables
f(x)
Solution
P(a ≤ X ≤ b) Proposition (Characteristic Z 5.1 Z 5.1
properties) P(4.95 < X < 5.1) = f(x)dx = 5dx = 0.75
If f is a (probability) Z4.95
5 Z 4.95
5
density function then P(X < 5) = f(x)dx = 5dx = 0.5
1 f(u) ≥ 0 4.9 4.9
Z ∞
2 f(u)du = 1
−∞
a x
b
Dung Nguyen Probability and Statistics9 / 41 Dung Nguyen Probability and Statistics10 / 41
Probability Mass/Density Functions Continuous random variables Probability Mass/Density Functions Continuous random variables
Example Example
6 Suppose that X is a continuous random variable whose 6 Suppose that X is a continuous random variable whose
probability density function is given by probability density function is given by
( (
c(4u − 2u2 ), 0 < u < 2 c(4u − 2u2 ), 0 < u < 2
f(u) = f(u) =
0, otherwise 0, otherwise
Find c and P(X > 1). Find c and P(X > 1).
7 The amount of time in hours that a computer functions before
breaking down is a continuous random variable with probability
density function
(
λ e−u/100 , u ≥ 0
f(u) =
0, otherwise
Compute the probability that a computer will function
Dung Nguyen Probability and Statistics11 / 41 Dung Nguyen Probability and Statistics11 / 41
Probability Mass/Density Functions Continuous random variables Probability Mass/Density Functions Continuous random variables
Example Example
6 Suppose that X is a continuous random variable whose 7 The amount of time in hours that a computer functions before
probability density function is given by breaking down is a continuous random variable with probability
density function
(
c(4u − 2u2 ), 0 < u < 2
f(u) = (
0, otherwise λ e−u/100 , u ≥ 0
f(u) =
Find c and P(X > 1). 0, otherwise
Compute the probability that a computer will function
7 The amount of time in hours that a computer functions before
a between 50 and 150 hours before breaking down?
breaking down is a continuous random variable with probability
b for fewer than 100 hours?
density function
(
λ e−u/100 , u ≥ 0
f(u) =
0, otherwise
Compute the probability that a computer will function
a between 50 and 150 hours before breaking down?
Dung Nguyen Probability and Statistics11 / 41 Dung Nguyen Probability and Statistics11 / 41
Cumulative Distribution Function Cumulative Distribution Function
Dung Nguyen Probability and Statistics12 / 41 Dung Nguyen Probability and Statistics12 / 41
f(x) F(x)
f(x)
F(u) = P(X ≤ u) 1
P(X ≤ 2)
k P(X = k) P(X ≤ k) F(u)
0 0.35 0.35
1 0.22 0.57
2 0.20 0.77
3 0.13 0.90
4 0.10 1.00 x 0 x
u u
0 1 2 3 4 x
Dung Nguyen Probability and Statistics13 / 41 Dung Nguyen Probability and Statistics14 / 41
Cumulative Distribution Function Cumulative Distribution Function
0.6
Proposition (F =⇒ f)
1 If X has a discrete distribution then
Dung Nguyen Probability and Statistics18 / 41 Dung Nguyen Probability and Statistics19 / 41
Example Example
12 Let X have the CDF 12 Let X have the CDF
F(u) F(u)
1 1
0.6 0.6
u u
−2 −1 −2 −1
a Determine all values of u such that P(X = u) > 0. a Determine all values of u such that P(X = u) > 0.
b Find P(X ≤ 0)
Dung Nguyen Probability and Statistics19 / 41 Dung Nguyen Probability and Statistics19 / 41
Cumulative Distribution Function Cumulative Distribution Function
Example Example
12 Let X have the CDF 13 Let X have the CDF
F(u) F(u)
1 1
0.75
0.6 0.5
0.25
u
u 5 10 15 20
−2 −1 Find the numerical values of the following quantities
a Determine all values of u such that P(X = u) > 0.
b Find P(X ≤ 0)
c Find P(X < 0).
Dung Nguyen Probability and Statistics19 / 41 Dung Nguyen Probability and Statistics20 / 41
Example Example
13 Let X have the CDF 13 Let X have the CDF
F(u) F(u)
1 1
0.75 0.75
0.5 0.5
0.25 0.25
u u
5 10 15 20 5 10 15 20
Find the numerical values of the following quantities Find the numerical values of the following quantities
a P(X ≤ 1) a P(X ≤ 1)
b P(X ≤ 10)
Dung Nguyen Probability and Statistics20 / 41 Dung Nguyen Probability and Statistics20 / 41
Cumulative Distribution Function Cumulative Distribution Function
Example Example
13 Let X have the CDF 13 Let X have the CDF
F(u) F(u)
1 1
0.75 0.75
0.5 0.5
0.25 0.25
u u
5 10 15 20 5 10 15 20
Find the numerical values of the following quantities Find the numerical values of the following quantities
a P(X ≤ 1) a P(X ≤ 1)
b P(X ≤ 10) b P(X ≤ 10)
c P(X ≥ 10) c P(X ≥ 10)
d P(X = 10)
Dung Nguyen Probability and Statistics20 / 41 Dung Nguyen Probability and Statistics20 / 41
Dung Nguyen Probability and Statistics22 / 41 Dung Nguyen Probability and Statistics23 / 41
Mean Mean
Example Example
16 A roulette wheel has the numbers 1 through 36, as well as 0 and 17 The pmf of the amount of memory X (GB) in a purchased flash
00. If you bet $1 that an odd number comes up, you win or lose drive satisfies
$1 according to whether that event occurs. Find the average x 1 2 4 8 16
net gain if you have played 1 game. How about doubling your p(x) 0.05 0.10 0.35 0.40 0.10
bet? or playing 10 games? Calculate the average amount of memory in the flash drive.
Dung Nguyen Probability and Statistics24 / 41 Dung Nguyen Probability and Statistics24 / 41
Mean Mean
Dung Nguyen Probability and Statistics24 / 41 Dung Nguyen Probability and Statistics25 / 41
Mean Mean
Example Example
19 Let X denote a random variable that takes on any of the values 19 Let X denote a random variable that takes on any of the values
-1, 0, and 1 with respective probabilities -1, 0, and 1 with respective probabilities
P(X = −1) = 0.2, P(X = 0) = 0.5, P(X = 1) = 0.3 P(X = −1) = 0.2, P(X = 0) = 0.5, P(X = 1) = 0.3
Compute E(X 2 ). Compute E(X 2 ).
20 Let X be the current measured in mA. The PDF is f(x) = 0.05 for
0 ≤ x ≤ 20. What is the expected value of power when the
resistance is 100 ohms?
Dung Nguyen Probability and Statistics26 / 41 Dung Nguyen Probability and Statistics26 / 41
Mean Mean
Solution
Put g(u) = u3 .
4
X 4
X
E(X 3 ) = E(g(X)) = g(u)f(u) = u3 f(u)
u=0 u=0
= 03 (0.6561) + 13 (0.2916) + 2 (0.0486) + 33 (0.036) + 43 (0.0001)
3
= 1.6588.
Dung Nguyen Probability and Statistics27 / 41 Dung Nguyen Probability and Statistics28 / 41
Mean Mean
Solution
Put h(u) = u3 . Then
1 1
u4 1 1
Z Z
E(X 3 ) = E(h(X)) = u3 f(u)du = u3 du = = .
0 0 4 0 4
Dung Nguyen Probability and Statistics29 / 41 Dung Nguyen Probability and Statistics30 / 41
Mean Median
Median Median
Median Example
The median of a random variable X are all points m such that 1 1
P(X ≤ m) ≥ 0.5 and P(X ≥ m) ≥ 0.5,
or equivalently,
F(m) ≥ 0.5 and F(m − ) ≤ 0.5,
Example Example
25 The pmf of the amount of memory X (GB) in a purchased flash 25 The pmf of the amount of memory X (GB) in a purchased flash
drive satisfies drive satisfies
x 1 2 4 8 16 x 1 2 4 8 16
p(x) 0.05 0.10 0.35 0.40 0.10 p(x) 0.05 0.10 0.35 0.40 0.10
Determine Md(X). Determine Md(X).
Dung Nguyen Probability and Statistics34 / 41 Dung Nguyen Probability and Statistics34 / 41
p p
x = 6.5 x = 6.5
0.25
0.125
x x
5 6 7 8 3 4 5 6 7 8 9 10
(a) Class 1 (b) Class 2
Dung Nguyen Probability and Statistics35 / 41 Dung Nguyen Probability and Statistics36 / 41
Variance and Standard Deviation Variance and Standard Deviation
Dung Nguyen Probability and Statistics37 / 41 Dung Nguyen Probability and Statistics37 / 41
Deviations Deviations
1+2+5+8 1+2+5+8
Observations: 1,2,5,8 =⇒ M = = 4. Observations: 1,2,5,8 =⇒ M = = 4.
4 4
1 − 4 = −3 5−4=1 1 − 4 = −3 5−4=1
1 2 4 5 8 1 2 4 5 8
2 − 4 = −2 8−4=4 2 − 4 = −2 8−4=4
Dung Nguyen Probability and Statistics38 / 41 Dung Nguyen Probability and Statistics38 / 41
Variance and Standard Deviation Variance and Standard Deviation
Deviations Deviations
1+2+5+8 1+2+5+8
Observations: 1,2,5,8 =⇒ M = = 4. Observations: 1,2,5,8 =⇒ M = = 4.
4 4
1 − 4 = −3 5−4=1 1 − 4 = −3 5−4=1
1 2 4 5 8 1 2 4 5 8
2 − 4 = −2 8−4=4 2 − 4 = −2 8−4=4
Dung Nguyen Probability and Statistics38 / 41 Dung Nguyen Probability and Statistics38 / 41
Deviations Deviations
1+2+5+8 1+2+5+8
Observations: 1,2,5,8 =⇒ M = = 4. Observations: 1,2,5,8 =⇒ M = = 4.
4 4
1 − 4 = −3 5−4=1 1 − 4 = −3 5−4=1
1 2 4 5 8 1 2 4 5 8
2 − 4 = −2 8−4=4 2 − 4 = −2 8−4=4
Dung Nguyen Probability and Statistics38 / 41 Dung Nguyen Probability and Statistics38 / 41
Variance and Standard Deviation Variance and Standard Deviation
Deviations Deviations
1+2+5+8 1+2+5+8
Observations: 1,2,5,8 =⇒ M = = 4. Observations: 1,2,5,8 =⇒ M = = 4.
4 4
1 − 4 = −3 5−4=1 1 − 4 = −3 5−4=1
1 2 4 5 8 1 2 4 5 8
2 − 4 = −2 8−4=4 2 − 4 = −2 8−4=4
Dung Nguyen Probability and Statistics38 / 41 Dung Nguyen Probability and Statistics38 / 41
Deviations Deviations
1+2+5+8 1+2+5+8
Observations: 1,2,5,8 =⇒ M = = 4. Observations: 1,2,5,8 =⇒ M = = 4.
4 4
1 − 4 = −3 5−4=1 1 − 4 = −3 5−4=1
1 2 4 5 8 1 2 4 5 8
2 − 4 = −2 8−4=4 2 − 4 = −2 8−4=4
Sum of squares: (1 − 4)2 + (2 − 4)2 + (5 − 4)2 + (8 − 4)2 . (1 − 4)2 + (2 − 4)2 + (5 − 4)2 + (8 − 4)2
Average sum of squares: .
4
Dung Nguyen Probability and Statistics38 / 41 Dung Nguyen Probability and Statistics38 / 41
Variance and Standard Deviation Variance and Standard Deviation
Deviations Deviations
1+2+5+8 1+2+5+8
Observations: 1,2,5,8 =⇒ M = = 4. Observations: 1,2,5,8 =⇒ M = = 4.
4 4
1 − 4 = −3 5−4=1 1 − 4 = −3 5−4=1
1 2 4 5 8 1 2 4 5 8
2 − 4 = −2 8−4=4 2 − 4 = −2 8−4=4
Dung Nguyen Probability and Statistics38 / 41 Dung Nguyen Probability and Statistics38 / 41
Dung Nguyen Probability and Statistics39 / 41 Dung Nguyen Probability and Statistics39 / 41
Variance and Standard Deviation Variance and Standard Deviation
X is continuous Z ∞
X is continuous Z ∞
V(X) = (u − µ)2 f(u)du. V(X) = (u − µ)2 f(u)du.
−∞ −∞
Dung Nguyen Probability and Statistics39 / 41 Dung Nguyen Probability and Statistics39 / 41
Dung Nguyen Probability and Statistics40 / 41 Dung Nguyen Probability and Statistics41 / 41
Variance and Standard Deviation Variance and Standard Deviation
Properties Properties
1 Computational formula 1 Computational formula
2 2
V(X) = E(X ) − (E X) V(X) = E(X 2 ) − (E X)2
2 Variance and standard deviation are not linear
V(aX + b) = a2 V(X) and SD(aX + b) = a SD(X)
Dung Nguyen Probability and Statistics42 / 41 Dung Nguyen Probability and Statistics42 / 41
Dung Nguyen Probability and Statistics42 / 41 Dung Nguyen Probability and Statistics43 / 41
Variance and Standard Deviation Variance and Standard Deviation
Dung Nguyen Probability and Statistics44 / 41 Dung Nguyen Probability and Statistics45 / 41
0.10
0.05
0
−20 −10 0 10 20 30 40 50
Dung Nguyen Probability and Statistics45 / 41 Dung Nguyen Probability and Statistics46 / 41
Variance and Standard Deviation Joint Distributions
Dung Nguyen Probability and Statistics46 / 41 Dung Nguyen Probability and Statistics47 / 41
Determine
a P(X < 3, Y ≤ 2).
b P(X < 3|Y ≤ 2).
c P(Y ≤ 2|X < 3).
Dung Nguyen Probability and Statistics48 / 41 Dung Nguyen Probability and Statistics49 / 41
Joint Distributions Joint Distributions
Solution
k = 6 × 10−6 , P(X ≤ 1000, Y ≤ 2000) = 0.915
Dung Nguyen Probability and Statistics50 / 41 Dung Nguyen Probability and Statistics51 / 41
Dung Nguyen Probability and Statistics52 / 41 Dung Nguyen Probability and Statistics53 / 41
Joint Distributions Joint Distributions
Dung Nguyen Probability and Statistics54 / 41 Dung Nguyen Probability and Statistics55 / 41