chapter # 2 : basic structures: sets, functions, sequences...

45
ECOM 2311- Discrete Mathematics Chapter # 2 : Basic Structures: Sets, Functions, Sequences, Sums, and Matrices Fall, 2013/2014 ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 1 / 45

Upload: others

Post on 24-Jun-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

ECOM 2311- Discrete Mathematics

Chapter # 2 : Basic Structures: Sets, Functions, Sequences,

Sums, and Matrices

Fall, 2013/2014

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 1 / 45

Page 2: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Outline

1 Sets

2 Set Operations

3 Functions

4 Sequences and Summations

5 Matrices

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 2 / 45

Page 3: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsIntroduction

Set

is an unordered collection of objects, called elements or members of theset. A set is said to contain its elements. We write a ∈ A to denote thata is an element of the set A. The notation a 6∈ A denotes that a is not anelement 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.

The set V of all vowels in the English alphabet can be written as[roster method] V = {a, e, i , o, u}.The set of positive integers less than 100 can be denoted by{1, 2, 3, · · · , 99}.”· · · ” is called ellipses which used for brevity when the generalpattern of the elements is obvious.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 3 / 45

Page 4: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsIntroduction

Equal sets

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 thesame elements.

The order in which the elements of a set are listed does not matter.

{1, 3, 3, 3, 5, 5, 5, 5} is the same as the set {1, 3, 5} because theyhave the same elements.

It does not matter if an element of a set is listed more than once.

Empty set or null set: the set that has no elements and is denotedby ∅ or by {} [but not {∅}].

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 4 / 45

Page 5: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsSet builder

By using the set builder, the set can be described by stating theproperty they must have to be members.

The set of all odd positive integers can be written asO = {x |x is an odd positive integer less than 10} orO = {x ∈ Z + |x is odd and x < 10}.Famous sets: N: natural numbers, Z: integers, Z+: positiveintegers, Q: rational numbers, R: real numbers, R+: positive realnumbers and C: complex numbers.

Subset

The set A is a subset of B if and only if every element of A is also anelement of B, i.e ∀x(x ∈ A→ x ∈ B). We use the notation A ⊆ B toindicate that A is a subset of the set B.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 5 / 45

Page 6: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsSubsets

Proper subset

written as A ⊂ B and it read as ”A is a proper subset of B”. It used toemphasize that a set A is a subset of the set B but that A 6= B, i.e.∀x(x ∈ A→ x ∈ B) ∧ ∃x(x ∈ B ∧ x 6∈ A)

A = B → (A ⊆ B) ∧ (B ⊆ A)

(A ⊆ B) ∧ (B ⊆ C )→ A ⊆ C [SEE VENN DIAGRAM]

EX. Find an equal set with the following setB = {x |x is a subset of the set {a, b}}.Ans. A = {∅, {a}, {b}, {a, b}}, Note that {a} ∈ A but a 6∈ A.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 6 / 45

Page 7: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsCardinality of the Set

Let S be a set. If there are exactly n distinct elements in S where n is anonnegative integer, we say that S is a finite set and that n is thecardinality of S . The cardinality of S is denoted by |S |.

Examples:

A is the set of odd positive integers less than 10 ⇒ |A| = 5 .

S is the set of the English Alphapet ⇒ |S | = 26.

D = ∅ ⇒ |D| = 0.

The set of positive integers ⇒ Infinite set.

The power set of S is the set of all subsets of the set S and is denoted byP(S) or 2S , i.e. P(S) = {B|B ⊆ S}

P({0, 1, 2}) = {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}} .

P(∅) = {∅}P({∅}) = {∅, {∅}}

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 7 / 45

Page 8: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsCartesian Products

The ordered n-tuple (a1, a2, · · · , an) is the ordered collection that has a1as its first element, a2 as its second element, . . . , and an as its nthelement.

Two ordered n-tuples are equal if and only if each correspondingpair of their elements is equal. In other words,(a1, a2, · · · , an) = (b1, b2, · · · , bn) if and only if ai = bi , fori = 1, 2, · · · , n.

Ordered 2-tuples are called ordered pairs. The ordered pairs (a, b)and (c , d) are equal if and only if a = c and b = d .

Note that (a, b) and (b, a) are not equal unless a = b.

Let A and B be sets. The Cartesian (direct) product of A and B, denotedby 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}.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 8 / 45

Page 9: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

SetsCartesian Products

EX.A = {1, 2} , B = {a, b, c}A× B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.B × A = {(a, 1), (a, 2), (b, 1), (b, 2), (c , 1), (c , 2)}.A× B 6= B × A unless A = B.

