SlideShare a Scribd company logo
1 of 23
Download to read offline
Discrete Maths: Exercises and Solutions
Basic Structures: Sets, Functions, Sequences,
Sums and Matrices
Page 1 of 22
Basic Structures: Sets, Functions,
Sequences, Sums and Matrices
Much of discrete mathematics is devoted to the study of discrete structures, used to represent
discrete objects. Many important discrete structures are built using sets, which are collections
of objects.
2.1 Sets:
Introduction: In this section, we study the fundamental discrete structure on which all other
discrete structures are built, namely, the set. Sets are used to group objects together. Often,
but not always, the objects in a set have similar properties. For instance, all the students who
are currently enrolled at any school/college, make up a set. Likewise, all the students currently
taking a discrete mathematics course make up a set. In addition, those currently enrolled
students, who are taking a course in discrete mathematics form a set that can be obtained by
taking the elements common to the first two collections.
Definition: 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.
It is common for sets to be denoted using uppercase letters. Lowercase letters are usually
used to denote elements of sets.
There are several ways to describe a set. One way is to list all the members of a set, when
this is possible. We use a notation where all members of the set are listed between braces. For
example, the notation {a, b, c, d} represents the set with the four elements a, b, c, and d. This
way of describing a set is known as the roster method.
EXAMPLE 1 The set V of all vowels in the English alphabet can be written as V = {a, e, i, o, u}.
EXAMPLE 2 The set O of odd positive integers less than 10 can be expressed by
O = {1, 3, 5, 7, 9}.
Sometimes the roster method is used to describe a set without listing all its members. Some
members of the set are listed, and then ellipses (. . .) are used when the general pattern of the
elements is obvious.
EXAMPLE 3: The set of positive integers less than 100 can be denoted by {1, 2, 3, . . . , 99}.
Page 2 of 22
Another way to describe a set is to use set builder notation. We characterize all those
elements in the set by stating the property or properties they must have to be members. For
instance, the set O of all odd positive integers less than 10 can be written as
O = {x | x is an odd positive integer less than 10}, or, specifying the universe as the set of
positive integers, as O = {x โˆˆ Z+ | x is odd and x < 10}.
We often use this type of notation to describe sets when it is impossible to list all the elements
of the set. For instance, the set Q+ of all positive rational numbers can be written as
Q+ = {x โˆˆ R | x =
๐‘
๐‘ž
, for some positive integers p and q}.
These sets ( common Universal sets), each denoted using a boldface letter, play an important
role in discrete mathematics:
N = {0, 1, 2, 3, . . .}, the set of natural numbers
Z = {. . . ,โˆ’2,โˆ’1, 0, 1, 2, . . .}, the set of integers
Z+ = {1, 2, 3, . . .}, the set of positive integers
Q = {p/q | p โˆˆ Z, q โˆˆ Z, and q _= 0}, the set of rational numbers
R, the set of real numbers
R+, the set of positive real numbers
C, the set of complex numbers.
Definition: 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.
EXAMPLE 4: The sets {1, 3, 5} and {3, 5, 1} are equal, because they have the same elements.
Note that the order in which the elements of a set are listed does not matter. Note also that it
does not matter if an element of a set is listed more than once, so {1, 3, 3, 3, 5, 5, 5, 5} is the
same as the set {1, 3, 5} because they have the same elements.
The empty set: There is a special set that has no elements. This set is called the empty set,
or null set, and is denoted by โˆ…. The empty set can also be denoted by { }
Definition: 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.
Page 3 of 22
The Size of a Set
Sets are used extensively in counting problems, and for such applications we need to discuss
the sizes of sets.
Definition: 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 5 Let A be the set of odd positive integers less than 10. Then |A| = 5.
EXAMPLE 6 Let S be the set of letters in the English alphabet. Then |S| = 26.
EXAMPLE 7 Because the null set has no elements, it follows that |โˆ…| = 0.
Definition: Given a set S, the power set of S is the set of all subsets of the set S. The power set
of S is denoted by P(S).
EXAMPLE 8 What is the power set of the set {0, 1, 2}?
Solution: The power set P({0, 1, 2}) is the set of all subsets of {0, 1, 2}. Hence,
P({0, 1, 2}) = {โˆ…, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}.
Note: If a set has n elements, then its power set has 2n elements.
Definition: 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 9 What is the Cartesian product of A = {1, 2} and B = {a, b, c}?
Solution: The Cartesian product A ร— B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.
EXAMPLE 10 What is the Cartesian product A ร— B ร— C, where A = {0, 1}, B = {1, 2}, and
C = {0, 1, 2} ?
Solution: The Cartesian productA ร— 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)}.
Page 4 of 22
Note : When A, B, and C are sets, (A ร— B) ร— C is not the same as A ร— B ร— C
We use the notation A2 to denote A ร— A, the Cartesian product of the set A with itself.
Similarly, A3 = A ร— A ร— A, A4 = A ร— A ร— A ร— A, and so on. More generally,
An = {(a1, a2, . . . , an) | ai โˆˆ A for i = 1, 2, . . . , n}.
EXAMPLE 11 Suppose that A = {1, 2}. It follows that A2 = {(1, 1), (1, 2), (2, 1), (2, 2)} and
A3 = {(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)}.
Page 5 of 22
Exercise 2.1
1. List the members of these sets.
a) {x | x is a real number such that x2 = 1}
b) {x | x is a positive integer less than 12}
c) {x | x is the square of an integer and x < 100}
d) {x | x is an integer such that x2 = 2}
2. Use set builder notation to give a description of each of these sets.
a) {0, 3, 6, 9, 12}
b) {โˆ’3,โˆ’2,โˆ’1, 0, 1, 2, 3}
c) {m, n, o, p}
3. Determine whether each of these pairs of sets are equal.
a) {1, 3, 3, 3, 5, 5, 5, 5, 5}, {5, 3, 1}
b) {{1}}, {1, {1}}
c) โˆ…, {โˆ…}
4. For each of the following sets, determine whether 2 is an element of that set.
a) {x โˆˆ R | x is an integer greater than 1}
b) {x โˆˆ R | x is the square of an integer}
c) {2,{2}}
Page 6 of 22
5. What is the cardinality of each of these sets?
a) {a}
b) {{a}}
c) {a, {a}}
d) {a, {a}, {a, {a}}}
6. Find the power set of each of these sets, where a and b are distinct elements.
a) {a}
b) {a, b}
c) {โˆ…, {โˆ…}}
7. Let A = {a, b, c, d} and B = {y, z}. Find
a) A ร— B.
b) B ร— A.
8. Let A = {a, b, c}, B = {x, y}, and C = {0, 1}. Find
a) A ร— B ร— C.
b) C ร— B ร— A.
c) C ร— A ร— B.
d) B ร— B ร— B.
9. Find A2 if
a) A = {0, 1, 3}.
b) A = {1, 2, a, b}.
Page 7 of 22
10. Find A3 if
a) A = {a}.
b) A = {0, a}.
Page 8 of 22
2.2 Set Operations:
Introduction: Two, or more, sets can be combined in many different ways. For instance,
starting with the set of Computer Science majors at your school and the set of Business majors
at your school, we can form the set of students who are Computer Science majors or Business
majors, the set of students who are joint majors in Business and Computer science, the set of
all students not majoring in Computer Science, and so on.
Definition: Let A and B be sets. The union of the sets A and B, denoted by A โˆช B, is the set
that contains those elements that are either in A or in B, or in both.
An element x belongs to the union of the sets A and B if and only if x belongs to A or x belongs
to B. This tells us that A โˆช B = {x | x โˆˆ A โˆจ x โˆˆ B}.
EXAMPLE 12 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5};
that is, {1, 3, 5} โˆช {1, 2, 3} = {1, 2, 3, 5}.
Definition: Let A and B be sets. The intersection of the sets A and B, denoted by A โˆฉ B, is the
set containing those elements in both A and B.
An element x belongs to the intersection of the sets A and B if and only if x belongs to A and
x belongs to B. This tells us that A โˆฉ B = {x | x โˆˆ A โˆง x โˆˆ B}.
EXAMPLE 13 The intersection of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 3};
that is, {1, 3, 5} โˆฉ {1, 2, 3} = {1, 3}.
Definition: Let A and B be sets. The difference of A and B, denoted by A โˆ’ B, is the set
containing those elements that are in A but not in B. The difference of A and B is also called the
complement of B with respect to A.
An element x belongs to the difference of A and B if and only if x โˆˆ A andx /โˆˆ B. This tells us
That A โˆ’ B = {x | x โˆˆ A โˆงx /โˆˆ B}.
EXAMPLE 14 The difference of {1, 3, 5} and {1, 2, 3} is the set {5}; that is, {1, 3, 5} โˆ’ {1, 2, 3} =
{5}. This is different from the difference of {1, 2, 3} and {1, 3, 5}, which is the set {2}.
Page 9 of 22
Definition: Let U be the universal set. The complement of the set A, denoted by ๐ดฬ…, is the
complement of A with respect to U. Therefore, the complement of the set A is U โˆ’ A.
An element belongs to A if and only if x /โˆˆ A. This tells us that A = {x โˆˆ U | x /โˆˆ A}.
EXAMPLE 15 Let A = {a, e, i, o, u} (where the universal set is the set of letters of the English
alphabet). Then A = {b, c, d, f, g, h, j, k, l,m, n, p, q, r, s, t, v,w, x, y, z}.
Page 10 of 22
Exercise 2.2
1. Let A = {1, 2, 3, 4, 5} and B = {0, 3, 6}. Find
a) A โˆช B.
b) A โˆฉ B.
c) A โˆ’ B.
d) B โˆ’ A.
2. Let A = {a, b, c, d, e} and B = {a, b, c, d, e, f, g, h}. Find
a) A โˆช B.
b) A โˆ’ B.
c) B โˆ’ A.
d) A โˆฉ B.
3. Let A = {0, 2, 4, 6, 8, 10}, B = {0, 1, 2, 3, 4, 5, 6}, and C = {4, 5, 6, 7, 8, 9, 10}. Find
a) A โˆฉ B โˆฉ C.
b) A โˆช B โˆช C.
c) (A โˆช B) โˆฉ C.
d) (A โˆฉ B) โˆช C.
4. What can you say about the sets A and B if we know that
a) A โˆช B = A?
b) A โˆฉ B = A?
c) A โˆ’ B = A?
d) A โˆฉ B = B โˆฉ A?
Page 11 of 22
2.3 Functions
Introduction : In many instances we assign to each element of a set a particular element of a
second set (which may be the same as the first). For example, suppose that each student in a
discrete mathematics class is assigned a letter grade from the set {A,B,C,D, F}. And suppose that
the grades are A for Adams, C for Chou, B for Goodfriend, A for Rodriguez, and F for Stevens.
This assignment of grades is illustrated in Figure 1.
Adams A
Chou B
Goodfriend C
Rodriguez D
Stevens F
FIGURE 1: Assignment of Grades in a Discrete Mathematics Class.
This assignment is an example of a function. The concept of a function is extremely important
in mathematics and computer science. For example, in discrete mathematics functions are
used in the definition of such discrete structures as sequences and strings. Functions are also
used to represent how long it takes a computer to solve problems of a given size.
Definition: 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. We write f (a) = b if b is the unique element of B
assigned by the function f to the element a of A. If f is a function from A to B, we write f : A โ†’ B.
Note: Functions are sometimes also called mappings or transformations.
Definition: 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. If f (a) = b, we say that b is the image of a and a is a preimage of b. The range, or image,
of f is the set of all images of elements of A. Also, if f is a function from A to B, we say that f
maps A to B.
EXAMPLE 16 What are the domain, codomain, and range of the function that assigns grades to
students described in the first paragraph of the introduction of this section?
Solution: Let G be the function that assigns a grade to a student in our discrete mathematics
class. Note that G(Adams) = A, for instance.
The domain of G is the set {Adams, Chou, Goodfriend, Rodriguez, Stevens}, and
the codomain is the set {A,B,C,D, F}.
The range of G is the set {A,B,C, F}, because each grade except D is assigned to some student.
Page 12 of 22
Definition: Let f be a function from A to B and let S be a subset of A. The image of S under
the function f is the subset of B that consists of the images of the elements of S. We denote the
image of S by f (S), so f (S) = {t | โˆƒs โˆˆS (t = f (s))}.
We also use the shorthand {f (s) | s โˆˆ S} to denote this set.
EXAMPLE 17 : Let A = {a, b, c, d, e} and B = {1, 2, 3, 4} with f (a) = 2, f (b) = 1, f (c) = 4, f (d) = 1,
and f (e) = 1. The image of the subset S = {b, c, d} is the set f (S) = {1, 4}.
One-to-One and Onto Functions
Some functions never assign the same value to two different domain elements. These functions
are said to be one-to-one.
Definition: A function f is said to be one-to-one, or an injunction, if and only if f (a) = f (b)
implies that a = b for all a and b in the domain of f. A function is said to be injective if it is one-
to-one.
a 1
b 2
c 3
d 4
5
FIGURE 2: A One-to-One Function.
EXAMPLE 18 : Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with
f (a) = 4, f (b) = 5, f (c) = 1, and f (d) = 3 is one-to-one.
Solution: The function f is one-to-one because f takes on different values at the four elements
of its domain.
Page 13 of 22
Definition: A function f from A to B is called onto, or a surjection, if and only if for every
element b โˆˆ B there is an element a โˆˆ A with f (a) = b. A function f is called surjective if it is
onto.
a 1
b 2
c 3
d
FIGURE 3: An Onto Function.
EXAMPLE 19 : Let f be the function from {a, b, c, d} to {1, 2, 3} defined by f (a) = 3, f (b) = 2, f (c)
= 1, and f (d) = 3. Is f an onto function?
Solution: Because all three elements of the codomain are images of elements in the domain, we
see that f is onto. Note that if the codomain were {1, 2, 3, 4}, then f would not be onto.
FIGURE 4: Examples of Different Types of Correspondences.
Definition: The function f is a one-to-one correspondence, or a bijection, if it is both one-to-
one and onto. We also say that such a function is bijective.
EXAMPLE 20: Let f be the function from {a, b, c, d} to {1, 2, 3, 4} with f (a) = 4, f (b) = 2, f (c) = 1,
and f (d) = 3. Is f a bijection?
Solution: The function f is one-to-one and onto. It is one-to-one because no two values in
the domain are assigned the same function value. It is onto because all four elements of the
codomain are images of elements in the domain. Hence, f is a bijection.
Page 14 of 22
Definition: Let g be a function from the set A to the set B and let f be a function from the set
B to the set C. The composition of the functions f and g, denoted for all a โˆˆ A by f โ—ฆ g, is
defined by (f โ—ฆ g)(a) = f (g(a)).
EXAMPLE 21: 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 22: Let f and g be the functions from the set of integers to the set of integers defined
by f (x) = 2x + 3 and g(x) = 3x + 2. What is the composition of f and g? What is the composition
of g and f ?
Solution: Both the compositions f โ—ฆ g and g โ—ฆ f are defined.
Moreover, (f โ—ฆ g)(x) = f (g(x)) = f (3x + 2) = 2(3x + 2) + 3 = 6x + 7
And (g โ—ฆ f )(x) = g(f (x)) = g(2x + 3) = 3(2x + 3) + 2 = 6x + 11.
Page 15 of 22
Exercise 2.3
1. Determine whether each of these functions from {a, b, c, d} to itself is
a) one-to-one b) Onto
i) f (a) = b, f (b) = a, f (c) = c, f (d) = d
ii) f (a) = b, f (b) = b, f (c) = d, f (d) = c
iii) f (a) = d, f (b) = b, f (c) = c, f (d) = d
Page 16 of 22
2. Determine whether each of these functions from Z to Z is one-to-one.
a) f (n) = n โˆ’ 1
b) f (n) = n2 + 1
c) f (n) = n3
3. Which functions in the above question are onto?
Page 17 of 22
4. Determine whether each of these functions is a bijection from R to R.
a) f (x) = 2x + 1
b) f (x) = x2 + 1
c) f (x) = x3
5. Find f โ—ฆ g and g โ—ฆ f , where f (x) = x2 + 1 and g(x) = x + 2, are functions from R to R.
Page 18 of 22
2.4 Sequences and Summations
Introduction: Sequences are ordered lists of elements, used in discrete mathematics in many
ways. They are also an important data structure in computer science. We will often need to
work with sums of terms of sequences in our study of Discrete Mathematics.
The terms of a sequence can be specified by providing a formula for each term of the
Sequence. Identifying a sequence when the first few terms are provided is a useful skill when
solving problems in discrete mathematics.
Definition: A sequence is a function from a subset of the set of integers (usually either the set
{0, 1, 2, . . .} or the set {1, 2, 3, . . .}) to a set S. We use the notation an to denote the image of
the integer n. We call an a term of the sequence
EXAMPLE 23: Consider the sequence {an}, where an =
1
๐‘›
The list of the terms of this sequence, beginning with a1, namely,
a1, a2, a3, a4, . . . , starts with
1
1
,
1
2
,
1
3
,
1
4
, โ€ฆโ€ฆโ€ฆ etc
Definition: An arithmetic progression is a sequence of the form
a, a + d, a + 2d, . . . , a + nd, . . . where the initial term a and the common difference d are real
numbers.
Definition: A geometric progression is a sequence of the form
a, ar, ar2, . . . , arn, . . .
where the initial term a and the common ratio r are real numbers.
EXAMPLE 24 Let {an} be a sequence that satisfies the recurrence relation
an = anโˆ’1 + 3 for n = 1, 2, 3, . . . , and suppose that a0 = 2. What are a1, a2, and a3?
Solution: We see from the recurrence relation that a1 = a0 + 3 = 2 + 3 = 5. It then follows
that a2 = 5 + 3 = 8 and a3 = 8 + 3 = 11.
Page 19 of 22
EXAMPLE 25 Let {an} be a sequence that satisfies the recurrence relation
an = anโˆ’1 โˆ’ anโˆ’2 for n = 2, 3, 4, . . . , and suppose that a0 = 3 and a1 = 5. What are a2 and a3?
Solution: We see from the recurrence relation that a2 = a1 โˆ’ a0 = 5 โˆ’ 3 = 2 and a3 = a2 โˆ’
a1 = 2 โˆ’ 5 = โˆ’3.We can find a4, a5, and each successive term in a similar way.
Summations :
Next, we consider the addition of the terms of a sequence. For this we introduce summation
notation. We begin by describing the notation used to express the sum of the terms
am, am+1, . . . , an from the sequence {an}.We use the notation
โˆ‘ ๐‘Ž๐‘—
๐‘›
๐‘—=๐‘š
(read as the sum from j = m to j = n of aj ) to represent am + am+1 +ใƒป ใƒป ใƒป+an.
Here, the variable j is called the index of summation, and the choice of the letter j as the
variable is arbitrary; that is, we could have used any other letter, such as i or k.
EXAMPLE 26 Use summation notation to express the sum of the first 100 terms of the
sequence {aj }, where aj =
1
๐‘—
for j= 1, 2, 3, . . . .
Solution: The lower limit for the index of summation is 1, and the upper limit is 100.We write
this sum as
โˆ‘
1
๐‘—
100
๐‘—=1
EXAMPLE 27: What is the value of โˆ‘ ๐‘—2
5
๐‘—=1
Solution: We have
โˆ‘ ๐‘—2
5
๐‘—=1 = 12 + 22 + 32 + 42 + 52
= 1 + 4 + 9 + 16 + 25
= 55.
Page 20 of 22
EXAMPLE 28: What is the value of โˆ‘ (โˆ’1)๐‘˜
8
๐‘˜=4 ?
Solution: We have
โˆ‘(โˆ’1)๐‘˜
8
๐‘˜=4
= (โˆ’1)4 + (โˆ’1)5 + (โˆ’1)6 + (โˆ’1)7 + (โˆ’1)8
= 1 + (โˆ’1) + 1 + (โˆ’1) + 1
= 1.
Page 21 of 22
Exercise 2.4
1. Find these terms of the sequence {an}, where an = 2 ใƒป (โˆ’3)n + 5n.
a) a0 b) a1 c) a4 d) a5
2. What is the term a8 of the sequence {an} if an equals
a) 2nโˆ’1? b) 7?
3. What are the terms a0, a1, a2, and a3 of the sequence {an}, where an equals
a) 2n + 1?
b) (โˆ’2)n ?
c) 7 + 4n?
Page 22 of 22
4. Find the first five terms of the sequence defined by each of these recurrence relations and
initial conditions.
a) an = 6anโˆ’1, a0 = 2
b) an = a2
nโˆ’1, a1 = 2
c) an = anโˆ’1 + 3anโˆ’2, a0 = 1, a1 = 2
5. What are the values of these sums?
a) โˆ‘ (๐‘˜ + 1)
5
๐‘˜=1
b) โˆ‘ (โˆ’2)๐‘—
4
๐‘—=0

