4.3. The Inclusion-Exclusion Principle
4.3. The Inclusion-Exclusion Principle
Sinple orm
AUB = 1A| + |s -
1Ane
unted twice
B
141+|el
50, exclded iraldy onu
- 1AnB
Examples
How many infegers et 1 to 20 axe divisible by 2,
32
A A
3
2 or 3
Hhan, AUB
2 and 3
A DB
>LeM o 2 aud 3
10 + 6 3
13
verificahm 1, 2, 3, 4. 5. 6, 7,8,9, 1o
Tot 3
auy
2Hosb wnauy bit string lergth 4 stor t ih O cr enda
th 11?
B end ih I
stans i k
AU
O anod 11
A0G A
A: O o/ o
AUB lAl+|6) -1A nG| 2 2 2
=
2+ 2" -
2
e: o11 :2
8 +4-2 2 2
10
A A6 : 11:2
2
ttou many infegers bet 1 to 50 ae divisibl byy o
3 or 8 ?
C 8
L+ -13
25+ 6 - 8= 33
includnd twi ce
A0enc is AOC exeluoud
onc
enerad fov ms
A
A,UAz U As . .
.UAn I =
ËI4:| -
2
Ii<sn
I i<j<ksn
A,...DAn
+ (-) A,O A2 0
Exaupla
14:1+|44| + Taking single
A,UAg UA UA4-l4,l+|2 |+
- 1 4 , 4 | - 14,0 4-4,0441-14:0As|-14,04
- taking intersection of double
-
1As 0 A|
+ taking intersection of triple
+|4,0A,0Aa]+|A,a^A
+|A,A0As +|A, A44)
t prebltmg :
-
Veridy wih
Htu mauy mtegers ber 1 to 100o ae divisibe by
2 or or 5 r lo 2