inclusion-exclusion - cornell university elements |a ... = p(a) + p(b) – p(a ∩ b) (set theory)...

40
Inclusion-Exclusion CS 2800: Discrete Structures, Fall 2014 Sid Chaudhuri

Upload: trinhtu

Post on 19-May-2018

217 views

Category:

Documents


1 download

TRANSCRIPT

Inclusion-Exclusion

CS 2800: Discrete Structures, Fall 2014

Sid Chaudhuri

ecampusnews.com

telegraph.co.uk

ftbie.com

iamlyons.com

Probability of general celebration in class

● Buses are delayed/cancelled 10% of the time during the winter

● I oversleep 20% of the time

Analogous: a serial circuit

A B

Broken 20%of the time

Analogous: a serial circuit

A B

Broken 10%of the time

What's the probability no current is fowing?

A B

Broken 20%of the time

Broken 10%of the time

Modeling

● A: event that buses are delayed– (or frst component breaks)

● B: event that I oversleep– (or second component breaks)

● Late = A ∪ B: event that I am late– (or current is blocked)

Probability of a Union

● Kolmogorov's 3rd Axiom guarantees a simple formula for the probability of the union of mutually exclusive events in a probability space

P(E1 ∪ E

2 ∪ E

3 ∪ …) = P(E

1) + P(E

2) + P(E

3) + …

Probability of a Union

● Kolmogorov's 3rd Axiom guarantees a simple formula for the probability of the union of mutually exclusive events in a probability space

P(E1 ∪ E

2 ∪ E

3 ∪ …) = P(E

1) + P(E

2) + P(E

3) + …

● But what if the events are not mutually exclusive?

SA

BA∩B

SA

BA∩B

SA

BA∩B

Counting Elements

|A ∪ B|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

= |A| + |B \ A|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

= |A| + |B \ A|

= |A| + |B \ A| + |A ∩ B| – |A ∩ B|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

= |A| + |B \ A|

= |A| + |B \ A| + |A ∩ B| – |A ∩ B|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

= |A| + |B \ A|

= |A| + |B \ A| + |A ∩ B| – |A ∩ B|

= |A| + |(B \ A) ∪ (A ∩ B)| – |A ∩ B|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

= |A| + |B \ A|

= |A| + |B \ A| + |A ∩ B| – |A ∩ B|

= |A| + |(B \ A) ∪ (A ∩ B)| – |A ∩ B|

= |A| + |B| – |A ∩ B|

Counting Elements

|A ∪ B| = |A ∪ (B \ A)|

= |A| + |B \ A|

= |A| + |B \ A| + |A ∩ B| – |A ∩ B|

= |A| + |(B \ A) ∪ (A ∩ B)| – |A ∩ B|

= |A| + |B| – |A ∩ B|

A similar result holds for probabilities

The Inclusion-Exclusion Principle(for two events)

For two events A, B in a probability space:

P(A ∪ B) = P(A) + P(B) – P(A ∩ B)

The Inclusion-Exclusion Principle(for two events)

For two events A, B in a probability space:

P(A ∪ B) = P(A) + P(B) – P(A ∩ B)

Don't use this to “prove” Kolmogorov's Axioms!!!

Proof:

P(A ∪ B) = P(A ∪ (B \ A)) (set theory)

The Inclusion-Exclusion Principle(for two events)

Proof:

P(A ∪ B) = P(A ∪ (B \ A)) (set theory)

= P(A) + P(B \ A) (mut. excl., so Axiom 3)

The Inclusion-Exclusion Principle(for two events)

Proof:

P(A ∪ B) = P(A ∪ (B \ A)) (set theory)

= P(A) + P(B \ A) (mut. excl., so Axiom 3)

= P(A) + P(B \ A) + P(A ∩ B) – P(A ∩ B) (Adding 0 = P(A ∩ B) – P(A ∩ B) )

The Inclusion-Exclusion Principle(for two events)

Proof:

P(A ∪ B) = P(A ∪ (B \ A)) (set theory)

= P(A) + P(B \ A) (mut. excl., so Axiom 3)

= P(A) + P(B \ A) + P(A ∩ B) – P(A ∩ B) (Adding 0 = P(A ∩ B) – P(A ∩ B) )

= P(A) + P((B \ A) ∪ (A ∩ B)) – P(A ∩ B) (mut. excl., so Axiom 3)

The Inclusion-Exclusion Principle(for two events)

Proof:

P(A ∪ B) = P(A ∪ (B \ A)) (set theory)

= P(A) + P(B \ A) (mut. excl., so Axiom 3)

= P(A) + P(B \ A) + P(A ∩ B) – P(A ∩ B) (Adding 0 = P(A ∩ B) – P(A ∩ B) )

= P(A) + P((B \ A) ∪ (A ∩ B)) – P(A ∩ B) (mut. excl., so Axiom 3)

= P(A) + P(B) – P(A ∩ B) (set theory)

The Inclusion-Exclusion Principle(for two events)

Will I be late for class?

● P(Late) = P(A ∪ B)

Will I be late for class?

● P(Late) = P(A ∪ B)

= P(A) + P(B) – P(A ∩ B)

Will I be late for class?

● P(Late) = P(A ∪ B)

= P(A) + P(B) – P(A ∩ B)

= 0.1 + 0.2 – ???

Will I be late for class?

● P(Late) = P(A ∪ B)

= P(A) + P(B) – P(A ∩ B)

= 0.1 + 0.2 – ???

Let's make the modeling assumptionA and B are independent: P(A ∩ B) = P(A) P(B)

Will I be late for class?

● P(Late) = P(A ∪ B)

= P(A) + P(B) – P(A ∩ B)

= P(A) + P(B) – P(A) P(B)

Will I be late for class?

● P(Late) = P(A ∪ B)

= P(A) + P(B) – P(A ∩ B)

= P(A) + P(B) – P(A) P(B)

= 0.1 + 0.2 – 0.1 × 0.2

Will I be late for class?

● P(Late) = P(A ∪ B)

= P(A) + P(B) – P(A ∩ B)

= P(A) + P(B) – P(A) P(B)

= 0.1 + 0.2 – 0.1 × 0.2

= 0.28

The Inclusion-Exclusion Principle(for three events)

For three events A, B, C in a probability space:

P(A ∪ B ∪ C) = P(A) + P(B) + P(C)

– P(A ∩ B) – P(B ∩ C) – P(C ∩ A)

+ P(A ∩ B ∩ C)

The Inclusion-Exclusion Principle

For events A1, A

2, A

3, … A

n in a probability space:

P(∪i=1n Ai)=∑i=1

n

P(A i)−∑1≤i< j≤nP(Ai∩A j)

+∑1≤i< j<k≤nP(Ai∩A j∩A k)−...+(−1)n−1P(∩i=1

n A i)

The Inclusion-Exclusion Principle

For events A1, A

2, A

3, … A

n in a probability space:

=∑k=1

n

((−1)k−1∑I⊆{1,2,... n}|I|=k

P(∩i∈I Ai))

+∑1≤i< j<k≤nP(Ai∩A j∩A k)−...+(−1)n−1P(∩i=1

n A i)

P(∪i=1n Ai)=∑i=1

n

P(A i)−∑1≤i< j≤nP(Ai∩A j)