0% found this document useful (0 votes)
30 views17 pages

Ch1 Ch2 Basic Structure, Sets - Functions

Uploaded by

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

Ch1 Ch2 Basic Structure, Sets - Functions

Uploaded by

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

1

Ch.2 Basic Structures: Sets, Functions,


Sequences, Sums, and Matrices
2.1 Sets

DEFINITION 1 . 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.
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}.These 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.
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.Venn
Diagrams.
Subsets
It is common to encounter situations where the elements of one set are also the elements of a second set.
We now introduce some terminology and notation to express such relationships between sets.
DEFINITION 3. 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.
We see that A ⊆ B if and only if the quantification∀x(x ∈ A → x ∈ B) is true.
Note that to show that A is not a subset of B we need only find one element x ∈ A with
x ∉ B. Such an x is a counterexample to the claim that x ∈ A implies x ∈ B.

We have these useful rules for determining whether one set is a subset of another:
Showing that A is a Subset of B To show that A ⊆ B, show that if x belongs to A then x
also belongs to B.
Showing that A is Not a Subset of B . To show that A ⊄ B, find a single x ∈ A such thatx ∉ B.
2

The Size of a Set


DEFINITION 4. 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 1.Let A be the set of odd positive integers less than 10. Then |A| = 5.
EXAMPLE 2. Let S be the set of letters in the English alphabet. Then |S| = 26.
EXAMPLE 3. Because the null set has no elements, it follows that |∅| = 0.
We will also be interested in sets that are not finite.
A set is said to be infinite if it is not finite.
Power Sets
DEFINITION 6 . 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 1. 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 that the empty set and the set itself are members of this set of subsets.
EXAMPLE 2. What is the power set of the empty set? What is the power set of the set {∅}?
Solution: The empty set has exactly one subset, namely, itself. Consequently,
P(∅) = {∅}.
The set {∅} has exactly two subsets, namely, ∅ and the set {∅} itself. Therefore,P({ ∅}) = {∅, {∅}}.
If a set has n elements, then its power set has 2n elements. We will demonstrate this fact in
several ways in subsequent sections of the text
Cartesian Products
The ordered n-tuple (a1, a2, . . . , an) is the ordered collection that has a1 as its first element, a2 as its
second element, . . . , and an as its nth element
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}.
The Cartesian product of the sets A1,A2, . . . , An, denoted by A1 × A2 ×. . . ×An, is the set of ordered n-
tuples (a1, a2, . . . , an), where ai belongs to Ai for i = 1, 2, . . . , n. In other words,
A1 × A2 ×. . . ×An = {(a1, a2, . . . , an) | ai ∈ Ai for i = 1, 2, . . . , n}.
Remark: Note that when A, B, and C are sets, (A × B) × C is not the same as A × B × C (see Exercise
39).
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}.
3

Truth Sets and Quantifiers


We will now tie together concepts from set theory and from predicate logic. Given a predicate P, and a
domain D, we define the truth set of P to be the set of elements x in D for which P(x) is true. The truth
set of P(x) is denoted by {x ∈ D | P(x)}.

EXAMPLE. What are the truth sets of the predicates P(x), Q(x), and R(x), where the domain is the
set of integers and P(x) is “|x| = 1,” Q(x) is “x2 = 2,” and R(x) is “|x| = x.”

Solution: The truth set of P, {x ∈ Z | |x| = 1}, is the set of integers for which |x| = 1. Because |x| = 1
when x = 1 or x = −1, and for no other integers x, we see that the truth set of P is the set {−1, 1}.

The truth set of Q, {x ∈ Z | x2 = 2}, is the set of integers for which x2 = 2. This is the empty set
because there are no integers x for which x2 = 2.

The truth set of R, {x ∈ Z | |x| = x}, is the set of integers for which |x| = x. Because |x| = x if and only if
x ≥ 0, it follows that the truth set of R is N, the set of nonnegative integers.

Note that ∀x P(x) is true over the domain U if and only if the truth set of P is the set U.

Likewise, ∃x P(x) is true over the domain U if and only if the truth set of P is nonempty

2.2 Set Operations


The union of the sets A and B, A ∪ B = {x | x ∈ A ∨ x ∈ B}.
4

The intersection of the sets A and B: A ∩ B = {x | x ∈ A ∧ x ∈ B}.

