1 Section 3.3 Principle of Inclusion and Exclusion.

15
1 Section 3.3 Principle of Inclusion and Exclusion

Transcript of 1 Section 3.3 Principle of Inclusion and Exclusion.

Page 1: 1 Section 3.3 Principle of Inclusion and Exclusion.

1

Section 3.3 Principle of

Inclusion and Exclusion

Page 2: 1 Section 3.3 Principle of Inclusion and Exclusion.

2

( 2 more counting principles )

Principle of Inclusion and Exclusion Given finite sets A1, A2, …An, n 2, then

|A1A2 … An| =

nji

ji

n

ii AAA

11

||||

...||1

nkji

kji AAA

+ (-1)n+1| A1A2 … An |

Page 3: 1 Section 3.3 Principle of Inclusion and Exclusion.

3

A-B AB B-AS: universal set

A-B, AB, B-A are mutually disjoint sets. i.e. xA-B, then xB,

and therefore x B-A, x AB.

|AB| = |A| + |B| - |AB||A-B| = |A| - |AB||B-A| = |B| - |AB|

e.g. |AB| can be computed in several ways depends on the information given.

Page 4: 1 Section 3.3 Principle of Inclusion and Exclusion.

4

e.g. In a group of 42 tourists, everyone speaks English or French; there are 35 English speakers and 18 French speakers. How many speak both English & French?

42

English French

35 18

?

|AB| = |A| + |B| - |AB|

|AB| = 11

42 35 18

Page 5: 1 Section 3.3 Principle of Inclusion and Exclusion.

5

e.g. What if we have 3 sets:

|ABC| = |A| + |B| + |C| - |A B| - |A C| - |B C| + |A B C|

L.H.S. = |A (B C)| = |A| + |B C|-|A (B C)|

= |A| + |B| + |C| - |B C| - |(A B) (A C)| = |A| + |B| + |C| - |B C| - |A B| - |A C| + |ABC|

= R.H.S.(can also be seen from the picture)

A

B C

I

I I

II IIIII

II

For |A| + |B| + |C|:I: counted 1 timeII: counted 2 timesIII: counted 3 times

Page 6: 1 Section 3.3 Principle of Inclusion and Exclusion.

6

eg: a survey of 150 college students reveals that:

83 own Cars,

97 own Bikes,

28 own Motorcycles,53 own a car and a bike,14 own a car and a motorcycle,7 own a bike and a motorcycle,2 own all three.

Page 7: 1 Section 3.3 Principle of Inclusion and Exclusion.

7

a. How many own a bike and nothing else?

|B – (C M)|= |B| - |B (C M)|= |B| - |(B C) (B M)|= |B| - (|B C| + |B M| - |B C M|)= 97 – (53 + 7 – 2)= 39

C 83

B 97M 28

Page 8: 1 Section 3.3 Principle of Inclusion and Exclusion.

8

b. How many students do not own any of the three?

150 - |C B M|= 150 – (83+97+28-53-14-7+2)= 150 – 136 = 14

The general formula can be derived on P.1

15018

12

9

51

5

2

39

C

B M

14

Page 9: 1 Section 3.3 Principle of Inclusion and Exclusion.

9

Pigeonhole Principle:

If more than k items are placed into k bins, then at least one bin contains more than one item.e.g. How many people must be in a room to guarantee that two people have last names that begin with the same letter?

there are 26 letters(or bins). If there are 27 people, then at least 2 people will have last names beginning with the same letter.

Page 10: 1 Section 3.3 Principle of Inclusion and Exclusion.

10

e.g. The population of city x is about 35,000. If each resident has three initials, is it true that there must be at least 2 individuals with the same initials?

Yes, 26 26 26 = 17,576 < 35,000

Why?Pigeonhole principle & Multiplication rule

Page 11: 1 Section 3.3 Principle of Inclusion and Exclusion.

11

eg: How many numbers less than 1 million contain the digit 2?987234 398173 × 222333

106 - 96

(including 0) (without digit 2)

eg: How many bit strings have length 3, 4, or 5? 101 1110 00110 100001×

23 + 24 + 25

Page 12: 1 Section 3.3 Principle of Inclusion and Exclusion.

12

eg: Quality control in a factory pulls 40 parts with paint, packaging, or electronics defects from an assembly line. Of these,

28 had a paint defect, 17 had a packaging defect, 13 had an electronics defect, 6 had both paint and packaging

defects, 7 had both packaging and electronics defects,

and 10 had both paint and electronics defects.

Did any part have all three types of defect?

Page 13: 1 Section 3.3 Principle of Inclusion and Exclusion.

13

Yes, x = 5

40 parts w/paint, packaging, or electronics defects:40 = 28 + 17 + 13 – 6 – 7 – 10 + x

x = 5Paint

Packaging electronics

28

1713

Page 14: 1 Section 3.3 Principle of Inclusion and Exclusion.

14

eg: In a group of 25 people, must there be at least 3 who were born in the same month?

25 people, since there are only 12 months(bins)

more than 24 items means that at least one bin has more than 2 items.

Yes

Page 15: 1 Section 3.3 Principle of Inclusion and Exclusion.

15

e.g. How many numbers must be selected from the set {2, 4, 6, 8, 10, 12, 14, 16, 18, 20} in order to guarantee that at least one pair adds up to 22?

Find all pairs add to 22: (2, 20)(4, 18)(6, 16) 5 bins(8, 14)(10, 12)

6 numbers selected, at least 2 of them will be from the same pair, which gives 22.