Probability and Statistics for Computer Science A major use of - - PowerPoint PPT Presentation

probability and statistics
SMART_READER_LITE
LIVE PREVIEW

Probability and Statistics for Computer Science A major use of - - PowerPoint PPT Presentation

Probability and Statistics for Computer Science A major use of probability in sta4s4cal inference is the upda4ng of probabili4es when certain events are observed Prof. M.H. DeGroot Credit: wikipedia Hongye Liu, Teaching


slide-1
SLIDE 1

ì

Probability and Statistics for Computer Science

“A major use of probability in sta4s4cal inference is the upda4ng of probabili4es when certain events are observed” –
  • Prof. M.H. DeGroot
Hongye Liu, Teaching Assistant Prof, CS361, UIUC, 9.8.2020 Credit: wikipedia
slide-2
SLIDE 2

Fixed

team

review

Opt

  • ut
  • deadline

is today 9/8

@

7 pm central
slide-3
SLIDE 3

Laws of Sets

Commuta4ve Laws A ∩ B = B ∩ A A B = B A Associa4ve Laws (A ∩ B) ∩ C = A ∩ (B ∩ C) (A B) C = A (B C) Distribu4ve Laws A ∩ (B C) = (A ∩ B) (A ∩ C) A (B ∩ C) = (A B) ∩ (A C)
slide-4
SLIDE 4

Laws of Sets

Idempotent Laws A ∩ A = A A A = A Iden4ty Laws A ø = A A ∩ U = A A U = U A ∩ ø = ø Involu4on Law (A c) c = A Complement Laws A Ac = U A ∩ Ac = ø U c = ø ø c = U De Morgan’s Laws (A ∩ B) c = A c B c (A B) c = A c ∩ B c U is the complete set

⇐ pc AUDI

= pushpin
  • plan By
slide-5
SLIDE 5

Warm up

F)Ways of

forming a queue with co students randomly . per 'm co !

EEE

  • - l
students → ways of forming a queue
  • f
5 µ - permu randomly from lo students

res

II

con ' "

tree ¥÷I÷

,

5.tk#.?

* z ) ways of forty tsf 5

randomly

WM

' from co students f '?)
slide-6
SLIDE 6

Which is larger?

i ) l!! )

4183 )

A

. D B .

4

c .

None

in,

= c.I .)
slide-7
SLIDE 7

Last time

Probability

: a first look

Definitions

Random Experiment . Outcome , Sample space, Event

probability

  • three
axioms

Properties

  • f

probability

afalculating

probability

slide-8
SLIDE 8

Objectives

Probability

More probability

calculation

  • Conditional probability

* fazes rule

* Independence

slide-9
SLIDE 9

Senate Committee problem

The United States Senate contains two senators from each of the 50 states. If a commiZee of eight senators is selected at random, what is the probability that it will contain at least one of the two senators from IL?

  • f
too 8 I - p ( none
  • f IL
senators are ) gg chosen = i -

treaties

in ,

slide-10
SLIDE 10 ( I L z I L Senators ( Y
  • ins )

E) (%

T ris,

t ,

a-

slide-11
SLIDE 11

Probability: Birthday problem

Among 30 people, what is the probability that at least 2 of them celebrate their birthday on the same day? Assume that there is no February 29 and each day of the year is equally likely to be a birthday.

  • I - prob f none of
the people share
  • rder matters
B- day } House Tings : n

Irl

'l - 'Ii
slide-12
SLIDE 12

per n=t÷s.

(521=365×365×365 365
  • H
s , s - s , 30 365 y,

fi .

  • 365 }
30

Irl =

365
  • 365×364×363

