Discrete STR Notes
Discrete STR Notes
This booklet includes lecture notes, homework problems, and exam problems from discrete structures course I taught in Fall 2006 at the Kent State University, USA. I wrote a good part of these notes in Fall 2006; I revise them every time I teach the course. The problems in the notes have been used in class lectures, homework assignments, or exams. You can nd a collection of homework assignments and exams from past semesters of my class online at http://www.personal.kent.edu/~rmuhamma/. Please do not ask for solutions. If you are a student, the only way to learn the material is solve yourself. If you are a teacher, you should not assign problems that you cannot solve yourself.
Copyright 2006-2011 Rashid Bin Muhammad. Last Update Fall 2009. This work may be freely actual cost of reproduction, storage, or transmittal. This work is licensed under a Creative Commons Attribution-NonCommercial-Share Alike 3.0 United States License.
copied and distributed, either electronically or on paper. It may not be sold for more than the
INTRODUCTION
Propositional Logic
1 Introduction
The algorithms in computer science and proofs in mathematics use logical expressions such as if
then
q .
value of such expressions, that is, to know the cases in which these expressions are either true or false. We discuss these issues in this lecture.
1.1 Proposition
A proposition (or statement) is a sentence that is true or false but not both.
Example.
(1)
2+2 = 4 (proposition).
(2)
5+2 = 7 (proposition).
(3)
x +2 = 7
1.4.1 Conjunction
If
and
and
and
q is p and q . p or q is false,
It or
pq
is false.
p
T T F F
q
T F T F
pq
T F F F
Page 2 of 20
1.5
Proposition Form
INTRODUCTION
1.4.2 Disjunction
If
and
and
is p or
q .
It is
or
and
are
p
T T F F
q
T F T F
pq
T T T F
1.4.3 Negation
If
is not
p
that
p
and denoted
false; if
is false,
p. It has p is true.
p:
if
is true,
is
p
T F
p
F T
Example.
(1)(p
q ) (p q ).
(2)(p
q ) r .
and
is
P Q. ( p).
(2) Show Nonequivalence:
(p q )
Example.
and
p q .
(p q ) p q .
Page 3 of 20
1.7
INTRODUCTION
Symbolically,
(p q ) p q .
Example.
tautology
A
contradiction
truth values of the indivitual stateemnts substituted for its proposition variables. A proposition whose form is a contradiction is called a contradictory proposition.
Example.
p p
p p
is a contradiction.
pq qp pq qp
2. Associative Laws (p (p
q ) r p (q r) q ) r p (q r)
3. Distributed Laws
p (q r) (p q ) (p r) p (q r) (p q ) (p r)
4. Identtity Laws
ptp pcp
5. Negation Laws
Page 4 of 20
1.9
Conditional Proposition
INTRODUCTION
p p t p p c
6. Double Negation Law
( p) p
7. Idempotent Laws
ppp ppp
8. De Morgan's Laws
(p q ) p q (p q ) p q
9. Universal Bound Laws
ptt pcc
10. Absorption Laws
p (p q ) p p (p q ) p
11. Negations of
and
tc ct
and
conditional
q
of
by
is if
then
q
or p implies
q .
It is false when
is true and
then
q
q .
Exercise.
r) (q r).
Page 5 of 20
PROPOSITIONAL FUNCTIONS
contrapositive
then
then
q
is if
p.
Fact. A conditional proposition is logically equivalent to its contrapositive. 1.9.2 Converse and Inverse Propositions
converse
Suppose a conditional proposition of the form if is if
then
p
and the
inverse
then
is if
then
q is q .
q .
It is true if both
and
p and q , the biconditional of p and q is p if and only q have the same truth values and is false if p and p
T T F F
q
T F T F
pq
T F F T
and 1. 2.
are propositions:
r r
is a is a
sucient condition for s means if r then s. necessary condition for s means if r then s. r
is a necessary condition for
Example.
Show that
then
r.
Predicate Logic
2 Propositional Functions
A
propositional function
The
(or
ables and becomes a proposition when specic values are substituted for the variables.
domain
Page 6 of 20
2.1
Truth Set
QUANTIFIERS
P (x)
P (x)
is
x has domain D, the truth set of P (x) is P (x) true when substituted for x. The denoted{x D | P (x)}. D
that make and
Notation.
Suppose
P ( x)
P (x) Q(x)
means that
Q(x) be propositional functions and also suppose D. The noation P (x) Q(x) means that every of P (x) is in the truth set of Q(x). The notation P (x) and Q(x) have identical truth sets.
is
3 Quantiers
One way to obtain proposition from propositional functions is to add quantiers.
proposition
Suppose
Q(x)
universal quantier.
Note.
A value for
for which
Q(x)
is false is called a
counterexample
to the
universal proposition.
tential proposition
D the domain of x. An exisx D such that Q(x). The existential proposition is dened to be true if and only if Q(x) is true for at least one x in D . It is false if and only if Q(x) is false for all x in D . The symbole Q(x)
be a propositional function and is a proposition of the form denotes there exists and is called the
existential quantier.
x,
if
P (x)
then
Q(x). x R,
if
Example.
x>2
then
x2 > 4.
D, Q(x)
is x
Page 7 of 20
METHODS OF PROOF
is x
D,
Q(x).
is x
such that
4 Methods of Proof
Mathematics, as a science, commenced when rst someone, probably a Greek, proved propositions about any things or about some things without specication of denite particular things - A. N. Whitehead.
4.1 Denitions
You must clearly understand what the proposition is about to evaluate its truth or falsity. Mathematicians dene terms percisely so consider it important to learn denitions virtually word for word.
n n
is is
even odd
if and only if
n = 2k
k. k. r
if and only if
n = 2k + 1
s,
if
An integer
composite
and
if and only if
n = rs
r b
If
and
with
r=1 r
is
s = 1.
if and only if
rational
r = a/b
b = 0.
irrational.
and
n and d are integers and d = 0, then n is divisible by d if and only if n = d k for some integer k . Note that the notation d | n is read d divides n.
Given any integer and
such that
n and positive integer d, there exist unique integer q n = d q + r and 0 r < d. [The Quotient-Remainder n and a positive integer d, n div d equals the n is divided by d, and n mod d equals the obtainded when n is divided by d.
, is that unique integer
Theorem]
such that
Page 8 of 20
4.2
Direct Proof
METHODS OF PROOF
such that
denoted
, is that unique
Proof.
Prove that the sum of any two rational numbers is rational. Theorem 3. real numbers r and s, if r and s are rational then
rational. Proof.
Suppose and
r + s is
r = a/b r+s=
r and s are rational rumbers. Then by denition of rational, s = c/d for some integers a, b, c, and d with b = 0 and d = 0. So a c ad+bc b + d = bd . Let p = ad + bc and q = bd. Then p and q are integers because products and sums of integers are integers and because a, b, c, and d p are all integers. Thus, r + s = q where p and q are integers and q = 0. So, r + s
c.
Prove the transitive property of divisibility. Theorem 4. integers a, b, and c, if a divides b and b divides c, then a divides
By denition of divisibility, are integers such that a divides b and b divides c. b = a r and c = b s for some integers r and s. By substitution c = b s = (a r ) s = a (r s). Let k is an integer since it is a product of integers, and therefore c = a k where k is an integer. Thus a divides c by denition of divisibility. Suppose and
Proof.
a, b,
Prove that given any two consecutive integers, one is even and the other is odd. Theorem 5. Any two consecutive integers have opposite parity.
m and m + 1 are given. By the m is odd. Case 1 (m is even): In this case, m = 2k for some integer k , and so m + 1 = 2k + 1, which is odd. Hence, in this case one of m and m + 1 is even and the
Suppose that two consecutive integers parity property, either
Proof.
is even or
other is odd.
Page 9 of 20
4.2
Direct Proof
METHODS OF PROOF
Case 2 (m is odd): In this case, m = 2k + 1 for some integer k , and so m + 1 = (2k + 1) + 1 = 2k + 2 = 2(k + 1). But k + 1 is an integer because it is a sum of two integers. Therefore,m + 1 equals twice some integer, and thus m + 1 is even. Hence, in this case also one of m and m + 1 is even and the other is odd. It follows that regardless of which case actually occurs for the particular and
m + 1 that are chosen, one of m and m + 1 is even and the other is odd.
n = 4q n
with
n = 4q + 1
n = 4q + 2 n,
or
n = 4q + 3
q.
and a remainder
Proof.
d = 4.
such that or
n = 4q+r
and
0 r < 4. q.
r r Hence, n = 4q or n = 4q + 1 or n = 4q + 2
But the only nonnegative remainders
n = 4q + 3
The square of any odd integer has the form 8m + 1 for some integer m. Theorem 6. odd integers n, an integer m such that n2 = 8m + 1.
Proof.
be written in one of the forms:
n can n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3 for some integer q . In fact, since n is odd and 4q and 4q + 2 are even, n must have one of the forms: n = 4q + 1 or n = 4q + 3. 2 2 Case 1 (n = 4q + 1 for some integer q ): Since n = 4q + 3, n = (4q + 1) = (4q + 1)(4q + 1) = 16q 2 + 8q + 1 = 8(2q 2 + q ) + 1. Let m = 2q 2 + q . Then m is an integer since 2 and q are integers and sums and products of integers are 2 integers. Thus substituting, n = 8m + 1where m is an integer. 2 2 Case 2 (n = 4q + 3 for some integer q ): Since n = 4q + 3, n = (4q + 3) = (4q + 3)(4q + 3) = 16q 2 + 24q + 9 = 16q 2 + 24q + (8 + 1) = 8(2q 2 + 3q + 1) + 1. Let m = 2q 2 + 3q + 1. Then m is an integer since 2, 3, and q are integers and sums 2 and products of integers are integers. Thus, substituting, n = 8m + 1where m
Suppose is a odd integer. By the quotient-remainder theorem, is an integer. Cases 1 and 2 show that given any odd integer, whether of the form or
4q + 1
4q + 3, n2 = 8m + 1
m.
Proving a Property of Floor Theorem 7. For all real numbers x and all integers m,
Proof.
Suppose a real number By denition of oor,
x + m = x + m.
x is and an integer m are given. Let n = x . n is an integer and n x < n + 1. Add m to all sides to obtain n + m x + m < n + m + 1. Now n + m is an integer, and so by denition of oor x + m = n + m. But n = x . Hence by substitution x + m = x + m.
Page 10 of 20
4.3
Indirect Proof
SEQUENCE
Proof.
4.3.2 Argument by Contraposition Theorem 9. For all integers n, if n2 is odd, then n is odd.
Proof.
Form the contrapositive of the given proposition: For all integers
n,
if
is even, then
n2
n is integer. By denition of even n = 2 k k . So, by substitution n n = (2k ) (2k ) = 2 (2 k k ). Let m = 2 k k . Now m is an integer because products of integers are integers; and 2 2 and k are integers. Hence, n = 2 m for some integer m. So, by denition of 2 even n is even. Hence, the given proposition is true by the logical equivalence
between a proposition and its contrapositive.
Sequences
5 Sequence
Informally, the sequence is a set of elements written in a row. In a sequence
am , am+1 , . . .
the values of
an ,
each element
ak
in
ak
is called a
subscript or index. A general formula for a sequence is a rule that shows how
ak
depend on
k.
5.1 Notations
Summation Notation
tion from If m and n are integers and m n, then the summam to n of ak is the sum of all terms am , am+1 , . . . , an . We n write k=m ak = am , am+1 , . . . , an and call k the index of the summation, m the lower limit of the summation, and n the upper limit of the summation.
equals
Example.
5 k=1
Then
Page 11 of 20
5.2
Example.
of variable:
j = k + 1.
from
If m and n are integers and m n, then the product m to n of ak is the product of all terms am , am+1 , . . . , an . We n write k=m ak = am am+1 . . . an and call k the index of the product, m the lower limit of the product, and n the upper limit of the product. For instance, 5 k=1 k = 1 2 3 4 5 = 120.
Product Notation
k
equals
Example.
(
n k=m
ak ) (
n k=m bk ).
n k=m
ak + 2
n k=m bk (2)
5.3 Factorial
Denition.
Note.
For each positive integer
n,
n.
That is,
n (n 1) . (n 2) . . . 3 2 1.
n!, n! = 0! = 1.
n: n! = n (n 1)!
P (n)
n,
and let
be a xed integer. Suppose the following two propositions are true: (1) is true. (2) For all integersk the proposition for all integers
n0 P (n0 )
is true. Then
Proof.
Example.
numbers
n i i=0 r
n 0
Page 12 of 20
FUNCTIONS
7 Functions
A function and elements of
X to a set Y is a relationship between elements of X Y with the property that each element of X is related to a unique element of Y . The notation f : X Y means f is a function from X to Y . The set X is called the domain of f and the set Y is called the co-domain of f . Given an element x X , there is a unique element y Y that is related to x. We can think of x as input and y as the related output. We then say f sends x to y . The unique element y to which f sends x is denoted f (x) and is called f of x, or the value of f at x, or the image of x under f . The set of all values of f taken together is called the range of f or the image of X under f . Symbollically: range of f = {y Y | y = f (x), for some x in X }. Given an element y Y , there may exist elements in X with y as their image. The set of all such elements is called the inverse image of y . Symbollically: inverse image of y = {x X | f (x) = y }.
from a set
Example.
to
Let X = {a, b, c} and Y = {1, 2, 3, 4}. Dene a function f from X Y by specifying that f (a) = 2, f (b) = 4, and f (c) = 2. Then, domain of f = {a, b, c}, co-domain of f = {1, 2, 3, 4}, range of f = {2, 4}, inverse image of 2 = {a, c}, inverse image of 4 = {b}, inverse image of 1 = and we can represent f as a set of ordered pairs: {(a, 2), (b, 4), (c, 2)}.
x1
and
Example.
specifying that
X = {1, 2, 3}and Y = {a, b, c, d}. Dene H : X Y by H (1) = c, H (2) = a, and H (3) = d. Dene K : X Y by specifying that K (1) = d, K (2) = b, and K (3) = d. Then, H is one-to-one because each of the three elements of domain of H is sent by H to a dierent element of the co-domain: H (1) = H (2), H (1) = H (3), and H (2) = H (3). However, K is not one-to-one because K (1) = K (3) = d but 1 = 3.
Let
Lemma. If the function f : R R is dened by the rule f(x)=4x-1, for all real
numbers x, then f is one-to-one Proof.
Suppose x1 and x2 are real numbers such that f (x1 ) = f (x2 ).Then, 4x1 1 = 4x2 1, Adding 1 to both sides gives 4x1 = 4x2 , and dividing both sides by 4 gives x1 = x2 , which is required.
Page 13 of 20
7.2
FUNCTIONS
Proof.
22 = 4
and so
n1 = 2 and n2 = 2. Then g (n1 ) = g (2) = g (n2 ) = g (2) = (2)2 = 4. Hence, g (n1 ) = g (n2 ) but n1 = n2 ,
to a set
Y.
in
in
X x X , F (x) = y .
to a set
Y.
Example.
X = {1, 2, 3, 4}and Y = {a, b, c}. Dene H : X Y by H (1) = c, H (2) = a, H (3) = c, and H (4) = b. Dene K : X Y by specifying that K (1) = c, K (2) = b, and K (4) = c. Then, H is onto because each of the three elements of the co-domain of H is the image of some element of the domain of H : a = H (2), b = H (4), and c = H (1) = H (3). However, K is not onto because a = K (x) for any x in {1, 2, 3, 4}.
specifying that
y +1 4 . Then x is a real number since sums and quotients (other than by 0) of real numbers are real numbers. It follows that = 4 y+1 1 = (y + 1) 1 = y . f (x) = f y+1 4 4
y R.
Let
x =
Lemma. If the function h : Z Z is dened by the rule h(n) = 4n 1 for all integers n, then h is not onto.
Proof.
(by counterexample) The co-domain of for any integer
n.
For if
h(n) = 0,
then
h is Z and 0 Z. 4n 1 = 0 by denition
But of
to a set
is a function
F : X Y
that is both
F :X Y y
in
F 1 : Y X
F ( x)
equals
y.
Example.
f : R R
f (x) = 4x 1
x.
Then by denition of
f 1 , f 1 ( y ) =
Page 14 of 20
7.5
Pigeonhole Principle
FUNCTIONS
number
y such that f (x) = y . But f (x) = y 4x 1 = y x = y+1 4 . Hence, y +1 1 f (y ) = 4 , which is the inverse function of the given function f (x) = 4x 1.
Lemma. If X and Y are sets and F : X Y is bijection (that is, one-to-one and onto), then F 1 : Y Y is also bijection.
is one-to-one: Suppose y1 and y2 are elements of Y such that F 1 (y1 ) = F 1 (y2 ). Let x = F 1 (y1 ) = F 1 (y2 ). Then, x X , and by de1 1 nition of F , F (x) = y1 since x = F (y1 ) and F (x) = y2 since x = F 1 (y2 ). Consequently, y1 = y2 since each is equal to F (x). F 1 is onto: Suppose x X . Let y = F (x). Then y Y , and by denition 1 1 of F , F (y ) = x.
Proof. F 1
Example.
A group of thirteen people must contain at least two who were born
in the same month, for there are only twelve months in a year and
13 > 12.
The truth of the pigeonhole principle depends on the sets being nite. So, the denitions of nite and innite sets are as follows:
Denition.
A set is called nite if, and only if, it is the empty set or there is a
{1, 2, . . . , n} to it,
where
n.
f from a nite set X to a nite set Y , if n(X ) > n(Y ), then f is not one-to-one. n(X ) > n(Y ). X to a nite set Y where n(Y ) = m, and denote the elements of Y by y1 , y2 , . . . , ym . 1 Recall that for each yi in Y , the inverse image set f (yi ) = {x X : f (x) = yi }.
is any function from a nite set Let Now consider the collection of all the inverse image sets for all the elements of
Y : f 1 (y1 ), f 1 (y2 ), . . . , f 1 (ym ). By denition of function, each element of X is sent by f to some element of Y . Hence, each element of X is one of the inverse image sets, and so the union of all these sets equals X . But also by denition of function, no element of X is sent by f to more than one element of Y . Thus each element of X is in only one of the inverse image sets, and so
the inverse image sets are mutually disjoint. Therefore, by the addition rule,
n(X ) = n(f 1 (y1 )) + n(f 1 (y2 )) + . . . + n(f 1 (ym )) (Equation 1). 1 Now suppose that f is one-to-one. Then, each set f (yi ) has at most one 1 1 1 element, and so n(f (y1 ))+ n(f (y2 ))+ . . . + n(f (ym )) 1+1+ . . . +1 = m
(Equation 2). Putting Equation 1 and Equation 2 togather gives that This contradicts the fact that one-to-one must be false.
n(X ) m = n(Y ). f is
Page 15 of 20
7.6
Composition of Functions
RECURSION
Example.
f : Z Z be the successor function and let g : Z Z be the f (n) = n + 1 for all n Z and g (n) = n2 for all n Z. The function g f and f g are dened as follows: (g f )(n) = g (f (n)) = g (n + 1) = (n + 1)2 for all n Z, and (f g ) = f (g (n)) = f (n2 ) = n2 + 1 for all n Z.
Let Two functions from one set to another are equal if, and only if, they take the same values. In this case, Thus, the two functions
The above example illustrates the important fact that composition of functions is not a commutative operation: for general functions not necessarily equal
G, F G need
GF
X = {1, 2, 3}, Y = {a, b, c, d}, Y = {a, b, c, d, e}, Z = {x, y, z }. f : X Y and g : Y Z as f (1) = c, f (2) = b, f (3) = a, and g (a) = y , g (b) = y , g (c) = z , g (d) = z , and g (e) = z . Find the arrow diagram for g f and nd the range of g f .
Let Dene functions
Exercise.
Lemma. If f : X Y and g : Y
is one-to-one. Proof.
Suppose Suppose
f : X Y and g : Y Z are both one-to-one functions. x2 are elements of X such that (g f )(x1 ) = (g f )(x2 ). By denition of composition of functions, g (f (x1 )) = g (f (x2 )). Since g is one-toone, f (x1 ) = f (x2 ). And since f is one-to-one, x1 = x2 . x1
and
Lemma. If f
onto. Proof.
a element of
f : X Y and g : Y Z are both onto functions. Let z be Since g is onto, there is an element y in Y such that g (y ) = z . And since f is onto, there is an element x in X such that f (x) = y . Hence, there exists an element x in X such that (g f )(x) = g (f (x)) = g (y ) = z. It follows that g f is onto.
Suppose
Z.
8 Recursion
a1 , a2 , a3 , . . . is a formula that relates each ak1 , ak2 , . . . , aki , where i is a xed integer and k is any integer greater than or equal to i. The initial conditions for such a recurrence relation specify the values of a0 , a1 , a2 , . . . , ai1 .
A recurrence relation for a sequence term
ak
Page 16 of 20
8.1
Iteration Method
RECURSION
b0 , b1 , b2 , . . . can be dened recursively as follows: k 2, bk = bk1 + bk2 (recurrence relation) and b0 = 1, b1 = 3 (initial conditions). Since b0 and b1 are given, b2 can be computed using recurrence relation. b2 = b1 + b0 = 3+1 = 4. Then, since both b1 and b2 are now known, b3 can be computed using recurrence relation. b3 = b2 + b1 = 4 + 3 = 7.
For example, a sequence For all integer In general, the recurrence relation says that any term of the sequence after b is the sum of the two preceding terms. Thus,
b4 = b3 + b2 = 7 + 4 = 11, b5 =
b4 + b3 = 11 + 7 = 18,
and so forth.
a0 , a1 , a2 , . . . be the sequence dened recursively as follows: For all intek 1, ak = ak1 + 2 (recurrence relation) a0 = 1 (initial condition). We ak = ak1 + 2 k.
for all integers In particular,
use iteration to guess an explicit formula for the sequence. Recall that to say what positive integer is replaced
k 1 means no matter a1 = a0 + 2, a2 = a1 +
2, a3 = a2 + 2,
of successive substitutions into these equations, not just of numbers but of numerical expressions. Here's how the process works for the given sequence:
=1 = a0 + 2 = 1 + 2 = a1 + 2 = (1 + 2) + 2 =1+2+2 = a2 + 2 = (1 + 2 + 2) + 2 =1+2+2+2 = a3 + 2 = (1 + 2 + 2 + 2) + 2 = 1 + 2 + 2 + 2 + 2 We use the shorthand k 2 in place of 2 + 2 + . . . + 2 (k items), so starting from a0 . a0 = 1 =1+02 a1 = a0 + 2 = 1 + 2 =1+12 a2 = a1 + 2 = (1 + 2) + 2 = 1 + 2 + 2 = 1+22 a3 = a2 + 2 = (1 + 2 + 2) + 2 = 1 + 2 + 2 + 2 = 1+32 a4 = a3 + 2 = (1 + 2 + 2 + 2) + 2 = 1 + 2 + 2 + 2 + 2 = 1+42 a5 = a4 + 2 = (1 + 2 + 2 + 2 + 2) + 2 = 1 + 2 + 2 + 2 + 2 + 2 = 1+52
So the guess is:
a0 a1 a2 a3 a4
an = 1 + n 2 = 1 + 2n
The answer obtained for this problem is just a guess. To be sure of the correctness of this guess, you will need to check it by mathematical induction. The sequence like the one in the above example, in which each term equals the previous term plus a xed constant, is called an
arithmetic sequence.
Denition.
A sequence
a0 , a1 , a2 , . . . is called an arithmetic sequence if and d such that ak = ak1 + d for all integers k 1. Or
Page 17 of 20
RELATIONS
equivalently,
an = a0 + d n
n 0.
In a geometric sequence, each term equals the previous term times a xed constant.
Denition.
equivalently,
if there is a constant
a0 , a1 , a2 , . . . is called a geometric sequence if and only r such that ak = r ak1 for all integers k 1. Or an = a0 rn for all integers n 0.
A sequence
ak = r ak1
k 1, a0 = a.
Use
9 Relations
Let
R from A to B is a subset A B . (x, y ) in A B , x is related to y by R, written xRy , if and only if (x, y ) is in R. For instance, let A = {0, 1, 2} and B = {1, 2, 3}. Let us say that an element x in A is related to an element y in B if and only if x is less than y . Then 0R1 since 0 < 1, 0R2 since 0 < 2, 0R3 since 0 < 3, 1R2 since 1 < 2, 1R3 since 1 < 3, and 2R3 since 2 < 3. Recall that the Cartesian product of A and B , A B , consists of all ordered pairs whose rst element is in A and whose second element is in B : A B = {(x, y ) : x A y B }. In this case, A B = {(0, 1), (0, 2), (0, 3), (1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}. The elements of some ordered pairs in A B are related while the elements of other ordered pairs are not. Consider the set of all ordered pairs in A B whose elements are related: {(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)}. Observe that knowing which A
and
ordered pairs lie in this set is equivalent to knowing which elements are related to which.
A = {1, 2} and B = {1, 2, 3} and dene a binary relation R from A B , (x,y) R if and only if xy is even. Then A B = {(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3)}. To determine explicitly the composition of R, examine each ordered pair in A B to see whether its elements satisfy the dening condition of R. (1, 1) R because 1 1 = 0 and 0 is even, (1, 2) / R because 1 2 = 1 and 1 is not even, (1, 3) R because 1 3 = 2 and 2 is even, (2, 1) / R because 2 1 = 1 and 1 is not even, (2, 2) R because 2 2 = 0 and 0 is even, and (2, 3) / R because 2 3 = 1 and 1 is not even. Thus, R = {(1, 1), (1, 3), (2, 2)}.
Let A to B as follows: given any (x,y)
Example.
Z. That Z as follows: for all (m, n) Z Z, mEn if and only if m n is even. Then, 4E 0 because 4 0 = 4 and 4 is even . . . and so forth. Now we'll show that if n is odd then we have nE 1.
is, dene a binary relation
Generalize the relation in the above example to the set of all integers
from
to
9.1
Functions
RELATIONS
Proof.
Then n = 2k + 1 for E , nE 1 if and only if n 1 is even. But n 1 = (2k + 1) 1 = 2k, and since k is an integer, 2k is even. Suppose is nay odd integer. Now by denition of Dene a binary relation if and only if
k.
by substitution,
nE 1. (x, y )
R R, (x, y ) C
Exercise.
C from R x2 + y 2 = 1.
to
9.1 Functions
A to B that satises x in A, there is an element y in B such that (x, y ) F . (2) For all elements x in A and y and z in B , if (x, y ) F and (x, z ) F , then y = z . If F is a function from A to B , we write y = F (x) if and only if (x, y ) F .
A function from a set to a set is a relation from the following two properties: (1) For every element
Example.
Let A = {2, 4, 6} and B = {1, 3, 5}. The relations R dene as R = {(2, 5), (4, 1), (4, 3), (6, 5)} and the relation S dene as for all (x, y ) A B, (x, y ) S if and only if y = x + 1. Then, the relation R is not a function because it does not satisfy property (2). The ordered pairs (4, 1) and (4, 3) have the same rst element but dierent second elements. The relation S is not a function because it does not satisfy property (1). element of It is not true that every
S.
For example,
6A
but there is no
in
such that
y = 6 + 1 = 7.
R, (x, y ) C
or
Exercise.
L
R to R as follows: for all (x, y ) R x2 + y 2 = 1. (b) Dene a relation from R to R as (x, y ) R R, (x, y ) L if and only if y = x 1. Which one C
is a function?
R 1
from
to
Page 19 of 20
REFERENCES
REFERENCES
References
[1] Kenneth A. Ross and Charles R. B. Wright, Discrete Mathematics, 5th Edition, Pearson Education Inc., 2003. [2] Susanna S. Epp, Discrete Mathematics with Applications, PWS Publishing Company, Boston, MA, 1995 [3] .Seymour Lipschutz and Marc Lipson, Schaum's Outline of Theory and Problems of Discrete Mathematics, McGraw-Hill, 1997.
Page 20 of 20