You are on page 1of 18

MTH 244 2.

6 Excursion: Representations of Numbers


Number Theory, a field of mathematics that deals with the nature of numbers and numerals has
always been an important field for both mathematicians as well as computer scientists. This
section concentrates on how to represent numbers using different numerals. For example, we
know that number and numerals are not the same thing. We use the Hindu-Arabic system
whose numerals are based on the number of angles of the numeral we are using. The Roman
number system is the known system that is clearly related to tally marks. That is, a numeral is a
representation of the system for a number, and a number is the abstract notion of quantity.
In elementary school, we learned the meaning of decimal number system to represent integers.
Since deci means ten and since we use the ten Hindu-Arabic symbols 0, 1, 2, 3, 4, 5, 6, 7, 8,
and 9, then to interpret a string of decimal digits as number we mentally multiply each digit by its
place value. For example, the integer 5342 can be decomposed in the following manner
5342 = 5(1000) + 3(100) + 4(10) + 2(1) = 5(10)3 + 3(10)2 + 4(10)1 + 2(10)0
Since the decimal notation of a number can be represented as the sum of product of the powers
of ten, that is why the decimal number system gets its name, or sometime is called the base ten
number system.
Decimal and Binary Units
From our introduction, we have the following definition.
Definition. Give a positive integer X, the decimal representation for X is a string consisting of
digits from {0,1,2,3,4,5,6,7,8,9} that looks like dndn1 d2d1d0, where
n
X = [summation ]di 10i
i=0
=dn 10n +dn1 10n1 ++d2 102 +d1 101 +d0 100
Definition. The base two (a.k.a. binary) representation of a positive integer X is a string
consisting of digits from { 0, 1 } that looks like bnbn1 b2b1b0 where
n
X = [summation] bi 2i i=0
=bn 2n +bn1 2n1 ++b2 22 +b1 21 +b0 20
We will refer to binary digits as bits, a term coined by Princeton University statistician and
computer pioneer
John W. Tukey (1915-200).
Note. When the discussion of the base of the number being used is in doubt, we will write the
base as a subscript. For example (101101)ten represents the decimal number one hundred and
one thousand, one- hundred and one, while the binary numeral (101101)two represents the
decimal number
(101101)two =125 +024 +123 +122 +021 +120 = 32 + 8 + 4 + 1= 45,
a much smaller number.
Proposition 2. (p.153) Every natural number has a binary representation.

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. Set A and B are disjoint if A B = .


Definition. Given a set A with elements from the universe U, the complement of A (written A) is
the set that contains those elements of the universal set U which are not in A. That is, A = U \ A.
Properties and Venn Diagrams
Soon we will introduce some properties of the set operations (which look interestingly close to
properties of numerical operations or even symbolic logic properties), but we will not give formal
proofs of them in this section. We formally prove some of the following properties in Section 3.3.
To get at the truths of these statements, we will use a visualization technique called a Venn
diagram.
A Venn diagram is simple. We use a large rectangle ro represent the universe U, and then add
circles within the rectangle to represent sets. We imagine that the elements of the universe in a
set S fall inside the circle for S and the elements not in the set S fall outside the circle. When the
sets are small, we can actually draw the whole picture without taxing our imagination too much.
Proposition 1. For sets A, B, and C, the following properties hold:
Commutative property for Commutative property for Associative property for Associative
property for Distributive property of over Distributive property of over
AB=BA
AB=BA
(A B) C = A (B C)
(A B) C = A (B C)
A (B C) = (A B) (A C) A (B C) = (A B) (A C)
The Inclusion-Exclusion Principle
Since we have a number of things in a give set, say A, a natural question arises, How many
elements does A have?
Definition. If A is a finite set, we use the notation n(A) to indicate the number of elements in the
set A. Note. Later in Chapter 4, we will refer to the size of a set as its cardinality.
Theorem 2 (The Inclusion-Exclusion Principle). Let sets A, B, and C be given.
1. n(AB)=n(A)+n(B)n(AB)
2. n(ABC)=n(A)+n(B)+n(C)n(AB)n(AC)n(BC)n(ABC)
Again will will not be giving a formal proof of the preceding principle, but the principle is quite
intuitive. For example, when we add n(A) and n(B), we count the elements that are in both A and
B twice, so we subtract the number n(A B) to adjust for the overcount.
3.2 More Operations on Sets Cartesian Products
The next operation we will discuss is how to create sets of pairs, like ordered pairs or n-tuples.
Definition. Given sets A and B, we define
AB={(a,b) : aAandbB}.
(We read A B as A cross B and call (a, b) the ordered pair a, b.) We often refer to A B the
Cartesian product or direct product of A and B. In the common special case that both
coordinates are taken from the same set, we often write A2 instead of A A.

