CH 2 - Fundamental Structures
CH 2 - Fundamental Structures
Chapter II
Fundamental Structures
A A A i 1 2 An A A A
i 1 2 An
i1
i1
Set Theory – Disjoint Set
A
B
• Uc = Ø and Øc = U
• A - B = A Bc
09/03/23 Prepared by Dr. Zakir H. Ahmed 14
Set Theory – Set Identities
C C
A (B C) (A B) (A C)
Identities Name
AU=A
Identity laws
AU=A
AUU=U
Domination laws
A=
AUA=A
Idempotent laws
AA=A
(Ac)c = A Complementation law
AUB=BUA
Commutative laws
AB=BA
A U (B U C) = (A U B) U C
Associative laws
A (B C) = (A B) C
Identities Name
A U (B C) = (A U B) (A U C)
Distributive laws
A (B U C) = (A B) U (A U C)
(A U B)c = Ac Bc
De Morgan’s laws
(A B)c = Ac U Bc
A U (A B) = A
Absorption laws
A (A U B) = A
A U Ac = U
Complement laws
A Ac =
Question:
Prove the above identities by using Venn diagram
and Membership tables ??
09/03/23 Prepared by Dr. Zakir H. Ahmed 18
Cardinality of a set
B A Wrong or right?
Answer:
• Note that |A|+|B| counts each element that is in
A but not in B, or in B not in A, exactly once.
• Each element that is in both A and B will be
counted twice
• So, elements in A B will be subtracted the
result, i.e.,
|A B| = |A| + |B| - |A B|
Question: Generalize the formula for 3 sets
Example:
There are 150 CS majors CS530
100 are taking CS530 CS520
70 are taking CS520
30 are taking both
Question:
How many are taking neither?
Answer:
150 – (100 + 70 - 30) = 10
th 1 if ai A
i bit
0 if ai A
Examples:
• Let U={1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and
• Then the set A={1, 3, 5, 7, 9} can be represented by
the string of bits: 10 1010 1010
• The set B={1, 2, 4, 9} can be represented as:
11 0100 0010
09/03/23 Prepared by Dr. Zakir H. Ahmed 23
Examples:
• A: 10 1010
1010
• B: 11 0100
0010
• The set A U B can be represented as: 11 1110 1010
• The set A B can be represented as:10 0000 0010
Questions:
• If C={1, 6, 8, 10}, express following sets with bit
strings
A-B, Ac, A U (B C) and A (B U C)
09/03/23 Prepared by Dr. Zakir H. Ahmed 24
Functions
Notation: f: RR,
codomain f(x) = -(1/2)x - 25
domain
f(x) = -(1/2)x - 25
Hussain Amina
Muhammad Fatima
Hassan Khadiza
Eisa Mariyam
09/03/23 Prepared by Dr. Zakir H. Ahmed 29
A B
Functions – Image and Pre-image
Hussain Amina
Muhammad Fatima
Hassan Khadiza
Eisa Mariyam
Muhammad Amina
Hassan Fatima
Eisa Mariyam
A B
An important implication of this characteristic:
The preimage (f-1) is a function!
:Example 14
Q3. Suppose f: R R,
f(x) = x2.
Is f one-to-one?
Is f onto?
Is f bijective?
Q4. Let f be a function
from {a, b, c, d} to
{1, 2, 3, 4} with f(a)=4,
f(a)=3, f(b)=2, f(c)=1
and f(d)=3.
Is f one-to-one?
Is f onto?
Is f bijective?
A f B
09/03/23 Prepared by Dr. Zakir H. Ahmed 40
Functions – Examples
(f o g)(a)
. g(a) . f(g(a)) .
a g(a) f(g(a))
g f
A B C
fog
09/03/23 Prepared by Dr. Zakir H. Ahmed 42
Functions – Examples
:Example 19
Some properties:
• f(Ø) = Ø
• f({a}) = {f(a)}
• f(A U B) = f(A) U f(B)
• f(A B) f(A) f(B)
• f-1-1() = -1
• f-1(A U B) = f-1(A) U f-1-1(B)
• f (A B) = f (A) f (B)