More Related Content

What's hot

Set theory-ppt
Set theory-pptSet theory-ppt
Set theory-pptvipulAtri
ย 
Sets and venn diagrams
Sets and venn diagramsSets and venn diagrams
Sets and venn diagramsFarhana Shaheen
ย 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summationsAli Saleem
ย 
Set theory
Set theorySet theory
Set theorymanikanta361
ย 
Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Amr Rashed
ย 
Linear dependence & independence vectors
Linear dependence & independence vectorsLinear dependence & independence vectors
Linear dependence & independence vectorsRakib Hossain
ย 
Echelon or not
Echelon or notEchelon or not
Echelon or notDrradz Maths
ย 
METHOD OF JACOBI
METHOD OF JACOBIMETHOD OF JACOBI
METHOD OF JACOBIjorgeduardooo
ย 
Equivalence relations
Equivalence relationsEquivalence relations
Equivalence relationsTarun Gehlot
ย 
Error analysis in numerical integration
Error analysis in numerical integrationError analysis in numerical integration
Error analysis in numerical integrationAmenahGondal1
ย 
Category Theory for Programmers
Category Theory for ProgrammersCategory Theory for Programmers
Category Theory for ProgrammersSantosh Rajan
ย 
Systems of Linear Equations
Systems of Linear EquationsSystems of Linear Equations
Systems of Linear Equationsalrosiemae
ย 
Linear algebra-Basis & Dimension
Linear algebra-Basis & DimensionLinear algebra-Basis & Dimension
Linear algebra-Basis & DimensionManikanta satyala
ย 
Inner Product Space
Inner Product SpaceInner Product Space
Inner Product SpacePatel Raj
ย 
Daa linear recurrences
Daa linear recurrencesDaa linear recurrences
Daa linear recurrencesAtul Verma
ย 
Matrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIAMatrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIADheeraj Kataria
ย 