Theorem 1. For all finite sets A and B,


n(A B) = n(A) n(B).
A proof of Theorem 1 is left as an exercise at the end of this section. Definition. For any integer
n 3, the structure (x1 , x2 , ..., xn ) is called an n-tuple.
Definition. Given sets S1, S2, ..., Sn, we define the Cartesian product S1 S2 Sn
as the set of all n-tuples (x1,x2,...,xn) such that x1 S1, x2 S2, and so on. As before, in the
event tha the sets S1,S2, and so on are actually all the same set, we will often use the
notational shorthand
Sn =SSS (n terms)
Theorem2. ForanyfinitesetsS1,S2,...,Sk,n(S1S2Sk)=n(S1)n(S2)n(Sk). A proof of
Theorem 2 is left as an exercise at the end of this section.
Sets of Sets
Definition. The power set of A, is the set
P(A) = {S : S A}
(We read P(A) as the power set of A.)
Theorem 3. For any finite set A, if k = n(A), then n(P(A)) = 2k.
A proof of this Theorem is left as an exercise at the end of this section.
Partitions of a Set
It is often advantageous to separate a set into parts where each one has distinct elements. For
example, the United States is partitioned into fifty states. For another example, observe that if U
is universe then for any setA,wehaveAA =andAA =U. Infact,thiscanbedonewithanyset.
Definition. For a set A, a partition of A is a set S = {S1,S2,S3,...} of subset of A (each set Si is
call a part of S such that
1. For all i, Si = . That is, each part is nonempty.
2. For all i and j, if Si = Sj , then Si Sj = . That is, different parts have nothing in common. 3.
S1S2S3=A.Thatis,everelementinAisinsomepart.
More on the Size of Sets
Did you notice the connection between two of the set structures that have been introduced in
this section. For A = {1,2,...,k}, Theorem 3 tells us that n(P(A)) = 2k.
For S = {0,1}, Theorem 2 tells us that n(Sk) = 2k.
Could this be a coincident? Of course not. This connection will be developed more in Chapter 5.
To the the connection, we will list out the elements in the two relevant set when k is
manageable.
MTH 244 3.3 Proving Set Properties
In the last two sections we say many important properties of the set operations, but we never
formally proved them. We either saw how some of the properties were obviously true, or we
gave informal arguments which intuitively made the properties seem true. In this section, we will
be providing formal proofs to some(but not all) of the properties of set operations.
Element-Wise Proofs
For the next couple of examples, we will prove when one set is a subset of another set.
Proof Technique. To show that one set is a subset of another, we establish that every element of
the first set must also be an element in the second set.

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:

The resulting output voltage, labeled a, is given by this true table:


a a 01 10
Notice that if we think that 1 represent true and 0 represents false, this is the truth table for
the logical not operation. That is why the inverter gate is also called the not gate.

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.

Inverse Functions Revisited


The composition operation on functions gives us another way to express the inverse
relationship between functions. To do this, we first need to understand the concept of the
identity function.
Definition. For a give set A, the identity function on A is the function A : A A with the rule that
A(x) = x for all xinA. If the set A is clear from the context of the problem, we will often omit A and
just use . Note that A = {(x,x) : x A} for when we wish to consider A as a binary relation.
Theorem1. Functionf:ABandg:BAareinversesofeachotherifandonlyiffg=B and g f = A.

Composition of Binary Relations


Binary relations can be combined to create new relations in much the same way that we
combined functions.

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.

MTH 244 4.4 Properties of Relations


We will start focusing our attention at the properties of binary relations. We broadly refer to
these as order relations and equivalence relations. The former class consists of relations that
compare objects is some way. The latter class consists of relations that equate objects in some
way. In this section we will address order relations while the next section will address
equivalence relations.
Order Relations
Lets get right to the definition.
Definition. Let R be a binary relation on a set A.
1. The relation R is said to be reflexive if (a, a) R for all a A. In terms of the arrow diagram,
this
means that every node has a loop.
2. The relation R is called antisymmetric if for all a,b A, if a = b and (a,b) R, then (b,a) / R.
In
terms of the arrow diagram, this means that the arrow only go in one direction.
3. A relation R is called transitive if whenever (a,b) R and (b,c) R, it must also be the case
that (a, c) R. In terms of the arrow diagram, this means that whenever you can follow two
arrow to get
from node a to node c, you also get there along a single line.
Definition. A relation R on a set A is called a partial order on A if R is reflexive, antisymmetric,
and
transitive.
The properties of reflexive, antisymmetric, and transitive leads to a simplified arrow diagram
named for the German mathematician Helmut Hasse. These simplified arrow diagrams will be
referred to as the Hasse diagram.
Remark.
1. The binary relation on the real numbers (or any subset of the real numbers) is a partial
order because
a a for all a R, a = b and a b implies b a, and a b and b c implies a c.
2. The binary relation on the powerset P(S) for any set S is a partial order because A A for
all
A P(S), A = B and A B implies B A, and A B and B C implies A B.
Proofs About Properties of Relations
As usual, the form of a proof about an abstract object is directly tied to to the formal definitions
involved. In the case of reflexive and transitive properties for relations, the definitions are simple
if, then statement allowing for a direct proof structure.
The Antisymmetric Property
Proofs about the antisymmetric property,
for all a, b A, if a = b and (a, b) R, then (b, a) / R,

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.

Definition. We say that R is a total ordering on A if R is a reflexive, transitive, and antisymmetric


relation on A that also satisfies the property
For all a, b A, if a = b, either (a, b) R or (b, a) R.
As with partial orderings, a strict total ordering has the same properties except that it is
irreflexive instead
of reflexive.
MTH 244 4.5 Equivalence Relations
Recall that this section will focus our attention at equivalence relations, the class of relations
that equate
objects in some way so that they are the same.
Equivalence Relations and Partitions
Take your favorite deck of old cards. How do you make sure you have all 52 cards? Do you
count them from 1 to 52? Do you separate them by the 4 suits? Do you separate them by the 13
card values? All three are what we call partitions of the deck of cards. Are they any other
partitions of the deck of cards?
Definition. For a set A, a partition of A is a set S = {S1,S2,S3,...} of subset of A (each set Si is
called a part of S such that
1. For all i, Si = . That is each part is nonemepty.
2. For all i and j, if Si = Sj , then Si Sj = . That is, different parts have nothing in common. 3.
S1S2S3=A.Thatis,everyelementinAisinsomepart.
Definition. For a set A and a relation R on A, R is an equivalence relation on A if there is a
partition S of A such that (x,y) R if and only if x and y are in the same part of S. In this case,
we will refer to S as the partition of A induced by R.
Two properties of equivalence relations should be immediately apparent. For any reasonable
notion of the same, is that any element is the same as itself, and if a is the same as b, then
b is the same as a. The first property we know from Section 4.4, which is known as the
reflexive property. The second property we do not know.
Definition. A relation R on a set A is said to be symmetric if for all a,b A, if (a,b) R, then (b,a)
R.

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.

From Reals to Integers


Arguably, the most frequently used numerical functions in discrete math are functions that
convert fractional values to integers.
Definition. We define the functions floor and ceiling, each as functions R Z, as follows: x
=the greatest integer less than or equal to x.
x =the least integer greater than or equal to x.
Remark. For all x R, x = x.
We generalize the above example to the following proposition.
Proposition 3. Let k and n be positive integers. The number of multiples of k in the set of
integers {1,2,3,...,n} is given by n/k.
Proposition 4. For a positive integer n and a prime p, the power of p in the prime factorization of
n! is given by
n n
n
n
p + p2 + p3 + p4 +
Proof. See Exercise 26 at the end to this section.
Composition of Numerical Functions
We generalize the preceding example with the following proposition.
Proposition 5. For any integer b 2, the number of digits in the base b representation of a
positive integer
n is given by the function
which is built out of the logb function, the floor function, and addition.
Arithmetic Operation as Functions
The functions Sum : Z Z Z and Prod : Z Z Z defined by the rules Sum(i,j)=i+j and
Prod(i,j)=ij
are the usual addition operation and multiplication operation on integers, respectively.
MTH 244 4.8 Excursion: Growth of Functions
This section discusses some possibilities to address the complexity of algorithms. This is a
primary interest in the field of computer science. For example, if two computer scientists working
for a large corporation find two suitable algorithms for a certain task at hand, which algorithm
will the company choose? Of course the one that takes less computer times to produce the
desired result. The question is is it possible to estimate the amount of time an algorithm will
require before implementing it?
Complexity of Algorithms
Here we will discuss an example of complexity.
Example. In order to determine the distance between two point (x1,x2,...xn) and (y1,y2,...,yn) in
ndimensional Euclidean space, we must calculate the number
(x1 y1)2 +(x2 y2)2 ++(xn yn)2 .
If n = 2, the requires two subtractions, two squarings, one addition and one square root. Thats a
total of six operations. If n = 3, there are three subtraction, three squarings, two additions, and
one square roots or nine operations. If n = 4, there are twelve operations. In general, the
number of operations in the n-dimensional case is 3n. In general, for this algorithm, we found a

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)

You might also like