EX.A = {0, 1} , B = {1, 2} and C = {0, 1, 2}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)}.(A× B)× C 6= A× B × C .

The notation A2 is used to denote A× Aand similarly A3 = A× A× A.

The truth set of the predicate P is the set of elements x in the domainD for which P(x) is true. The truth set of P(x) is denoted by{x ∈ D|P(x)}.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 9 / 45

Page 10: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Set OperationsIntroduction

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 inboth, i.e. A ∪ B = {x |x ∈ A ∨ x ∈ B}.

Let A and B be sets. The intersection of the sets A and B, denoted byA ∩ B, is the set that contains those elements in both A and B, i.e.A ∩ B = {x |x ∈ A ∧ x ∈ B}.

Two sets are called disjoint if their intersection is the empty set.

Let A and B be sets. The difference of A and B, denoted by A− B, isthe set containing those elements that are in A but not in B, i.e.A−B = {x |x ∈ A∧ x 6∈ B}.. The difference of A and B is also called thecomplement of B with respect to A and sometimes is denote by A \ B

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 10 / 45

Page 11: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Set OperationsIntroduction

Let U be the universal set. The complement of the set A, denoted by A,is the complement of A with respect to U. Therefore, the complement ofthe set A is U − A, i.e. A = {x ∈ U|x 6∈ A}.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 11 / 45

Page 12: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Set OperationsIntroduction

EX. A = {1, 3, 5} and B = {1, 2, 3}A ∪ B = {1, 2, 3, 5}A ∩ B = {1, 3}A− B = {5}B − A = {2}

The union of a collection of sets [generalized union] is the set thatcontains those elements that are members of at least one set in thecollection. A1 ∪ A2 ∪ · · · ∪ An =

⋃ni=1 Ai

The intersection of a collection of sets [generalized intersection] is the setthat contains those elements that are members of all the sets in thecollection. A1 ∩ A2 ∩ · · · ∩ An =

⋂ni=1 Ai

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 12 / 45

Page 13: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Set OperationsSet Identities

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 13 / 45

Page 14: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Set OperationsSet Identities

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 14 / 45

Page 15: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Set OperationsSet Identities

Ex. By using the builder notation, prove that A ∩ B = A ∪ B

Exercise: prove that A ∪ B = A ∩ B

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 15 / 45

Page 16: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsIntroduction

Function Definition

Let A and B be nonempty sets. A function f from A to B is anassignment of exactly one element of B to each element of A. We writef (a) = b if b is the unique element of B assigned by the function f to theelement a of A. If f is a function from A to B, we write f : A→ B.

Functions are sometimes also called mappings or transformations.

If f is a function from A to B, we say that A is the domain of f and B isthe codomain of f. If f (a) = b, we say that b is the image of a and a is apreimage of b. The range, or image, of f is the set of all images ofelements of A. Also, if f is a function from A to B, we say that f maps Ato B.

Check if the following relations of the sets A = {a, b, c},B = {1, 2, 3} are functions or not :

f = {(a, 1), (b, 2), (c , 1)}√

g = {(a, 1), (b, 2)} ×h = {(a, 1), (b, 2), (c , 1), (a, 2)} ×

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 16 / 45

Page 17: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsIntroduction

EX. What are the domain, codomain, and range of the function thatmaps the set A = {a, b, c} to the set B = {1, 2, 3} according to therelation f = {(a, 1), (b, 2), (c , 1)}.

Domain: {a, b, c}.Codomain: {1, 2, 3}.Range: {1, 2}

EX. What are the domain, codomain and range of f : Z → Z whichassign the square of an integer to this integer. i.e. f (x) = x2

Domain: Z (all integers)

Codomain: Z (all integers)

Range: the set of all integers that are perfect squares, namely,{0, 1, 4, 9, · · · }.

EX. Express the range of the function that maps the set A to B usingthe set builder notation.

range of f ={b ∈ B|f (a) = b for some a ∈ A}ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 17 / 45

Page 18: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsIntroduction

Let f1 and f2 be functions from A to R. Then f1 + f2 and f1f2 are alsofunctions from A to R defined for all x ∈ A by(f1 + f2)(x) = f1(x) + f2(x),(f1f2)(x) = f1(x)f2(x).

EX. Let f1 and f2 be functions from R to R such that f1(x) = x2 andf2(x) = x − x2. What are the functions f1 + f2 and f1f2?(f1 + f2)(x) = f1(x) + f2(x) = x2 + (x − x2) = x and(f1f2)(x) = x2(x − x2) = x3 − x4.

