Slides 9 A
Slides 9 A
Chrysafis Vogiatzis
Lecture 9a
DISCRETE
p(0) = 1 − p
Bernoulli 0<p<1 {0, 1}
p(1) = p
n
Binomial 0 < p < 1, n ≥ 0 {0, 1, . . . , n} p(x) = px · (1 − p)n−x
x
λx
Poisson λ>0 {0, 1, . . .} p(x) = e−λ
x!
1
Uniform - [a, b] p(x) =
b−a+1
CONTINUOUS
1
Uniform - [a, b] f (x) =
b−a
λk ·x k −1 ·e−λx
Gamma λ > 0, k > 0 [0, +∞) f (x) = Γ(k )
λk ·x k −1 ·e−λx
Erlang λ > 0, integer k > 0 [0, +∞) f (x) = (k −1)!
1 (x−µ)2
Normal µ, σ 2 (−∞, +∞) f (x) = √ e 2σ 2
2π · σ
Recall that:
P
p(x) = 1.
x∈S
+∞
R
f (x)dx = 1.
−∞
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
+∞
R
Continuous random variables: E [X ] = x · f (x)dx.
−∞
Example
A (discrete) random variable is distributed with p(x) = x 2 /c, x = 1, 2, 3, 4.
What is the mean value?
What if the random variable is continuous in [1, 4]?
Answer: Z4 Z4 4
4 4
x3 100 x3 x4 63.75
x ·f (x) = = = .
X X
x · p(x) = = . c 4c c
c c x=1 x=1
1
x=1 x=1
4
P R4
From p(x) = 1, we get that c = 30. From f (x) = 1, we get that c = 21.
x=1 x=1
E [X ] = 1 · p + 0 · (1 − p) = p.
E [X ] = n · p.
Example
Students accepted in a certificate program graduate with probability
p = 0.75. This year, the certificate program has accepted 300 students. How
many are expected to successfully finish the program?
Answer: Binomial with n = 300, p = 0.75, hence µ = n · p = 225 students.
E [X ] = 1 · p + 0 · (1 − p) = p.
E [X ] = n · p.
Example
Students accepted in a certificate program graduate with probability
p = 0.75. This year, the certificate program has accepted 300 students. How
many are expected to successfully finish the program?
Answer: Binomial with n = 300, p = 0.75, hence µ = n · p = 225 students.
E [X ] = 1 · p + 0 · (1 − p) = p.
E [X ] = n · p.
Example
Students accepted in a certificate program graduate with probability
p = 0.75. This year, the certificate program has accepted 300 students. How
many are expected to successfully finish the program?
Answer: Binomial with n = 300, p = 0.75, hence µ = n · p = 225 students.
n
!
X X n x
E [X ] = x · p(x) = x p (1 − p)n−x =
x
x
x=0
n
X n!
= x px (1 − p)n−x =
x! · (n − x)!
x=0
n
X n · (n − 1)!
= p · px−1 · (1 − p)n−x =
(x − 1)! · (n − x)!
x=0
n
!
X n − 1 x−1
=np p (1 − p)n−x =
x −1
x=1
n−1
!
X n−1 k
=np p (1 − p)n−k −1 = (k = x − 1)
k
k =0
m
!
X m k
=np p (1 − p)m−k = (m = n − 1)
k
k =0
=np.
10 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Means of discrete random variables
Geometric with parameter p:
1
E [X ] = .
p
Example
A kid learning basketball is shooting free throws with a probability of scoring
equal to 25%. What are the expected free throws the kid has to attempt until
scoring for the first time?
1
Answer: Geometric with p = 0.25, hence µ = p
= 4 free throws.
Hypergeometric with parameters N, K , n:
K
E [X ] = n .
N
Example
A trick-or-treat package contains 100 items, 20 of them are chocolate bars. A
kid picks 10 items at random; how many chocolate bars should they expect?
Answer: Hypergeometric with N = 100, K = 20, n = 10, hence µ = n KN = 2
chocolate bars.
11 / 16 Chrysafis Vogiatzis Expectations
Poisson with parameter λ:
E [X ] = λ.
E [X ] = λ.
Example
If the next bus arrives uniformly in the next 10 minutes, then the next bus is
expected to arrive in E [X ] = 5 minutes.
E [X ] = µ.
Example
If grades are normally distributed with N (80, 12), then the expected grade of
a student in the class is E [X ] = 80.
Example
If the next bus arrives uniformly in the next 10 minutes, then the next bus is
expected to arrive in E [X ] = 5 minutes.
E [X ] = µ.
Example
If grades are normally distributed with N (80, 12), then the expected grade of
a student in the class is E [X ] = 80.
Example
If the next bus arrives uniformly in the next 10 minutes, then the next bus is
expected to arrive in E [X ] = 5 minutes.
E [X ] = µ.
Example
If grades are normally distributed with N (80, 12), then the expected grade of
a student in the class is E [X ] = 80.
Example
If cars pass through an intersection with rate λ = 60/hour , then the next car
will pass in E [X ] = λ1 = 1 minute.
Example
If cars pass through an intersection with rate λ = 60/hour , then the
k = 30-th car is expected to pass in E [X ] = λk = 60/hour
30
= 0.5 hours.
Example
If cars pass through an intersection with rate λ = 60/hour , then the next car
will pass in E [X ] = λ1 = 1 minute.
Example
If cars pass through an intersection with rate λ = 60/hour , then the
k = 30-th car is expected to pass in E [X ] = λk = 60/hour
30
= 0.5 hours.
Example
If cars pass through an intersection with rate λ = 60/hour , then the next car
will pass in E [X ] = λ1 = 1 minute.
Example
If cars pass through an intersection with rate λ = 60/hour , then the
k = 30-th car is expected to pass in E [X ] = λk = 60/hour
30
= 0.5 hours.
Example
Let X be a continuous random variable measuring the current (in
milliamperes, mA) in a wire with pdf f (x) = 0.05, for 0 ≤ x ≤ 20. The heat
produced from the current is given by the function g(x) = 10 · x (with x in
milliamperes). What is the mean heat produced by the current?
Answer:
R20 R20 R20
E [g(X )] = g(x) · f (x)dx = 10 · x · 0.05dx = 0.5xdx = 100.
x=0 x=0 x=0
Example
Let X be a continuous random variable measuring the current (in
milliamperes, mA) in a wire with pdf f (x) = 0.05, for 0 ≤ x ≤ 20. The heat
produced from the current is given by the function g(x) = 10 · x (with x in
milliamperes). What is the mean heat produced by the current?
Answer:
R20 R20 R20
E [g(X )] = g(x) · f (x)dx = 10 · x · 0.05dx = 0.5xdx = 100.
x=0 x=0 x=0
Example
Let X be a continuous random variable measuring the current (in
milliamperes, mA) in a wire with pdf f (x) = 0.05, for 0 ≤ x ≤ 20. The heat
produced from the current is given by the function g(x) = 10 · x (with x in
milliamperes). What is the mean heat produced by the current?
Answer:
R20 R20 R20
E [g(X )] = g(x) · f (x)dx = 10 · x · 0.05dx = 0.5xdx = 100.
x=0 x=0 x=0
Example
Let X be a continuous random variable measuring the current (in
milliamperes, mA) in a wire with pdf f (x) = 0.05, for 0 ≤ x ≤ 20. The heat
produced from the current is given by the function g(x) = 10 · x (with x in
milliamperes). What is the mean heat produced by the current?
Answer:
R20 R20 R20
E [g(X )] = g(x) · f (x)dx = 10 · x · 0.05dx = 0.5xdx = 100.
x=0 x=0 x=0