0% found this document useful (0 votes)
49 views49 pages

Lecture 3

Here are the solutions to the quiz questions: Q1. Construct a truth table for the following expression: P ∧ (Q ∨ R) P Q R P ∧ (Q ∨ R) 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 Q2. The Boolean expression corresponding to the given circuit is: Y = PQ + PR The outputs for the given inputs are: Input: 00, Output: 0 Input: 01, Output: 1 Input: 10, Output: 1 Input: 11

Uploaded by

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

Lecture 3

Here are the solutions to the quiz questions: Q1. Construct a truth table for the following expression: P ∧ (Q ∨ R) P Q R P ∧ (Q ∨ R) 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1 Q2. The Boolean expression corresponding to the given circuit is: Y = PQ + PR The outputs for the given inputs are: Input: 00, Output: 0 Input: 01, Output: 1 Input: 10, Output: 1 Input: 11

Uploaded by

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

LECTURE NO 3

Basic Set Theory


Functions
A set is an unordered collection of objects, called elements or
members of the set. A set is said to contain its elements. We write
a ∈ A to denote that a is an element of the set A. The notation a
∉ A denotes that a is not an element of the set A.

O = {1, 3, 5, 7, 9}.
O = {x | x is an odd positive integer less than 10},
O = {x ∈ Z+ | x is odd and x < 10}.
V = {a, e, i, o, u}.
L = {1, 2, 3, . . . , 99}.
R, the set of real numbers
R+, the set of positive real numbers
C, the set of complex numbers.
[a, b] = {x | a ≤ x ≤ b}
[a, b) = {x | a ≤ x < b}
(a, b] = {x |a < x ≤ b}
(a, b) = {x |a < x < b}
Note that [a, b] is called the closed interval from a to b and (a,
b) is called the open interval from a to b.

Two sets are equal if and only if they have the same elements.
Therefore, if A and B are sets, then A and B are equal if and only
if ∀x(x ∈ A ↔ x ∈ B).We write A = B if A and B are equal sets.

The sets {1, 3, 5} and {3, 5, 1} are equal, because they have the
same elements
The set A is a subset of B if and only if every element of A is also an
element of B. We use the notation A ⊆ B to indicate that A is a subset of
the set B.
The quantification of A ⊆ B is ∀x(x ∈ A → x ∈ B).

Let S be a set. If there are exactly n distinct elements in S where n is a


nonnegative integer, we say that S is a finite set and that n is the
cardinality of S. The cardinality of S is denoted by |S|.

EXAMPLE 10
Let A be the set of odd positive integers less than 10. Then |A| = 5.

EXAMPLE 11
Let S be the set of letters in the English alphabet. Then |S| = 26.

EXAMPLE 12
Because the null set has no elements, it follows that | ∅| = 0.
Solution:
Question:

For each of these pairs of sets, determine whether the first is a


subset of the second, the second is a subset of the first, or neither
is a subset of the other.
a) the set of people who speak English, the set of people
who speak English with an Australian accent
b) the set of fruits, the set of citrus fruits
c) the set of students studying discrete mathematics, the
set of students studying data structures
OPERATIONS ON SETS

 A ∪ B = {x | x ∈ A ∨ x ∈ B}. Union of two sets


 A ∩ B = {x | x ∈ A ∧ x ∈ B}.Intersection of two sets

 |A ∪ B| = |A| + |B| − |A ∩ B|. Cardinality of union


of two sets
 A − B = {x | x ∈ A ∧x ∉ B}. Difference of two sets

 A^c = {x ∈ U | x ∉A}. Complement of a set


Example:

You ask a Man: Who do you live with in your house ?


He replies: I live with my wife and two sons.
You ask his wife: Who do you live with in your house ?
She replies: I live with my husband and two sons.

You ask yourself: How many members this family has ? 6 or 4 ?


The correct answer is 4 (and not 6) by avoiding double counting of two sons.
| 𝐴 ∪ 𝐵|=6
| 𝐴|+|𝐵|−| 𝐴 ∩ 𝐵|= 4+ 4 −2=6
Q. Prove the following equality of sets: 𝐴∪ 𝐵= 𝐴∩ 𝐵
Solution:

