Probability and Statistics for Computer Science Can we call - - PowerPoint PPT Presentation

probability and statistics
SMART_READER_LITE
LIVE PREVIEW

Probability and Statistics for Computer Science Can we call - - 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: wikipedia Hongye Liu, Teaching Assistant Prof, CS361, UIUC, 10.1.2020 Last time Objectives Normal


slide-1
SLIDE 1

ì

Probability and Statistics for Computer Science

Can we call the exci-ng ?

Hongye Liu, Teaching Assistant Prof, CS361, UIUC, 10.1.2020 Credit: wikipedia

e = lim

n→∞

  • 1 + 1

n n

e e

slide-2
SLIDE 2

Last time

slide-3
SLIDE 3

Objectives

✺ Normal (Gaussian) distribu-on ✺ Exponen-al distribu-on

slide-4
SLIDE 4

Cumulative distribution of continuous uniform distribution

✺ Cumula-ve distribu-on func-on (CDF)

  • f a uniform random variable X is:

X

b a 1

p(x)

1 b − a

X

b a

CDF P(X ≤ x) = x

−∞

p(x)dx

1

slide-5
SLIDE 5

Normal (Gaussian) distribution

✺ The most famous con-nuous random variable

distribu-on. The probability density is this:

Carl F. Gauss (1777-1855) Credit: wikipedia

p(x) = 1 σ √ 2π exp(−(x − µ)2 2σ2 )

slide-6
SLIDE 6

Normal (Gaussian) distribution

✺ The most famous con-nuous random variable

distribu-on. The probability density is this:

Carl F. Gauss (1777-1855) Credit: wikipedia

p(x) = 1 σ √ 2π exp(−(x − µ)2 2σ2 )

E[X] = µ & var[X] = σ2

slide-7
SLIDE 7

Normal (Gaussian) distribution

✺ The most famous con-nuous random variable

distribu-on. p(x) = 1 σ √ 2π exp(−(x − µ)2 2σ2 )

E[X] = µ & var[X] = σ2

+∞

−∞

p(x)dx = 1

Carl F. Gauss (1777-1855) Credit: wikipedia

slide-8
SLIDE 8

Normal (Gaussian) distribution

✺ A lot of data in nature are approximately

normally distributed, ie. Adult height, etc. p(x) = 1 σ √ 2π exp(−(x − µ)2 2σ2 )

E[X] = µ & var[X] = σ2

Carl F. Gauss (1777-1855) Credit: wikipedia

slide-9
SLIDE 9

PDF and CDF of normal distribution curves

Credit: wikipedia

slide-10
SLIDE 10

Spread of normal (Gaussian) distributed data

Credit: wikipedia

99.7% 95% 68%

slide-11
SLIDE 11

Standard normal distribution

✺ If we standardize the normal distribu-on (by

subtrac-ng μ and dividing by σ), we get a random variable that has standard normal distribu-on.

✺ A con-nuous random variable X is standard

normal if

p(x) = 1 √ 2π exp(−x2 2 )

slide-12
SLIDE 12

Derivation of standard normal distribution

p(x) = 1 √ 2π exp(−x2 2 )

+∞

−∞

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 − µ σ

slide-13
SLIDE 13
  • Q. What is the mean of standard normal?
  • A. 0
  • B. 1
slide-14
SLIDE 14
  • Q. What is the standard deviation of

standard normal?

  • A. 0
  • B. 1
slide-15
SLIDE 15

Standard normal distribution

✺ If we standardize the normal distribu-on (by

subtrac-ng μ and dividing by σ), we get a random variable that has standard normal distribu-on.

✺ A con-nuous random variable X is standard

normal if

p(x) = 1 √ 2π exp(−x2 2 )

E[X] = 0 & var[X] = 1

slide-16
SLIDE 16

Another way to check the spread of normal distributed data

✺ Frac-on of normal data within 1 standard

devia-on from the mean.

✺ Frac-on of normal data within k standard

devia-ons from the mean.

1 √ 2π 1

−1

exp(−x2 2 )dx ≃ 0.68

1 √ 2π k

−k

exp(−x2 2 )dx