What's hot (20)

Set theory-ppt
Set theory-pptSet theory-ppt
Set theory-ppt
ย 
Sets and venn diagrams
Sets and venn diagramsSets and venn diagrams
Sets and venn diagrams
ย 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summations
ย 
Set theory
Set theorySet theory
Set theory
ย 
Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1Discrete Structure Mathematics lecture 1
Discrete Structure Mathematics lecture 1
ย 
Linear dependence & independence vectors
Linear dependence & independence vectorsLinear dependence & independence vectors
Linear dependence & independence vectors
ย 
Echelon or not
Echelon or notEchelon or not
Echelon or not
ย 
METHOD OF JACOBI
METHOD OF JACOBIMETHOD OF JACOBI
METHOD OF JACOBI
ย 
Equivalence relations
Equivalence relationsEquivalence relations
Equivalence relations
ย 
Sor
SorSor
Sor
ย 
Error analysis in numerical integration
Error analysis in numerical integrationError analysis in numerical integration
Error analysis in numerical integration
ย 
Category Theory for Programmers
Category Theory for ProgrammersCategory Theory for Programmers
Category Theory for Programmers
ย 
Generating function
Generating functionGenerating function
Generating function
ย 
Systems of Linear Equations
Systems of Linear EquationsSystems of Linear Equations
Systems of Linear Equations
ย 
Linear algebra-Basis & Dimension
Linear algebra-Basis & DimensionLinear algebra-Basis & Dimension
Linear algebra-Basis & Dimension
ย 
Inner Product Space
Inner Product SpaceInner Product Space
Inner Product Space
ย 
Daa linear recurrences
Daa linear recurrencesDaa linear recurrences
Daa linear recurrences
ย 
Multivariate Calculus Abdul Aziz
Multivariate Calculus Abdul AzizMultivariate Calculus Abdul Aziz
Multivariate Calculus Abdul Aziz
ย 
ABSTRACT ALGEBRA
ABSTRACT ALGEBRAABSTRACT ALGEBRA
ABSTRACT ALGEBRA
ย 
Matrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIAMatrix presentation By DHEERAJ KATARIA
Matrix presentation By DHEERAJ KATARIA
ย 