𝑥 ∈ 𝐴∪ 𝐵
→ 𝑥 ∈ 𝐴∨ 𝑥 ∈ 𝐵
→ 𝑥 ∉ 𝐴∨ 𝑥 ∉ 𝐵
→ ¬ ( 𝑥 ∈ 𝐴 ) ∨¬( 𝑥 ∈ 𝐵)
→ ¬( 𝑥 ∈ 𝐴∧ 𝑥 ∈ 𝐵)
→ ¬( 𝑥 ∈ 𝐴∩ 𝐵)
→ 𝑥 ∈ 𝐴∩ 𝐵

Alternatively, prove the above equality using the membership table!


Q. Prove the following equality of sets:

Solution:
Q:

Solution:
Question:
Practice problems:
Definition:
Example:
Example:
Let A and B be sets. The Cartesian product of A and B, denoted
by A × B, is the set of all ordered pairs (a, b), where a ∈ A and b
∈ B. Hence,
A × B = {(a, b) | a ∈ A ∧ b ∈ B}.

EXAMPLE 17
What is the Cartesian product of A = {1, 2} and
B = {a, b, c}?

Solution:
The Cartesian product A × B is
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.
EXAMPLE 19
What is the Cartesian product A × B × C, where
A = {0, 1}, B = {1, 2}, and C = {0, 1, 2} ?

Solution:
The Cartesian product A × B × C consists of all ordered triples (a,
b, c), where a ∈ A, b ∈ B, and c ∈ C. Hence,
A × B × C = {(0, 1, 0), (0, 1, 1), (0, 1, 2), (0, 2, 0), (0, 2, 1),
(0, 2, 2),(1, 1, 0), (1, 1, 1), (1, 1, 2), (1, 2, 0), (1, 2, 1),
(1, 2, 2)}.

Is it possible to calculate A × A?
FUNCTIONS

Let A and B be nonempty sets. A function f from A to B is an


assignment of exactly one element of B to each element of A.
f (a) = b; f : A → B.

If f is a function from A to B, we say that A is the domain of f and


B is the codomain of f.
b is the image of a and a is a preimage of b.
The range of f is the set of all images of elements of A.
In general, the range is a subset of codmain while in some cases,
they are equal.
When f is not a function ?

f
1 A
2 B
3 C
4 D

Here f is not a function since f(2)=A, and f(2)=C i.e. two elements are
assigned 2.
A function f from A to B is called one-to-one (or injective) (or
injective) whenever f (a) = f (b) implies
a = b, i.e., No element of B is the image of more than one element
in A. Or If every element of domain has unique image in Range.

A function f from A to B is called onto (or surjective) if for


all b in B there is an a in A such that whenever
f (a) = b. All elements in B are used.
Example:
Definition

Example:
EXAMPLE 22 Let g be the function from the set {a, b, c} to itself
such that g(a) = b, g(b) = c, and g(c) = a. Let f be the function from
the set {a, b, c} to the set {1, 2, 3} such that f (a) = 3, f (b) = 2, and
f (c) = 1. What is the composition of f and g, and what is the
composition of g and f ?
Solution:
The composition f ◦ g is defined by
(f ◦ g)(a) = f (g(a)) = f (b) = 2,
(f ◦ g) (b) = f (g(b)) = f (c) = 1,
and
(f ◦ g)(c) = f (g(c)) = f (a) = 3.
Note that g ◦ f is not defined, because the range of f is not a subset
of the domain of g.
Example:
Example:

1 1 1 1
⌊ − ⌋=⌊ ⌋ + ⌊ − ⌋ ?
2 2 2 2
1 1
⌊ − ⌋= ⌊ 0 ⌋ =0
2 2
1 1 1
⌊ ⌋=0 , ⌊ − ⌋ =− ⌈ ⌉ =−1
2 2 2

Hence the above equality does not hold.


Example:
QUIZ-1
Q.1 Construct a truth table for the following expression

Q.2 Find the Boolean expression corresponding to the circuit given below.
Further, find the output if the input is
00,01,10,11 ?

You might also like