0% found this document useful (0 votes)
94 views27 pages

Week2 Session 1 Application Venn Diagram

Here are the solutions to the selected exercises from Discrete Mathematics and Its Applications by Kenneth H. Rosen: 1) Let A = {students who study math}, B = {students who study science}, C = {students who study English}. |A∪B∪C| = Total students - students who study nothing = 34 - ? Given: |A| = 20, |B| = 25, |A∩B| = 10, |B∩C| = 15, |A∩C| = 8 Using the inclusion-exclusion principle: |A∪B∪C| = |A| + |B| + |C| - |A∩B|

Uploaded by

zain ashraf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views27 pages

Week2 Session 1 Application Venn Diagram

Here are the solutions to the selected exercises from Discrete Mathematics and Its Applications by Kenneth H. Rosen: 1) Let A = {students who study math}, B = {students who study science}, C = {students who study English}. |A∪B∪C| = Total students - students who study nothing = 34 - ? Given: |A| = 20, |B| = 25, |A∩B| = 10, |B∩C| = 15, |A∩C| = 8 Using the inclusion-exclusion principle: |A∪B∪C| = |A| + |B| + |C| - |A∩B|

Uploaded by

zain ashraf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Sets

Chapter # 2 section 2.2, pg#115

Book: Discrete Mathematics and Its Applications Kenneth H. Rosen

Week 2 July 12, 2020 – July 19, 2020


Session 1 application of sets

Session 1 and 2

Course: Discrete Structures

Instructor : Muhammad Atif Idrees


Principle of Inclusion/Exclusion
We are often interested in finding the cardinality of a union of two finite sets A and B.

Note that |A| + |B| counts each element that is in A but not in B or in B but not in A exactly
once and each element that is in both A and B exactly twice.

Thus, if the number of elements that are in both A and B is subtracted from |A| + |B|,
elements in A ∩ B will be counted only once.

Hence,

5
Principle of Inclusion/Exclusion

| A  B |=| A | + | B | − | A  B |
Also,

| A |=| A  B | − | B | + | A  B |
Principle of Inclusion & Exclusion
|A  B| = |A| + |B| - |A  B|
• The above equation represents the principle of
inclusion and exclusion for two sets A and B.
• The name comes from the fact that to calculate the
elements in a union, we include the individual
elements of A and B but subtract the elements
common to A and B so that we don’t count them
twice.
• This principle can be generalized to n sets.
1- n(AUB) = n(A) + n(B) - n(AnB)

2- n(AUBUC) = n(A)+n(B)+n(C)-n(AnB)-n(BnC)-n(AnC)+n(AnBnC)

n(AuB) = Total number of elements related to any of the two events A & B.
n(AnB) = Total number of elements related to both A & B
n(AuBuC) = Total number of elements related to any of the three events A, B & C.

n(A) = Total number of elements related to A.

n(B) = Total number of elements related to B.

n(C) = Total number of elements related to C.


Question:
There are 40 students in a class. 20 take Chemistry and 25 take French. 8 students take both.
1.Find how many students take none.
2.How many are there in at least one classes?
Solution:
We will solve the problem using venn diagram. First let us write all the given information.

Universal set U = 40

Students take Chemistry C = 20


Students take French F = 25
Students take both CnF = 8
Example 2: Inclusion/Exclusion for three Sets
• Example 2: In a class of students undergoing a
computer course the following were observed.
• Out of a total of 50 students: 30 know Java, 18 know C++,
26 know Basic, 9 know both Java and C++, 16 know both
Java and Basic, 8 know both C++ and Basic, 47 know at
least one of the three languages.
• From this we have to determine
• a. How many students know none of these languages?
• b. How many students know all three languages?
Example2 Solution
a. We know that 47 students know at least one of the three languages in the
class of 50. The number of students who do not know any of three
languages is given by the difference between the number of students in
class and the number of students who know at least one language.
• Hence, the students who know none of these languages = 50 – 47 = 3.
b. Students know all three languages, so we need to find |A  B  C|.
▪ A = All the students who know Java in class.
• B = All the students who know C++ in the class.
• C = All the students who know BASIC in class.
• We have to derive the inclusion/exclusion formula for three sets
|A  B  C| = |A  (B  C)| = |A| + |B  C| - |A  (B  C)|
Example2 Solution (Continued)
• |A  B  C| = |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| - |A  B  C|)
= |A| + |B| + |C| - |B  C| - |A  B| - |A  C| + |A  B  C|
• Given in the problem are the following:
|B  C| = 8
|A  B| = 9
|A  C| =16
|A  B  C| = 47
• Hence, using the above formula, we have
47 = 30 + 26 + 18 -9 -16 -8 + |A  B  C|
Hence, |A  B  C| = 6
• Now we use this result to fill the venn diagram we have:
• 6 knows all three languages
• 9 know both Java and C++ but not basic=9-6
Java and C++=3
➢16 know both Java and Basic but not C++ =16-6
Java and Basic=10
➢8 know both C++ and Basic but not java =8-6
C++ and Basic=2
30-3-6-10=11 knows only java
18-3-6-2=7 knows only C++
26-10-6-2=8 knows only basic

26
Exercise 2.2 pg # 136 from recommended book by Kenneth H. Rosen

Q1, 3, 4. 34, 50, 53, 54

You might also like