Similar to Sets functions-sequences-exercises

Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNbaberexha
ย 
POWERPOINT (SETS & FUNCTIONS).pdf
POWERPOINT (SETS & FUNCTIONS).pdfPOWERPOINT (SETS & FUNCTIONS).pdf
POWERPOINT (SETS & FUNCTIONS).pdfMaryAnnBatac1
ย 
Discrete mathematics OR Structure
Discrete mathematics OR Structure Discrete mathematics OR Structure
Discrete mathematics OR Structure Abdullah Jan
ย 
discrete maths notes.ppt
discrete maths notes.pptdiscrete maths notes.ppt
discrete maths notes.pptNamuwayaPhionah1
ย 
CMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set OperationsCMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set Operationsallyn joy calcaben
ย 
Sets in discrete mathematics
Sets in discrete mathematicsSets in discrete mathematics
Sets in discrete mathematicsUniversity of Potsdam
ย 
6.1_set.pptx
6.1_set.pptx6.1_set.pptx
6.1_set.pptxirrfanalikhan
ย 
Discrete mathematics for diploma students
Discrete mathematics for diploma studentsDiscrete mathematics for diploma students
Discrete mathematics for diploma studentsZubair Khan
ย 
Mathematics JEE quick revision notes pdf
Mathematics JEE quick revision notes pdfMathematics JEE quick revision notes pdf
Mathematics JEE quick revision notes pdfgowhiksankar54
ย 
Chap2_SETS_PDF.pdf
Chap2_SETS_PDF.pdfChap2_SETS_PDF.pdf
Chap2_SETS_PDF.pdfRatipornChomrit
ย 
SETS PPT-XI.pptx
SETS PPT-XI.pptxSETS PPT-XI.pptx
SETS PPT-XI.pptxTamannaNayak5
ย 
Sets (Mathematics class XI)
Sets (Mathematics class XI)Sets (Mathematics class XI)
Sets (Mathematics class XI)VihaanBhambhani
ย 
SET AND ITS OPERATIONS
SET AND ITS OPERATIONSSET AND ITS OPERATIONS
SET AND ITS OPERATIONSRohithV15
ย 
Module week 1 Q1
Module week 1 Q1Module week 1 Q1
Module week 1 Q1Rommel Limbauan
ย 
Set Theory
Set TheorySet Theory
Set Theoryitutor
ย 
Set theory and Venn Diagram.docx
Set theory and Venn Diagram.docxSet theory and Venn Diagram.docx
Set theory and Venn Diagram.docxRenierXanderUy
ย 