Let f be a function from A to B and let S be a subset of A. The image ofS under the function f is the subset of B that consists of the images ofthe elements of S. We denote the image of S by f (S), sof (S) = {t|∃s ∈ S(t = f (s))} or {f (s)|s ∈ S}.EX. 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 subsetS = {b, c , d} is the set f (S) = {1, 4}.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 18 / 45

Page 19: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsOne-to-One and Onto Functions

A function f is said to be one-to-one, or injective, if and only iff (a) = f (b) implies that a = b for all a and b in the domain of f. i.e. thefunction never assigns the same value to two different domain elements.∀a∀b(f (a) = f (b)→ a = b)

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 19 / 45

Page 20: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsOne-to-One and Onto Functions

A function f from A to B is called onto, or surjective, if and only if forevery element b ∈ B there is an element a ∈ A with f (a) = b. i.e, therange and the codomain are equal.∀y∃x(f (x) = y).

The function f is a one-to-one correspondence, or bijective, if it isboth one-to-one and onto.

Ex. State whether the following functions are one-to-one, onto orbijective:**(1) 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) = 3One-to One and not onto as 2 has no preimage.

**(2) f (x) = x2 from the set of integers to the set of integersnot one to one as f (1) = f (−1) = 1 for example and not onto as there isno integer x with x2 = −1, for instance.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 20 / 45

Page 21: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsOne-to-One and Onto Functions

**(3) f (x) = x + 1 from the set of real numbers to itselfThe function f (x) = x + 1 is a one-to-one function. To demonstrate this,note that x + 1 6= y + 1 when x 6= y . Additionally, this function is onto,because for every integer y there is an integer x such that f (x) = y. Tosee this, note that f (x) = y if and only if x + 1 = y, which holds if andonly if x = y - 1. The function is bijective as its one-to-one and onto.

**(4) f is 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.not one to one but onto.

**(5) f is 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.one to one and onto ⇒ bijective.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 21 / 45

Page 22: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsOne-to-One and Onto Functions

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 22 / 45

Page 23: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsInverse Functions and Compositions of Functions

Let f be a one-to-one correspondence from the set A to the set B. Theinverse function of f is the function that assigns to an element b ∈ B theunique element a in A such that f (a) = b. The inverse function of f isdenoted by f −1. Hence, f −1(b) = a when f (a) = b.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 23 / 45

Page 24: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsInverse Functions and Compositions of Functions

Ex. State whether the following functions are invertible or not:**(1) f is the function from {a, b, c} to {1, 2, 3} such that f (a) = 2, f(b) = 3, and f (c) = 1.The function f is invertible because it is a one-to-one correspondence.The inverse function f −1 reverses the correspondence given by f , sof −1(1) = c , f −1(2) = a, and f −1(3) = b.

**(2) Let f : Z→ Z be such that f (x) = x + 1.The function f has an inverse because it is a one-to-one correspondence.To reverse the correspondence, suppose that y is the image of x, so thaty = x + 1. Then x = y - 1 ⇒ f −1(y) = y − 1.

**(3) Let f be the function from R to R with f (x) = x2.f is not invertible as it not bijective.

** Exercise: Let f be the function from R+ to R+ with f (x) = x2.** Exercise: (i) f (x) = log2(x + 1) (ii) f (x) = 4x

(2x−1) .

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 24 / 45

Page 25: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsInverse Functions and Compositions of Functions

Let g be a function from the set A to the set B and let f be a functionfrom 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)).

To find (f ◦ g)(a) we first apply the function g to a to obtain g(a)and then we apply the function f to the result g(a) to obtain(f ◦ g)(a) = f (g(a)).

The composition f ◦ g cannot be defined unless the range of g is asubset of the domain of f.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 25 / 45

Page 26: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsInverse Functions and Compositions of Functions

EX. 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, cto the set 1, 2, 3 such that f (a) = 3, f (b) = 2, and f (c) = 1. What isthe composition of f and g, and what is the composition of g and f ?

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.g ◦ f is not defined, because the range of f is not a subset of the domainof g.

EX. Let f and g be the functions from the set of integers to the set ofintegers defined by f (x) = 2x + 3 and g(x) = 3x + 2. What is thecomposition of f and g? What is the composition of g and f ?

