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, 9.29.2020 the number ? what is N am Kk


slide-1
SLIDE 1

ì

Probability and Statistics for Computer Science

Can we call the exci-ng ?

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

e = lim

n→∞

  • 1 + 1

n n

e e

slide-2
SLIDE 2

what is

the

number ?

N

e

"

= I

am Kk

x

k

  • o

e

^

an

= ? ¥

s

(E)

'

= ex

ex

slide-3
SLIDE 3

How

many

empty

shots ?

Hashing

N items

to

k

slots , IN " k )

collisions

are

allowed

,

and

will

be

handled

by

linked list .

What

is

che

td

number of

empty

slots ?

Xi = f

l

slot

in

remains empty

  • therwise

ECM

. .

=EKxi)

p ( slot

remains empty )

= ( I - tf)

"

  • [ ( Xd ) =

T.xpcxi-i.pcisutimpyito.ci/-P'=k.ltIEIeiI

=

u- Fas

"

slide-4
SLIDE 4

Last time

Bernoulli

Distribution

Binomial

Dpistribution)

Benfield;

Geometric

istribwtion

slide-5
SLIDE 5

Objectives

Poisson Distribution

continuous

Random

Variable

probability Density

Function

Exponential

Distribution

slide-6
SLIDE 6

Motivation for

Poisson

Disa could

incidences in

a

time

interval

.

→ all

these

rate

data

in

a

wanting

process

.
slide-7
SLIDE 7

Motivation for a model called Poisson Distribution

What’s the probability of the number of

incoming customers (k) in an hour?

It’s widely applicable in physics

and engineering both for modeling of -me and space.

Simeon D. Poisson (1781-1840) Credit: wikipedia

Degroot

Pg 287

  • 288
slide-8
SLIDE 8

Poisson Distribution

A discrete random variable X is called

Poisson with intensity λ (λ>0) if

Simeon D. Poisson (1781-1840)

P(X = k) = e−λλk k!

for integer k ≥ 0

λ is the average rate of the event′s occurrence

x

slide-9
SLIDE 9

Poisson Distribution

Poisson distribu-on is a valid pdf for

Simeon D. Poisson (1781-1840)

P(X = k) = e−λλk k!

for integer k ≥ 0

λ is the average rate of the event′s occurrence

x

  • i=0

λi i! = eλ ⇒

  • k=0

λke−λ k! = 1

pcxekl = -2¥

"

k

k !

=

e-

'

'

e Ik

PC f) =/

k

k !

  • a

a

= e

  • e
O

= e

  • =/
slide-10
SLIDE 10

Expectations of Poisson Distribution

The expected value and the variance are

wonderfully the same! That is λ

Simeon D. Poisson (1781-1840)

P(X = k) = e−λλk k!

for integer k ≥ 0

E[X] = λ var[X] = λ

x

*

EM

= -2 x pox tank

warm

=-2k¥

.is :

  • An .dk
  • I

⇒e¥

!

⇒ Ee: -

Kal de

  • l) ?

=D - -_

slide-11
SLIDE 11

Plxtk )

.
  • e
  • T

ak

KT

vwCxI=

Efx'T

  • Easy

= -2 kkY

'

  • n'
  • = A
slide-12
SLIDE 12

Examples of Poisson Distribution

How many calls does a call center get in an hour? How many muta-ons occur per 100k

nucleo-des in an DNA strand?

How many independent incidents occur in an

interval?

P(X = k) = e−λλk k!

for integer k ≥ 0

slide-13
SLIDE 13

Poisson Distribution: call center

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

  • = I 0

I - E Paek,

K-0

pixels,= e

  • da k

Ti

k= 15

  • lo

15

A

  • lo
Ic

=

÷ o.o 3

I

, I

15 !

K

  • 16

k !

slide-14
SLIDE 14
  • Q. Poisson Distribution: call center

If a call center receives 4 calls per hour on average. What is intensity λ here for an hour?

  • A. 1
  • B. 4
  • C. 8

Credit: wikipedia

e

slide-15
SLIDE 15
  • Q. Poisson Distribution: call center

If a call center receives 4 calls per hour on average. What is probability the center receives 0 calls in an hour?

  • A. e-4
  • B. 0.5
  • C. 0.05

Credit: wikipedia

A

ECXI

  • a

M

uns Cx7= T

  • a = 4

p ex -

  • ki
  • e÷"I

K

  • o no = ,

K

  • o

K !

= o ! = I
slide-16
SLIDE 16
  • Q. Poisson Distribution: call center

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?

=-D

= 20

proof : Deere; gao

slide-17
SLIDE 17

Example of a continuous random variable

The spinner The sample space for all outcomes is

not countable

θ

θ ∈ (0, 2π]

t

slide-18
SLIDE 18

* What

is

che probability of

p ( O = Oo) ?

do

is

a constant

in

( o, UT ]

  • .

I

*

what is

the probability of

PL Oo - o

  • O .-180 )

?

" ÷÷÷÷÷÷÷÷÷

slide-19
SLIDE 19

Probability density function (pdf)

For a con-nuous random variable X, the

probability that X=x is essen-ally zero for all (or most) x, so we can’t define

Instead, we define the probability density

func;on (pdf) over an infinitesimally small interval dx,

For a < b

p(x)dx = P(X ∈ [x, x + dx])

b

a

p(x)dx = P(X ∈ [a, b])

P(X = x)

slide-20
SLIDE 20

A putt X=4

'

¥I→X=x

Pfaff

b)

fab pdtixdx