The difference of the sets A and B. A − B = {x | x ∈ A ∧x ∉ B}.


The complement of the set A : A = {x ∈ U | x ∉ A}.

The symmetric difference of A and A ⊕ B = { x ∈ U | (x ∈ A ∧ x ∉ B )∨(x ∈ B ∧x ∉ A) }.


Set Identities

Identity Name
A∩U=A Identity laws
A∪∅=A
A∪U=U Domination laws
A∩∅ = ∅
A∪A=A Idempotent laws
A∩A=A
Á = A Complementation law
A∪B=B∪A Commutative laws
A∩B=B∩A
A ∪ (B ∪ C) = (A ∪ B) ∪ C Associative laws
A ∩ (B ∩ C) = (A ∩ B) ∩ C
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) Distributive laws
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
A ∪ A = A ∩B De Morgan’s laws
A∩ A = A ∪B
A ∪ (A ∩ B) = A Absorption laws
A ∩ (A ∪ B) = A
A ∪ A= U Complement laws
A∩ A=∅

EXAMPLE1.Use logical equivalences to establish the first De Morgan law A ∩ B = A ∪ B


.Solution:We can prove this identity with the following steps.
5

A ∩ B = {x | x ∉ A ∩ B} by definition of complement

= {x | ¬(x ∈ (A ∩ B))} by definition of does not belong symbol

= {x | ¬(x ∈ A ∧ x ∈ B)} by definition of intersection

= {x | ¬(x ∈ A)∨¬(x ∈ B)} by the first De Morgan law for logical equivalences

= {x | x ∉ A ∨x ∉ B} by definition of does not belong symbol

= {x | x ∈ A ∨ x ∈ B} by definition of complement

= {x | x ∈ A ∪ B} by definition of union
= A ∪B by meaning of set builder notation.▄

EXAMPLE 2. Let A, B, and C be sets. Use logical equivalences to prove that A ∪( B ∩C) = ( C ∪ B)∩ A
Solution. We have

A ∪(B ∩C) = A ∩ ( B ∩C ) by the first De Morgan law


= A ∩ ( B ∪C ) by the second De Morgan law
= ( B ∪C ) ∩ A by the commutative law for intersections
= (C ∪ B) ∩ A by the commutative law for unions. ▄
EXAMPLE 3. Let A, B, and C be sets. Use logical equivalences to prove that A−B = A⋂ B .
Solution.: We have

A−B = {x | x ∈ A ∧ x ∉ B} by definition A−B


={x | x ∈ A ∧ x ∈ B } by definition of complement
=A∩B } by definition intersections. ▄
EXAMPLE 4. Show that A ⊕ B = (A ∪ B) − (A ∩ B).
Solution: We have

A ⊕ B = { x ∈ U | (x ∈ A ∧ x ∉ B )∨(x ∈ B ∧x ∉ A) } by definition
= { x ∈ U | (x ∈ A ∧x ∈ B )∨(x ∈ B ∧ x ∈ B ) }. by definition of complement
= (A − B) ⋃ (B − A). by definition symmetric difference. ▄

membership tables
Set identities can also be proved using membership tables
6

To indicate that an element is in a set, a 1 is used; toindicate that an element is not in a set, a 0 is used. (The reader
should note the similarity betweenmembership tables and truth tables.)

EXAMPLE . Construct A Membership Table for the Distributive Property:

A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

Solution:

▄ A B C B∪C A ∩ (B ∪ C) A∩B A∩C (A ∩ B) ∪ (A ∩ C)


1 1 1 1 1 1 1 1
1 1 0 1 1 1 0 1
1 0 1 1 1 0 1 1
1 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0
Computer Representation of Sets
Assume that the universal set U is finite .First, specify an arbitrary ordering of the elements of U, for
instance a1, a2, . . . , an. Represent a subset A of With the bit string of length n, where the ith bit in this
string is 1 if ai belongs to A and is 0 if ai does not belong to A. Example 18 illustrates this technique.
EXAMPLE 1. Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering of elements of U has the elements
in increasing order; that is, ai = i. What bit strings represent the subset of 1) all odd integers in U,

2) the subset of all even integers in U, and 3) the subset of integers not exceeding 5 in U?

