Professional Documents
Culture Documents
Proof. Please read the proof on pp.152-153. It is a cool proof using the technique of
mathematical induction.
The proof of Proposition 2 yields instructions for finding a base two representation. The
summary of the steps found from the proof are as follows:
1. Write n=2q+r.
2. Write down the base two representation for the quotient q.
3. Append r to the right of the string you wrote in step 2.
Rewriting the process in another way yields an algorithm for writing a number in base two.
Algorithm for Writing a Number in Base Two.
Input a natural number n.
When n > 0, do the following.
Divide n by 2 and get a quotient q and a remainder r. Write r as the next (right-to-left) digit.
Replace the value of n with q, and repeat.
Numbers in Other Bases
Definition. A natural number x has the base b representation
x = dndn1 d2d1d0
where each of the digits is from the set { 0, 1, 2, ..., b 1 }. The exact meaning of this place
value numeral is
n
x=[summation] di bi.
i=1
Note. Base eight is known as octal and base 12 is known as duodecimal or dozenal.
Since base sixteen, otherwise known as hexadecimal, needs to use digits from the set of
numbers from zero to fifteen. Since we only have the 10 digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, we
need to use a different symbols for digits that would correspond to the numbers 10, 11, 12, 13,
14, and 15. That is, the digits to represent a number for the hexadecimal number system will
come from the set
{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F }
MTH 244 3.1 Set Definitions and Operations
Most of mathematics is based upon a single undefined concept of a set. For example, topology
is a branch of mathematics based solely on set theory and concerns itself with structures and
properties of spaces through its open sets. Informally, a set is an unordered collection of things
called members or elements which is indifferent to repetition. Understandably, a set is one of the
few basic terms that we accept without a formal definition. As mathematicians know, we need to
be careful since informal definitions can lead to paradoxes. To avoid this in discrete
mathematics, we generally work with well-understood sets.
Definition. Here are some of the common set of numbers we will use:
N is the set of natural numbersthese are the numbers that can answer counting problems (N
=
{0,1,2,3,...}).
Z isthesetofintegers (Z={...3,2,1,0,1,2,3,...}).
Q is the set of rational numbersthese are characterized as ratios of integers (Q = { p : p, q
Z, q = 0 }). q
R is the set of real numbersthese can be thought of as decimal numbers with possibly
unending strings of digits after the decimal point.
At time variations of these basic sets are used, so its good to adopt consistent notation for the
most common circumstances:
R+ is the set of positive real numbers.
R0 is the set of nonnegative real numbers. Q+ is the set of positive rationals.
Q0 is the set of nonnegative rationals.
Z+ is the set of positive integers.
Z0 is the same as N.
Subsets
Definition.
1. The notation x A means x is an element of the set A, which means that x is one of the
member of
the set A.
2. A is a subset of B (written A B) if every element in the set A is also an element in the set B.
Formally,
this means that fore every x, if x A, then x B.
3. A is equal to B (simply written A = B) means that A and B have exactly the same members.
This is
expressed formally by saying, A B and B A.
4. A set that contains no elements is called an empty set, and is denoted by { } or .
5. For any give discussion, all the sets will be subset of a larger set call the universal set or
universe, for
short. We commonly us the letter U to denote this set.
New Sets from Old
Just as numbers can be added or multiplied, and predicates can be combined by and , there
are various operations we perform on sets.
Definition. Given two sets A and B of elements from a universal set U,
1. The intersection of A and B (written A Bthink of for itersection) is the set that contains
those
elements common to both A and B. In-set builder notation, we write AB={xU : xAandxB}.
2. The union of A and B (written A Bthink of for nion) is the set that contains those
elements in set A or B. In set-builder notation, we write
AB={xU : xAorxB}.
3. The difference of A and B (written A \ B) is the set that contains those elements in A which are
not in
B. In set-builder notation, we write
A\B={xU : xAbutx/B}.
Definition. TwosetAandBareequal,writtenA=B,ifABandBA.
Proof Technique. To show that two sets are equation, we show that each is a subset of the other
one. This often requires two separate proofs!
Proving New Properties from Old
It is not surprising that preceding examples (Example 3 and Example 4) are properties of sets
that are contained in a much larger theorem.
Theorem 6. For sets A, B, and C, the universal set U, and the empty set , the property shown
in the following table hold.
(a) Commutative
(b) (b) Associative
(c) Distributive
(d) Identity
(e) Negation
(f) Double negative
(g) Idempotent
(h) DeMorgans laws
(i) Universal bound
(j) Absorption
(k) Complements of U and
(l) Complement and negation
AB=BA
(A B) C = A (B C)
A (B C) = (A B) (A C) AU=A
A A = U
(A) = A
AA=A
(A B) = A B
AU=U
A (A B) = A
U =
A \ B = A B
AB=BA
(A B) C = A (B C)
A (B C) = (A B) (A C) A=A
A A =
AA=A
(A B) = A B A=
A (A B) = A = U
Definition. Foranyexpressioninvolvingthesetoperations,,,U,and,thedualexpressionisobtained
by interchanging every and and by interchanging every U and .
Theorem 7 (Duality Principle). For any true equation of two set expressions, the equation
obtained by replacing each expression by its dual expression is also true.
The Duality Principle will not be proved. Notice the table of the properties (a)-(l) of Theorem 6 all
show this duality. In addition, we will see that the textbook makes us prove many statements
and their dualities in the exercises to convince us the Duality Principle is true.
MTH 244 3.4 Boolean Algebra
Boolean algebra is provides a framework for dealing with statements. It is used in uniting
concepts such as logical systems and set systems. For example, if we look back at Theorem
2 of Section 1.3 and Theorem 6 of Section 3.3, we see many similarities between logical
statements and set notation.
Theorem 2 (Section 1.3) again. Let p, q, and r stand for any propositions. Let t indicate a
tautology, and c indicate a contradiction. Then all the following logical equivalencies hold.
(a) Commutative (b) Associative
(c) Distributive (d) Identity
(e) Negation
(f ) Double negative
(g) Idempotent
(h) DeMorgans laws
(i) Universal bound
(j) Absorption
(k) Negation of t and c
pqqp (pq)rp(qr) p(qr)(pq)(pr) ptp
ppt
(p) p
ppp
(pq) pq
ptt
p (p q) p
t c
pqqp
(p q) r p (q r)
p (q r) (p q) (p r) pcp
p p c
ppp
(pq) pq pcc
p (p q) p
c t
Theorem 6 (Section 3.3) again. For sets A, B, and C, the universal set U, and the empty set ,
the property shown in the following table hold.
(a) Commutative
(b) Associative
(c) Distributive
(d) Identity
(e) Negation
(f) Double negative
(g) Idempotent
(h) DeMorgans laws
(i) Universal bound
(j) Absorption
(k) Complements of U
and
AB=BA
(A B) C = A (B C)
A (B C) = (A B) (A C) AU=A
A A = U
(A) = A
AA=A
(A B) = A B
AU=U
A (A B) = A
U =
AB=BA
(A B) C = A (B C)
A (B C) = (A B) (A C) A=A
AA=
AA=A (AB)=AB A= A(AB)=A =U
Remark. By simply making the following mechanical changes:
Fromp,q,andrtoA,B,andC,
Fromto,
From , to ,
From , to ,
From , to =,
From t to U,
From c to , we can translate the first theorem into the second. That is, any logical expression
can be
converted to a related expression from set theory (and vice versa).
In the mid-1800s the English mathematician George Boole investigate systems with properties
such as these, giving rise to the structure that today is called Boolean algebra. It is customary in
describing Boolean algebra to use lower case letters, to use and + for the operations, and to
use 0 and 1 for the special elements. It is also customary to consider to have higher
precedence than +, reducing the need for parentheses. So observe the following relationships in
the following table.
Logical Sets Boolean Algebra
Variables p,q,r A,B,C a,b,c
Operations
Special elements
+
c 0 tU1
Using these relationships, we can construct a table for the properties of a Boolean algebra.
Properties of a Boolean Algebra.
(a) Commutative (b) Associative
(c) Distributive (d) Identity
(e) Negation
(f) Double negative
(g) Idempotent
(h) DeMorgans laws
(i) Universal bound
(j) Absorption
(k) Complement of 1 and 0
Notes.
1. It turns out that to verify
ab=ba (ab)c=a(bc) a(b+c) = (ab)+(ac) a1=a
a+a=1
(a)=a
aa=a
(ab) =a +b
a+1=a
a(a+b)=a
1=0
a+b=b+a
(a + b) + c = a + (b + c) a+(bc) = (a+b)(a+c) a+0=0
a a = 0
a+a=a (a+b) =a b a0=0
a + (a b) = a 0 = 1
that any givem system is a Boolean algebra, one needs only check that properties (a), (c), (d),
and (e) ar true. The other seven properties can be proven if we know these four
hold.
2. One of the advantages of the Boolean algebra notation is the some of the properties are
analogous to
familiar properties of ordinary algebra. For example, only the first of the two distributive
properties is the same as what we are familiar with. This makes some symbolic manipulations
easier for us than they would be using either in the logical symbols or the set symbols.
Duality
Similar as what we say with the set operations, every property of Boolean algebra, except for
property (f), occurs in two forms. We say these properties are duals of each other.
Definition. The dual of a Boolean algebra expression is the expression obtained by
interchanging the roles of + and , and also interchanging the roles of 1 and 0.
Theorem 1 (Duality). for every true equality in a Boolean Algebra, the dual of that property
(given by swapping +/ and swapping 0/1 is also true.
Again a formal proof of duality is not given, but observe that if you prove an original Boolean
algebra equality, the same proof is used to prove the dual Boolean algebra equality.
MTH 244 3.5 Excursion: Logic Circuits
One of the fascinating things about mathematics is that applications of a mathematical idea are
frequently discovered many years, even centuries, after the mathematical idea is developed. An
example of this is the use of Boolean Algebra to construct electrical circuits within a computer.
The idea is that simple circuits, called gates, are used to combine one or more single bits (a bit
is binary digit, otherwise known as a binary number) into a single bit answer. It is not the
intention of this class to do this in detail the various ways in which these combinations can be
used. That is for a computer programming class. We will just learn about some of the individual
gates, how they are used, especially how they produce truth tables.
Logic Gates
One of the basic gates that is used to combine bits is called the and gate. The symbolic
representation of
the and gate is given by the picture:
where he wires labeled a and b contain an input voltage that is either the voltage that
represents the bit value 1, or the voltage that represents the bit value 0. The resulting output
voltage, labeled a b, is given by this true table:
Notice that if we think that 1 represent true and 0 represents false, this is the truth table for
the logical and operation.
Another basic gate that is used to combine bits is called the or gate. The symbolic
representation of the or gate is given by the picture:
The resulting output voltage, labeled a + b, is given by this true table:
aba+b 000 011 101 111
Notice that if we think that 1 represent true and 0 represents false, this is the truth table for
the logical or operation.
The final basic gate that is used to combine bits is called the inverter gate. The symbolic
representation
of the invertor gate is given by the picture:
Simplifying Circuits
Remember that we are truly talking about electrical circuits. So it is important to build circuits
with as few gates as possible. Using the properties
(a) Commutative (c) Distributive
(d) Identity (e) Negation
ab=ba a(b+c)=(ab)+(ac) a1=a
a+a =1
a+b=b+a a+(bc)=(a+b)(a+c) a+0=0
aa =0
and what we already know from Section 3.4, we clearly have that circuits form a Boolean
algebra, where = means equivalent circuits. (Two circuits are equivalent if they give the same
output for all possible combinations of input.)
MTH 244 4.1 Definitions, Diagrams, and Inverses Next in importance to the notion of set is the
idea of a function. Notation and Terminology of Functions
Definition. The notation f : A B is used for a function, simply called f, with a set of inputs A
(called the domain), and a set B (called the codomain) that includes all the outputs. The function
f associates with each input in A one and only one output in B.
Remark. We use the notation f : A B and say, f is a function from A to B. If the rule
associates to the element a of the domain the element B of the codomain, we write f(a) = b, and
say, f maps a to b, thevalueoff atatob,orf ofaequalsb.
One way to visualize a function is to use an arrow diagram, a picture where we draw an arrow
from each input value to is associated output values.
Through all the preceding examples, we see that to completely describe a function, we must do
four things:
1. Give the function a name, f, g, and h are popular names for functions, but its always okay to
be creative and descriptive.
2. Describe the domain.
3. Describe the codomain.
4. Describe the rule.
Binary Relations
A set of ordered pairs is a simple structure for storing information in a way that captures a basic
relationship between data. This type of structure is called a binary relation, and it will provided a
generalization of our notion of function.
Definition. A binary relation R consists of three components: a domain A, a codomainB, and a
subset of A B called the rule for the relation. We will often omit the adjective binary since
we will not address other kinds of relations in this book.
When is a Relation a Function?
By looking back at Example 4 and Example 5, if is obvious that those two binary relations do not
satisfy the definition of a function. It is also obvious that the definition of a function satisfies the
definition of a binary relation. We will rewrite our definition to reflect that a function is a special
kind of binary relation.
Definition. A function F from A to B is a binary relation with domain A and codomain B with the
property that for every x A, there is exactly one element y B for which (x, y) F .
Inverse Functions
Now that we have defined the notion of a function as a map from an element in the domain to
an element in a codomain, it is natural to ask can we undo or reverse the function to map the
element in the codomain back to the element in the domain. For example, if f : {1,2,3}
{1,8,27} by the rule f(x) = x3, we know that g : {1,8,27} {1,2,3} would be given by the rule g(y)
= 3 y,.
Definition. Function f : A B and function g : B A are inverses of each other if f(a) = b if and
only if g(b) = a for all a A and b B. In this case, we refer to f as the inverse of G and to g as
the inverse of f. In this case, we will often us the notation f1 to mean the function that is the
inverse of function f.
MTH 244 4.2 The Composition Operation
There are operations for combining integers (for example, + and ), and there are operations for
combining
sets (for example, and ). There is a natural operation for combining functions.
Composition of Functions
Consider the successor function (n n + 1) and the squaring function (n n2). What would
happen if we used placed an input into the successor function to achieve an output, but then
used the output as an input into the squaring function. Then you would have the following
picture.
In short, we have
n n + 1 (n + 1)2 .
Definition. Iff:ABandg:BC,whenwecanbuildanewfunctioncalled(gf)thathasdomain A and
codomain C, and that follows the rule (g f)(x) = g(f(x)). We call (g f), read g of f, the
composition of g with f.
Definition. Given the relation R1 with domain A and codomain B and the relation R2 with domain
B and codomain C, we define the new relation (R2 R1) with domain A, codomain C, and the
rule (a, c) (R2 R1) if there is an element b B such that (a,b) R1 and (b,c) R2.
seem less direct because the definition is a bit more complex. To help aid in proofs about
antisymmetry, we rephrase the meaning of the definition.
Proposition 1. A relation R on a set A is antisymmetric if and only if the following statement is
true: For all a, b A, if (a, b) R and (b, a) R, then a = b.
Other Types of Orders
R={(a,b)AA : bisamultipleofa}.
Transitivity and antisymmetry are the essential properties of an order relation. The reflexive
property is the one property that is not essential for a relation to seem like an ordering.
Definition. A relation R on A is irreflexive if for all a A, (a, a) / R. (That is, the arrow diagram
of an irreflexive relation R has no loops.) A strict partial ordering on a set A is a relation R on A
that is transitive, antisymmetric, and irreflexive.
Since it is reasonable to believe that any equivalence relation should be reflexive and
symmetric, what is the missing property or properties needed to make a relation an equivalence
relation? The answer to this question is the transitivity property.
Theorem 1. If the relation R on the set A is reflexive, symmetric, and transitive, then R is an
equivalence relation.
Proof. Please read p. 319
But wait, we are not finished. From Theorem 1, a relation R on a set A having the reflexive,
symmetric, and transitive properties is a sufficient condition for making R an equivalence class,
but wouldnt it be nice if it was a necessary condition? The answer to this is yes, as we will
prove in the next theorem.
Theorem 2. An equivalence relation R on a set A is reflexive, symmetric, and transitive.
Since we now have established that it is necessary and sufficient for a an equivalent relation to
be reflexive, symmetric, and transitive, we know combine Theorem 1 and Theorem 2 into a
single Theorem.
Theorem 3. A relation R on a set A is an equivalence relation on A if and only if R is reflexive,
symmetric, and transitive.
Now, instead of trying to see in the relation yields a partition of A, we can now just check if the
relation R is reflexive, symmetric, and transitive.
MTH 244 4.6 Numerical Functions in Discrete Math
This section discusses some important numerical functions used for specific applications of
discrete mathematics.
Exponents and Logarithms
Logarithms can be used to determine the number of digits in large integers.
Definition. The base ten logarithm of a positive real number r is the real number p for which 10p
= r. In
this case, we write log1 0r = p, or simply log r = p.
Theorem 1. The following properties hold for all real numbers x and y.
1. (10x)y = 10xy
2. 10x 10y = 10x+y
3. 10x/10y = 10xy
We will not prove these properties even though you have probably seen the proofs when x and
y are
integers. We will use the properties of Theorem 1 to prove Theorem 2.
Theorem 2. The following properties old for all positive real numbers a and b.
1. log10(ab)=blog10(a)
2. log10(ab)=log10(a)+log10(b)
3. log10 (a/b) = log10 (a) log10 (b)
There is nothing special in the fact that we are using the base of 10. We know that any positive
number b can be used s a base for exponentiation.
Definition. For any positive real number b = 1, we write logb r = p to mean that bp = r, and we
call p the base b logarithm of r.
The exponent properties in Theorem 1 and the logarithm properties in Theorem 2 also hold for
any base b other than 10.
closed formula for and upper bound of the complexity, called the complexity function f : N N
given by the rule f(n) = 3n where n is the dimension of the Euclidean space.
Induction and Inequalities
As we saw in the preceding example, one can reason a closed formula for the complexity.
Unfortunately, for many algorithms, finding a closed formula can be rather difficult. Oftentimes
an algorithm leads us to conclude a recurrence relation. In order to determine when one
algorithm is much better than another, we do not necessarily need a closed formula to compare
them.
The Language of Function Growth: , O, and .
We begin with some definitions that allow us to classify and compare functions by growth rate.
Definition. For a fixed function g : N R+, we define the following sets of functions:
1. ThesetO(g(n))isthesetoffunctionsf:NR+ suchthatforallnN, f(n) K g(n)
for some real number K and natural number N. Informally, we can thing of f(n) O(g(n)) as
meaning
that f(n) grow no faster than g(n).
2. Theset(g(n))isthesetoffunctionsf:NR+ suchthatforallnN,
f(n) L g(n)
for some real number L and natural number N. Informally, we can thing of f(n) (g(n)) as
meaning
that f(n) grow at least as fast as g(n).
3. (g(n)) = O(g(n)) (g(n)). Informally, we can thing of f(n) (g(n)) as meaning that f(n)
and
g(n) grow at the same rate. We often state this by saying, f(n) is of order g(n).
This example should lead you to believe that following Theorem. Although we do not prove this
theorem here, exercise 9, 10, 11, and 12 lead to a general proof of the theorem.
Theorem 2. Let f(n) be a polynomial of degree p with positive leading coefficient. That is, f(n) =
cp np + cp1 np2 + + c1 n + c0 , where p N, cp > 0, and each ci R. Then f (n) (np ).
Moreover, for any q = p, f(n) / (nq).
The next proposition gives alternative characterizations of O, , and that are easier to use in
practice. Proposition3. Letfunctionsf:NR+ andg:NR+ begiven.
1. f(n) O(g(n)) if and only if there are positive numbers K and N such that f(n) K for all n > N.
g(n)
2. f(n) (g(n)) if and only if there are positive numbers L and N such that
f(n) L for all n > N. g(n)
3. f(n) (g(n)) if and only if there are positive numbers K, L, and N such that L f(n) K for all
n > N.
g(n)
Now using the function growth notation we have developed, we can state the following theorem.
Once again we will not prove this theorem, but we will opt instead to investigate it further using
the exercises.
Theorem 5. Let p and C be positive real numbers, and suppose that g(n) (np). The
sequence with recurrence relation an = C an1 + g(n) has on of three possible growth rates:
1. IfC<1,thenan (np). 2. IfC=1,thenan (np+1). 3. IfC>1,thenan (Cn).
For the remainder of the this section, they discuss a few specific algorithms which we will not
discuss in class. Those discussion do contain some necessary propositions to discuss. The first
proposition justifies the use of the phrase order of log n, with no specified base, to describe
logarithmic growth.
Proposition 7. For any base b > 1, logb n (log2 n).
Proof. See Example 10 on p.355. Can you mimic the solution as a proof that guarantees our
conclusion?
The next proposition recognizes the fact that logarithmic growth is small, which is a good thing
for functions measuring complexity.
Proposition 8. If p is any positive real number, then there is a positive number N such that log2 x
< xp
for all x > N.
Proof. Ask a calculus teacher and make their day!
The last remark to make is that the big-oh notation gives a natural hierarchy of elementary
functions based on their growth rates. That is,
O(log2 n) O(n1/3) O(n1/2) O(n) O(n2) O(2n)