( El F

  • .
. -
  • sbsp
t 365 ! Wu are different
go 335 !
slide-13
SLIDE 13

How

does it change with # of people P =
  • 706
K
  • 30
  • De Groot et , al
.
slide-14
SLIDE 14

what

are

the

differences

between

  • these
two

examples ?

Senate

Committee

, Birthday .
  • rder

doesn't

matter

matters

T

'I
slide-15
SLIDE 15

Conditional Probability

Mo4va4on of condi4onal

probability

pities sina.tn?.irire1

7 test is .

if①

→Di

Darth

parts

driven

too I
slide-16
SLIDE 16

Conditional Probability

Example:

An insurance company knows in a

popula4on of 100 thousands females, 89.835% expect to live to age 60, while 57.062% can expect to live to 80. Given a woman at the age of 60, what is the probability that she lives to 80?

Ent

slide-17
SLIDE 17

I

slide-18
SLIDE 18

Conditional Probability

The probability of A given B

Credit: Prof. Jeremy Orloff & Jonathan Bloom

P(A|B) = P(A ∩ B) P(B)

P(B) ̸= 0

The “Size” analogy

I

¥""m%m^#

slide-19
SLIDE 19

Conditional Probability

A : a woman lives to 80 B : a woman is at 60 now While

P(A) = 57, 062 100, 000 = 0.57062

P(A|B) = 57, 062 89, 835 = 0.6352

P(A|B) = P(A ∩ B) P(B)

  • 57062/100000
= =
  • . 6352
slide-20
SLIDE 20

Conditional Probability: die example

2 3 4 5 2 3 5 4 1 1

Throw 5-sided fair die twice.

X Y

P(A|B) =?

A : max(X, Y ) = 4 B : min(X, Y ) = 2 t

.

  • I *
x
  • stIs

÷ "Ii÷¥÷

slide-21
SLIDE 21

Conditional probability, that is?

P(A|B) = P(A ∩ B) P(B)

P(B) ̸= 0

slide-22
SLIDE 22

Venn Diagrams of events as sets

E c

1

E1 − E2 E1 ∩ E2

E1 ∪ E2

E1

E2

same:*

%

%

d T T t

t l T as
slide-23
SLIDE 23

Multiplication rule using conditional probability

Joint event

P(A|B) = P(A ∩ B) P(B)

P(B) ̸= 0

⇒ P(A ∩ B) = P(A|B)P(B)

B → Ita

slide-24
SLIDE 24

Multiplication using conditional probability

B-sdijkw.ie

*

⇒ Esse

pond"EhaI"7÷s

qpcsgpi.pt#D

\

prior likelihood

T

pcmert )= ?

slide-25
SLIDE 25

Symmetry of joint event in terms of conditional prob.

P(A|B) = P(A ∩ B) P(B)

P(B) ̸= 0

⇒ P(A ∩ B) = P(A|B)P(B) ⇒ P(B ∩ A) = P(B|A)P(A)

TEE

slide-26
SLIDE 26

P(A|B)P(B) = P(B|A)P(A)

∵ P(B ∩ A) = P(A ∩ B)

Symmetry of joint event in terms of conditional prob.

B n A =

An

B pl A)to PCB)# o
slide-27
SLIDE 27

The famous Bayes rule

P(A|B)P(B) = P(B|A)P(A)

P(A|B) = P(B|A)P(A) P(B)

Thomas Bayes (1701-1761)

¥

¥

. I in ," .
  • D %
. -> Du
slide-28
SLIDE 28

Bayes rule: lemon cars

There are two car factories, A and B, that supply the same dealer. Factory A produced 1000 cars, of which 10 were lemons. Factory B produced 2 cars and both were lemons. You bought a car that turned out to be a lemon. What is the probability that it came from factory B?

  • I

=

I f

T A

B : a bad car from the dealer * A : it came from Fac B p calm = Putnam = =

=L

T
slide-29
SLIDE 29

Bayes rule: lemon cars

There are two car factories, A and B, that supply the same dealer. Factory A produced 1000 cars, of which 10 were lemons. Factory B produced 2 cars and both were lemons. You bought a car that turned out to be a lemon. What is the probability that it came from factory B?

P(B|L) = P(L|B)P(B) P(L) Ix # = = E- to
slide-30
SLIDE 30