Similar to Sets functions-sequences-exercises (20)

4898850.ppt
4898850.ppt4898850.ppt
4898850.ppt
ย 
Set and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUNSet and Set operations, UITM KPPIM DUNGUN
Set and Set operations, UITM KPPIM DUNGUN
ย 
POWERPOINT (SETS & FUNCTIONS).pdf
POWERPOINT (SETS & FUNCTIONS).pdfPOWERPOINT (SETS & FUNCTIONS).pdf
POWERPOINT (SETS & FUNCTIONS).pdf
ย 
Discrete mathematics OR Structure
Discrete mathematics OR Structure Discrete mathematics OR Structure
Discrete mathematics OR Structure
ย 
2.1 Sets
2.1 Sets2.1 Sets
2.1 Sets
ย 
discrete maths notes.ppt
discrete maths notes.pptdiscrete maths notes.ppt
discrete maths notes.ppt
ย 
CMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set OperationsCMSC 56 | Lecture 6: Sets & Set Operations
CMSC 56 | Lecture 6: Sets & Set Operations
ย 
Sets in discrete mathematics
Sets in discrete mathematicsSets in discrete mathematics
Sets in discrete mathematics
ย 
6.1_set.pptx
6.1_set.pptx6.1_set.pptx
6.1_set.pptx
ย 
Discrete mathematics for diploma students
Discrete mathematics for diploma studentsDiscrete mathematics for diploma students
Discrete mathematics for diploma students
ย 
Mathematics JEE quick revision notes pdf
Mathematics JEE quick revision notes pdfMathematics JEE quick revision notes pdf
Mathematics JEE quick revision notes pdf
ย 
Sets
SetsSets
Sets
ย 
Chap2_SETS_PDF.pdf
Chap2_SETS_PDF.pdfChap2_SETS_PDF.pdf
Chap2_SETS_PDF.pdf
ย 
SETS PPT-XI.pptx
SETS PPT-XI.pptxSETS PPT-XI.pptx
SETS PPT-XI.pptx
ย 
G-1-SETS.pdf
G-1-SETS.pdfG-1-SETS.pdf
G-1-SETS.pdf
ย 
Sets (Mathematics class XI)
Sets (Mathematics class XI)Sets (Mathematics class XI)
Sets (Mathematics class XI)
ย 
SET AND ITS OPERATIONS
SET AND ITS OPERATIONSSET AND ITS OPERATIONS
SET AND ITS OPERATIONS
ย 
Module week 1 Q1
Module week 1 Q1Module week 1 Q1
Module week 1 Q1
ย 
Set Theory
Set TheorySet Theory
Set Theory
ย 
Set theory and Venn Diagram.docx
Set theory and Venn Diagram.docxSet theory and Venn Diagram.docx
Set theory and Venn Diagram.docx
ย 

Recently uploaded

USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
ย 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
ย 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
ย 
HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...
HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...
HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...Nguyen Thanh Tu Collection
ย 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
ย 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
ย 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
ย 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
ย 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
ย 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
ย 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
ย 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
ย 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
ย 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
ย 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
ย 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
ย 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beรฑa
ย 

Recently uploaded (20)

FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
ย 
USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSยฎ Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
ย 
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
Model Call Girl in Tilak Nagar Delhi reach out to us at ๐Ÿ”9953056974๐Ÿ”
ย 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
ย 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
ย 
HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...
HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...
HแปŒC TแปT TIแบพNG ANH 11 THEO CHฦฏฦ NG TRรŒNH GLOBAL SUCCESS ฤรP รN CHI TIแบพT - Cแบข Nฤ‚...
ย 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
ย 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
ย 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
ย 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
ย 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
ย 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
ย 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
ย 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ย 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
ย 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
ย 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
ย 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
ย 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
ย 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
ย 