Solution:
The bit string that represents the set of odd integers in U, namely, {1, 3, 5, 7, 9}, is 10 1010 1010.
The bit string that represents the set {2, 4, 6, 8, 10}, is 01 0101 0101.
The set of all integers in U that do not exceed 5, namely, {1, 2, 3, 4, 5}, is represented by the
String 11 1110 0000. ▄
To find the bit string for the complement of a set from the bitstring for that set, we simply change each 1 to a 0 and
each 0 to 1, because x ∈ A if and only if x ∉ A . Note that this operation corresponds to taking the negation of
each bit when we associate a bit with a truth value—with 1 representing true and 0 representing false.
EXAMPLE 2. We have seen that the bit string for the set {1, 3, 5, 7, 9} (with universal set {1, 2, 3, 4,
5, 6, 7, 8, 9, 10}) is 10 1010 1010.What is the bit string for the complement of this set?
7

Solution: The bit string for the complement of this set is obtained by replacing 0s with 1s and vice versa. This yields
the string 01 0101 0101,which corresponds to the set {2 , 4, 6, 8, 10}.▄
To obtain the bit string for the union and intersection of two sets we perform bitwise Boolean operations on the bit
strings representing the two sets.

EXAMPLE 3. The bit strings for the sets {1, 2, 3, 4, 5} and {1, 3, 5, 7, 9} are 11 1110 0000 and 10 1010 1010,

respectively. Use bit strings to find the union and intersection of these sets.

Solution: The bit string for the union of these sets is

11 1110 0000 ∨ 10 1010 1010 = 11 1110 1010,which corresponds to the set {1, 2, 3, 4, 5, 7, 9}.

The bit string for the intersection of these sets is

11 1110 0000 ∧ 10 1010 1010 = 10 1010 0000,which corresponds to the set {1, 3, 5}.▄

EXERCISES
1. The symmetric difference of A and B, denoted by A ⊕ B, is the set containing those elements in
either A or B, but not in both A and B.
(1) Find the symmetric difference of {1, 3, 5} and {1, 2, 3}.
(2) Show that A ⊕ B = (A ∪ B) − (A ∩ B).
(3) . Show that A ⊕ B = (A − B) ∪ (B − A).
2. Suppose that the universal set is U ={1, 2, 3, 4,5, 6, 7, 8, 9, 10}. Express each of these sets with bit
strings where the ith bit in the string is 1 if i is in the set and 0 otherwise.

a) {3, 4, 5}, ) , b){1, 3, 6, 10}, c) {2, 3, 4, 7, 8, 9}


3. Using the same universal set as in the last problem, find the set specified by each of these bit strings.
a) 11 1100 1111, b) 01 0111 1000, c) 10 0000 0001
4. What subsets of a finite universal set do these bit strings represent?
a) the string with all zeros, b) the string with all ones.

2.3 Functions
Introduction. Definitions and examples of : a function f from a set A to a set B , domain and range
(codomain ) of functions. One-to-One and Onto Functions…….
Some Important Functions (The floor and ceiling functions).
Let x be a real number
8

The floor function ⌊ ⌋ : ⌊ x ⌋ = max{ n∈ Z| n ≤ x}.


The ceiling function ⌈ ⌉ : ⌈ x ⌉ = min{ n∈ Z| n ≥ x}

Floor function Ceiling function

Example1. These are some values of the floor and ceiling functions:

⌊ 0.5 ⌋ =0, ⌈ 0.5 ⌉=1, ⌊−0.5 ⌋ =−1 , ⌈ −0.5 ⌉=0 , ⌊ 3.1 ⌋ =3 , ⌈ 3.1⌉ =4 , ⌊ 9 ⌋=9 , ⌈ 9 ⌉ =1 ▄
Example. These are some values of the floor and ceiling functions:
⌊ 0.5 ⌋ =0, ⌈ 0.5 ⌉=1, ⌊−0.5 ⌋ =−1 , ⌈ −0.5 ⌉=0 , ⌊ 3.1 ⌋ =3 , ⌈ 3.1⌉ =4 , ⌊ 9 ⌋=9 , ⌈ 9 ⌉ =1 ▄
Directly from the definitions of floor and ceiling we have the following properties.
Properties of the floor and ceiling functions:
(1) ⌊ x ⌋=n if and only if n ≤ x < n+1 or ⌊ x ⌋ ≤ x < ⌊ x ⌋ +1
(2) ⌊ x ⌋=n if and only if x−¿ 1 < n ≤ x or x−¿1 < ⌊ x ⌋ ≤ x
(3) ⌈ x ⌉=n if and only if n−¿ 1 < x ≤ n or ⌈ x ⌉−¿1 < x ≤ ⌈ x ⌉
(4) ⌈ x ⌉=n if and only if x ≤ n < x+1 or x ≤ ⌈ x ⌉ < x+1