(f ◦ g)(x) = f (g(x)) = f (3x + 2) = 2(3x + 2) + 3 = 6x + 7.(g ◦ f )(x) = g(f (x)) = g(2x + 3) = 3(2x + 3) + 2 = 6x + 11.Note that f ◦ g 6= g ◦ f

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 26 / 45

Page 27: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsInverse Functions and Compositions of Functions

Let A be a set. The identity function on A is the function ιA : A→ A,where ιA(x) = x for all x ∈ A. In other words, the identity function ιA isthe function that assigns each element to itself. The function ιA isone-to-one and onto, so it is a bijection.

When the composition of a function and its inverse is formed, ineither order, an identity function is obtained.

suppose that f is a one-to-one correspondence from the set A to theset B. Then the inverse function f −1 exists and is a one-to-onecorrespondence from B to A.

f −1(b) = a when f (a) = b, and f (a) = b when f −1(b) = a.

(f −1 ◦ f )(a) = f −1(f (a)) = f −1(b) = a⇒ f −1 ◦ f = ιA

(f ◦ f −1)(b) = f (f −1(b)) = f (a) = b ⇒ f ◦ f −1 = ιB

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 27 / 45

Page 28: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsSome Important Functions

The floor function assigns to the real number x the largest integer thatis less than or equal to x. The value of the floor function at x is denotedby bxc. The ceiling function assigns to the real number x the smallestinteger that is greater than or equal to x. The value of the ceilingfunction at x is denoted by dxe.

b12c = 0, d12e = 1, b−12 c = −1, d−1

2 e = 0

Note that dx + ye 6= dxe+ dye

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 28 / 45

Page 29: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsSome Important Functions

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 29 / 45

Page 30: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

FunctionsCardinality of Sets

The sets A and B have the same cardinality if and only if there is aone-to-one correspondence from A to B. When A and B have the samecardinality, we write |A| = |B|.

If there is a one-to-one function from A to B, the cardinality of A is lessthan or the same as the cardinality of B and we write |A| ≤ |B|.

SCHRODER-BERNSTEIN THEOREM

if there are one-to-one functions f from A to B and g from B to A, thenthere is a one-to-one correspondence between A and B.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 30 / 45

Page 31: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Sequences and SummationsSequences

Sequence

A sequence is a function from a subset of the set of integers (usuallyeither the set {0, 1, 2, . . .} or the set {1, 2, 3, . . .}) to a set S. Weuse the notation an to denote the image of the integer n. We call an aterm of the sequence.

Consider the sequence {an}, where an = 1n .

The list of terms of this sequence starts with: {1, 12 ,13 ,

14 , · · · }

Geometric progression

A geometric progression is a sequence of the forma, ar , ar2, · · · , arn, · · ·where the initial term a and the common ratio r are real numbers.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 31 / 45

Page 32: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Sequences and SummationsSequences

Arithmetic progression

An arithmetic progression is a sequence of the forma, a + d , a + 2d , · · · , a + nd , · · ·where the initial term a and the common difference d are real numbers.

List the first five terms of the sequences

{bn} with bn = (−1)n ⇒ the terms are: 1,−1, 1,−1, · · · . Its ageometric progression with initial term 1 and common ratio -1.

{sn} with sn = −1 + 4n⇒ the terms are: −1, 3, 7, 11, · · · . Its anarithmetic progression with initial term -1 and common difference 4.

Recurrence Relation

A recurrence relation for the sequence {an} is an equation that expressesan in terms of one or more of the previous terms of the sequence,namely, a0, a1, ..., an−1, for all integers n with n ≥ n0, where n0 is anonnegative integer. A sequence is called a solution of a recurrencerelation if its terms satisfy the recurrence relation.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 32 / 45

Page 33: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Sequences and SummationsRecurrence Relations

Let an be a sequence that satisfies the recurrence relation an = an−1 + 3for n = 1, 2, 3, · · · and suppose that a0 = 2. What are a1, a2, and a3?

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.

a0 = 2 is called the initial condition.

Fibonacci sequence

The Fibonacci sequence, f0, f1, f2, · · · is defined by the initial conditionsf0 = 0, f1 = 1, and the recurrence relationfn = fn−1 + fn−2 for n = 2, 3, 4, · · ·

The Fibonacci numbers: f2 = f1 + f0 = 1 + 0 = 1, similarlyf3 = 2, f4 = 3, f5 = 5 and f6 = 8.

It is an important sequence for many applications and we will studyit in depth later.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 33 / 45

Page 34: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Sequences and SummationsRecurrence Relations

Find formulae for the sequences with the following first five terms: (a) 1,1/2, 1/4, 1/8, 1/16 (b) 1, 3, 5, 7, 9

