ì ¡
Probability ¡and ¡Statistics ¡ for ¡Computer ¡Science ¡ ¡
Can ¡we ¡call ¡ ¡ ¡ ¡ ¡ ¡ ¡the ¡ exci-ng ¡ ¡ ¡ ¡ ¡? ¡
¡
Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡10.1.2019 ¡ Credit: ¡wikipedia ¡
e = lim
n→∞
- 1 + 1
Probability and Statistics for Computer Science Can - - PowerPoint PPT Presentation
Probability and Statistics for Computer Science Can we call the e exci-ng ? e n 1 + 1 e = lim n n Credit:
¡
Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡10.1.2019 ¡ Credit: ¡wikipedia ¡
n→∞
✺ Time: ¡Oct. ¡10 ¡th, ¡Thurs. ¡2019 ¡ ✺ Place: ¡the ¡same ¡classroom-‑ ¡ ¡1320 ¡DCL ¡ ✺ Dura-on: ¡75 ¡mins ¡ ✺ Coverage: ¡All ¡course ¡contents ¡upto ¡today’s ¡lecture, ¡and ¡the ¡
HWs ¡No.1-‑5. ¡ ¡
✺ Notes ¡on ¡one ¡sheet ¡of ¡paper ¡of ¡the ¡size ¡8.5×11inch ¡(both ¡
sides) ¡are ¡permiZed. ¡ ¡
✺ No ¡calculator ¡or ¡other ¡electronic ¡device ¡ ✺ No ¡use ¡of ¡phone ¡
✺ Poisson ¡distribu-on ¡ ✺ Uniform ¡con-nuous ¡distribu-on ¡ ✺ Exponen-al ¡distribu-on ¡ ✺ Normal ¡distribu-on ¡& ¡Central ¡Limit ¡Theorem ¡ ✺ Approximate ¡Binomial ¡with ¡Normal ¡
Simeon ¡D. ¡Poisson ¡ (1781-‑1840) ¡ Credit: ¡wikipedia ¡
Simeon ¡D. ¡Poisson ¡ (1781-‑1840) ¡
for ¡integer ¡ k ≥ 0
λ is the average rate of the event′s occurrence
x ¡
Simeon ¡D. ¡Poisson ¡ (1781-‑1840) ¡
for ¡integer ¡ k ≥ 0
λ is the average rate of the event′s occurrence
x ¡
∞
∞
¡ ¡ ¡ ¡ ¡
Simeon ¡D. ¡Poisson ¡ (1781-‑1840) ¡
for ¡integer ¡ k ≥ 0
λ is the average rate of the event′s occurrence
x ¡
∞
∞
x ¡
Simeon ¡D. ¡Poisson ¡ (1781-‑1840) ¡
for ¡integer ¡ k ≥ 0
x ¡
✺ How ¡many ¡calls ¡does ¡a ¡call ¡center ¡get ¡in ¡an ¡hour? ¡ ✺ How ¡many ¡muta-ons ¡occur ¡per ¡100k ¡
✺ How ¡many ¡independent ¡incidents ¡occur ¡in ¡an ¡
for ¡integer ¡ k ≥ 0
✺ If ¡a ¡call ¡center ¡receives ¡10 ¡
calls ¡per ¡hour ¡on ¡average, ¡ what ¡is ¡the ¡probability ¡that ¡it ¡ receives ¡15 ¡calls ¡in ¡a ¡given ¡ hour? ¡ ¡
✺ What ¡is ¡λ ¡here? ¡ ✺ What ¡is ¡P(k=15)? ¡
Credit: ¡wikipedia ¡
✺ If ¡a ¡call ¡center ¡receives ¡10 ¡
calls ¡per ¡hour ¡on ¡average, ¡ what ¡is ¡the ¡probability ¡that ¡it ¡ receives ¡15 ¡calls ¡in ¡a ¡given ¡ hour? ¡ ¡
✺ What ¡is ¡λ ¡here? ¡10 ¡
✺
For ¡the ¡expected ¡value ¡of ¡ Poisson ¡is ¡λ ¡ ¡ ✺ What ¡is ¡P(k=15)? ¡
Credit: ¡wikipedia ¡
1015e−10 15!
If ¡a ¡call ¡center ¡receives ¡4 ¡ calls ¡per ¡hour ¡on ¡average. ¡ What ¡is ¡intensity ¡λ ¡here ¡ for ¡an ¡hour? ¡
Credit: ¡wikipedia ¡
If ¡a ¡call ¡center ¡receives ¡4 ¡ calls ¡per ¡hour ¡on ¡average. ¡ What ¡is ¡the ¡intensity ¡λ ¡ here ¡for ¡an ¡hour? ¡
Credit: ¡wikipedia ¡ x ¡
If ¡a ¡call ¡center ¡receives ¡4 ¡ calls ¡per ¡hour ¡on ¡average. ¡ What ¡is ¡probability ¡the ¡ center ¡receives ¡0 ¡calls ¡in ¡ an ¡hour? ¡
Credit: ¡wikipedia ¡
If ¡a ¡call ¡center ¡receives ¡4 ¡ calls ¡per ¡hour ¡on ¡average. ¡ What ¡is ¡probability ¡the ¡ center ¡receives ¡0 ¡calls ¡in ¡ an ¡hour? ¡
Credit: ¡wikipedia ¡ x ¡
Credit: ¡wikipedia ¡
✺ Given ¡a ¡call ¡center ¡receives ¡
10 ¡calls ¡per ¡hour ¡on ¡average, ¡ what ¡is ¡the ¡intensity ¡λ ¡of ¡the ¡ distribu-on ¡for ¡calls ¡in ¡Two ¡ hours? ¡ ¡
Credit: ¡wikipedia ¡
✺ Given ¡a ¡call ¡center ¡receives ¡
10 ¡calls ¡per ¡hour ¡on ¡average, ¡ what ¡is ¡the ¡intensity ¡λ ¡of ¡the ¡ distribu-on ¡for ¡calls ¡in ¡Two ¡ hours? ¡ ¡
✺ If ¡we ¡scale ¡the ¡interval, ¡then ¡
the ¡intensity ¡of ¡the ¡ distribu-on ¡scales ¡by ¡the ¡ same ¡amount. ¡ ¡ ¡λ=20 ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
x ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
20 7
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ A ¡store ¡staff ¡mixed ¡their ¡fuji ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡gala ¡
✺ For ¡a ¡con-nuous ¡random ¡variable ¡X, ¡the ¡
✺ Instead, ¡we ¡define ¡the ¡probability ¡density ¡
✺ For a < b
a
−∞
−∞
−∞
x ¡
weight ¡
b ¡ 0 ¡ a ¡ 1 ¡ 1 b − a
p(x)
p(x) =
b−a
for x ∈ [a, b]
E[X] = a + b 2 & var[X] = (b − a)2 12
b ¡ 0 ¡ a ¡ 1 ¡
p(x)
1 b − a
target ¡
p(x) =
b−a
for x ∈ [a, b]
E[X] = a + b 2 & var[X] = (b − a)2 12
b ¡ 0 ¡ a ¡ 1 ¡
p(x)
1 b − a
target ¡2) ¡Oken ¡associated ¡with ¡random ¡sampling ¡
p(x) =
b−a
for x ∈ [a, b]
E[X] = a + b 2 & var[X] = (b − a)2 12
b ¡ 0 ¡ a ¡ 1 ¡
p(x)
1 b − a
✺ Cumula-ve ¡distribu-on ¡func-on ¡(CDF) ¡ ¡
b ¡ 0 ¡ a ¡ 1 ¡
p(x)
1 b − a
b ¡ 0 ¡ a ¡
−∞
1 ¡
✺ Common ¡
✺ Associated ¡
Credit: ¡wikipedia ¡
✺ A ¡con-nuous ¡random ¡variable ¡X ¡is ¡exponen-al ¡
✺ It’s ¡similar ¡to ¡Geometric ¡distribuHon ¡– ¡the ¡
✺ Both ¡are ¡memory-‑less. ¡See ¡Morris ¡et ¡al ¡Pg ¡322 ¡
✺ A ¡con-nuous ¡random ¡variable ¡X ¡is ¡exponen-al ¡
✺ It’s ¡similar ¡to ¡Geometric ¡distribuHon ¡– ¡the ¡
✺ A ¡con-nuous ¡random ¡variable ¡X ¡is ¡exponen-al ¡
x ¡
✺ How ¡long ¡will ¡it ¡take ¡un-l ¡the ¡next ¡call ¡to ¡be ¡
✺ How ¡long ¡will ¡it ¡take ¡un-l ¡the ¡next ¡call ¡to ¡be ¡
✺ A ¡store ¡has ¡a ¡number ¡of ¡customers ¡coming ¡on ¡
✺ A ¡store ¡has ¡a ¡number ¡of ¡customers ¡coming ¡on ¡
x ¡
✺ The ¡most ¡famous ¡con-nuous ¡random ¡variable ¡
Carl ¡F. ¡Gauss ¡ (1777-‑1855) ¡ Credit: ¡wikipedia ¡
✺ The ¡most ¡famous ¡con-nuous ¡random ¡variable ¡
Carl ¡F. ¡Gauss ¡ (1777-‑1855) ¡ Credit: ¡wikipedia ¡
✺ The ¡most ¡famous ¡con-nuous ¡random ¡variable ¡
−∞
Carl ¡F. ¡Gauss ¡ (1777-‑1855) ¡ Credit: ¡wikipedia ¡
✺ A ¡lot ¡of ¡data ¡in ¡nature ¡are ¡approximately ¡
Carl ¡F. ¡Gauss ¡ (1777-‑1855) ¡ Credit: ¡wikipedia ¡
Credit: ¡ ¡ wikipedia ¡
99.7% ¡ 95% ¡ 68% ¡
✺ If ¡we ¡standardize ¡the ¡normal ¡distribu-on ¡(by ¡
✺ A ¡con-nuous ¡random ¡variable ¡X ¡is ¡standard ¡
+∞
−∞
p(x) dx = +∞
−∞
1 σ √ 2π exp(−(x − µ)2 2σ2 ) dx = +∞
−∞
1 σ √ 2π exp(− ˆ x2 2 )σ dˆ x = +∞
−∞
1 √ 2π exp(− ˆ x2 2 ) dˆ x = +∞
−∞
p(ˆ x) dx
Call ¡this ¡standard ¡and ¡omit ¡ using ¡a ¡hat ¡ ˆ x = x − µ σ
✺ If ¡we ¡standardize ¡the ¡normal ¡distribu-on ¡(by ¡
✺ A ¡con-nuous ¡random ¡variable ¡X ¡is ¡standard ¡
E[X] = 0 & var[X] = 1
✺ Frac-on ¡of ¡normal ¡data ¡within ¡1 ¡standard ¡
✺ Frac-on ¡of ¡normal ¡data ¡within ¡k ¡standard ¡
1 √ 2π 1
−1
exp(−x2 2 )dx ≃ 0.68
1 √ 2π k
−k
exp(−x2 2 )dx
✺ If ¡X ¡~ ¡N ¡(μ=3, ¡σ2 ¡=16) ¡(normal ¡distribu-on) ¡
P(X ≤ 4) = P(X − 3 4 ≤ 4 − 3 4 ) = CDF(0.25)
x ¡
✺ The ¡distribu-on ¡of ¡the ¡sum ¡of ¡N ¡independent ¡
✺ Even ¡when ¡the ¡component ¡random ¡variables ¡
✺ CLT ¡helps ¡explain ¡the ¡prevalence ¡of ¡normal ¡
✺ A ¡binomial ¡random ¡variable ¡tends ¡toward ¡a ¡
10 20 30 40 0.00 0.05 0.10 0.15 0.20
Binomial
k probability
n=20,p=0.5 n=20,p=0.7 n=40,p=0.5
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
Binomial ¡distribu-on ¡
μ ¡= ¡20, ¡ ¡ ¡σ2 ¡= ¡10 ¡ n= ¡40, ¡p=0.5 ¡
10 20 30 40 0.00 0.05 0.10 0.15 0.20
Normal
k probability
¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡
Approxima-on ¡with ¡Normal ¡
E[k] = np = 40 · 0.5 = 20 P(10 ≤ k ≤ 25) =
25
40 k
=
25
40 k
std[k] =
= √ 40 · 0.5 · 0.5 = √ 10 ✺ Let ¡k ¡be ¡the ¡number ¡of ¡heads ¡appeared ¡in ¡40 ¡
✺ Goal ¡is ¡to ¡es-mate ¡the ¡following ¡with ¡normal ¡
P(10 ≤ k ≤ 25) ≃ 1 σ √ 2π 25
10
exp(−(x − µ)2 2σ2 )dx = 1 √ 2π
3.16 10−20 3.16
exp(−x2 2 )dx ≃ 0.94
✺ Use ¡the ¡same ¡mean ¡and ¡standard ¡devia-on ¡of ¡
✺ Then ¡standardize ¡the ¡normal ¡
¡