slide-17
SLIDE 17

Using the standard normal’s table to calculate for a normal distribution’s probability

✺ If X ~ N (μ=3, σ2 =16) (normal distribu-on) P(X ≤ 5) =?

slide-18
SLIDE 18

Q.

✺ If X ~ N (μ=3, σ2 =16) (normal distribu-on) P(X ≤ 5) =?

A . 0.5199 B. 0.5987 C. 0.6915

slide-19
SLIDE 19
  • Q. Is the table with only positive x

values enough?

  • A. Yes B. No.
slide-20
SLIDE 20

Central limit theorem (CLT)

✺ The distribu-on of the sum of N independent

iden-cal (IID) random variables tends toward a normal distribu-on as N

✺ Even when the component random variables

are not exactly IID, the result is approximately true and very useful in prac-ce

slide-21
SLIDE 21

Central limit theorem (CLT)

✺ CLT helps explain the prevalence of normal

distribu-ons in nature

✺ A binomial random variable tends toward a

normal distribu-on when N is large due to the fact it is the sum of IID Bernoulli random variables

slide-22
SLIDE 22

The Binomial distributed beads of the Galton Board

The Binomial distribu-on looks very similar to Normal when N is large

slide-23
SLIDE 23

Binomial approximation with Normal

  • ● ● ●
  • ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●

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

slide-24
SLIDE 24

Binomial approximation with Normal

E[k] = np = 40 · 0.5 = 20 P(10 ≤ k ≤ 25) =

25

  • k=10

40 k

  • 0.5k0.540−k

=

25

  • k=10

40 k

  • 0.540 ≃ 0.96

std[k] =

  • np(1 − p)

= √ 40 · 0.5 · 0.5 = √ 10 ✺ Let k be the number of heads appeared in 40

tosses of fair coin

✺ The goal is to es-mate the following with normal

slide-25
SLIDE 25

Binomial approximation with Normal

P(10 ≤ k ≤ 25) ≃ 1 σ √ 2π 25

10

exp(−(x − µ)2 2σ2 )dx = 1 √ 2π

  • 25−20

3.16 10−20 3.16

exp(−x2 2 )dx ≃ 0.94

✺ Use the same mean and standard devia-on of

the original binomial distribu-on.

✺ Then standardize the normal to do the

calcula-on

σ = √ 10 ≃ 3.16 µ = 20

slide-26
SLIDE 26

Exponential distribution

✺ Common

Model for wai-ng -me

✺ Associated

with the Poisson distribu-on with the same λ

p(x) = λe−λx for x ≥ 0

Credit: wikipedia

slide-27
SLIDE 27

Exponential distribution

✺ A con-nuous random variable X is exponen-al

if it represent the “-me” un-l next incident in a Poisson distribu-on with intensity λ. Proof See Degroot et al Pg 324.

✺ It’s similar to Geometric distribu>on – the

discrete version of wai-ng in queue

p(x) = λe−λx for x ≥ 0

slide-28
SLIDE 28

Expectations of Exponential distribution

✺ A con-nuous random variable X is exponen-al

if it represent the “-me” un-l next incident in a Poisson distribu-on with intensity λ.

p(x) = λe−λx for x ≥ 0

E[X] = 1 λ & var[X] = 1 λ2

x

slide-29
SLIDE 29

Example of exponential distribution

✺ How long will it take un-l the next call to be

received by a call center? Suppose it’s a random variable T. If the number of incoming call is a Poisson distribu-on with intensity λ = 20 in an hour. What is the expected -me for T?

slide-30
SLIDE 30

Q:

✺ A store has a number of customers coming on

  • Sat. that can be modeled as a Poisson

distribu-on. In order to measure the average rate of customers in the day, the staff recorded the -me between the arrival of customers, can he reach the same goal?

  • A. Yes B. No
slide-31
SLIDE 31

Additional References

✺ Charles M. Grinstead and J. Laurie Snell

"Introduc-on to Probability”

✺ Morris H. Degroot and Mark J. Schervish

"Probability and Sta-s-cs”

slide-32
SLIDE 32

See you next time

See You!