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 Thurs Oct . 8 Midterm 1 . . (


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

Midterm

1 Oct

. 8 .

Thurs

.

( CBT F )

12:30pm

conflicts

&

alternative

Oct

8

,

8pm

CBTF

Oct

.

9, 8 am

CBTF

Oct

8,

4pm

check

  • ut

instructions , practices

.
slide-3
SLIDE 3

Last time

Poisson Distribution

continuous

Random

Variable

probability Density

Function

slide-4
SLIDE 4

Objectives

Cumulative

Distribution

Function

for

continuous random

variable

Normal

C Gaussian) Distribution

Exponential

Distribution

Pdt

P ' " ' y

f

poxidx =/

  • o
slide-5
SLIDE 5

Cumulative

Distribution

Function

Det

. :

P ( X E x )

Discrete Rv

.

PCXEXK.IE?pcX=x )

  • 2
  • S

continuous

RV

×

pcxex ) =)

pix, dx

^

→ ¥1,1

"

  • x
slide-6
SLIDE 6

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

CD Ffx=¥] = o . 5 I

,

too
  • -T
x_ a
slide-7
SLIDE 7

Q: Probability density function: spinner

What is the constant c given the spin angle θ

has the following pdf? θ

p(θ)

π

c

  • A. 1
  • B. 1/π
  • C. 2/π
  • D. 4/π
  • E. 1/2π
  • ,

what is the

CDF

?

a

÷

,

slide-8
SLIDE 8

Quantile

µ Pdf Cx)

( DF

l K)

(

  • 7

K

Go.7

4.on to 7

slide-9
SLIDE 9

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 )

[Trix) dx

  • r
  • b
= /

(exp) →e

  • #
  • E

e

2

¥

slide-10
SLIDE 10

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-11
SLIDE 11

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-12
SLIDE 12

PDF and CDF of normal distribution curves

Credit: wikipedia

probability density tune .

I

( PDF )

| §

"" " """"

g-

FIT

Cumin

  • fun. .
+ ( CDF )

E

"

T;

into

µ =o

  • I

0=1

I I ' all @
slide-13
SLIDE 13

Quantile)

Quan(les)give)

a)measure)of) loca(on,)the) median)is)the) 0.5)quan(le)

Probability)density) Credit:)) J.)Orloff)et)al) ))) Cumula(ve)Probability) ) )(CDF))) CK, → Pdf
  • ,

/

2=0.253

OFI

→ CDF ✓

fo . 6=0.253

y

  • ÷
slide-14
SLIDE 14

Q.)

What)is)the)value)of)50%)quan(le)in)a)

standard)normal)distribu(on?)

  • A. J1)
  • B. 0)
  • C. 1)
  • "
slide-15
SLIDE 15

Spread of normal (Gaussian) distributed data

Credit: wikipedia

99.7% 95% 68%

res

f p CX) DX

e.68 µ - 6 6

si:.mx I

. .. .
slide-16
SLIDE 16

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 )

x -U

g-

= si
slide-17
SLIDE 17

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

Sakae

  • ⇐Ki.
=

¥

,

e-¥

dx

slide-18
SLIDE 18

C D F C b)

  • CDF Ca)

¥*¥÷t¥

.

peaks D= fab -¥

doc

slide-19
SLIDE 19

rat .

I

a.

cos

stuff

.

zico#ItcPFy;¥tfma②

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

e

slide-21
SLIDE 21
  • Q. What is the standard deviation of

standard normal?

  • A. 0
  • B. 1

a

slide-22
SLIDE 22

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-23
SLIDE 23

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 1=5

slide-24
SLIDE 24

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) =?

✓O-5

→ I

ss

#

. If
  • - -

÷÷÷

slide-25
SLIDE 25

Q.

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

A . 0.5199 B. 0.5987 C. 0.6915

a-

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

values enough?

  • A. Yes B. No.

e

slide-27
SLIDE 27

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

a S

OI=CDF

S

= X i t Xu
  • t XN

,

"#

µ→s

s →

  • tinsel S nI→ E c Norma,
slide-28
SLIDE 28

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-29
SLIDE 29

The Binomial distributed beads of the Galton Board

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

slide-30
SLIDE 30

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

Htt

"

pix-ks-cyeypkci.pt

  • k

pea> =

e-

' *minor

XB =

i Y

Bernoulli

Fo

GI var

pix

÷÷÷÷÷÷¥÷÷÷.¥¥h

slide-31
SLIDE 31

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-32
SLIDE 32

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

.

JV (o, I)

PEEL

ii.

slide-33
SLIDE 33

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-34
SLIDE 34

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-35
SLIDE 35

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-36
SLIDE 36

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-37
SLIDE 37

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-38
SLIDE 38

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-39
SLIDE 39

See you next time

See You!