EXAMPLE 2. If x is a real number and n is a natural number, then

(a) x−¿ 1 < ⌊ x ⌋ ≤ x ≤ ⌈ x ⌉ < x+1


(b) ⌊−x ⌋=−⌈ x ⌉
(c) ⌈−x ⌉=−⌊ x ⌋
9

(d) ⌊ x+ n ⌋ =⌊ x ⌋+ n
(e) ⌈ x+ n⌉ =⌈ x ⌉ +n
Proof.
(a) Follows from properties (2) ,(4). We will prove (b) –(e).
(b) Assume ⌊−x ⌋=n , then ⌊−x ⌋=n ⟺ −x−¿ 1 < n ≤ −x , by (2). This follows x ≤ −n < x +1. By
we have −n = ⌈ x ⌉ , that is −⌊−x ⌋=⌈ x ⌉ ∧so ⌊−x ⌋=−⌈ x ⌉ .
(c) Similarly to (b).
(d) Suppose that ⌊ x ⌋=m,. By property (1), it follows that m ≤ x <m+ 1.
Adding n to all three quantities m + n ≤ x +n < m+ n + 1.
Using property (1) again, we see that ⌊ x+ n ⌋ = m + n = ⌊ x ⌋ +n .
(e) Similarly to (d). ▄
EXAMPLE .3 Prove that if x is a real number , then
1
⌊ 2 x ⌋=⌊ x ⌋ + ⌊ x+ ⌋
2

Solution. Assume that ⌊ x ⌋=n , then by property (1) we have n ≤ x < n+1 . There is
0≤ε<1, such that x=n+ ε . We consider 3 cases:
1 1 1 1 1
1) 0 ≤ ε < , x + =n+ε + , then ⌊ x+ ⌋ =n because ε < . And
2 2 2 2 2
1
2 x=2 n+2 ε and ⌊ 2 x ⌋=2 n because 2 ε <1. So ⌊ 2 x ⌋=2 n=n+n=⌊ x ⌋ + ⌊ x + ⌋ .
2
1 1 1
2) ε = , then ⌊ x+ ⌋ = ⌊ n+ε + ⌋ =⌊ n+ 1 ⌋ =n+1 , and
2 2 2
1
⌊ 2 x ⌋=⌊ 2n+ 2 ε ⌋ = ⌊ 2n+ 1 ⌋ =2n+ 1. So ⌊ 2 x ⌋=2 n+1=n+n+1=⌊ x ⌋ + ⌊ x + ⌋
2
1 1 1
3) < ε <1 , then ⌊ x+ ⌋ = ⌊ n+ε + ⌋ =⌊ n+ 1 ⌋ =n+1 and
2 2 2
1
⌊ 2 x ⌋=⌊ 2n+ 2 ε ⌋ =2 n+1, So ⌊ 2 x ⌋=2 n+1=n+n+1=⌊ x ⌋ + ⌊ x + ⌋ ▄
2

Exercises
1
1. Give counterexample to prove that the proposition ⌈ 2 x ⌉=⌈ x ⌉ + ⌈ x+ ⌉ is false.
2
10

Answer: x=1.
1
2. Give counterexample to prove that the proposition ⌊ 2 x ⌋=⌊ x ⌋ + ⌊ x− ⌋ is false.
2
Answer: x=1.
1
3. Use Example 3 and (b) in Example 2, to prove ⌈ 2 x ⌉=⌈ x ⌉ + ⌈ x− ⌉ .
2
1
Answer: We have from Example 3, ⌊ 2 x ⌋=⌊ x ⌋ + ⌊ x+ ⌋ for all real numbers. Replacing x by −x
2
1 1
we get ⌊−2 x ⌋ =⌊−x ⌋+ ⌊−x + ⌋ =⌊−x ⌋+ ⌊−( x− ) ⌋ . By the property ⌊−x ⌋=−⌈ x ⌉ ( see (b) in
2 2
1 1
Example 2), we have −⌈ 2 x ⌉=−⌈ x ⌉ −⌈ x− ⌉ and so ⌈ 2 x ⌉=⌈ x ⌉ + ⌈ x+ ⌉ ▄
2 2
4. Prove, without using the property ⌊−x ⌋=−⌈ x ⌉ , that if x is a real m then :
1
⌈ 2 x ⌉=⌈ x ⌉ + ⌈ x− ⌉
2