= -

slide-21
SLIDE 21

Properties of the probability density function

resembles the probability func-on

  • f discrete random variables in that

for all x The probability of X taking all possible

values is 1.

p(x) p(x) ≥ 0

−∞

p(x)dx = 1

per) = I

slide-22
SLIDE 22

Area under the Pdf

curve

pdt

c

/

'

÷"

tie

'

slide-23
SLIDE 23

Properties of the probability density function

differs from the probability

distribu-on func-on for a discrete random variable in that

is not the probability that X = x can exceed 1

p(x) p(x) p(x)

  • r

"

slide-24
SLIDE 24

Probability density function: spinner

Suppose the spinner has equal chance

stopping at any posi-on. What’s the pdf of the angle θ of the spin posi-on?

For this func-on to be a pdf,

Then

θ

2π c

p(θ) =

  • c

if θ ∈ (0, 2π]

  • therwise

−∞

p(θ)dθ = 1

c-

  • IF
slide-25
SLIDE 25

Probability density function: spinner

What the probability that the spin angle θ is

within [ ]?

π 12, π 7

  • pi
  • c- f

II )

=

pies

are

Pcos

: LT

,

tor

OG lo, 24)

no

=

  • O

If UT

slide-26
SLIDE 26

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π

'

I

slide-27
SLIDE 27

Expectation of continuous variables

Expected value of a con-nuous random

variable X

Expected value of func-on of con-nuous

random variable

E[X] = ∞

−∞

xp(x)dx E[Y ] = E[f(X)] = ∞

−∞

f(x)p(x)dx

Y = f(X)

x

weight

  • S
slide-28
SLIDE 28

Probability density function: spinner

Given the probability density of the spin angle θ The expected value of spin angle is

p(θ) = 1

if θ ∈ (0, 2π]

  • therwise

E[θ] = ∞

−∞

θp(θ)dθ

It

=) .6¥

, do

= LT

. OY.

"

=

I

#

= I

slide-29
SLIDE 29

Properties of expectation of continuous random variables

The linearity of expected value is true for

con-nuous random variables.

And the other proper-es that we derived

for variance and covariance also hold for con-nuous random variable

slide-30
SLIDE 30

Q.

Suppose a con-nuous variable has pdf

What is E[X]?

  • A. 1/2
  • B. 1/3
  • C. 1/4
  • D. 1
  • E. 2/3

p(x) =

  • 2(1 − x)

x ∈ [0, 1]

  • therwise

E[X] = ∞

−∞

xp(x)dx

do

at

home

slide-31
SLIDE 31

Continuous uniform distribution

A con-nuous random variable X is

uniform if

X

b a 1 1 b − a

p(x)

O

slide-32
SLIDE 32

Continuous uniform distribution

A con-nuous random variable X is

uniform if

p(x) =

  • 1

b−a

for x ∈ [a, b]

  • therwise

E[X] = a + b 2 & var[X] = (b − a)2 12

X

b a 1

p(x)

1 b − a

Efx's

  • eix,

÷a¥Ii⇐

tax? pcxidxefak

? 'Fa¥x

Eat!

slide-33
SLIDE 33

Continuous uniform distribution

A con-nuous random variable X is

uniform if

Examples: 1) A dart’s posi-on thrown on the

target

p(x) =

  • 1

b−a

for x ∈ [a, b]

  • therwise

E[X] = a + b 2 & var[X] = (b − a)2 12

X

b a 1

p(x)

1 b − a

slide-34
SLIDE 34

Continuous uniform distribution

A con-nuous random variable X is

uniform if

Examples: 1) A dart’s posi-on thrown on the

target 2) Ojen associated with random sampling

p(x) =

  • 1

b−a

for x ∈ [a, b]

  • therwise

E[X] = a + b 2 & var[X] = (b − a)2 12

X

b a 1

p(x)

1 b − a

slide-35
SLIDE 35

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

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

Qs for discrete distributions

slide-38
SLIDE 38

Q.

A store staff mixed their fuji and gala

apples and they were individually wrapped, so they are indis-nguishable. Given there are 70% of fuji, if I want to know what is the probability I get 7 fuji in 20 apples? What is the distribu-on I should use?

  • A. Bernoulli
  • B. Binomial
  • C. Geometric
  • D. Poisson
  • E. Uniform
slide-39
SLIDE 39

Q.

A store staff mixed their fuji and gala

apples and they were individually wrapped, so they are indis-nguishable. Given there are 70% of fuji, if I want to know what is the probability I get 7 fuji in 20 apples? What is the distribu-on I should use? What is the probability?

slide-40
SLIDE 40

Q.

A store staff mixed their fuji and gala

apples and they were individually wrapped, so they are indis-nguishable. Given there are 70% of fuji, if I want to know the probability of picking the first gala on the 7th -me (I can put back ajer each pick). What is the distribu-on I should use?

  • A. Bernoulli
  • B. Binomial
  • C. Geometric
  • D. Poisson
  • E. Uniform
slide-41
SLIDE 41

Q.

A store staff mixed their fuji and gala

apples and they were individually wrapped, so they are indis-nguishable. Given there are 70% of fuji, if I want to know the probability of picking the first gala on the 7th -me (I can put back ajer one pick). What’s the probability?

slide-42
SLIDE 42

Q.

A store staff mixed their fuji and gala

apples and they were individually wrapped, so they are indis-nguishable. Given there are 70% of fuji, what’s the average ;mes of picking to get the first gala?

slide-43
SLIDE 43

See you next time

See You!