Sets functions-sequences-exercises

  • 1. Discrete Maths: Exercises and Solutions Basic Structures: Sets, Functions, Sequences, Sums and Matrices
  • 2. Page 1 of 22 Basic Structures: Sets, Functions, Sequences, Sums and Matrices Much of discrete mathematics is devoted to the study of discrete structures, used to represent discrete objects. Many important discrete structures are built using sets, which are collections of objects. 2.1 Sets: Introduction: In this section, we study the fundamental discrete structure on which all other discrete structures are built, namely, the set. Sets are used to group objects together. Often, but not always, the objects in a set have similar properties. For instance, all the students who are currently enrolled at any school/college, make up a set. Likewise, all the students currently taking a discrete mathematics course make up a set. In addition, those currently enrolled students, who are taking a course in discrete mathematics form a set that can be obtained by taking the elements common to the first two collections. Definition: 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. It is common for sets to be denoted using uppercase letters. Lowercase letters are usually used to denote elements of sets. There are several ways to describe a set. One way is to list all the members of a set, when this is possible. We use a notation where all members of the set are listed between braces. For example, the notation {a, b, c, d} represents the set with the four elements a, b, c, and d. This way of describing a set is known as the roster method. EXAMPLE 1 The set V of all vowels in the English alphabet can be written as V = {a, e, i, o, u}. EXAMPLE 2 The set O of odd positive integers less than 10 can be expressed by O = {1, 3, 5, 7, 9}. Sometimes the roster method is used to describe a set without listing all its members. Some members of the set are listed, and then ellipses (. . .) are used when the general pattern of the elements is obvious. EXAMPLE 3: The set of positive integers less than 100 can be denoted by {1, 2, 3, . . . , 99}.
  • 3. Page 2 of 22 Another way to describe a set is to use set builder notation. We characterize all those elements in the set by stating the property or properties they must have to be members. For instance, the set O of all odd positive integers less than 10 can be written as O = {x | x is an odd positive integer less than 10}, or, specifying the universe as the set of positive integers, as O = {x โˆˆ Z+ | x is odd and x < 10}. We often use this type of notation to describe sets when it is impossible to list all the elements of the set. For instance, the set Q+ of all positive rational numbers can be written as Q+ = {x โˆˆ R | x = ๐‘ ๐‘ž , for some positive integers p and q}. These sets ( common Universal sets), each denoted using a boldface letter, play an important role in discrete mathematics: N = {0, 1, 2, 3, . . .}, the set of natural numbers Z = {. . . ,โˆ’2,โˆ’1, 0, 1, 2, . . .}, the set of integers Z+ = {1, 2, 3, . . .}, the set of positive integers Q = {p/q | p โˆˆ Z, q โˆˆ Z, and q _= 0}, the set of rational numbers R, the set of real numbers R+, the set of positive real numbers C, the set of complex numbers. Definition: 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. EXAMPLE 4: The sets {1, 3, 5} and {3, 5, 1} are equal, because they have the same elements. Note that the order in which the elements of a set are listed does not matter. Note also that it does not matter if an element of a set is listed more than once, so {1, 3, 3, 3, 5, 5, 5, 5} is the same as the set {1, 3, 5} because they have the same elements. The empty set: There is a special set that has no elements. This set is called the empty set, or null set, and is denoted by โˆ…. The empty set can also be denoted by { } Definition: 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.
  • 4. Page 3 of 22 The Size of a Set Sets are used extensively in counting problems, and for such applications we need to discuss the sizes of sets. Definition: 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 5 Let A be the set of odd positive integers less than 10. Then |A| = 5. EXAMPLE 6 Let S be the set of letters in the English alphabet. Then |S| = 26. EXAMPLE 7 Because the null set has no elements, it follows that |โˆ…| = 0. Definition: Given a set S, the power set of S is the set of all subsets of the set S. The power set of S is denoted by P(S). EXAMPLE 8 What is the power set of the set {0, 1, 2}? Solution: The power set P({0, 1, 2}) is the set of all subsets of {0, 1, 2}. Hence, P({0, 1, 2}) = {โˆ…, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}. Note: If a set has n elements, then its power set has 2n elements. Definition: 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 9 What is the Cartesian product of A = {1, 2} and B = {a, b, c}? Solution: The Cartesian product A ร— B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}. EXAMPLE 10 What is the Cartesian product A ร— B ร— C, where A = {0, 1}, B = {1, 2}, and C = {0, 1, 2} ? Solution: The Cartesian productA ร— 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)}.
  • 5. Page 4 of 22 Note : When A, B, and C are sets, (A ร— B) ร— C is not the same as A ร— B ร— C We use the notation A2 to denote A ร— A, the Cartesian product of the set A with itself. Similarly, A3 = A ร— A ร— A, A4 = A ร— A ร— A ร— A, and so on. More generally, An = {(a1, a2, . . . , an) | ai โˆˆ A for i = 1, 2, . . . , n}. EXAMPLE 11 Suppose that A = {1, 2}. It follows that A2 = {(1, 1), (1, 2), (2, 1), (2, 2)} and A3 = {(1, 1, 1), (1, 1, 2), (1, 2, 1), (1, 2, 2), (2, 1, 1), (2, 1, 2), (2, 2, 1), (2, 2, 2)}.
  • 6. Page 5 of 22 Exercise 2.1 1. List the members of these sets. a) {x | x is a real number such that x2 = 1} b) {x | x is a positive integer less than 12} c) {x | x is the square of an integer and x < 100} d) {x | x is an integer such that x2 = 2} 2. Use set builder notation to give a description of each of these sets. a) {0, 3, 6, 9, 12} b) {โˆ’3,โˆ’2,โˆ’1, 0, 1, 2, 3} c) {m, n, o, p} 3. Determine whether each of these pairs of sets are equal. a) {1, 3, 3, 3, 5, 5, 5, 5, 5}, {5, 3, 1} b) {{1}}, {1, {1}} c) โˆ…, {โˆ…} 4. For each of the following sets, determine whether 2 is an element of that set. a) {x โˆˆ R | x is an integer greater than 1} b) {x โˆˆ R | x is the square of an integer} c) {2,{2}}
  • 7. Page 6 of 22 5. What is the cardinality of each of these sets? a) {a} b) {{a}} c) {a, {a}} d) {a, {a}, {a, {a}}} 6. Find the power set of each of these sets, where a and b are distinct elements. a) {a} b) {a, b} c) {โˆ…, {โˆ…}} 7. Let A = {a, b, c, d} and B = {y, z}. Find a) A ร— B. b) B ร— A. 8. Let A = {a, b, c}, B = {x, y}, and C = {0, 1}. Find a) A ร— B ร— C. b) C ร— B ร— A. c) C ร— A ร— B. d) B ร— B ร— B. 9. Find A2 if a) A = {0, 1, 3}. b) A = {1, 2, a, b}.
  • 8. Page 7 of 22 10. Find A3 if a) A = {a}. b) A = {0, a}.
  • 9. Page 8 of 22 2.2 Set Operations: Introduction: Two, or more, sets can be combined in many different ways. For instance, starting with the set of Computer Science majors at your school and the set of Business majors at your school, we can form the set of students who are Computer Science majors or Business majors, the set of students who are joint majors in Business and Computer science, the set of all students not majoring in Computer Science, and so on. Definition: Let A and B be sets. The union of the sets A and B, denoted by A โˆช B, is the set that contains those elements that are either in A or in B, or in both. An element x belongs to the union of the sets A and B if and only if x belongs to A or x belongs to B. This tells us that A โˆช B = {x | x โˆˆ A โˆจ x โˆˆ B}. EXAMPLE 12 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, {1, 3, 5} โˆช {1, 2, 3} = {1, 2, 3, 5}. Definition: Let A and B be sets. The intersection of the sets A and B, denoted by A โˆฉ B, is the set containing those elements in both A and B. An element x belongs to the intersection of the sets A and B if and only if x belongs to A and x belongs to B. This tells us that A โˆฉ B = {x | x โˆˆ A โˆง x โˆˆ B}. EXAMPLE 13 The intersection of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 3}; that is, {1, 3, 5} โˆฉ {1, 2, 3} = {1, 3}. Definition: Let A and B be sets. The difference of A and B, denoted by A โˆ’ B, is the set containing those elements that are in A but not in B. The difference of A and B is also called the complement of B with respect to A. An element x belongs to the difference of A and B if and only if x โˆˆ A andx /โˆˆ B. This tells us That A โˆ’ B = {x | x โˆˆ A โˆงx /โˆˆ B}. EXAMPLE 14 The difference of {1, 3, 5} and {1, 2, 3} is the set {5}; that is, {1, 3, 5} โˆ’ {1, 2, 3} = {5}. This is different from the difference of {1, 2, 3} and {1, 3, 5}, which is the set {2}.
  • 10. Page 9 of 22 Definition: Let U be the universal set. The complement of the set A, denoted by ๐ดฬ…, is the complement of A with respect to U. Therefore, the complement of the set A is U โˆ’ A. An element belongs to A if and only if x /โˆˆ A. This tells us that A = {x โˆˆ U | x /โˆˆ A}. EXAMPLE 15 Let A = {a, e, i, o, u} (where the universal set is the set of letters of the English alphabet). Then A = {b, c, d, f, g, h, j, k, l,m, n, p, q, r, s, t, v,w, x, y, z}.
  • 11. Page 10 of 22 Exercise 2.2 1. Let A = {1, 2, 3, 4, 5} and B = {0, 3, 6}. Find a) A โˆช B. b) A โˆฉ B. c) A โˆ’ B. d) B โˆ’ A. 2. Let A = {a, b, c, d, e} and B = {a, b, c, d, e, f, g, h}. Find a) A โˆช B. b) A โˆ’ B. c) B โˆ’ A. d) A โˆฉ B. 3. Let A = {0, 2, 4, 6, 8, 10}, B = {0, 1, 2, 3, 4, 5, 6}, and C = {4, 5, 6, 7, 8, 9, 10}. Find a) A โˆฉ B โˆฉ C. b) A โˆช B โˆช C. c) (A โˆช B) โˆฉ C. d) (A โˆฉ B) โˆช C. 4. What can you say about the sets A and B if we know that a) A โˆช B = A? b) A โˆฉ B = A? c) A โˆ’ B = A? d) A โˆฉ B = B โˆฉ A?
  • 12. Page 11 of 22 2.3 Functions Introduction : In many instances we assign to each element of a set a particular element of a second set (which may be the same as the first). For example, suppose that each student in a discrete mathematics class is assigned a letter grade from the set {A,B,C,D, F}. And suppose that the grades are A for Adams, C for Chou, B for Goodfriend, A for Rodriguez, and F for Stevens. This assignment of grades is illustrated in Figure 1. Adams A Chou B Goodfriend C Rodriguez D Stevens F FIGURE 1: Assignment of Grades in a Discrete Mathematics Class. This assignment is an example of a function. The concept of a function is extremely important in mathematics and computer science. For example, in discrete mathematics functions are used in the definition of such discrete structures as sequences and strings. Functions are also used to represent how long it takes a computer to solve problems of a given size. Definition: 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. We write f (a) = b if b is the unique element of B assigned by the function f to the element a of A. If f is a function from A to B, we write f : A โ†’ B. Note: Functions are sometimes also called mappings or transformations. Definition: 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. If f (a) = b, we say that b is the image of a and a is a preimage of b. The range, or image, of f is the set of all images of elements of A. Also, if f is a function from A to B, we say that f maps A to B. EXAMPLE 16 What are the domain, codomain, and range of the function that assigns grades to students described in the first paragraph of the introduction of this section? Solution: Let G be the function that assigns a grade to a student in our discrete mathematics class. Note that G(Adams) = A, for instance. The domain of G is the set {Adams, Chou, Goodfriend, Rodriguez, Stevens}, and the codomain is the set {A,B,C,D, F}. The range of G is the set {A,B,C, F}, because each grade except D is assigned to some student.
  • 13. Page 12 of 22 Definition: Let f be a function from A to B and let S be a subset of A. The image of S under the function f is the subset of B that consists of the images of the elements of S. We denote the image of S by f (S), so f (S) = {t | โˆƒs โˆˆS (t = f (s))}. We also use the shorthand {f (s) | s โˆˆ S} to denote this set. EXAMPLE 17 : Let A = {a, b, c, d, e} and B = {1, 2, 3, 4} with f (a) = 2, f (b) = 1, f (c) = 4, f (d) = 1, and f (e) = 1. The image of the subset S = {b, c, d} is the set f (S) = {1, 4}. One-to-One and Onto Functions Some functions never assign the same value to two different domain elements. These functions are said to be one-to-one. Definition: A function f is said to be one-to-one, or an injunction, if and only if f (a) = f (b) implies that a = b for all a and b in the domain of f. A function is said to be injective if it is one- to-one. a 1 b 2 c 3 d 4 5 FIGURE 2: A One-to-One Function. EXAMPLE 18 : Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with f (a) = 4, f (b) = 5, f (c) = 1, and f (d) = 3 is one-to-one. Solution: The function f is one-to-one because f takes on different values at the four elements of its domain.
  • 14. Page 13 of 22 Definition: A function f from A to B is called onto, or a surjection, if and only if for every element b โˆˆ B there is an element a โˆˆ A with f (a) = b. A function f is called surjective if it is onto. a 1 b 2 c 3 d FIGURE 3: An Onto Function. EXAMPLE 19 : Let f be the function from {a, b, c, d} to {1, 2, 3} defined by f (a) = 3, f (b) = 2, f (c) = 1, and f (d) = 3. Is f an onto function? Solution: Because all three elements of the codomain are images of elements in the domain, we see that f is onto. Note that if the codomain were {1, 2, 3, 4}, then f would not be onto. FIGURE 4: Examples of Different Types of Correspondences. Definition: The function f is a one-to-one correspondence, or a bijection, if it is both one-to- one and onto. We also say that such a function is bijective. EXAMPLE 20: Let f be the function from {a, b, c, d} to {1, 2, 3, 4} with f (a) = 4, f (b) = 2, f (c) = 1, and f (d) = 3. Is f a bijection? Solution: The function f is one-to-one and onto. It is one-to-one because no two values in the domain are assigned the same function value. It is onto because all four elements of the codomain are images of elements in the domain. Hence, f is a bijection.
  • 15. Page 14 of 22 Definition: Let g be a function from the set A to the set B and let f be a function from the set B to the set C. The composition of the functions f and g, denoted for all a โˆˆ A by f โ—ฆ g, is defined by (f โ—ฆ g)(a) = f (g(a)). EXAMPLE 21: 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 22: Let f and g be the functions from the set of integers to the set of integers defined by f (x) = 2x + 3 and g(x) = 3x + 2. What is the composition of f and g? What is the composition of g and f ? Solution: Both the compositions f โ—ฆ g and g โ—ฆ f are defined. Moreover, (f โ—ฆ g)(x) = f (g(x)) = f (3x + 2) = 2(3x + 2) + 3 = 6x + 7 And (g โ—ฆ f )(x) = g(f (x)) = g(2x + 3) = 3(2x + 3) + 2 = 6x + 11.
  • 16. Page 15 of 22 Exercise 2.3 1. Determine whether each of these functions from {a, b, c, d} to itself is a) one-to-one b) Onto i) f (a) = b, f (b) = a, f (c) = c, f (d) = d ii) f (a) = b, f (b) = b, f (c) = d, f (d) = c iii) f (a) = d, f (b) = b, f (c) = c, f (d) = d
  • 17. Page 16 of 22 2. Determine whether each of these functions from Z to Z is one-to-one. a) f (n) = n โˆ’ 1 b) f (n) = n2 + 1 c) f (n) = n3 3. Which functions in the above question are onto?
  • 18. Page 17 of 22 4. Determine whether each of these functions is a bijection from R to R. a) f (x) = 2x + 1 b) f (x) = x2 + 1 c) f (x) = x3 5. Find f โ—ฆ g and g โ—ฆ f , where f (x) = x2 + 1 and g(x) = x + 2, are functions from R to R.
  • 19. Page 18 of 22 2.4 Sequences and Summations Introduction: Sequences are ordered lists of elements, used in discrete mathematics in many ways. They are also an important data structure in computer science. We will often need to work with sums of terms of sequences in our study of Discrete Mathematics. The terms of a sequence can be specified by providing a formula for each term of the Sequence. Identifying a sequence when the first few terms are provided is a useful skill when solving problems in discrete mathematics. Definition: A sequence is a function from a subset of the set of integers (usually either the set {0, 1, 2, . . .} or the set {1, 2, 3, . . .}) to a set S. We use the notation an to denote the image of the integer n. We call an a term of the sequence EXAMPLE 23: Consider the sequence {an}, where an = 1 ๐‘› The list of the terms of this sequence, beginning with a1, namely, a1, a2, a3, a4, . . . , starts with 1 1 , 1 2 , 1 3 , 1 4 , โ€ฆโ€ฆโ€ฆ etc Definition: An arithmetic progression is a sequence of the form a, a + d, a + 2d, . . . , a + nd, . . . where the initial term a and the common difference d are real numbers. Definition: A geometric progression is a sequence of the form a, ar, ar2, . . . , arn, . . . where the initial term a and the common ratio r are real numbers. EXAMPLE 24 Let {an} be a sequence that satisfies the recurrence relation an = anโˆ’1 + 3 for n = 1, 2, 3, . . . , and suppose that a0 = 2. What are a1, a2, and a3? Solution: We see from the recurrence relation that a1 = a0 + 3 = 2 + 3 = 5. It then follows that a2 = 5 + 3 = 8 and a3 = 8 + 3 = 11.
  • 20. Page 19 of 22 EXAMPLE 25 Let {an} be a sequence that satisfies the recurrence relation an = anโˆ’1 โˆ’ anโˆ’2 for n = 2, 3, 4, . . . , and suppose that a0 = 3 and a1 = 5. What are a2 and a3? Solution: We see from the recurrence relation that a2 = a1 โˆ’ a0 = 5 โˆ’ 3 = 2 and a3 = a2 โˆ’ a1 = 2 โˆ’ 5 = โˆ’3.We can find a4, a5, and each successive term in a similar way. Summations : Next, we consider the addition of the terms of a sequence. For this we introduce summation notation. We begin by describing the notation used to express the sum of the terms am, am+1, . . . , an from the sequence {an}.We use the notation โˆ‘ ๐‘Ž๐‘— ๐‘› ๐‘—=๐‘š (read as the sum from j = m to j = n of aj ) to represent am + am+1 +ใƒป ใƒป ใƒป+an. Here, the variable j is called the index of summation, and the choice of the letter j as the variable is arbitrary; that is, we could have used any other letter, such as i or k. EXAMPLE 26 Use summation notation to express the sum of the first 100 terms of the sequence {aj }, where aj = 1 ๐‘— for j= 1, 2, 3, . . . . Solution: The lower limit for the index of summation is 1, and the upper limit is 100.We write this sum as โˆ‘ 1 ๐‘— 100 ๐‘—=1 EXAMPLE 27: What is the value of โˆ‘ ๐‘—2 5 ๐‘—=1 Solution: We have โˆ‘ ๐‘—2 5 ๐‘—=1 = 12 + 22 + 32 + 42 + 52 = 1 + 4 + 9 + 16 + 25 = 55.
  • 21. Page 20 of 22 EXAMPLE 28: What is the value of โˆ‘ (โˆ’1)๐‘˜ 8 ๐‘˜=4 ? Solution: We have โˆ‘(โˆ’1)๐‘˜ 8 ๐‘˜=4 = (โˆ’1)4 + (โˆ’1)5 + (โˆ’1)6 + (โˆ’1)7 + (โˆ’1)8 = 1 + (โˆ’1) + 1 + (โˆ’1) + 1 = 1.
  • 22. Page 21 of 22 Exercise 2.4 1. Find these terms of the sequence {an}, where an = 2 ใƒป (โˆ’3)n + 5n. a) a0 b) a1 c) a4 d) a5 2. What is the term a8 of the sequence {an} if an equals a) 2nโˆ’1? b) 7? 3. What are the terms a0, a1, a2, and a3 of the sequence {an}, where an equals a) 2n + 1? b) (โˆ’2)n ? c) 7 + 4n?
  • 23. Page 22 of 22 4. Find the first five terms of the sequence defined by each of these recurrence relations and initial conditions. a) an = 6anโˆ’1, a0 = 2 b) an = a2 nโˆ’1, a1 = 2 c) an = anโˆ’1 + 3anโˆ’2, a0 = 1, a1 = 2 5. What are the values of these sums? a) โˆ‘ (๐‘˜ + 1) 5 ๐‘˜=1 b) โˆ‘ (โˆ’2)๐‘— 4 ๐‘—=0