Answer: Assume that ⌈ x ⌉=n , then by property (3) we have n−¿ 1 < x ≤ n . There is
0≤ε<1, such that x=n−ε . We consider 3 cases:
1 1 1 1 1 1
1) 0 ≤ ε < , x− =n−ε− , then ⌈ x− ⌉=⌈ n−ε− ⌉ =n because ε < .
2 2 2 2 2 2
1
2 x=2 n−2 ε and ⌈ 2 x ⌉=2 n because 2 ε <1. So ⌈ 2 x ⌉=⌈ x ⌉ + ⌈ x− ⌉ .
2
1 1 1
2) ε = , then ⌈ x− ⌉= ⌈ n−ε− ⌉ =⌊ n−1 ⌋ =n−1 ,
2 2 2
1
⌈ 2 x ⌉=⌈ 2 n−2 ε ⌉ = ⌈ 2n−1 ⌉=2 n−1 . So ⌈ 2 x ⌉=2 n−1=n+n−1=⌈ x ⌉ + ⌈ x− ⌉
2
1 1 1
3) < ε <1 , then ⌈ x− ⌉= ⌈ n−ε− ⌉ =⌈ n−1 ⌉ and
2 2 2
1
⌊ 2 x ⌋=⌊ 2n−2 ε ⌋=2 n−1, So ⌊ 2 x ⌋=2 n−1=n+n−1=⌈ x ⌉ + ⌈ x− ⌉ ▄
2
5. If x is a real number, prove that ⌊ x+1 ⌋=⌊ x ⌋ +1

Answer: ⌊ x+1 ⌋=n ⟶ n ≤ x +1< n+1 by property (2)

x−1 ≤ x < n ⟶ ⌊ x ⌋=n−1 1 by property (2). So

⌊ x+1 ⌋=n=n−1+1=⌊ x ⌋ +1
11

6. Prove or disprove each of the following statements:


1) ⌈ ⌊ x ⌋ ⌉ =⌊ x ⌋ . True, ⌊ x ⌋ is integer.
1
2) ⌊ 2 x ⌋=2 ⌊ x ⌋ . False , x= .
2
1
3) ⌈ x+ y ⌉ = ⌈ x ⌉ + ⌈ y ⌉ False , x= .
2
1 3
4) ⌈ xy ⌉ = ⌈ x ⌉ ⌈ y ⌉ False , x= , y= .
2 2
x
7. Prove ⌈ ⌈ ⌉ /2⌉ = ⌈ x /4 ⌉ , for all x ∈R.
2

Answer: ⌈ x /4 ⌉=n ⟶ n−¿ 1 < x /4 ≤ n ⟶ 2n−¿2 < x /2 ≤ 2n ⟶ 2n−¿ 2 < x /2 ≤ 2n ⟶


x
⟶ ⌈ x /2 ⌉ =2 n or ⌈ x /2 ⌉=2 n−¿1 ⟶ ⌈ ⌈ ⌉ /2⌉ =⌈ 2 n /2 ⌉=n=⌈ x /4 ⌉ or
2
x
⌈⌈ ⌉ /2⌉ =⌈ (2 n−1)/2⌉ =⌈ n−1/2 ⌉=n=⌈ x / 4 ⌉ ▄
2
12

2.2.4 Sequences and Summations


 Sequences. Asequence 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.
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.

Examples.
1) bn = (−1)n = 1,−1, 1,−1, 1, . ;, is a geometric progression with initial term and ratio equal to 1 and −1;
2) cn = 2 ・ 5n is a geometric progression with initial term and ratio equal to 2 and 5;
3) dn = 6 ・ (1/3)n is a geometric progression with initial term and ratio equal to 6 and 1/3;
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.

Examples.
1) sn = −1 + 4n is an arithmetic progressions with initial term and difference equal to −1 and 4.
2) tn = 7 − 3n is an arithmetic progressions with initial term and difference equal to 7 and −3.
A String is a finite sequences a1a2 . . . an. The length of a string is the number of terms in this string. The
empty string, denoted by λ, is the string that has no terms. The empty string has length zero.
The string abcd is a string of length four

 Recurrence Relations