(a) an = 1/2n is a possible match (b) an = 2n + 1 is a possible match.

How can we produce the terms of a sequence if the first 10 terms are 1,2, 2, 3, 3, 3, 4, 4, 4, 4?

The integer 1 appears once, the integer 2 appears twice, the integer3 appears three times, and the integer 4 appears four times. Areasonable rule for generating this sequence is that the integer nappears exactly n times.

How can we produce the terms of a sequence if the first 10 terms are 1,3, 4, 7, 11, 18, 29, 47, 76, 123?

Starting with the third term, each term is the sum of the twoprevious terms. That is, 4 = 3 + 1, 7 = 4 + 3, 11 = 7 + 4, and so on.We can guess that the sequence is determined by the recurrencerelation Ln = Ln−1 + Ln−2 with initial conditions L1 = 1 and L2 = 3.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 34 / 45

Page 35: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Sequences and SummationsSummations

The summation notation∑n

i=m ai used to refer to the sum ofam + am+1 + · · ·+ an.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 35 / 45

Page 36: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesMatrix Arithmetic

Matrix

A matrix is a rectangular array of numbers. A matrix with m rows and ncolumns is called an m × n matrix. A matrix with the same number ofrows as columns is called square. Two matrices are equal if they have thesame number of rows and the same number of columns and thecorresponding entries in every position are equal.

The sum of two matrices of the same size is obtained by addingelements in the corresponding positions.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 36 / 45

Page 37: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesMatrix Arithmetic

Let A be an m × k matrix and B be a k × n matrix. The productof A and B, denoted by AB, is the m × n matrix with its (i,j)thentry equal to the sum of the products of the correspondingelements from the ith row of A and the jth column of B.

Matrix multiplication is not commutative. That is, if A and B aretwo matrices, it is not necessarily true that AB and BA are thesame.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 37 / 45

Page 38: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesMatrix Arithmetic

The Identity Matrix of order n is n×n matrix where the maindiagonal is all 1 and every other element is 0.

The transpose of A, denoted by At , is obtained by interchanging therows and columns of A.

A square matrix A is called symmetric if A = At .

a matrix is symmetric if and only if it is square and it is symmetricwith respect to its main diagonal.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 38 / 45

Page 39: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesZeroOne Matrices

Zero-one matrices

It is a matrix with entries that are 0 or 1. They represent discretestructures using Boolean arithmetic.

The Boolean arithmetic is based on the Boolean operations ∧ and ∨,which operate on pairs of bits, defined by

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

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 39 / 45

Page 40: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesZeroOne Matrices

Example: Find the join and meet of the zero-one matrices:

The join of A and B is:

The meet of A and B is:

Now we will define the Boolean Product of two matrices.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 40 / 45

Page 41: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesZeroOne Matrices

Example: Find the join and meet of the zero-one matrices:

The join of A and B is:

The meet of A and B is:

Now we will define the Boolean Product of two matrices.

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 41 / 45

Page 42: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesZeroOne Matrices

Boolean product

Let A = [aij ] be an m×k zero-one matrix and B = [bij ] be a k×nzero-one matrix. Then the Boolean product of A and B, denoted byA� B, is the m×n matrix with (i, j)th entry cij wherecij = (ai1 ∧ b1j) ∨ (ai2 ∧ b2j) ∨ · · · ∨ (aik ∧ bkj).

Example: Find the Boolean product of A and B, where:

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 42 / 45

Page 43: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

MatricesZeroOne Matrices

ECOM 2311- Discrete Mathematics - Ch.2 Dr. Musbah Shaat 43 / 45

Page 44: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

Homework due to 22nd of Oct.From the text book, Section 1.7, page 91Questions: Q2,Q64, Q14, Q16, Q22, Q26 and Q42.From the text book, Section 1.8, page 108Questions: Q4,Q8, Q22 and Q30.From the text book, Section 2.1, page 125Questions: Q2[part a], Q10, Q18, Q24, and Q32[part d].From the text book, Section 2.2, page 136Questions: Q4, Q6, Q10, Q14, Q32, and Q34.From the text book, Section 2.3, page 152Questions: Q2, Q10, Q11, and Q12.

Page 45: Chapter # 2 : Basic Structures: Sets, Functions, Sequences ...site.iugaza.edu.ps/musbahshaat/files/chapter2_all_handout.pdf · ECOM 2311- Discrete Mathematics ... Functions, Sequences,

End of Chapter # 2