Simulation of Conditional Probability

hZp:// www.randomservices.org/ random/apps/ Condi4onalProbabilityExperim ent.html

slide-31
SLIDE 31

Additional References

Charles M. Grinstead and J. Laurie Snell

"Introduc4on to Probability”

Morris H. Degroot and Mark J. Schervish

"Probability and Sta4s4cs”

slide-32
SLIDE 32

Assignments

Reading Chapter 3 of the textbook Next 4me: More on independence and

condi4onal probability

slide-33
SLIDE 33

Addition material on Counting

slide-34
SLIDE 34

Addition principle

Suppose there are n disjoint

events, the number of

  • utcomes for the union of

these events will be the sum of the outcomes of these events.

slide-35
SLIDE 35

Multiplication principle

Suppose that a choice is made

in two consecu4ve stages

Stage 1 has m choices Stage 2 has n choices

Then the total number of

choices is mn

slide-36
SLIDE 36

Multiplication: example

How many ways are there to

draw two cards of the same suit from a standard deck of 52 cards? The draw is without replacement.

slide-37
SLIDE 37

Multiplication: example

How many ways are there to

draw two cards of the same suit from a standard deck of 52 cards? The draw is without replacement.

52×12

slide-38
SLIDE 38

Permutations (order matters)

From 10 digits (0,…9) pick 3 numbers for

a CS course number (no repe44on), how many possible numbers are there?

slide-39
SLIDE 39

Permutations (order matters)

From 10 digits (0,…9) pick 3 numbers for

a CS course number (no repe44on), how many possible numbers are there? 10×9×8 = P(10,3) = 720

P(n, r) = n! (n − r)!

slide-40
SLIDE 40

Combinations (order not important)

A graph has N ver4ces, how many edges

could there exist at most? Edges are un- direc4onal.

C(n, r) = n! (n − r)!r! = P(n, r) r!

= C(n, n − r)

slide-41
SLIDE 41

Combinations (order not important)

A graph has N ver4ces, how many edges

could there exist at most? Edges are un- direc4onal. C(N,2) = N×(N-1)/2

C(n, r) = n! (n − r)!r! = P(n, r) r!

= C(n, n − r)

slide-42
SLIDE 42

Partition

How many ways are there to rearrange

ILLINOIS?

General form

8! 3!2!1!1!1!

I L

n! n1!n2!...nr!

slide-43
SLIDE 43

Allocation

Puxng 6 iden4cal leZers into

3 mailboxs (empty allowed)

L L L L L L

Choose 2 from the 8 posi4ons

slide-44
SLIDE 44

Allocation

Puxng 6 iden4cal leZers into

3 mailboxs (empty allowed)

L L L L L L

Choose 2 from the 8 posi4ons: C(8,2) = 28

slide-45
SLIDE 45

Counting: How many think pairs could there be?

  • Q. Es4mate for # of pairs from

different groups. There are 4 even sized groups in a class of 200

slide-46
SLIDE 46

Random experiment

Q: Is the following experiment a

random experiment for probabilis4c study?

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

Size of sample space

Q: What is the size of the sample

space of this experiment? Deal 5 different cards out of a fairly shuffled deck of standard poker (order maZers).

  • A. C(52,5) B. P(52,5) C. 52
slide-48
SLIDE 48

Event

Roll a 4-sided die twice

The event “max is 4” and “sum is 4” are disjoint.

  • A. True
  • B. False
slide-49
SLIDE 49

Probability

Q: A deck of ordinary cards is shuffled

and 13 cards are dealt. What is the probability that the last card dealt is an ace?

  • A. 4*P(51,12)/P(52,13) B. 4/13
  • C. 4*C(51,12)/C(52,13)
slide-50
SLIDE 50

Allocation: beads

Puxng 3000 beads randomly

into 20 bins (empty allowed)

C(3019, 19) = 3019! 19!3000!

slide-51
SLIDE 51

See you next time

See You!