A recurrence relation for the sequence {an} is an equation that expresses an in terms of one or more of
the previous terms of the sequence, namely, a0, a1, . . . , a n−1, for all integers n with n ≥ n0, where n0 is a
nonnegative integer. A sequence is called a solution of a recurrence relation if its terms satisfy the
recurrence relation. (A recurrence relation is said to recursively define a sequence. We will explain this
alternative terminology in Chapter 5.)
EXAMPLE 1. Let {an} satisfies the recurrence relation an = a n−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
13

that a2 = 5 + 3 = 8 and a3 = 8 + 3 = 11▄


EXAMPLE 1. Let {an} be a sequence that satisfies the recurrence relation an = a n−1 – a n−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. ▄

The Fibonacci sequence, f0, f1, f2, . . . , is defined by the initial conditions f0 = 0, f1 = 1,
and the recurrence relation f n = f n−1 + f n−2 for n = 2, 3, 4, . . . .
EXAMPLE 1 Find the Fibonacci numbers f2, f3, f4, f5, and f6.
Solution: 2,3,5,8. . ▄
EXAMPLE 2 Suppose that {an} defined by an = n!, where n = 1, 2, 3, . . .. Because
n! = n((n − 1)(n − 2) . . . 2 ・ 1) =n(n − 1)! = n a n−1, we see that the sequence of factorials satisfies the
recurrence relation an = n a n−1, together with the initial condition a1 = 1. ▄
We say that we have solved the recurrence relation together with the initial conditions when
we find an explicit formula, called a closed formula, for the terms of the sequence.
EXAMPLE 3. Determine whether the sequence {an}, , is a solution of the recurrence relation
an = 2a n−1 – a n−2 for n = 2, 3, 4, . . . .
1) an = 3n , 2) an = 2n , 3) an = 5.
Solution: 1) Suppose that an = 3n for every nonnegative integer n. Then, for n ≥ 2, we see that
2a n−1 – a n−2 = 2(3(n − 1)) − 3(n − 2) = 3n = an. Therefore, {an}, where an = 3n, is a solution
of the recurrence relation.
2) Suppose that an = 2n. Note that a0 = 1, a1 = 2, and a2 = 4.
Because 2a1 − a0 = 2・2 − 1 = 3 ≠ a2, we see that {an}, where an = 2n, is not a solution of
the recurrence relation.
3) Suppose that an = 5 for every nonnegative integer n. Then for n ≥ 2, we see that an =
2a n−1 – a n−2 = 2 ・5 − 5 = 5 = an. Therefore, {an}, where an = 5, is a solution of the recurrence relation.

EXAMPLE 3. Let {an} be a sequence that satisfies the recurrence relation an = a n−1 + 3 for n = 1, 2, 3, .
. . , and suppose that a0 = 2. Find explicit formula of an
14

Solution: starting with the initial condition a1 = 2, and working upward until we reach an to deduce a
explicit formula for the sequence. We see that
a2 = 2 + 3
a3 = (2 + 3) + 3 = 2 + 3 ・ 2
a4 = (2 + 2 ・ 3) + 3 = 2 + 3 ・ 3
...
an = a n−1 + 3 = (2 + 3 ・ (n − 2)) + 3 = 2 + 3(n − 1). ▄
Some Useful Summation Formulae
n
ar n+1 −a
1. ∑ ar = k

1−r
, r≠0
k=0

n
n(n+1)
2. ∑ k = 2
k =1

n
n ( n+1 ) (2 n+1)
3. ∑ k 2 = 6
k =1

n
n2 ( n+1 )2
4. ∑ k = 3

4
k =1


1
5. ∑ x k = 1−x , |x| <1
k=0


1
6. ∑ k x k −1 = ¿¿
, |x| <1
k =1

2.6 Matrices Introduction


15

Definitions of m × n matrix. A , matrix arithmetic , the product of A and B, the identity matrix of
order n , The transpose of a matrix. A

5) Zero–One Matrices

A matrix all of whose entries are either 0 or 1 is called a zero–one matrix. Zero–one matrices are
often used to represent discrete structures, as we will see in Chapters 9 and 10. Algorithms using these
structures are based on Boolean arithmetic with zero–one matrices. This arithmetic is based on the Boolean
operations ∧ and ∨, which operate on pairs of bits, defined by

