You are on page 1of 4

Data Science Math Skills

Paul Bendich and Daniel Egger


Duke University

Sets: Venn Diagrams


Video companion

1 Visualizing sets
• Venn diagrams

• Inclusion-exclusion formula

• Medical testing example, re-visited

2 Single set
A = {1, 5, 10, 2} |A| = 4

1
5
A=
10
2

1
Data Science Math Skills
Paul Bendich and Daniel Egger
Duke University

3 Multiple sets

A = {1, 5, 10, 2}
B = {5, −7, 10, 3}
C = {8, 11}

A B
C
1 10 −7
8

2
5 11
3

A∩C =∅
A ∩ B = {10, 5}
B∩C =∅

2
Data Science Math Skills
Paul Bendich and Daniel Egger
Duke University

4 Inclusion-exclusion formula

A∪B

A B

1 10 −7

2
5
3

A ∩ B = {10, 5}

Inclusion-exclusion formula:

|A ∪ B| = |A| + |B| − |A ∩ B|

Check with this example:


?
6=4+4−2
6=6 X

3
Data Science Math Skills
Paul Bendich and Daniel Egger
Duke University

5 Medical testing example

S ∩ N = false negative

N P

X=

H S

H ∩ P = false positive

X =H ∪S H ∩S =∅
S =N ∪P N ∩P =∅

You might also like