{
b 1 ∧b 2= 1 if b 1=b 2=1
0 otherwise
, {
b 1 ∨b 2= 1 if b 1=1 ∨b 2=1
0 otherwise

6) The join and the meet of zero–one matrices

Let A = [aij ] and B = [bij ] be m × n zero–one matrices. Then the join of A and B is the zero–one
matrix with (i, j )th entry aij ∨ bij . The join of A and B is denoted by A ∨ B. Themeet of A and B is
the zero–one matrix with (i, j )th entry aij ∧ bij . The meet of A and B is denoted by A ∧ B.

EXAMPLE 1. Find the join and meet of the zero–one matrices

A= [ 10 0 1
1 0 ]
, B=
0 1 0
1 1 0[ ]
Solution: We find that the join of A and B is

A∨B= [ 1∨ 0
0 ∨1
0 ∨1 1 ∨0
1 ∨1 0 ∨0
= ][
1 1 1
1 1 0 ]
The meet of A and B is

A∧B= [ 1∧ 0
0 ∧1
0 ∧1 1 ∧0
1 ∧1 0 ∧0
= ][
0 0 0
0 1 0
▄ ]
7) The Boolean product of two matrices

Let A = [aij ] be an m × k zero–one matrix and B = [bij ] be a k × n zero–one matrix. Then the
Boolean product of A and B, denoted by A⨀B, is the m × n matrix with (i, j )th entry cij where

cij = (ai1 ∧ b1j ) ∨ (ai2 ∧ b2j ) ∨ ・ ・ ・ ∨ (aik ∧ bkj ).


16

EXAMPLE 2, Find the Boolean product of A and B, where

[ ]
1 0
A= 0 1
1 0
B= [ 10 1 0
1 1 ]
Solution

[ ][ ]
(1 ∧1)∨(0 ∧0) (1 ∧1) ∨(0 ∧1) (1 ∧0) ∨( 0∧ 1) 1∨ 0 1∨ 0 0 ∨ 0
A⨀B = (0 ∧1)∨(1 ∧0) (0 ∧1)∨(1 ∧1) (0 ∧ 0)∨(1∧ 1) = 0 ∨0 0 ∨1 0∨ 1 =
(1 ∧1)∨(0 ∧0) (1 ∧1) ∨(0 ∧1) (1 ∧0) ∨( 0∧ 1) 1∨ 0 1∨ 0 0 ∨ 0

[ ]
1 1 0
= 0 1 1▄
1 1 0

8) The Boolean power . Let A be a square zero–one matrix and let r be a positive integer. The rth
Boolean power of A is the Boolean product of r factors of A. The rth Boolean product of A is
denoted by A[r].Hence A[r] = A⨀A⨀A⨀ ・ ・ ・⨀A

(This is well defined because the Boolean product of matrices is associative.)We also define
A[0] to be In.

[ ]
0 0 1
EXAMPLE 9 Let A = 1 0 0 . Find A[n] for all positive integers n.
1 1 0
Solution

[ ] [ ][ ]
1 1 0 0 0 1 1 0 1
A = A ⨀A = 0 0 1 ⨀ 1 0 0 = 1 1 0
[3] [2]

1 0 1 1 1 0 1 1 1

[ ] [ ][ ]
1 0 1 0 0 1 1 1 1
[4]
¿
A = A ⨀A 1 1 0
[3]
⨀ 1 0 0=1 0 1
1 1 1 1 1 0 1 1 1
17

[ ]
1 1 1
A == 1 1 1 .So A[n] = A[5] for all positive integers n with n ≥ 5.
[5]

1 1 1
Exercises

[ ] [ ]
1 0 1 0 1 1
1. Let A= 1 1 0 and B = 1 0 1 . Find
0 0 1 1 0 1
a) A ∨ B. b) A ∧ B. c) A⨀B.
2. Find the Boolean product of A and B, where

[ ] []
10
1001
01
A= 0 1 0 1 , B= .
11
1111
10

[ ]
1 0 0
3. Let A= 1 0 1 . Find
0 1 0

a) A[2]. b) A[3]. c) A ∨ A[2] ∨ A[3].

4. Let A be a zero–one matrix. Show that


a) A ∨ A = A. b) A ∧ A = A.

You might also like