You are on page 1of 763

Edition

Second

Mathematics

Discrete

for

Scientists

Computer

and

Mathematicians
L

Joe

Mott

Kandel

Abraham

P. Baker

Theodore
The

Department

Florida

State

of Mathematics

University

and ComputerScience

Prentice Hall of India


New

Delhi-110

2008

Prftefe

001

Efcoi

This

Indian

DISCRETE
by

Edition\342\200\224Rs. 3547.00)

FOR COMPUTERSCIENTISTS
Abraham Kandel and Theodore P. Baker

MATHEMATICS

L. Mott,

Joe

350.00

Reprint\342\200\224Rs.

U.S.

(Original

by Joe L. Mott, Abraham Kandel


in any form,
book may be reproduced
from the publisher.
writing

Theodore

1986
\302\251

and

this

by mimeograph

in

AND

MATHEMATICIANS,

2nd Ed.

P. Baker. All rights reserved. No part of


or any other means, without permission

ISBN-978-81
-203-1502-0
Published

New
New

by

Asoke

Delhi-110001
Delhi-110015.

K.

Ghosh,

and

Printed

Prentice-Hall
by V.K.

of

India

Batra

Private

at Pearl

Limited, M-97, Connaught

Offset Press

Private

Circus,
Limited,

Contents

Preface,vii
xiii

Acknowledgments,

A Note

to the

Reader, xiv
1

Foundations,

1.1

Basics, 1

1.2

Sets

1.3

Relations and Functions,9

1.4

and

1.5

Fundamentals

1.6

Logical Inferences,

1.7

of

of

Methods

and Problem-Solving

of Proof

Methods

Some

of Sets,

Operations

Logic,

45

of an

Proof

Strategies, 17

33

1.8
1.9

and
First Order
Rulesof Inference

1.10

Mathematical

Logic

for

Implication, 60
Methods

Other

of Proof,

Propositions,

Quantified

79
97

Induction, 103

Elementary Combinatorics,125

2.1

Basics

2.2

Combinations and

2.3
2.4

of

126

Counting,
of

Enumeration

Permutations, 143
and

Combinations

147

Permutations,

Enumerating Combinationsand Permutationswith

Repetitions,

162

2.5

2.6

Permutations
Enumerating
Binomial Coefficients, 189

2.7 The

and

Binomial

2.8

Multinomial

with

Constrained

Repetitions,

172

,
Theorems,

201

211
The Principle of Inclusion-Exclusion,

RecurrenceRelations,

237

Functions

3.1

Generating

3.2

Calculating

3.3

Coefficients

of Sequences,
of

Generating

237
Functions,

247

Recurrence Relations,264
v

3.4

3.5
3.6

RecurrenceRelations,
Solutionsof Inhomogeneous
and

4.1

Relations
Equivalence

4.4

Ordering

4.6

Directed

Relations, Lattices,
on

Operations

Paths and

Relations,
and

5.2

Isomorphisms

428

437

and

Subgraphs,

449

Trees and TheirProperties,


468
480

Trees,

Spanning

5.5

Directed

Trees, 498

5.6

Binary

Trees,

5.7

Planar

5.8

Graphs, 523

Euler'sFormula,530

5.10

395

437

BasicConcepts,

5.9

Matrices,

Sorting,

Topological

Application:

Graphs,

5.4

Adjacency

Application: Sorting and Searching,415

5.1
5.3

and Enumerations,362

379

Closures,388

Graphs

4.9

349

Relations,

4.7 Directed
4.8

331

Graphs,

Special Properties of Binary Relations,339

4.3
4.5

507

Euler

and

Multigraphs

Circuits,

535

Hamiltonian Graphs, 452

5.11 ChromaticNumbers,558

5.12
6

Four-Color

The

Boolean

569

Problem,

577

Algebras,

6.1

Introduction,

6.2

Boolean

6.3

BooleanFunctions,588

6.4

306

331

Digraphs,

and

and Generating

Roots, 300

of Characteristic

Method

The

Relations

4.2

by Substitution

Relations

Recurrence

Solving

Functions,280

Switching

577

Algebras,

578

Mechanisms,

6.5

Minimization

6.6

Applications

595

of Boolean Functions,605
to

Digital

Computer

Design, 613

Contents
7

Network

7.1

631
Graphs as ModelsofFlowof Commodities,
Flows,

7.3

Maximal

7.4 The

631

Flows,

7.2
7.5

636

Max

Flows and

Minimal Cuts, 645

Flow-Min

Cut

Theorem,

659

Applications: Matching and Hall's Marriage Theorem,686

Representation
and

8.1

Fuzzy

8.2

Possibility

8.3

Application

Sets,

739

Manipulation

of Imprecision,

699

699

Theory, 715
of

735

Bibliography,

Index,

vii

Fuzzy

Set Theory

to Expert

Systems,720

Preface

Thistextis
an

in a first course in discrete mathematics


in
science and mathematics curriculum.The

computer
for a sophomore

undergraduate
is appropriate

level

use

for

intended

topics and the depth of analysis


two-term course. A computer

concurrently
data

of

study

first

the

with

structures

mathematics
student
calculus course.

or junior course,and
be

can

science

adjusted
student

of
or a

course
preliminary to the

in programming

course

number

the

to fit a one-term
can take this

design and analysis


take
courseconcurrently
this
may
and the

of

algorithms.
with
the

A
first

No specific backgroundis prerequisite


of the
ordi:
outside
material
in
In
covered
most
courses.
a
calculus
narily
collegealgebra
particular,
is not required for Chapters
1 to 7. While it is not necessary,
background
in understanding
the proof of one
knowledge of limits would
help
7 and
theorem in Chapter
of
knowledge
integration would enhance
in
some
of
discussions
the
understanding
Chapter 8. We have assumed
that students will have had little or no programming experience,

although it would

desirable.

be

Our

assumption
the text in certain

about background

has dictatedhow

places. For instance,

in

reference to the convergence

of

power

series

written

have

we

avoided

3, we have

Chapter

by representing

the

geometric
series

00

i-o

as

the

multiplicative

inverse of

considered powerseriesfrom
analytical
viewpoint.

Likewise,

1 -

a strictly

in Chapter

aX;

algebraic

4, we avoid

in

other

rather
reference

words,

we have

than the
to limits

when

IX

and the
exercises11

the asymptotic
behavior of functions
but if students
understand limits, then

discuss

we

notation,\"

4.2.1

Section

will

for

Machinery,

Computing

in

12

the discussion.

streamline

greatly

The Association

\"big

and

CUPM,

and others

have

recommendedthat a computersciencecurriculum
a discrete
include
mathematics
course that introduces the student
to logical
and algebraic
structures and to combinatorial mathematicsincluding
enumeration
methods
and graph theory. This text is an attempt to satisfy
that
recommendation.

we expect
who are

Furthermore,

mathematicians

Therefore, we

training.
in

algorithms

have

would

suppressed

purposely

language,

writing

will

be

or

by

many

although on occasionsit

course based on our book will


both
computerscienceand mathematics
important
While
the basic content of the book is mathematics,many
are oriented
toward computer science. Moreover,we have
can
be
to include
examples from computer sciencethat
without making presumptions about the reader'sbackground
that

applications

attempted

discussed
computer

a discrete

mathematics

needs of

several

majors.

in

have

computer
programming
been
easier to do so.

believe

We

meet

that someof the teachers


ofthis course
not computer scientistsby profession

science.

for
mathematical topics are quite useful
computer
students
need
to
well. In particular,computerscience
of graph
understand
be
theory will
topics
graph theory, since many
in a data structures course.Moreover,they
need
mathematical
applied
as a proof technique and to understandrecursion,Boolean
induction
for digital
to
circuit design, logic and other proof
algebra
prepare
to be able to prove correctness of algorithms,and recurrence
techniques
Besides
relationsto analyze
that, computer science students
algorithms.
needto seehow some real life problems can be modeledwith graphs (like
and
minimal
spanning trees in Section 5.4, schedulingproblems
graph
in Section 5.11, and networkflow problems
in Chapter
7).
coloring
will
as a modeling
use graphs
Mathematics majors, on the otherhand,
tool, and they will benefit from a study of recurrence relationsto
of differential
understand
solutions
equations. But morethan
computer
a good
that, discretemathematicsprovides
training
ground for the

Many apparently
science students as

and
mathematics student to learn to solve problems
take
proofs. For this reason,mathematicsmajorsshould
in their program of studies, preferably
mathematics
quite
early

courses

that require many

research

mathematics
defined

course.
and

because

before

those

spirit

of mathematical

and

almost any other undergraduate


for example, powerful concepts can be
they can be visualizedand simpleexamples

more than
perhaps
In graph
theory,
grasped

correct

discrete

proofs.

Discretemathematicsembodies
the
scientific

to make

xi

Preface

easily. This feature and othersmakethe subjectboth


to student and teacher alike.
rewarding
challenging
The text has evolved over a period of years and, in that time, our
State University has changed significantly,
curriculum
at Florida
science
for
students. Thus, not only has the listof topics
especially
computer
in which we discussthem.Consequently,
also
the
order
but
we
changed,
the text so that the chaptersaremore
have written
or less independent
of
each other.
The following
shows
the basic logical relationship among the
diagram
can

be constructed
and

chapters.
Chapter 3

Chapter1

Chapter

Chapter

Chapter

Chapter 6
-\342\226\272

Chapter

Chapter

Chapter 8

isintroductory
as
and
Chapter 1,ofcourse,
as needed depending on the background

discussed

much

or as
of

the

little

be

it can

of

students.

Most

been
to the material of Sections1.1,1.2,and
exposed
in Section 1.3of equivalence
the
definitions
relations,
except
possibly
of
and
one-to-one
and onto functions.
relations,
composition
We
recommend
at the minimum, Section 1.7 (Methods of
covering,

students likely have


1.3

Proof
1.6

which

of an
contain

Implication)

introductory
1.7 is
Section

and Section 1.10 (Induction).Sections


1.5and
material on logic and is the foundation
upon

built.

thorough

understanding

of

proof

by

induction is, in our opinion,absolutely


essential.
for
1.4 is a general discussionthat can be assigned
Section
reading.
1.9 (Rules of Inference for Quantified
Section
may be
Propositions)
omitted without injury.
at any
time after Chapter 2 is covered.In
Chapter3 can be taught
in
for
an early introductionto treesand
a
curriculum
that
calls
particular,
after
we
recommend
that
Chapter 3 be postponeduntil
graph
theory
in
in
and
are
used
Section
5.
recurrences
5.5,
Only elementary
Chapter
use of a recurrence relation. But even this
Section 5.6 there is only
one
doesnot require any result from Chapter 3, as a solutioncanbeobtained
from
instead
1.10.11 in Chapter 1.
Example
4
on
directed
Chapter
graphs and Chapter 5 on nondirectedgraphs are
relatedbut may be treated as mutually independent chapters since

definitions

for

5. In

Chapter

We have

we have

5.2.

5.1 and

Sections

with

4 for digraphs are repeated,


and
illustrated
fact, Sections 4.1 and 4.2 can be taught concurrently

in Chapter

given

made severalsignificant

from

changes

7 on

edition. First

the first

network flows

8
chapters,
Chapter
Chapter
on representation and manipulationof imprecision.
Next,we have added
we have
several exercises in almost every section of the book. Moreover,
consolidated two separate sectionson partial
orders
into one in this
second edition (Section4.4), and we have removed the material on fuzzy
1 of the first edition and incorporated
sets
from
that
with
other
Chapter
on expert systems into Chapter 8. We have
material
rewritten
other
sections including the sectionon methodsof proofin Chapter
1, Section
3.6 on solutions of inhomogeneousrecurrencerelationsin Chapter
3, and
The most notable change
Sections 5.1 through 5.6of Chapter5 on graphs.
in Chapter 5 is that we have consolidated
trees and minimal
spanning
into
and
have
trees
one
section
we
introduced
breadth-first
spanning
searchand depth-first
as
well.
search
trees
spanning
Finally, we have added chapter reviews at the end of each chapter.
5 has
a review for Sections 5.1to 5.6and
then
one for Sections
Chapter
5.7 to 5.12. Thesereviews
contain
and problems
from actual
questions
classroomtests that we have given in our own classes.
There are severalpossiblecourse
For mathematics
students
syllabi.
two

added

and

suggest Chapters1, 2, 3,5,and 7. One for computer science


couldbe Chapters
alone
1, 2, 4, 5 (at least Sections 5.1to 5.6),7,
majors
and
8. Chapter
6 on Boolean algebras couldreplaceChapter
7 or 8 if
a
for
course
i
sneeded.
preparation
digital design
At
Florida
our discrete classes contain both
State
University
only, we

mathematics

and

majors

science majors

so we follow

this

syllabus:

I:

Discrete

Sections 1.5 to
and

computer

DiscreteII:
Chapters

1.10of

5 (at

Chapter

3,4,

Chapter

1 (Section

least Sections

7, and

selected

1.9 is

5.1 to 5.6)

optional), Chapter 2,

topics from sections5.7to 5.12as

time

permits.

of
section, and as a general rule the level
routine to the moderately
difficult,
although
some proofs may present a challenge.In the early
we include
chapters
to
many worked-out examples and solutionsto the exercises
hoping
enable
confidence.
the student to check his work
and
Later in the
gain
book we make greaterdemandson the student;
in particular,
we expect
the studentto beable to make some proofs by the end of the text.

Exercises

difficulty

follow each
from the

ranges

Acknowledgments

to the Sloan Foundation for the grant


appreciation
at
departments of Mathematicsand ComputerScience
in 1983. The Sloan Foundationhas played
a
Florida
State
University
of the need for discrete
major role in educating the academiccommunity
mathematics 'uq. the curriculum,
and we appreciate the support that the
We

our

express

to the

awarded

has

Foundation

To our

us.

given

colleagues and friends who

of the book and madesuggestions

have
for

an earlier

from

taught
improvement

version

a heartfelt

we say

thank you.
at Reston

staff

editorial

The

thank them.

Publishing

have

been

a great

we

help and

Portionsof

in Chapter
the
material
8 are based on recent work
by Lofti
A. Zadeh [50], Maria Zemankova-Leechand Abraham
Kandel
[52],
in the fields
L. Applebaum
and E. H. Ruspini
and
researchers
many

[46],

of

set

fuzzy

and

Dalya

wrote

and
theory
Peli
Pelled,

Chapter

artificial intelligence. Special thanks


A.
who provided the desk upon which

are due
Kandel

8.

who
We wish to expressour gratitudeto severalpeople

helped

with

the

manuscript. SheilaO'Connelland Pam Flowers read


while
Robmade severalhelpful
Sandy
suggestions
Karen Serra, and
Ruth
bins, Denise Khosrow,Lynne
Pennock,
Wright,
Marlene Walker
edition.
of the manuscript for the first
typed
portions
Robert
edition.
Stephens
typed most of the manuscriptfor the second
of the
preparation
early versions and

we want

, Finally,
for

their

writing

patience

this

to

and

express

our love

encouragement

and appreciation to our families


throughout the time we were

book.

XIII

In
then

each

and
book, sections are numbered by chapter
section number 4.2meansthat it is the second section

of Chapter 4. Likewise
are numbered by chapter,
that

We

included

theorems,

example
every

acknowledge

at the

Reader

the

of this

chapter

section. Thus,

means the
Theendof

to

Note

theorem

our

section,

corollaries,

and

and examples

definitions,

sequence

so that

example 4.2.7

seventh example in section 4.2.


is indicated by the symbol \342\226\241.
proof
intellectual
debt to several authors.We have

is the

end of the

book a bibliography

which

references

many,

for
all, of the booksthat have been a great help to us. A bracket,
instance
[25], means that we are referringto the articleor book number
25 in the bibliography.
An
asterisk
that the problem beside which
the
asterisk
(*) indicates
is generally more difficult
the
of the
than
other
problems
appears

but not

section.

Joe L.

Mott

Abraham

Kandel

Theodore

P. fiaker

Foundations

1.1

BASICS

of

One

The

sets.

the important
tools in modern mathematics is
notation, terminology, and conceptsof set theory

the

theory

of

are

helpful

in

can
branch
of mathematics
any branch of mathematics. Every
of sets
of objects of one kind or another.For
be considered as a study
with sets of numbers and operationson
is concerned
example,
algebra
sets whereas
those
The study
analysis deals mainly with sets of functions.
of sets and theirusein the foundations
of mathematics
was begun in the
latter part ofthe nineteenth
century
by Georg Cantor (1845-1918). Since
has
unified
then, set theory
many seemingly disconnected ideas. It has
to their logical
helpedto reducemany mathematical
concepts
an
and systematic way and helped to clarify
foundations in
the
elegant
between
mathematics
and philosophy.
relationship
What
do the following
have in common?
studying

\342\200\242
a crowd
\342\200\242
a herd

of people,
of animals,
of flowers,
of children.

\342\200\242
a bunch
\342\200\242
a

group

In each casewe
Rather

than

are

use

and

with

dealing

a different

a collection

word

for

convenient to denote them all by

the

collectionof

objects,

called

of the

set are

elements
(or

in)

the

well-defined

members)

of objectsofa certaintype.

it is
Thus
a
set is a
one word \"set.\"
of the set. The
the elements
each

type

of collection,

said to belongto (orbecontained

set.

Chapter 1:Foundations
to realize that a set may
itself
It is important
be an element
of some
a line
is a set of points; the set of all lines in the
other set. Forexample,
plane is a set of setsof points.In fact a set can be a set of sets of sets and
so

The

on.

theory

dealing

to fuzzy

set

This

with

begins

chapter

of several

introduction
In this

sets defined in the above


in contrast
set theory,

(abstract)

conventional)

or

will be introduced later in Chapter8.


a review of set theory which
includes

which

theory

the

with

manner is called(abstract

important classesof sets and

their

the

properties.
of relations

and
chapter we also introducethe basicconcepts
of the material.
necessary for understanding the remainder
The chapter
also describes different methodsof proof\342\200\224including
shows
how to use these techniques in proving
mathematical
induction\342\200\224and
results
related
to the content of the text.
the applications of the
2-8
The materialin Chapters
represents
in this
these concepts and
Understanding
chapter.
conceptsintroduced

functions

their potential applicationsis


science and mathematics majors.

1.2 SETS

AND

OF

OPERATIONS

most

for

preparation

good

SETS

Sets will be denoted by capital lettersA,B,C,...,X,Y,Z.


be denoted by lower case letters a,b,c,...,x,y,2.
The
phrase
of\" will be denoted by the symbol
G.
Thus
we write x

element of A.\" In

element of A.\"
There

1.
set.

2.

are

analogous

Describe

a set

Describe

a set

used to

3. Describea setA

by

Elements

\"is an

for

for

\"x

will

element
\"x is an
is not an

describea set.
the properties of the

by describing
by listing

write

we

situations,

five ways

computer

membersof the

its elements.

its characteristic

Ijla(x)

Ijla(x)

1 if

= Oif

for all x in [/, where Uis the universal


of discourse,\"or just the \"universe,\"

function,
x G

A,

x $

A,

set,

of
describingthe contextfor the duration
If the discussionrefersto dogs only, for
discourseis the classof dogs.In elementary

sometimes
which

is

defined as

called the \"universe


a fixed specified set

the discussion.
then the
example,
algebra

universe of

or number

theory,

Sets and

Section 1.2

of Sets

Operations

the universe of discoursecouldbenumbers


(rational,
real, complex,
etc.).
The universe of discourse
must
be explicitly stated, because the truth
of a statement
value
depends upon it, as we shall seelater.
4. Describe
a^set
formula. This is to give one or more
by a recursive
elements of the set and a ruleby which
the rest of the elements of the set
in Chapter
We return to this idea in Section1.10and
be generated.
may
3.

a set by

5. Describe
complement,

on some

etc.)

an

operation

(such

as union,

1.2.1. Describethe set containing

Example

intersection,

other sets.
the

all

nonnegative

integers less than or equal to 5.

Let

the

denote

set. Then

the set

can

in the

be described

following

ways:

1.

{x | x

2.

{0,1,2,3,4,5}.

3.

pA(x)

is a nonnegative

(l for x

= 0,1,..

integer lessthan

or

equal

to 5}.

.,5,

0 otherwise.
4. A = {xi+l = x( + 1, i = 0,1,.. .,4,
5. This part is left to the reader an
operations sets are discussed.

where

as

x0

= 0}.

exercise

to be

completed once the

on

of bracesand | (\"suchthat\") is a conventionalnotation which


of x\\ means
\"the set of all elements x such that x has
Note
of
the given property.\"
that, for a given set, not all the five ways
set
of real numbers
the
it are always possible. For example,
describing
between 0 and 1 cannot
be described
by either listing all its elementsor
The use

reads:

by

{x | property

formula.

a recursive

In this section,
and the relations

we shall introducethe fundamental


among these operations.We

on sets

operations
begin

with

the

following

definitions.

Definition 1.2.1. Let A and B be two sets. Then A is


subset of B if every element
of A is an element of B; A is
proper subsetofB if A is a subset of B and thereisat leastone
B which is not in A

If A
A

is a

B. If

of B, we say A is contained
a proper subsetof B,then we

subset

A is

said
said

to be
to be

element

a
a
of

in B. Symbolically, we write
A is strictly contained in

say

Chapter

1: Foundations

denoted

Bt

by

properties.

1.

and C be sets.

following

A.

has the

of sets

containment

The

B.

A, B,

Let

2. IfACBandBCCthenACC.
3. If A C B and B C C, then A C C.
4. If A C B and
then
B(\302\243C,

A^C,

where

\"is not

means
\302\243

contained

in.\"

The statement
fact, we have both
the same

B have

A =

We

out the possibility

not rule

B does

and B

ACjB

Two sets A

if and

elements. Thus we

1.2.2.

Definition
write

define

that

B C

only if (abbreviated
the following:

iff)

B are

and

equal

iff

C B

A. In
A

and B

and

CA.

B.

Therefore, we have

the

principle.

following

To show that two sets A and B are equal, we must


A is also an element of B, and conversely.

Principle.

show

that eachelementof
A

set

is called

no elements

containing

by 0. For example,given

denoted

numbers,the setof
x +1 0 is an empty

all

set

set,

all positive

the equation
which

numbers

positive

null

or

U of

U satisfying

x in

numbers

positive

set since there are no

the empty set

universal

the

can

set
is a subset
of every set. In other
satisfy this equation. The empty
A
in 0;
for
A.
This
is
because
there
no elements
0
C
are
words,
every
in
A.
It
to
is
to
element
0
note
that
therefore, every
belongs
important
the
sets
0 and {0} are very
different
sets.
The former has no elements,

whereas the latterhas the unique


element is calleda singleton.
We

union,
from

shall

describe

now

intersection.
given sets. We
and

element

0.

set

containing

a single

three operations on sets; namely,


complement,
These operations allow us to constructnew

shall also

the

study

relationships

sets

these

among

operations.

Definition 1.2.3. Let U bethe universal


set and let A be any subset
The absolute complement of A, A, is defined as {x \\ x $ A} or,
{x | x G f/and x $ A}. If A and B are sets, the relative complementof
A with
to B is as shownbelow.
respect

of U.

BIt is

A-{x|xG

clear that 0 = \342\200\242


U
[/,

of
complement

is equal

0, and that

A}.

the complementof the

to A.

Definition 1.2.4. Let A


= {x|xGAorxGBor

AUfi

Band*

and

B be two sets. The union of A


both}.More generally,if Al9A2,..

and

B is

.,An are

Sets and

Section 1.2

their union is the setofall


of them,and is denoted by
sets, then

\342\200\242
\342\200\242

AXUA2U^

the set of all

objects

UAn,orby

x\302\243B).The

which

belong

belong

to at

least one

\\jAj.
7-1

The intersection

1.2.5.
G A and

Definition
Pi B = {x\\x

which

objects

of Sets

Operations

sets

two

of

of n sets /lx,A2,.
intersection
to every one of them, and

B is

and
. .,

An IS

is denoted

by

n a2

ax

... n

An,

or

p|

;-i

Some basic propertiesof union

a,-.

of two

intersection

and

as

sets are

follows:

Intersection

Union

AU

Idempotent:
Associative:

It should

be notedthat, in
U B)

(A

Definition
B is

difference

We

have a
can

1.2.6.

= {x\\x
of two sets

Definition
do not

= A

AU B = BU A
A U (B U C) = (A

Commutative:

C\\

A =

- B C\\ A
(B D C) =

A C\\ B

B) U

(A

B) D

general,

H C

(B

H C).

The symmetrical differenceoftwo

sets

theorems

the following

show

easily

from

the

definitions

if

they

of

and complement.

Theorem 1.2.1.

Let

Laws).

(Distributive

A, Bf

and C be threesets.

Then,

A and

G A, or x G J3, but not both}. The symmetrical


of the two sets.
is also called the Booleansum

1.2.7. Two sets A and B are said to be disjoint


member in common,that is to say, if A D B = 0.

union, intersection,

c u (a

u B)

- (c n

n b)

(c

A)

a) n

(c

n b),

(c u b).

Chapter

1: Foundations

1.2.2.

Theorem

(DeMorgan's Laws).LetA
(A

(A O

B,

B) = A

B.

B)

and

B be

two sets.

Then,

John
to use a diagram,calleda Venn diagram
[after
of the set
to visualize the various
properties
universal
set is represented
operations.
The
by a large rectangulararea.
within
universe
are represented by circular areas. A
this
Subsets
in Figure
1-1.
and their Venn diagrams is given
summary of set
operations
Venn
the
the
laws can be_establishedfrom
diagram.
DeMorgan's
_If
A represents A and the area outside B represents B, the
area
outside
It is often helpful
Venn (1834-1883)],

proofis immediate.
U

Let

be

our

universe;

applying DeMorgan's

expressed as a union of disjoint sets:


A

B =

Set

(A H

B )=U-

(A

set

of set

- (A

H B) U

(A

B)

Venn Diagram

complement

The relatrye

complement

of set B with

respect

A-

A U

to set A

The union
A and B

of sets

The intersection
sets A

of

AH B

and B

*V\\

The symmetrical
difference

sets A and

of

A B

B
Figure 1-1.

Venn

diagram

U (A

BCA

The absolute

B)

Symbol

Operation

Set B is contained
in

laws, A

of set

operations.

can

be

\302\243).

Sets and

Section 1.2

1.2.2.

Example
A

(A

- B) = A
= A

(A Pi B)

Pi (A

= AC)

(by definition

(AU B)

P(A) =

Symbolically,

{X|X

Let

1.2.3.

Example

be

Let

is the family

P(A),

B),

(by distributive

Clearly, the elementsofa setmay


such setsisthe power set.

by

\302\243),

DeMorgan),

(by

= 0 U (AC) B)
= AC)B

Definition1.2.8.

of A

(by definition of A

OB)

= (AC)A)U(Ar)B)

denoted

of Sets

Operations

(by

D A=

(by

U X

A special

be sets.

themselves

a given

law),
0),
= X).

set. The

of sets suchthat

class of

power set of A,
C

iff

P(A).

\302\243
A}.

The

{a,b,c}.

power set

of A

is as

follows:

= {{0},{a},{6},{c},{a,6},{6,c},{c,a},{a,6,c}}.

P(A)

Exercises for Section 1.2

1.

List

in the

elements

the

(a) The setof

following sets.

numbers

prime

(b) {x| x G U and x2

less

- 12

than

or equal

= 0},where IR

to 31.

represents

the

set of

real numbers.
in the word SUB
SETS.
(c) The setofletters
2. Russell's paradox:Show
that
set K, such that K = {S\\ S is a set
such that S tf. S], does not exist.
set
is uniqtie.
3. Prove that the empty
4. Cantor's paradox: Showthat set A, such that A = {S | S i$ a set},

not exist.

does

5. Let U -

- {1,5}, B {1,2,3,4,5},
A

sets.

the

following

(a)

A OB.

(b)

(c)

(A

U
U

(B
B)

C).
H (A

U C).

(d) (aTHb) u (FtTc).

(e)

UB.

Determine
and C = {2,5}.
{1,2,3,4},

Chapter 1: Foundations
6.

and C be subsetsof U.Prove

Ay B,

Let

B) n

(A U

n B)

(A

disprove:

(B U C) C A

(A

B.

the complementof

DeMorgan's laws to prove that

7. Use

or

n (a

b)

u o

is
U

(A

8.

of real

sets

are

A*

B)

U (A

H (B

numbers defined
A0

Ak

{a\\a<l

{a | a

U C)).

as
< 1}

+ 1AU

1,2,....

Provethat

9. List

a <

10. Let A
where

of the

elements

the

1 <

12 and 3 < b

be

<

set {a/b:

a and 6 are primeintegers

with

9}.

Define P (A) as the setofallsubsetsofA. List P(A)9


- {l,2,3}.If P(A) has 256 elements,
how many elements

a set.

are there in A?
11.

elements, formulate a conjectureabout the number

A has k

If set
of

in P(A).

elements

Cartesian product ofthe setsS and T, (S x T), is the set of


all orderedpairs(s9t) where s\302\243S and t\302\243T, with (sft) = (uyv) for
a E S, y G T, iff 5 = u and t = v. Prove
S x T is not equal to
that
T x S unless S = Tor either S or Tis 0.

12. The

13.

that

Prove

14. Prove that B -

is a

that

16. If

{0,1} and
x {1} x B.

(a)

(b) (Bx

A)

of A.

A.

A U (B - A) = B.
B
{l,a},determinethe sets

15. Prove
=

subset

O
\302\243

B implies

(BxA).

Section

Relations

1.3

Selected

for Section

Answers

2. It is

Functions

and

1.2

in using the concept of


unrestricted
freedom
to contradiction. One of the paradoxes,
exhibited
Bertrand
be
as
formulated
follows.
Most
sets
do
Russell,
by
may
A of all
not contain themselves as elements. For example,
set
the
A, being itself not an
integers contains as elementsonly integers;
set
not
a
as element.
but
d
oes
contain
itself
of integers,
integer
Such a set we may call \"ordinary.\" There may possibly be setsthat
do contain
themselves
as elements; for example,the set defined
\"S contains as elements all sets definable
as follows:
of
by phrase
less than ten words\"couldbe considered
to contain
itself as an
element. Such setswe might call \"extraordinary\"
sets. In any case,
most
sets will be ordinary, and we may
exclude
the erratic
however,
behavior of \"extraordinary\" sets by confining
our attention
to the
set of all ordinary
sets. Call this set C. Eachelement
ofthe set C is
itself a set; in fact an ordinary set.The question
now
is C
arises,
itself an ordinary setor an extraordinary
set? It must be one or the
other.If C is ordinary,
it contains
itself as an element, since C is
defined as containingall ordinary
sets.
This
being so, C must be
sets
are those
extraordinary, sincethe extraordinary
containing
that

observed

lead

must

\"set\"

C must
themselves as members.Thisisa contradiction.
Hence
be
But then C containsasa member
an
extraordinary
set (namely
C itself), which contradicts the definition
C
whereby
was to contain ordinary sets only.
in either
Thus
case we see that
of the
the assumption of the mereexistence
set C has led us to a

extraordinary.

contradiction.

3.

that

included

are
0X

are two
in every set,

there

that

Suppose

empty sets,

0xC

set of A, P(A) has


can
be
constructedusing
proof
Chapter 2.)

RELATIONS

AND

0 x and

and

2.

Since

0 x, which

and

implies

02.

11. The power

1.3

2k elements
the

binomial

if

has

theorem

k elements.

discussed

(A
in

FUNCTIONS

are ordered
our main concern is sets whose
elements
an ordered pair we mean that each set is specified by two
in a prescribed
order. The ordered pair of a and 6, with first
objects
also
define
that
coordinate a and secondcoordinateb, isthe set (a,6).
We
(a,b) = (c,d) iff a - c and b = d. We are now in a position to define the
In

this

section

pairs. By

Cartesianproduct

of

sets

A and

B.

1: Foundations
1.3.1.

Definition

of A

product

B is

and

generally, the Cartesian productof n


x

Ax

An =

A2 x

Example 1.3.1.

A =

B =

product

Cartesian

the

of

relationshipis required

the

between

Thus, frequently
product set but only in

ordered

pair.

Cartesian

way well

rc}.

ordered n-tuple.
= {a,6}.Then,

the

we have seen that any


an ordered pair. No
and 6 for them to form
an

product
x

Bis

objects

just

entire

the
is in

some

defined.

n-ary relation is
n =

subset

1, a subset # of

R from

relation

Example 1.3.3. Supposeit is desiredto find


R =

\\(x,y)

x and

y are

is a relationon the setofreal


Definition
denoted

1.3.3.
by dom

dom R
The range

{y\\y

of

all

the

points

inside a

and x2

y2 <

1}

numbers.

A and

of/?, denotedby
ran R

a subset

set

the

real numbers

Let R be a
R, is defined:
{x\\xEl

B is

to

relation on A. More generally,an


(binary)
of a Cartesian
.,An.
product of n sets AX,A2,..
A is called
a unary relation on A.

unit circle whosecenterisat the origin.Then

- 1, 2,...,

we are not interested in


a certain portion of it which

Definition 1.3.2. A (binary)


x B. If A = J3, we say R is a

In case

a,- \302\243E
Ai9 i

(0,2), (1,0),(1,1),(1,2),(2,0),
(2,2)}.
(2,1),

Cartesian product

in a

(a,6)

and B

defined as

An is

Let R1 be the set of real numbers.


Then
R1 x R1 = {(x,y)\\ x and y are real numbers}.

From the definition


element

an)

More

6GB}.

(l,a), (1,6),(2,a),(2,6)},

{(0,a), (0,6),

{(0,0) (0,1),
1.3.2.

Example

Cartesian

= {0,1,2}

Let

\302\243E
A and

Al9A2,...,

called an

an) is

a2,...,

(ax,

sets

Cartesian

The

sets.

two

= {(a,6)\\ a

{(ax, a2,...,

\342\200\242
\342\200\242
\342\200\242
x

The expression

be

Let A and B
defined asAxB

G B

ran

relation from

(xfy)

some

R, is

and (x,y)

(E

R for

to B.

The domain

y (E B\\.

defined:
\302\243E
R for

some

jc

A}.

of

Section

Relations

1.3

and ran R
coordinates in R and

dom RCA

Clearly,

of first

set

11

Functions

and

the domain of R is the


of R is the set of second

B. Moreover,

the

range

coordinates R.
in

(x,y) G

write

sometimes

We

x R y

as

to

relates

which reads \"x

R be a relation
Definition 1.3.4.
on A. R is an equivalence
relation A if the following conditions are satisfied:
Let

on

1. xRx for all x G A (R is reflexive).


for all xty G A
2. If xRy, then yRx,
3. If xRy and yRz, then x#z for all

is symmetric).

(R

G A

x>y,z

1.3.4. Let N be the setof natural


relationR in iV as follows:
Definea
{1,2,3,...}.
Example

# =

{(*,y)\\x,y

N
\302\243E

is, N

that

numbers,

x 4- y

and

is transitive).

CR

is even}.

in N because the first two conditions


are
relation
equivalence
z
i
f
x
are
divisible
As
to
the
and
satisfied.
third
+
4condition,
y
y
clearly
x + (y 4- y) 4- z is divisible
2, then
by 2. Hence x + 2 is divisible
by 2.
by
and
so are
In this equivalence relation all the odd numbersareequivalent
all the even numbers.

is an

A - {1,2,3,4}, and let


Example 1.3.5.
the
relation
is not
reflexive
(2,3), (3,1)}.Then,
Let

definition

(2,3) G
and

(3,2)
$ R; and
but
R,
(2,1) $ i?.

other

the

(6,a)

Therelation

i?

and

(3,1)

G #,

in

1.3.5 is

example

Let

positive

reflexive

since if

to part

transitive

1^3.
be
Let

the

not antisymmetric
set of

(1) of

symmetric

since

since (2,3) G
(2,3),

(3,1),

on A.

relation if (a9b) G

because(1,3)G R

natural numbers (that is, N is


on N definedby xRy iff

R be the relation
y = xz, where z is

someinteger.Then R is
y. Thus, (x,y) G R iff
R is transitive
since any integer x in N divides
itself.
Moreover,
= su, where
u and 1;are
s and s divides t, then s = ru and \302\243
divides

integers.But thent = r (ui>)


antisymmetric
since

is not

not

an antisymmetric

is called

a = b.

but certainly

Example 1.3.6.
the setof
integers).
x divides

is

(4,2), (2,4),

{(1,3),

according

the relation S = {(1,1),


(2,2),(3,3),(4,4),
and transitive but not symmetric
as a relation

R on a set A
G R implies

relation

and

finally,

similarly,

hand,

(2,1)} is reflexive

Q: R;

(1,1)

but

R9

(3,1)
On

because

1.3.4,

if a

so

that

divides b and b divides

r divides

\302\243.
Finally,

/? is

a, wherea and 6 are integers,then

in

12

Chapter

1: Foundations
=

general

in

\302\2616,
but,

case, since

this

a and

are

integers,

positive

a = b.

Example 1.3.7. Fromtime

to the equivalence
a positive
integer.

have occasion to refer


modulo n, wheren is

we shall
time,
as congruence

to

known

relation

Let A be the set of integersand let n be a fixed positive


b is an integral
Define
the
relationRn on A by aRnb iff a \342\200\224
integer.
\342\200\224
=
a
n.
Inother
iff
b
k
of
is someinteger.
words,
kn, where
aRnb
multiple
notation
is to write a = b mod n insteadof aRnb>
Themostcommon
and
n. Thus,
we say that a is congruent to b modulo
for example, 17 = 2 mod
2 = 3 \342\200\242
5 since17\342\200\224
17 is not congruent to 3 mod5 since17- 3 = 14
5, but
is not an integral multiple of 5.
a We now check that Rn is an equivalence
relation. Reflexivity: a \342\200\224
\342\200\242
=
=
a
n
If
b
so
a
mod
for
a.
a
that
each
mod
0 n,
n,
Symmetry:
integer
& is some integer. But then b - a = (-k)n,
so that
then a - b = /en, where
6 = a mod n. Transitivity:
If a = b mod n, and 6 = cmodn, then
a - b =
& and
kn and 6 - c = mrc where
m are integers. Therefore, by adding
a == c
we have a - c = (k + ra)n, and
we conclude
thesetwo equations
modrc.

Now if a is a given
a = b mod n.

[a] denote

let

integer,

The set [a] is called


equivalence class) containingthe integer

that

of
representative

the

class.
congruence
if n = 5, then there

[0]

{5fe

{5fe

belongs to one and


because the remainderis uniquely
by 5.

Each integer

{5fe

only

a is

class

such

(or

called a
is any

kn\\k

different

congruence

integer}. In
for the

classes

G A}

l|fe G A}
2|fe(E

[31={5fe + 3|fe(E
[4]

integers b

congruence

= {a +

\\k

[1] = {5k +
[2]

a and

Thus, [a]

are five
particular,
relation congruencemodulo5, namely,

the set of all


the

4|feG
one

A}
A}

A}
of these

determined

when

equivalence
an integer

classes
is divided

Functions

Definition1.3.5.
and

b G

B define

For

any

relation

R from

to

B and

the sets

R-l = {(y,x)eBxA\\(x9y)eR}
R(a)

{yGB\\(a9y)\302\243R}

R-\\b)-{xeA\\(x9b)ER}

for any

aG

Section 1.3

Relations and
~l is itselfa relationfrom B
set R
x under R -1 iff x relates to y under

to A

The

to

set of real numbers

on the

xRy

by

iff x

divides
y, then R'1 is the relationwhere
multiple of d. The set R(a) contains

elementa is related

R and

under

R(a) may

In general,

where, by definition, y

R. Thus,ifR

relation on the set Z

is the

if R

Likewise,

can be

be either empty

or

13

Functions

< y,

is the

relation

relates
defined

then cR~ld meansc >

d.

defined
by xRy iff x
c is an integral
cR~ld
means
all elements
of B to which the
of

integers

viewed as the^setof images of a.


contain
many elements. But if R

A to B, then
for each a G A, not only is R(a)
is a function from
one element.
precisely
nonempty, but, morethan that, R(a) contains
in
the
Let us reiterate this observation in another way
following
definition of function. The words
transformation,
mapping,
and
are among these words that are sometimes
correspondence,
operator

usedas

Definition
denoted

by /,

1. dom/

1.3.6.
from A

= Ay
/ is

words,

2.

for

synonyms

function.

Let
to

B is

B be

and

a relation

each a G A,
at each a G A.

is, for

that

defined

two nonempty

from A
(a,b)

to

B such

G /for

sets.

function,

that:

some b G

B. In other

and (xyz) G / then y = z. In this case,we say that / is


or single-valued. Thus,no element
of A is related
well-defined
to two elementsof B.If (x,y) G /, then we say that y is the image of

If (x,y)

G /

/ and

under

if

Moreover,

/ is

we write y

a function

- f{x).

A to

from

B, we

B.
write f:A \342\200\224\342\226\272

An alternate
can
be given in terms
approach to the notion of function
of a rule of assignment.In this version,
a function
from A to B is a rule
x in A a unique
that assignsto eachelement
element y in B where/(*) = y
to denote this correspondence. This is essentiallythe sameas
is written
in such a
above
definition
since the term \"rule\"
can
the
be interpreted
= y},
rule / determines the relation {(x,y)G A x B\\f{x)
that
each
way
=
and conversely. Thus, if the rule y
Sx is defined on the set of real
then
the function is the set {(x,y)| x and y are real numbers
and
numbers,
y = 3x}.
To be sure,if / is a function from A to B, and if b G B, ^fehen the set
This,
contain
several
elements.
f~l(b)
may be either empty or may
observation motivates the following
two
definitions.

Definition
f(xi)

1.3.7.

function

and f(x2) = y impliesxx

f:A
=

to be one-to-one
one-to-one iff for each

\342\200\224\342\226\272
B is

x2. Thus,

said

/ is

~l(b)containsexactlyoneelement.
Ifwe describe/
~l{b) as the set of preimages of b,
for each b G ran /, b has precisely
one preimage.

G ran
if

= y

/, /

then

/is

one-to-one

if

14

Chapter 1:Foundations
B is onto
iff
ran
f:A \342\200\224\342\226\272
/ = B. In other
words,
/ is onto iff / _1(b) is nonempty for each b (E B. To put it another
B has some preimage
in A.
way, / is onto if each b \302\243E
\342\200\224\342\226\272
B is both
one-to-one and onto, then the inverse
If the function
f:A
B to A. In this
and thus is a function
from
relation
single-valued,
/\"Ms

A function

1.3.8.

Definition

case,f~l is calledthe inverse functionof/.


A

function

onto

one-to-one,

correspondence betweenA
function f:A

If a

function.If/ is not

not

usually

we call it
one-to-one,
B, then it is said to

onto

necessarily

a function
is a set, two functions / and g from
Since
words,
/ = g iff
they are equal as sets.In other

1.3.8. Let A

Example
(r,2),

{(r,l),
fl(r)

(\302\243,2)}is

a relation

{r,s9t},

from

/ = {(r,l),(5,2), (\302\243,2)}is a
one-to-onesince/ -1(2)= {s,t}. Likewise,
the empty set.

The

equal if

B are

A into

for each

= g(a)

f(a)

- {1,2,3},and C = (r,5,\302\243,u}. R
B but i? is not a function
since

the

to

/ is

B but

to

not onto B since/

not

_1(3)

0,

= {(r,l),

Definition1.3.9.
B

/ is

A to

from

(\302\243,2),(u,3)}

from

function

(5,2), (\302\243,3)}is both a one-to-one and an onto


B. Moreover, g\"1 = {(l,r), (2,5),(3,\302\243)}.
B defined
other hand, the function h:C \342\200\224\342\226\272
as h = {(r,l), (5,1),
=
is onto, but not one-to-one since /i-1(l)
{r,s}.

function

function

from

to

a many-to-one
be into B.

= {1,2}.

The set

On

one-to-one

B.

and

\342\200\224\342\226\272
B is

called a

\342\200\224\342\226\272
B is

f:A

C. The

Let

composition

be

a relation

from

to

B and

of i? and S, denotedby

relation from A to C given


such that aRb and 6Sc.Inotherwords,

i?S, is the

by aRSc

iff

there

to c

a relates

is an

i?

relation

S a

\342\200\242
S or

element

under RS iff

simply

6GB

a relates

to c under S.
GB x C servesas an
for establishing
a correspondence
between the sets A and C.
intermediary
For instance, suppose that A is a set of hospital patients, B is a list of
C is a list of treatments. Suppose,moreover,that
and
R
symptoms,
relates
a patient to his symptoms,and S relates
to appropriate
symptoms
Then RS relates a patient to a treatmentappropriate
treatments.
for
his
Of course, a given patient may
have
several
and
symptoms.
symptoms
each may have several treatmentsso that
be several
there
may
treatments
associated
with a patient
under RS.
to some

6GB

ThesetB

in

under

the

where

composition

6, in

turn, relates

of R

x B

and S

Example 1.3.9. If A = {1,2,3}, B = {4,5}, and C = {a,b,c)y let R bea


{(1,4), (1,5), (2,5)}be a relationfrom A to B, and let S = {(4,a),(5,c)}
from A
B to C. Then RS = {(l,a),(l,c),(2,c)}
is a relation
relation
from
toC.

Section

Relations

1.3

15

Functions

and

= {(a,l), (a,2), (6,1),(c,2),(c,3)}


isa relationfrom C to A, then ST =
B to A.
is
a
relation
from
{(4,1),(4,2),(5,2),(5,3)}
V
for
the
relation
A to A, then
from
{(1,1),(1,2),(2,3),(3,1)}
Finally,
from A
is a relation
V2 = V . V = {(1,1), (1,2), (1,3), (2,1), (3,1),(3,2)}
If T

to

A.

the definition of composition,the relationsR and S are, in fact,


x under R \342\200\242
functions, then to expressthe imageof an element
S, we get
\342\200\242
=
into the peculiar notational anomaly
which
means
(R
S)(x)
SCR(x))
the value
of x under
R is determined first and then the value
of R(x)
under S is determined. This anomaly
has
induced
many writers to write
instead
of (J? \342\200\242
in
(x)(R \342\200\242
S)
S)(x),
and,
general, for any function / to
write
for
we
shall
stickto
the classical
notation
and
xf
f(x). Nevertheless,
face the anomaly as it comes.
If, in

Example 1.3.10. If R(x)'- x +


definedon the setofreal numbers,
then
=
and (S \342\200\242
x2
1.
+
R)(x)
fl(S(x))

1 and

(R

S(y)

= y2 are functions
= (x + l)2

= S(R(x))

\342\200\242

S)(x)

Exercises for Section1.3

1.

Let
relation

. (a) R

by

k}.
&}.

{(j,k)\\(j-k)2\302\243A}.

- {(jjk)\\j/k is a prime}.
be the relationfrom A

defined

by

\"x

is less

the relation

R be

Let

divides

((./,&)|j isa multipleof

R =

(d) #
2. Let #

3.

A for
{(jyk)\\j

(b) R =
(c)

Construct
pictorial descriptions of the
the following cases.

= {1,2,3,4,5,6}.

R on

than

defined
natural numbersN = {1,2,3,...}
is, let R = {(x,y) | x G N, y E N, x + 2y

is

in the

2y = 10,\"that

\"* +

which
{1,2,3,4,5} to B = {1,3,5}
y.\" Write i? as a set of orderedpairs.

10}. Find

(a) the
(b)

domainand rangeofR

A\"1

4. Prove

that if i? is an antisymmetric

so is

relation

\"\\

is a symmetricrelation,then R D R _1 = R.
6. Showthat if R is an antisymmetric relation and R* is an
R U #*?
about
so is R H #*. What
antisymmetric relation,
in the
Euclidean
7. Let L be the setof lines
plane and let R be the
to y.\" Is R a symmetric
in L defined by \"x is parallel
relation
relation? Why? Is R a transitive relation?

5.

Prove

that

if R

8. Replace the sentence\"x


perpendicular
Why?

Is R

to

y\"

a transitive

in

to
parallel
Is
7.
Exercise
is

relation?

y\"

by

i? a

the

sentence

\"x

is

symmetric relation?

9. Let D denotethe diagonal

pairs(a,a) G

that the

x A, i.e.,

relation

the set of all ordered


A is

on

C D.

H R-1

if R
antisymmetric

of A

line

A. Prove

10. Can a relationi?

both symmetric and

A be

a set

in

antisymmetric?

11.

A =

Let

12.

exampleof a relationR

{l,2,3}. Give an

neither symmetric

nor

that i?

A such

is

antisymmetric.

relation R

Show that when a


Rk is the &th

where

in

is

power

for any

so is Rk

symmetric,

>

&

0,

R.

relation

of the

B is a one-to-one
13. If/:A \342\200\224\342\226\272

A is
correspondence, prove that/ _1:JB \342\200\224\342\226\272
correspondence.
14. If f:A \342\200\224+
B and
C are
both one-to-one
g:B \342\200\224\342\226\272
correspondences,
\342\200\242
prove that / g is a one-to-one correspondence.
15. Showthat the function
/ from the reals into the reals defined
by
=
1
x3
and
find / _1.
-f is a one-to-one,ontofunction
f(x)

a one-to-one

16.

x A

b:A

function

a binary

Moreover,
commutativeif

operation on the set A.

operation

for all

(x,y)

called

is

\302\243E
A

A. Which

of the

set of real numbersis

on the

operations

binary

a binary
b on the set

called

= b(y,x)

b(x,y)

following

\342\200\224\342\226\272
A is

commutative?

- y

= x

b(x,y)

(a)

(b) b{x,y)=x2+

y2

= max{x,y], where max{x,y}denotesthe largerof the


= 7,max{-6,2}
=
x and y. (For example,max{5,7}
numbers

b(x,y)

(c)

two
2.)

17.

- (x

b(x9y)

(d)
A

+ y)/2
forallx,;y,z

exercise16areassociative?
18.

a set

b on

operation

binary

b(x,b(y,z)) = b(b(x9y)9z)

is

said

to be

associative

of the

A. Which

following relations are functions?DefineR


= 1 wherex and y are real numbers such that

of the

Which

x2 4- y2

if

operations in
by

xRy

iff

(a) 0<x<l,0<y<l

(b) -1 <x

<

1,

-l<y<l

(c)

-1 <jc <l,0<y<l

(d)

x arbitrary,

19. Which

of

(a)

f(x)

(b)

f{x)

the

0 < y

< 1
are one-to-one?

functions

following

= x 4- 1

where

Which

where

integers},

{positive

{integers}.

= x2 where

' whereA

{real

^/(positive

integers},

- {1,2,3,4}

onto?
A

--=

where

- {integers/,

and

S =

{(1,3), (2,4),

numbers}.

and R =

{(1,2),(2,3),(3,4),
(4,2), (4,3)},then computeR.S,S-R,

20. If

are

(4,2)}

and

R2.

Section

Some Methods of Proofand

1.4

21.

If

= {a,b,c,d},determineif

= {1,2,3,4} and B
are one-to-one

Strategies

Problem-Solving

the

*7

following

or onto.

functions

(a) /={(l,a),(2,a),(3,6),(4,d)}
= {(l,d),(2,6),(3,a),(4,a)}

(b)

(c) /i =

{(l,d),(2,6),(3,a),(4,c)}

22. Supposethat

are

a,b,c

where a

integers,

c. Prove that a

a divides

and

dividesbx

^ 0. Supposea divides
cy where x and y are any

integers.

23.

Show
(a)

(b) -31 and


-15

(c)

following pairs of integersarecongruent

that the
3 and 24

modulo

7.

11

and-64

Show that 25 and 12arenot

7.

modulo

congruent

that a = b mod n and d is a positive integersuch that d


divides n. Prove that a = b mod d.
Show that the relation Q on the set A = {(a,6)| a9b are integers
and
b ^ 0}is an equivalence
relationwhere Q is defined as (a,6)Q(c,d)

24. Suppose
25.

iff

Selected

for Section 1.3

Answers

3.

(a)

= 6c.

ad

+ 2y

set of x

solution

The

even though there is an


is

(b)

x and
by interchanging

R -1 is found

{2,4,6,8}

\\(x,y)

\\x

subset

Any

in

of the

in which

\"diagonal

(a,6) G

and the

G N,y

={(1,8), (2,6)

number

infinite

the domainof R
R'1 -

10.

= 10is R

{(2,4),
(4,3),
of elements

range of J?

G N,

y in

2x + y

is

(6,2), (8,1)}
in N. Thus,

{4,3,2,1}.

the definition
-

of R;

10}

(3,4), (4,2)}.
line\" of
implies

A, that

= 6

is, any

is both

relation

symmetric and

anti-symmetric.

1.4 SOMEMETHODS
OF

PROOF

AND

PROBLEM-SOLVING

STRATEGIES

We do not aspire to accomplishthe ambitious


discourse on all (or even a significant
number)

of presenting
a
known methods of
here are a few basic

task

of the

What
we offer
proof and problem-solving
strategies.
hints with some examples
of the application of these hints. We expect
to refresh your
to these suggestionsfrom
time
to time
you to return
memory as you are developing
your ability to solve problems.Shouldyou

18

Chapter

1: Foundations

find this topic interesting, the booksby


in
Mathematics
Induction and Analogy
Inference [33],and MathematicalDiscovery
instructive, and most informative.

G.

Polya,

How

[33],

Patterns

[34]

are

to Solve it [32],
in Plausible
reading,

delightful

\"prove\" is a frightening word,but it shouldnot be so;


this problem,\" and solving a problemjust means
a way
out of a difficulty, a way
around
an obstacle,
a way of
finding
In other
accessible.
attaining a goal that otherwisewas not immediately
words, solving problemsis a vital part of life, and, as in life, we may need
and apply ad hoc techniques.But
to improvise
with
each
successful
of a task, we become
of completing the next
more
capable
completion
To

it

only

some

the word

signifies

\"solve

assignment.

Problem

is part
science and part art but is mostly
hard
It
work.
solving
science in that there are severaloft-repeated
to
principles
applied
varied
or rules
types of problems. It is also an art because
principles
cannot be applied mechanically
but
involve
the skill of the student.
an athletic
Moreover,just as in playing
game or a musicalinstrument,so
alsoin problem
this skill can only be learnedby imitation
and
solving
and
are the
We contend that interest, effort,
practice.
experience
will be your
the reader
you
primary factors to solvingproblems.Thus,
own best teacher. Any solution
that
effort
you have obtained by your own
or one that you have
and insight,
with keen, intelligent
followed
a pattern for you, a modelthat you can imitate
with
become
concentration,
may
success in solving similar problems.
each problem with an attitude
We
ask
of research, to
you to approach
at
but also to seek out the key
ideas
and
not only solvethe problem
hand,
that made the solutionpossible.
The generalproblem-solving
techniques
in this section and throughout the book will never
never
methods
taught
for lack of relevant knowledgeor intelligenteffort.
Our
compensate
can take you only so far; you have to go the rest of the way
discussion
on

is a

your

own.

of any problem worthy


some critical insight.Consequently,
The solution

with

in

the
problem,
a position
to

gain

information,

have the

of
you

the
simply

name will likely


must become

require
familiar

and observe patterns to put yourself

critical insight.Without

insight,

method

is

largely useless.

This insightis gainedthrough


hard
work and hard work only. We agree
A. Edison who is supposedto have
said
Thomas
that
genius is two
percent inspiration and ninety-eightpercentperspiration.
will
We
by introducing you to somegeneralmethodsof
get you started
tools like the inclusion-exclusion
approaching
specific
problems;
functions
the methods
are
of recurrence relations and generating
principleand
all to be discussed in later chapters.
Severalthings
established
must
be clearly
before a solution of a
For one thing, you must devisea plan of
be attempted.
problemshould
with

Section

Methods

Some

1.4

of Proof

and

19

Strategies

Problem-Solving

will learn
attack. We will give some more hints on this, but generally
you
best by experience, so for a while your best plan may be to imitate what
seen others do. It therefore becomesnecessary
have
for
to
you
you
solutions
and record, for future
understand
suitable for
reference,
imitation.

before

But

been

done.

you can imitate you will have to be able to


The solution of any problem consistsof two

analyze
major

what

has

parts:

the

ofthe solution. There are


discovery of the solutionand the presentation
the
two halves; one isn't completewithout
other.
is the cause,
Discovery
is
is
the
while
effect;
discovery
generally
private
presentation
In fact, you usually confront solutionsin their finished,
presentationis public.
and
therefore
all
form
rather than while they are in the making,
polished
have
eliminated.
the guesses, questions, false starts,and blind
been
alleys
not reflect the birth pains that
need
The beauty of this newborn
baby
that
must
not confuse the two
you
brought it into existence.Remember
halves of a solutionand neithercanyou

The

part.

of an Argument

Basic Elements

there

speaking

Generally

you will need

that

argument

either

exclude

are at least four


to identify and analyze;

(3) warrants, and (4) the frame

(2) grounds,

explain what these kinds of elementsare,and

of

basic elementsof
these

reference.
how

they

an

are:

(1) goals,

Let

us briefly

are connected

together.

1. Goals.

analyzing

is

there

argument,

conclusion

are

we

When

some

to

which

we

and criticizing

asked
always

to solve some problem or to present


some destination, some claim, some

are invited to arrive, and the first


is to make surewhat the precise character

step

in

of the

destination is.

2. Grounds.

kind
of
clarified
the goal, we must consider what
to
refers
to arrive at that goal.The termgrounds
If goals represent
claim.
the
facts relied on to support a given
if
we
are
then
Even
are
the
destination,
point.
analyzing
grounds
starting
we must ask ourselves where we
someone else's solution
or argument
would
whether we can see how to take the same
and determine
begin
and
so
end
the goal has been achieved.
that
steps
by
agreeing
o
n
kind
what
of
may
Depending
goal is under discussion,thesegrounds
of
common
matters
comprise
knowledge, experimentalobservations,
or may
not
established
claims, or other factual data that may
previously
have been given in the probleni.
3. Warrants.Knowing
an argument is founded is,
on what
grounds
nevertheless,only one step toward the destination. Next we must check
whether
these
do provide genuine support for each
grounds
really
individual
assertion
and are not just a lot of irrelevant information
Having

information
the specific

is required

20

Chapter

1: Foundations

having nothing to

do with

The

assertion.

the

may be

grounds

conclusion; the

true but

grounds may
issue at hand.
and
the
the
Given
goal, the questionis: How do you
starting
point
from
these
the
move
The reasonsor
grounds to that conclusion?
justify
warrants.
In
as
are
the
on
offered
the
justification
focusing
principles
or
on
but
the attention is not somuchon the starting
warrants,
point
goal
the correctnessof each step along the way.
about
Thus there are two concerns
the warrants cited in an argument:
and
are
Are
reliable
they applicable? Frequently in a mathematical
they
is
some
known formula, some commonly
the
warrant
accepted
argument
in this
an established
Thus,
fact,
theorem, or a rule of logicalinference.
in
of
warrant
be
the
not
but
the
the
event,
reliability
may
question,
or
is
all
asto
whether
not
warrant
the
crucial.
the
more
question
applies
if the warrant
even
is applicable, its correctapplicationisstill
Moreover,
required.The laws of algebra may apply but there arerestraintson their
for instance, one cannot divide by zero.
application;
no

have

on the

bearing

information yet

4.
theorem,

no

have

or

formula,

to the

relevancy

Aside

of reference.

Frame

principle

the

from

serves as

that

determine the frameof reference,that whole


tacit
ideas, facts, definitions, theorems,principles,
methods
that is presupposed by the warrant
appealed
is likely
to be meaningless.
otherwise, the warrant
at

an argument

in

an

argument,

interlocking

we
web of
and

assumptions,

to in

the argument;

are well founded

can be
connectedto the
being

of an appropriate and relevant kind


grounds
The grounds must be
their
support.
which are capable of
reliable,
warrants,
applicable
to a relevant frame of reference.
appeal
sufficient

Working

rule,

fact,

particular

grounds for

need to

The conclusionsarrived

on correct

based

be

if

only

in

offered

conclusion

by
by

justified

Forward
in high
The student probably has seen presentationsof arguments
school plane geometry that were patternedafterthe model
ofexposition
in Euclid's
written about 300 B.C. In the Euclidean
Elements,
presented
from
exposition, all arguments proceedgenerallyin the samedirection:
the
toward the goals by way
of reliable
warrants.
grounds
Any new
assertion has to be correctlyproved
from
the given hypothesis
or from
in foregoing
propositionscorrectly proved
steps. It is not enough that
correctstatementsare listed, but they must be listed in logicalorder,
eachleading
into
the next. All statements
should be connectedtogether
and

precept,

into

organized

precept

this method

whole for \"precept must


line.\"
line upon line, line upon

a well-adapted

upon

precept,

of presentation\342\200\224working

forward\342\200\224and

on occasion

be

We

upon

call

one can

Section 1.4

Some

Methods

of Proof

this
discover solutionsfollowing
schemeby the following diagram:

Grounds

and Problem-SolvingStrategies

pattern.

We

illustrate

21

the general

Goals

Warrants

Perform

Given

or

data

hypothesis

Unknowns
conclusion

allowable

variations,

draw inferences
Working

Figure

Forward

1-2.

follow
We emphasize that in relating a proof or a solutionmost writers
model and work forward from
the
to the
Euclidean
hypothesis
a natural
conclusion. As a consequence, there may
be
bias to work
forward in discoveringa solution,but this bias is often inappropriate in
problem solving because the orderin which we discover details is very
often exactly oppositefrom the order in which we relate those details.
is gained after focusing attention on the
the
critical
Frequently,
insight
on the conclusion
rather than the hypothesis.
goal,focusing

the

The Aspects of Discovery


of the solution
of a problem is likely
to encompass
at
of
(3)
stages development:(1)education,(2) experimentation,
and (4) revelation. In generalterms,let us describe
what
we
intubation,
think each of these entail.
1. Education.Certainly
have
little hope of solving a problem if
you
ofthe problem.
do not have a sound understanding of the statement
you
A first order of business then is to obtain a precisestatementof the
in unambiguous
language. This probably will entail
problem
reviewing
of
technical
frame
definitions,
determining the general context and
and identifying the different parts of the problem
the
(like
reference,
goal
The

discovery

least four

and grounds).

2. Experimentation.
In this stageyou may want to examine special
cases of the problem,replaceconditions
ones, consider
equivalent
by
or
or contradiction),
logical alternatives (like arguing by contrapositive
decompose the problem into parts and work on it case by case. In general
and reduce the complexity of
the
terms,attemptto reformulate
problem
the

problem.

3. Incubation.
After becoming thoroughly familiar
it may take some time for these
to germinate.
ideas

with

the

problem,

You may have to go

22

Chapter

1: Foundations

As
over steps 1 and 2 again and rethinkthe problem.
probably should focus your attention on the goal and

rather than focusingon the starting

\342\200\242

the

Clarify

the following

the problem.
of
complexity

\342\200\242
Reduce

the

\342\200\242
Focus

on the

to get

you

there

at

come

any

moment,

so be

soonas possible.

suggestions:

problem.

\342\200\242
Reformulate

Perhaps

includes

advice

our

Thus,

it

how

point.

The critical insight may


down
and test it out as

Revelation.

4.

prepared to write

rule

a general

the problem.

goal.
comments

more

few

will

be helpful

to understand our

suggestions.
times

Many

can be

problem

mathematical problem

by

finding

translated
an

problems\"in a collegealgebracourseserve
be
The complexity of a problem may

considerspecial
askedto
the

fewer

cases,

variables,

as

one

from

in

to solve.

equation

words

to a

The \"word

an example.

reduced

etc. For

in a variety of ways;
instance, suppose we are

in a set A. Then if A were the


of elements
sets B and C we need only count the number of
elementsin B and C separatelyand takethe sum of these two numbers to
discover the number of elementsin A. This simple idea is one of the
of counting
of such
rules
called the sum rule. The difficulty
fundamental
it is to spot a way of dividing
counting
problems depends on how difficult
the setA into such subsets which themselves can be countedwith ease.
count

disjoint

Inductive

number

union of two

Reasoning

Another particular process is worthy


of
inductive or scientificreasoning.Tounderstand

special
this

attention,
process,

namely,
we need

to

and
clarify the meaningofspecialization
generalization.
is passing from the considerationof a restrictedset
Generalization
of observations) to a more comprehensive
a small
number
set
(usually
if
For
the
more
restricted
set.
a
instance, proposition
containing
original
holds for all triangles and rectangles,there may
a generalization
be
for
all
i
f
holds
for
the integers 2,3,
holding
polygons.Likewise, something
and
it
all
hold
for
5, 7, 29,
59, may
prime integers.
the focus from a larger
Specialization reversesthe process
by
changing
set to a smallersetofobjects,say, for example, from the set of polygons
down
to the subset
of triangles, from the setof primeintegers
down
to a
subset of one or more specific
n
or
from
a
down
to
general integer
primes,
a specificvalue of n. In specialization, we examine special,more
manageablecases.
A good heuristic
approach is to set any integer
parameters

Section

Some Methodsof

1.4

equal to 1,2,3,4, ...


and

patterns

It

the

of

magnitude

23

Strategies

and
look for a pattern. Thus the
reduced to simpler casesand certain
more easily observed.
make a diagram or tabulate several

in

sequence

may be

problem

relationships
to

beneficial

be

may

and Problem-Solving

Proof

observations.

In

data by one or severalof theirattributesinto a


ordering
In
help solve problems by facilitating pattern recognition.
a list of successive observations, a list of differencesbetween

particular,

table

may
to

addition

successive

useful.

is sometimes

observations

As we

observe some pattern

emerging,

and
pattern is no merecoincidence,

therefore

we

that this
suspect
a generalization

may

conjecture

for all observations


the
and hopefully extend beyond
actual observations and hold true for all cases.
and
The process of reasoning by which one takesspecific
observations
formulates
a general hypothesis or conjecture which
for these
accounts
observations
is called indtcctive
or just plain induction (not to
reasoning
be confusedwith the principle of mathematical induction to be discussed

that

account

will

of our

limits

later).
If
the

method

will have
need

to analyze

of caution

of inductive

to be sufficient

to

and interpret

is needed

reasoning is to be fruitful,
a conclusion,
and

make

the

then

evidence

the investigator

will

a word
the evidencecorrectly.Therefore,

here. Rememberthat a conjectureis nothing

more

formulated guess; it is not provedyet. You may have much


could
be wrong.
confidence in your conjecture, but be careful\342\200\224your
guess
A conjecture
is merely
but
tentative; it is an attempt to get at the truth,
wariness\342\200\224a
some
without
verification
it should still be regardedwith
is still required.
Be careful not to jump to conclusions.
proof
or not with
We
could
need
to pay attention
to later cases which
agree
credible
A
in
more
the
makes
the
case
agreement
conjecture
conjecture.
the conjecture. If
but
does
not prove it. A conflicting
case
disproves
is true for all cases and there is at least one
someoneclaimsa conjecture
his
then
is false. This one exception is enoughto
exception,
conjecture
that
does
rule or general statement. This oneobject
would-be
refute
any
not comply
with the conjecture is calleda counterexample.
than

a clearly

Example1.4.1.

that every odd


and a power of

few

integer
greater
2. Each
new

computations

than 3 can
computation

might

be written

lead us
as

the

in agreement

to conjecture
a prime

sum of
with

the

plausibility
conjecture and we becomemoreconfident
is not a proof. Indeed
about
the possibility
of its validity. But confidence
the fact that the conjectureholds
for
the first 63 odd integers does not
127.
in fact, the conjecture fails for the integer
for,
guaranteevalidity,
You might ask how do we see that 127 is a counter example?We have
at least two options: first, we could consider/(p) = 127- p,for all primes
value
is ever a power of 2 for some
p less than 127, and investigateif f(p)
conjecture adds

to the

24

Chapter 1: Foundations

we could considerg(n) = 127- 2n, for all values of n so


is prime
for some
127, and then investigate if g(n)
since
there
are more primes less than 127than
of 2, the
second approach requires less effort.
The
and
shows that g(n) is never primefor n = 0,1,2,3,4,5,6

Or secondly,

of p.

that 2n is less than


value of n. Obviously,

there are

powers

table

following

127is indeeda counterexample


to the

thus that
n

- 127-

g(n)

2\"

3(41)

7(14)

5(25)

2(63)

Inductive reasoning does lead frequently


instance, consider the following
example.
1.4.2.
formula

Example
Conjecturea

general

we have

Suppose
for the

7(9)

5(19)

3(37)

valid

to

the

conjecture.

conjectures.

For

problem:

following

sum

\"

above

2!

3!

\"\"'

(n

+ 1)!

of the positive
integer n. (Recall that n\\
by specializing successivevalues
2 \342\200\242
1.)
of n(n \342\200\224
is the product
1)...
of the sum Tx = 1/2,
If we allow n to be 1, 2, 3, or 4, we get the values
=
=
=
We note that in each case the
119/120.
23/24,T4
5/6, T3
T2
numerator
is one less than the denominator. Moreover,the denominators
If not, then T5
are
coincidental?
2!, 3!, 4!, and 5!. Is this
respectively

should be (6!-

l)/6!.
In

-T

fact,
5
4

5!

6!

We

note

each

equal

other

one

observation.

to [(n

Analysis-Synthesisand

6!

- ?19-

6!

\"

6!

6!

*\342\226\240

'

so far Tn has had the denominator


(n + 1)!for
are emboldened to conjecturethat Tn is always
l]/(n+ Later we will discuss a method to prove

feature:

Now we

+ 1)! -

this conjecture.

119

Working

1)!.

Backward

We have suggested that you focus on the goal largely


direction of your thoughts. You might
do this in a variety
methods
frequently
prove beneficial.

We call the first method


\"analysis-synthesis\"
the problem has a solutionand then try to determine
a statement
Suppose that the problemis to prove

The methodencompasses
two

stages.

The

first

to

guide

the

of ways but two

we suppose
Basically,
its characteristics.
like: If A, then S.

stage\342\200\224the

analysis\342\200\224is

Section

Some Methods of

1.4

the

work so to

laboratory

Proof and Problem-Solving

speak; here the plan

the

constitutes

In the
granted,

start

from

second

carried out, where

is to be concluded,takeit for
conclusionuntil we reach

what

from the

inferences

draw

and

The

devised.

stage is applied.This stageactually

proof.

analysis stage, we

is

plan is actually

the
stage\342\200\224the
synthesis\342\200\224is where
in the analysis
what
was
discovered

25

Strategies

true, or patently obvious when


A. In otherwords,
information
we assume
B,
given
C we derive
and
so
until
at
we
arrive
derive or conclude C, from
D,
on,
Z that is obviousin conjunction
A. Now
with
we are prepared
statement
for the secondstage.
In the second stage, we simply reverse the process.Startingwith the
the
Euclidean
model of
obvious
statement
Z, we work forward, following
of
to
and
reverse
the
derivations
to
each
step
expositions
attempt
D and then Cand thenJ3.Of course,
of the synthesis
the success
conclude
or not each derivation is, in fact, reversible.
stage dependson whether

something

known,

already

considered in

admittedly

to the

relation

Example 1.4.3.

that
we want to prove: If n is a positive
Suppose
6n+2
72n+1
is
divisible
+
integer
by 43, then M = 6n+3 + 72n+3
is divisible by 43. Here we may not have
how to proceed from the
idea
any
N
M is divisible
is
43
divisible
show
43.
that
to
that
grounds
by
by
we
could
to
and
assume
However,
attempt
employ analysis-synthesis
that M is divisible by 43. ThenM - N,M - 2N, M - 3N, etc., are all
divisibleby 43. What we would hope is that in the analysis
we could
stage

that

such

Determine

Assume

characteristics
of a

Draw

inferences

solution

solution

Analysis

Hypothesis

characteristics

of a

or

forward

solution

help

Solution

Work

conclusion

determine

the direction of

inferences

Synthesis

Figure 1-3.

Diagram

of analysis-synthesis

method

of problem solving.

26

1: Foundations

Chapter

discover some oneof the numbers

43, then

we

could

Let us

proposition.

- kN

the process

reverse

that is obviously a multiple of

synthesis stage to prove

in the

M - N = 6n+3

72n+3

= 6n+2(6-

- (6n+2 +

1) +
+

6n+2(5)

72n+1(48).

glance this is no simplification,but


of
6
and 7 arethe sameas those in N.
powers
Then if we write 48 = 5 + 43 we see that

= 6n+2(5)

+ 72n+1(43)

72n+1(5)

72n+1)

72n+1(72- l)

At first

M-N

the

consider

first

notice

we

- 5N +

that

the

72n+1(43).

divisible by 43.
M - 6N = 72\"+1(43)
is something
obviously
Now we are preparedto presentthe synthesis
stage.
- 72n+1(43) and N are divisible
M = 6N +
Since M - QN
43,
by
is
43.
divisible
72n+1(43)
by
in
The method of working backward is similar to analysis-synthesis
is focused on the goal.However,
that
attention
backward
differs
working
in the way the goal is consideredin relation
to the given information. In
the analysis
of analysis-synthesis,
the goal is consideredto be part
stage
of the given information,
and we attempt to derive consequences
from
in
with
of
the
the
direction
inferenceis
the
Thus,
goal
conjunction
givens.
from
the
to some new statements. In working
backward,
goal statement
the goal is not considered to be a pieceofgiven
We start
information.
with the goal, but insteadof drawing
inferences
from
to
we
it,
try
guess a
Therefore,

taken
would imply the
that,
precedingstatementor statements
together,
are
in the frame of
statement.
there
theorems
or
facts
Frequently,
goal
referencethat will give such statements
that imply the goal statement.
the
a proof of an implication\"IfA, then B\" is
Thus,
person
formulating
\"I
to
think
like
canprove B if I can prove C; I can prove C
this:
supposed
D if I can prove E. But I can prove
E from
if I can prove D; I can prove

A.\"

Prove
Conclusion B

recall

A-

3rd

2nd

, 1st

observation

observation

observation

Figure 1-4. Working

backward

to prove

\"If

A, then

B\".

SomeMethods

Section 1.4

Example 1.4.4.

of Proof

the

Prove

and Problem-Solving
statement

following

27

Strategies

by working

backward.

of length
a and b and hypotenuseof
T
then
is
an
isosceles
equal
lengthc,
triangle.
a = b by showing the equivalent
show a = b. But we can prove
We
must
facta -6 = 0.Tobesure, a - b - Oiff (a - b)2 = a2 - 2ab + b2 - 0. So we
a2 - 2a 6 + b2 = 0 or equivalently,
can prove a - b = 0 by showing
that
a2 + b2 = 2ab. The Pythagorean theorem states that a2 + b2 = c2, so to
prove a2 + b2 = 2ab we need only show c2 = 2ab or, equivalently, that
c2/4 = ab/2. But recallthat the area of T is ab/2. Thus, by hypothesis,
= c2/4. Therefore, the proof is completedand
know
that a =
we
ab/2
If

the

right
has

b.

triangle

T,

sides

with

to c2/4,

area

Example 1.4.5.

Recall

that

for

positive, a = b modn meansa - b = k


if a = b mod n, and c = d mod
that
prove

integers
-

n, where
n, then

n is
a, b, and rc, where
k is some integer. Then
a + c = b + d mod rc by

backward.

working

(b + d) =\342\226\240
prove a + c = b + d mod n if we can show (a + c) \342\200\224
=
x.
But
(a + c) (b + d) (a b) + (c d), and we
integer
k and / are integers, since
c - d = n - I where
know that a - b = n \342\200\242
k and
k + n \342\200\242
/ =
a = b mod n and c = d mod n. Thus, (a + c) - (b + d) = n \342\200\242
x
fc
/
\342\226\241
is
we
need.
and
the
the
that
n(k + I)
integer +
integer

We can

\342\200\242
* for

some

Fallacies

a proof is not always clear, nor is it obvious


when
an
is convincing. In fact, mathematicians sometimesdisagree
as to whether
an argument is sound.Their
themselves
among
as the law
be over whether
to allow a particular warrant,
such
disagreementmay
constitutes

What

argument

excludedmiddlein logic, or their disagreement may occur when a


purported proof is thought to containsomeerror. Thus, when a
is presented,
founded
it is
mathematical
whether or not it is well
argument
decides
community
usually determined by consensus; the mathematical
of the

whether

is convincing. An
the argument
one can perceive any flaws in

argument

is accepted

as a

valid

it. Agreementin suchmattersis


proof
of
no
exist
but
is
means
fail-safe.Examples
the process
by
very
good,
but
were
for
that
were
as
widely accepted
proof many years
arguments
then shown to be fallacious by someone
a possibility
who
discovered
It is frequently the
that had beenoverlookedin the original argument.
if

case

that

original

no

the

overlooked

assertion,

possibility

but on

provides

occasion, the

grounds for refutation


discovery

results

of the

in

a new

as a proof.
is then
argument being devised,which
accepted
all
all are not agreed as to what makesan argumentconvincing,
While
and
all
be
considered
that
cases
an
must
issue
justification
agree
of
must be given for every
all would agree that, both
conclusion.
Moreover,

28

Chapter

1: Foundations

in the discovery and


avoided at all costs.

the presentationof a solution,

Fallaciesare

but unsound, their


resemblance
to sound arguments
superficial
to camouflage the deception. There are two

this

and

main

their

from

serves
of fallacies:

similarity

types

1. Fallacies

or

Ambiguity

of

are

that

arguments

comes

persuasiveness

be

should

fallacies

ambiguitiesin their constituent

persuasive

because of

are flawed

that

arguments
terms.

Assumptions or arguments that involve


from grounds to conclusionbecauseno
is made to a warrant, or the appealisto warrants
that
are not
valid or cannot be appliedto the presentargument.
of Unwarranted
or illicit step

Fallacies

2.

an

unacceptable
at all
appeal

arise when

of ambiguity

Fallacies

senses. The

different

ambiguity may

some crucial term is being

in

used

often a result of

but is

intentional

be

not
be confused
should
of language. Ambiguity
The question \"Is there a pitcher in the room?\"
is ambiguous,
because
the pitcher in question could be a containeror a
But the statement \"I will come to see you sometime this
baseball
player.
is vague,
time
because
it fails to tell us preciselywhat
the visit
afternoon\"
will take place.
of ambiguity
There are many fallacies
but we will mention
just two: the
the

feature

imprecise

with

however.

vagueness,

of
fallacy of equivocationand the fallacy
The fallacy of equivocation occurs when

morethan onesensein
midstream, so to

bring us one off

switch

from

\"Our
speak. The sentence

shelf

the

in

team

special kind of ambiguity gives


fallacy occurs as a result of faulty

Another

sense

one

needs

This

or other punctuation,careless
positioning
phrases, and the like. The Reader'sDigest
examples of such ambiguities.
occurs

Amphiboly

formulated,
\"X

equation

parentheses.
we

whether

(5

fallacy

of

rise to the

fallacy

of

of qualifying
often

prints

mathematical
problems because a problem
to some syntactical ambiguity. Thus
owing

is

the

3x5
+ 10\" is ambiguous as it
The calculation may yield X = 25or X
=

insert

of
words or
humorous

omission

grammar:

parentheses

as X

= (3 x 5)

stands, lack of
= 45, depending
for

on

10

or as

X = 3

10).

Practice
pitfalls

in

so

the

a comma

inadequately

in

to another
a new pitcher

kitchen\" commits

the

equivocation.

amphiboly.

or phrase is used in
result that its various

with the

argument

You cannot

confused.

are

senses

a single

amphiboly.
a word

identifying
grammatical
to which ambiguities can

goes unrecognized.Onceidentified,
rewriting and reformulating.

ambiguities can

lead if
such

their

help us to avoid

presence
can
fallacies

in an

the

argument
be eliminated by

Section

Methods

Some

1.4

of Proof

and

Strategies

Problem-Solving

Likewise there are several fallaciesof unwarranted


we will discuss just four: (1) beggingthe question,
(3) false
cause, and (4) faulty inference.
generalization,

assumptions,
(2)

29

but

hasty

Circular Reasoning

The

of

fallacy

We

this

commit

begging

fallacy

the question is also known as circularreasoning.


when we make an assertionand then argue
on its

what is purportedto begrounds


but
whose
meaning
that
is simply equivalent to
of the originalassertion.We make
an
of the
A and offer as grounds a statementB in support
assertion
statement
A, but actually A and B turn out to mean exactly the same
fact may be concealed because they are phrasedin
this
things\342\200\224though
different
terms.
The error here is that in attempting to prove
a certain
in another
the desired proposition itself\342\200\224perhaps
form\342\200\224is
proposition,
in the argument. Thus, the argumentdegenerates
assumed
unwittingly
of the type \"it's true because
into
an unconvincing
assertion
it'strue,\"
in
which
has no more force than just the assumption
of the
proposition
From
another
the
be
called
the
standpoint, argument
question.
might
\"vicious circle\"fallacy.
For example,in proving
the base angles of an isoscelestriangleare
that
a
assume
student
that these anglesare equalin order to prove
equal,
may
two triangles are congruent and then go on to argue that the angles in
behalf

by advancing

question must be equal as they

are

parts

corresponding

of congruent

triangles!

Example 1.4.6. The assertionthat

the

integer

1987

is prime

of begging
the
the question,
because it is not compositecommits
fallacy
\"The
root of 2 is irrational becauseit is not
as does the sentence
square
rational.\"On the other hand, the statement \"1987is primebecause1987
is not divisible by any of the integers 2 through 1986\"doesnot beg the
of
and is accepted as a fully
documented
proof,
provided,
question
of the integers 2
that
none
course, that indeed it has been verified
1987.
through 1986divides

definitions. The so-calledcircular


in terms
question by defining the word only
actually
begs
define
the word \"modal\" as
of synonyms. For instance, a dictionary may
and finally define
\"a modality,\"
as
pertaining to \"mode,\"\"mode\"
modal.\"
Considerthe
of
or
state
as
\"the
being
\"modality\"
quality
also occurs in

begging

Question

the

definition

following

A dog

definitions:

is a

canine animal.

is
Horsemanship
Distillation

is the

an

equestrian

skill.

process of distilling.

30

Chapter

1: Foundations

formulations presupposesan understandingofthe termto


who does not already know what a dog is can hardly
to have any idea of what it means to be canine.
for
that
Nor,
is it likely that someonewho has no idea of what distillation is
of the

Each

be

defined.

Anyone

expect

matter,

is meant

what

know

will

by distilling.

We commit the fallacy

concludethat

For example, we might

integer N + 2 is also primebecause

primes,3 and 5,5 and

specific

the proposed

N, the
the pairs of

integer

prime

every

considered

have

if
19, and 29and 31.Of course,
= 9 is not prime and refutes

13,17 and

and

7,11

for

we

the case whereN = 7,then

we consider

few

too

are not

that

examples

class.

whole

the

of
representative

conjecture based on

from
or (2) drawa conclusion

instances

or hasty

to conclusions\"

of \"jumping

a general

(1) make

we

generalization
when

+ 2

conjecture.

The

cause occurs when we take oneevent

of false

fallacy

simply becauseone event


Latin phrase that describesthis fallacy
of another
which

\"after

means

literally

for example, may

party,

place after their party


The

false

of false

fallacy

about a

The

of causality;

attributions

flat was

cause also

phenomenon.

given

maintained

this notion was

for

are

we

of science

for example,the notion

when

A political

this.\"

simply

abounds
that

the

mistaken
with

earth

such

was

is held by somethough
sailed around the world.

even now it

and

centuries,

dispelled

occurs when
history

The

upswing

indicating

about the upswing.

cause

that took
what policy brought

economic

an

without

office

took

on accountof

this, therefore

other.

propter hoc

hoc ergo

is post

take credit for

be the

to

the

before

happened

Magellan

Exercises for Section1.4

1.

n = 40 is a counterexampleto
is a prime for each integer n.

that

Show

n -f 41

a counterexampleto the statement


\"n2

2. Find

prime for

each

3. Show that
odd

integer

positive

(C>

79n +

1601 yields a

509 is a counterexample
to the conjecture
that
every
greater than 3 is the sum of a prime and a power of 2.

\342\200\242
2

\342\200\242
3

\342\200\242
3
3

\342\200\242
5

n2

n\"

integer

4. Conjecturea generalformula
1
. 1
' ' '
1,,, '

the conjecturethat

the

for

following

1
n(n

(2n

- l)(2n

+ 1)

4 1)

1)

4
1 \342\200\242
4 \342\200\242
7

' '

' +

(3\302\273

2)(3n

3 sums:

Section 1.4

SomeMethods

Conjecturea generalformula
and (c).

5.

Conjecture

and Problem-Solving

of Proof

for the

formula

general

results

the

includes

that

sum 1

4-

(2m

in (a),
5 +

- 1).

6. Guess the rule accordingto which


the
following sequenceof numbersarechosen:

(b),

\342\200\242
\342\200\242
\342\200\242
+

of the

terms

successive

31

Strategies

11,31,41,61,71,101,131,....

the expressions

7. Consider

10

+ 12

11

1 = 0 + 1,
2 + 3 + 4 = 1 + 8,
5 + 6 + 7 + 8 + 9 = 8 +27,
13 + 14 + 15 + 16 = 27 + 64.

Guessthe general suggested


in suitable mathematicalform.

by these

law

8.

in

three

first

The

3) are all

examples

and express it

of the sequence 3,13,23,... (numbersending


of the sequence
also
the following
terms
Are
prime.
terms

prime integers?

9.

is divisible by

lists

of positive

for a few values of a


divisors of n. We denote

For example,d(4) = 3 because1, 2, and


divisors of 4.
n

d(n)

10

123456789

122324243

Looking over
with

which

lln+3

122n+3

133.

10. The tablebelow


number

divisible by 133then

+ 122n+1 is

if lln+2

that

Verify

the values of d(n)9

d(n)

is an

we

even integer.

positive integern
this

are

11

12

13

are

struck

14
4

by the

Continuethe tableup

15

16

frequency
to

n =

Conjecture a general result.

11.

the

Identify

(a) Pearls
She

is a

in the

of fallacy

type

are

(b)

(c)

David
After

following statements:

soft.

pearl.

Hence, she is soft.


the truth

is telling
Melinda

insulted

Mad peopleshould
Hence, Anne

should

be

because he wouldn't lieto me.

her, Anne was mad.


put in a hospital.

be put

in a

hospital.

the

number
by d(ri).
the only positive

25.

32

Chapter

1: Foundations

cannot blame the Republicans

The Democrats

(d)

(e) Peopleshould

high
the

removed,

is right.

what

do

the

for

prices because in 1980, when price controlswere


were not in office.
Republicans

People have the right to disregardgood advice.


Therefore,
people should disregard good advice.

( f) Nodesigning

are

persons

of trust.

deserving

Architects are designersby profession.


architects
are to be distrusted.
Hence,

(g)

is illegal.

people

Killing

Hence,

(h)

(i)

All

(j) I

hospital are ill.


of the

members
exercise

see

never

will

have gone there.


Marching Chiefs exercise daily.
daily,
you can be in the band.
a doctor again. All my associates
who were ill
never

should

they

Hence,

over the past winter


Joe declared that

(k)
(1)1

is illegal.

punishment

capital

People in the

If you

is legalizedkilling.

punishment

Capital

to doctors.

went

he is insane.But he
the insaneneveradmit they are insane.
walked under a ladder.

hit

was

must

truck.

by a

Walking under a ladder brings bad luck,


United
The
Nations
is necessary because it is

(m)

work

nations

because

be sane

vital

that

together.

Godexists.
(n) Life makes sensebecause
Godexists because if He didn't life would be nonsense.
if sufficient reason is
break-ins
are legitimate
(o) Governmental
given.

National security
break-in.

is

In mattersof

national

legitimate,
at

Make

n -f 11

least

Find

where n

reasoning

4 integers.

concerning the values of/

Hint:

conjecture that Mp

to the

counterexample

integersarethe sum
(c)

should never

(n) = is a nonnegative integer. Prove or disprovethese

prime for each prime integer


14. Some integers are the sum
inductive

government

a break-in.

four conjectures

conjectures.

13.

for a governmental

the governmental break-in of Ellsberg'soffice


was
but the government cannot reveal the reason.

Therefore,

12.

the

security,

reveal its reasonsfor

reason

a sufficient

to
of

consider

2P

1 is

p.
of

formulate
the

n2

squares

2,

3, or 4 perfect squares. Use


a conjecture concerning which
of (a) 2 integers,(b) 3 integers,

prime integers

first.

Section

1.5

Selected

Fundamentals

of Logic

33

for Section 1.4

Answers

11.(a)

Ambiguity.

the question.

(b)

Begs

(c)

Ambiguity.

(d)

False

(e)

Ambiguity.

cause.

(f) Ambiguity.

(g) Begsthe question,


cause.

(h)

False

(i)

False cause.

(j

cause.

False

(k)

Begs the

(m)

Begs

(n)

Begs the

question.

(1) Falsecause.
the

question.

question.

1.5 FUNDAMENTALS
OFLOGIC
we can

before

Now

in some

discuss,

what we mean by

complete

inferences.

valid

the

the fallacy of faulty

inference

we must

assuming
logic and
not our intention heretodiscussa

we

It is

but rather
of several

in logic
statements

course

formulate

understand

detail at least, what

about

are

to introduce just enoughconcepts


to
commonly accepted rules of

inference.

of all, we shall restrict our attention only


First
to those
sentences
that
satisfy two fundamental assumptions that correspondto two famous
of classical logic, the law of the excludedmiddleand
\"laws\"
law of
the
We hasten to say that some logicians
be in
not
contradiction.
may
both
of these
but they will serve our
assumptions,
agreement with

purpose.

Sentences

as declarative,

exclamatory,
our
attention
to those declarative
imperative.
sentencesto which it is meaningful to assign one and only one of the truth
values \"true\"
or \"false.\"
We call such sentences propositions.
Of
not all sentences
are propositions because,for one thing, not
course,
all sentences are declarative. But we also rule out certain semantical
is false.\" For if we consider
\"This
sentence
paradoxes like the sentence:
this sentencetrue, then we must determine
from the content of the
if we
it false, then it turns
sentence
that it is false, and likewise,
consider
are

usually

classified

We

interrogative,or

confine

out to be true.

For

definiteness

let

us list

our assumptions

about propositions.

34

Chapter

1: Foundations

p,

The Lawof the Excluded


Middle.
or p is false.

1.

Assumption
proposition

For

every

p is true

either

Assumption2.

For every

of Contradiction.

Law

The

it is not the casethat

true and

is both

proposition p,

false.

Five Basic Connectives


by means of such connectivesas and, or,
word not.
only if; and they are modified
by the
in terms
of the three:
canbedefined
types of connectives
combined

are

Propositions

if...

if and

and

then

These five main

and, or, and not.

definitions of these connectives.If p is a


we represent
true\" is a proposition,which
as
of p\", or \"the denial of p\".
\"the
negation
~p, and refer to it as \"notp\",
Not p is a proposition that is true when
p is false and false when p is true.
Thedenialofp isaccomplished
by preceding
p by the words \"it is not the
in an appropriate
or by the insertion
of the word \"not\"
case that\"
place.
is a genius,
is the
Einstein
For example, the negationofthe proposition:
We

to

proceed

then

proposition,

give the
\"p is not

statement:

It is not the casethat

is a

Einstein

genius,

or

It is falsethat Einsteinisa genius,


or

is not

Einstein

a genius.

into another, other


third.
If p and q are
propositions
as
propositions, then
\"p and q\" is a proposition, which we represent in symbols
of p
p A q and refer to it as the conjunctionofp and
q. The
conjunction
and q is true only when both p and q are true. On the other hand,
the
the disjunction
of p and q, and denotedby
proposition
\"p or <?,\" called
is true. Here
p V q, is true whenever at least oneofthe two
propositions
we have defined or in the inclusive
or q is true or
sense\342\200\224either
p is true
both aretrue sothis \"or\" could be known as inclusive or. But, of course,
\"or\"
can
be used in the exclusive sense\342\200\224either
p is true or q is true, but
not both. Generally
in
usage the context determines
speaking
everyday
While

which

changes

negation

sense

is meant,

mean the inclusive


The

one

two

connectives combine

proposition

proposition
to form a

but, in our

usage, if

no

indication

is given,

we shall

or.

\"p implies

q\"

or

\"if p

then

q\"

is represented

as p

\342\200\224\342\226\

Section

Fundamentals of Logic

1.5

and is calledan
the

In this setting,p is called


of the implication,and q is

or consequent
of
the
We define
implication.
that is false only when the antecedent
p is true and
is
false.
It
be
beneficialto
q
might
emphasizethe cases
is
true
or
false
the
truth
table
that
implication
by
following
all possible truth values
for
and
and
the
p
q separately

the conclusion
a proposition

called

or a conditional.
or antecedent

implication

hypothesis,

premise,

35

\342\200\224\342\226\272
as

the

consequent

when

the

contains

corresponding

values

truth

for p

\342\200\224+
Let

T denote

p-+q

q.

\"true\"

and

F denote

\"false.\"

P
T

statement
about
example considerthe following
geometrical
triangle are equal,then the triangle is a right
occur in geometry and in
others
that
triangle. This proposition,likemany
other branchesof mathematics,
is a conditional
statement.
The

As an

objects:

If two angles of a

antecedent
and

the

consequent

are, respectively:

p: two anglesof a triangle are equal,


q: the triangle is a right triangle.
of the English languagethis
are equal
whenever
two angles of a triangle
predict
we
know
Of
that
there
then the triangle must be a right
course,
triangle.
is true for there exist isoscelesright
are caseswhen the proposition
are there cases where this statementis false?Sincea
But
triangles.
the
conditional
is false
consequent
only when the antecedent is true and
with two equal angles that is not a
is false, we should look for a triangle
right triangle.Thistype of example is easy to find, in fact, an equilateral
trianglehas all three angles equal and is not a right triangle. Only one
is not always true.
such example
is needed to showthat the proposition
Note in particular that an implicationp \342\200\224*
does
not assert that its
q
antecedent p is true;nor does it say that its consequent q is true. It only
that
is true
is true, then its consequent
also.
says
if the antecedent
this
a
nd
can
be
between
antecedent
Moreover,
consequent
relationship
if
that
w
ill
be
false
the
the
antecedent
expressed by saying
consequent is
false.Therefore,accordingto our definition
there are two
of implication,
to

According

propositionseems

to

our

understanding

that

1:Foundations
valid

that, nevertheless,

of implication

principles

are sometimes

considered paradoxical.

(a)

A false

(b)

A true

antecedent p impliesany
consequent q is impliedby

(a), we are correctin

To illustrate

If 1981is a leapyear,

Isaac

then

q;

proposition

p.

proposition

any

discovered

Newton

is true:

the following

that

claiming

America.

Here, if p denotes the proposition \"1981 is a leap year\" and q denotes


\"Isaac Newton discovered America,\" then since p is false,
we
know
of q.
that the implication p \342\200\224\342\226\272
q is true in spite of the falsity
immediately
To illustrate
the
is
(b) it is correct to assert that
implication
following
true:

If (p) IsaacNewton
sevendays in a week.
Here, since q

is true, we

discovered

that

know

p is trueor false.
the

Normally
inherent

\342\200\224\342\226\272
is

a premise

between

relationship

true,

uses implication

language

English

then

America,

(q) there

regardless

are

of whether

to indicatea causalor

and a conclusion.But the above

that in the language of propositionsthe premise


to the conclusion in any substantive way.
If such
are not allowed, then somerule must
be given
combinations
what propositions can be combinedto form
that will determine
have found that it is more difficult
to set up such a
implications. Mathematicians
situations as described in (a)
rule than it is to allow the two paradoxical
and (b)above.As a result mathematicians
do not hesitate to combineany
illustrations

not

need

emphasize
be related

by using

propositions
two

When

to

not

any of

propositions

the truth

confuse

the connectives.

by \"if... then\" one must be careful


or falsity of either of the propositions
with the
are joined

or falsity of the conditionalor to expectany cause


between the antecedentand the consequent.
relationship
truth

The proposition

be expressed

p\342\200\224+q
may

p implies q

ifptheng

if q

only

p is

a sufficient conditionfor

necessary condition

q is a
qifp

q follows

from p

for

as:

and

effect

Section 1.5

37

of Logic

Fundamentals

q provided p
ofp
q is a consequence
q

whenever

The
biconditional

of p

converse
p

\302\253-*is
(?

conditional
the
q\342\200\224+pand
of the conditionals p \342\200\224\342\226\272
<? and
g \342\200\224\302\273
p. The

the

conjunction

can be

biconditional

formed with the

\"p if and
\342\200\224\342\226\272
q
p, we see thatp

\302\253-*is

symbol

the

\342\200\224\342\226\272
is

and
p\342\200\224*q

read

\"if

words

and

only

if.\"

the

Thus,

table
of
only if q.\" By consultingthe truth
+-*(? is true whenp and q have the same

truth values,and is false otherwise.

Notice

we

that

are

as

are

connectives

different

{T,F}

into

Negation

{T,F}.

example, disjunctionV
each

variables

(T,T), (T,F), (F,T) and (F^F),and any


T or F\342\200\224to
{T,F} must assign a value\342\200\224either
four elements. Since each of thesefour elements
may take
in {T9F}2,

elements

four

namely,

{T,F}2 into

from

function

about mappings here: if we think of p and q


the value T or F, then the
taking
from either {T,F} or {T,F}2= {TfF}x
functions
- is a function
from
{T,F} into {T,F} while, for
is a function
from {T,F}2 into {T,F}.There are

talking

not as sentencesbut

of these

=
of the two values independently, there are 2x2x2x2
16
from {T9F}2into \\T,F}.
functions
possible
A propositional
is a function whose variablesare
function
propositions. Thus,
there
are only 16 propositional functions of two variables.
of several variables involving
But therecan be propositional
functions
connectives.
For example, the proposition [(p Aq)V ~r]\302\253-*
many
p may
of the three
be viewed as a function
variables p, qf and r and involves the
four connectives~, V, A, and +-*. Then as a function of three variables
into
We list all the
(~r) +-+ p maps the 8 points of \\TyFf
{T,F}.
(pAq)V
in the following
values of this function
truth table:

either

pAq

F
F
F
F

F
T
T

F
F
F
F
F
F

F
F
T

F
T

In constructing

truth

~r

(pA<7)V(~r)

[pA<7)V~r)\302\253-

F
T
F

T
T

\342\226\240
F

T
F
tables, it is

useful to

follow

these

two

conventions.

1.

Place

all propositional

variables in the

left-mostcolumns.

-p

38

Chapter

1:Foundations

values to the variables accordingto the following


F and 1 representT, then assign the values of the
pattern:
k is the
1 where
from
0 to 2k \342\200\224
numbers
variable by counting in binary
2

truth

Assign

0 represent

Let

of the
the
number of propositionalvariables.(Forexample,
assignment
to
the
and r in the above example
values TFTtop,q,
binary
corresponds
number 1 0 1.)

take on

the

are

functions

Two

and

the same values

propositions,since

same if they

truth

the

at

table

have the samedomain

and

range

same points. Thus, in the context of


lists all the values of a propositional

two propositional functions are the sameif they


the same identical truth tables. Now it is frequently
have
the
case that
mathematicians
that
two
then
functions
are
rather,
say,
propositional
or just equivalent, for short. Thus, if P and Q
logically
equivalent
are propositionalfunctions,
P and Q are equivalent if they
then
have the
same truth tables, and we write P = Q to mean P is equivalent to Q.
see that

then

w6

function

Moreover, sad to say, mathematicians


imprecise here and drop the word
A

Q are

and

propositionsP

all possible
truth

whose

function

if

P and

values of the propositional


variables;

tautology. A

value

is always

neither a

for

is a

or absurdity

contradiction

that is

somewhat
two
that
say
become

frequently
and

Q have the sametruth table.


function
whosetruth value is true
propositional

equivalent

is a

tautology

\"functions\"

false, such as p

tautology

nor

example,

for

p V ~p

is a

propositional function

-p.

contradiction

propositional

is called

contingency.

Abbrievated Truth Table


Properties

of

constructing

an

a propositional

abbreviated

function can sometimes be determinedby


truth table. For instance, if we wish to show
is a contingency,
it is enough to exhibit two

that a propositionalfunction
of the truth
lines
table, one which makes
makes it false. To determine if a
that
another

tautology, it is only
which

functions
function

the

necessary

to check

the propositiontrue

those lines

could be false; or
proposition
we need only
are equivalent
can be false.

function

propositional

and

is a

of the truth table for

to showthat

two

propositional

check those lines where

each

(~p) V q are equivalent we


Example 1.5.1. To show that p \342\200\224
q and
will use an abbreviatedtruth table.Sincep \342\200\224\342\226\272
q is false only when p is
true and q is false, we need only considertheonelineofthe truth table of
V q
of (~p)
table
likewise there is only one lineofthe truth
p \342\200\224\342\226\272
q. But
where (~p) V q is false and that is when ~p is false and q is false or, in
other words, when p is true and q is false. Thus, (p\342\200\224*q) = [(~p) Vg],

Section 1.5

Prove that [(p

1.5.2.

Example

39

of Logic

Fundamentals

r)] is

\342\200\224\342\200\224 \342\200\224\342\226\272
V

r]

~q)

[p

(q

tautology.

Sincethis propositioninvolves
3 variables,
table would
8 lines, but we will
require
appeal
an implication
table. The one casewhere
is

antecedentis

r)] is

(q

false. Then, the abbreviated

pqr

pA~q

TFF

Since the

bea

table

p is true and

the case where the


In the above, the
q

and

r are

both

case:

this one

addresses

r]
[(PA-C7) \342\200\224
[(pA^-f]-[p->(QVf)]

last columnhas the value

proposition must

case, the

in this

tautology.

of Two

Functions

Propositional

Let us now
p
F
F

false when

truth

[p-+(qVr)]

false is
is false.

consequent

\342\200\224\342\226\272
V

[p

consequent

the

but

true

p, q, r the complete truth


to an abbreviated
truth

list

3 4

5 6

functions of 2 variables.

16 propositional

F
F
T

T
T

the

Variables

F T F
T F F
F F F
T T T

9
T

10

11

F
T
T
F

13

12

'

F
F
T
F

15 16

14

F
T
F
F

F
F
F
F

of the
find
the representation
Examining this table, we readily
connectiveswe have already defined: disjunction (V) is in column 2,
in column
4, ~p is in
conjunction (A) is in column 8, p is represented
column 13,q is in column 6, and ~q in column 11;column1is \"universally
and thus
false\"
and so is a tautology, and column 16is \"universally
true\"
in column 5
a contradiction. Moreover,p \342\200\224\342\226\272
q is represented
represents
\342\200\224*
in column 3.
while the converseofp \342\200\224*
p, is represented
q, or q
these
6 columns? It would seem plausiblethat
What
of the
remaining
also represent
ways of combining propositions.That is indeedthe case,
mentioned.
in fact
some are just the negation of columnsalready
and
as column 2 represents the disjunction
pVg, column 15 represents
Thus,
or-(pV^).

nondisjunction

column
Column 7 represents p <-\342\226\272
q, and
+-+
is at the same time the truth
q and

denote ~(p
columns

\302\253-\342\226\272

5 and

q)

by p

*-/\342\200\224*
q.

3, respectively.

for
\342\200\224/-\302\273p
~(q-\302\273p).

Columns

10 represents
for

table

12 and

We shall write p

the

14 are

the negationof
exclusive

or. We

the negationsof
- (p

\342\200\224/\342\200\224
q for

\342\200\224and

q)

40

Chapter 1: Foundations
see that an understanding for ~, V, A, and \342\200\224\342\226\272
gives
an understanding
of all 16 propositional functions of 2 variables, and
all 16
sincep \342\200\224\342\226\272
to (~p) V q, in fact, ~, V, and A generate
q is equivalent
we have
now
functions. Let us list thesefunctions
with
the assignments
should

you

Thus,

made.

pVq

\"True\"

T
T

p+-l-+q
F

~(pAq)
F

T
T
T

-+q

q
T
F
T
F

T
F

P\"

F~
T
F
T

Propositions

~q

-*P

T
T
T
F

of 2

Connectives

The

-/-

7\"

~P
\342\226\240*q

q-

-/-

F
T

F
F

F
F

F
F

T
T

P~q

F
F
T

F
F
F

~(PVq)
F
F
. F

pAq

\"False\"
F
F
F

2 propositions,
between
it is possible to
Now, using all the connectives
more
than
16 such propositions. It follows, then, that
thereareseveral
Let us list some of the equivalences.
equivalences.

generate many
1.

(~p) A (~q)\\
laws)
(DeMorgan's

Vq)^

~(p

2. ~(p A?)3. p = ~(~p)


4.

= (~p)
(p\342\200\224\342\226\272
q)

5. (p

\342\200\224 =

q)

(~p)

(~q

(~q)\\

(Lawof doublenegation)
(Law of implication)

V q
\342\200\224

of contrapositive)

(Law

~p)

in
DeMorgan's laws are useful
conjunctions.For example,
suppose

forming
and

negations
q are

and

of disjunctions
the following

propositions:

p:

God

makes

q: It rains

in

little green

apples.
in the

Indianapolis

The negationofpVq

is:Itis

false

or it rains in Indianapolisin

since -(pVg) =
God doesn't

summer time.

the

makes little green apples


time. By DeMorgan's law,

God

that

summer

w6 see

that the

make little greenapplesand

it doesn't

the summer time.

(~p)

(~g),

negation of p V
rain

q is

also:

in Indianapolis

in

Section

1.5.3.
Example
when p V

precisely

(~p)

first

the

Verify

if (~p)

Conversely,

false so that ~(p

is true

(-g)
<?) is true.

then p

Thus, these two propositional functions


are therefore equivalent.

of p

a proposition,
The
law of

\342\200\224\342\226\272
is

\342\200\224*

q.

of

contrapositive

= P

~(~p)

converse

The

s3

\342\200\224+

and q

have

is

(~p)

(?, we

to p \342\200\224*
g.
of p \342\200\224*
<? is q

and

(~p)

\342\200\224\342\226\272
are

(~q)

\342\200\224The

F
T

F
F

F
T
F

~Q

~~P

\342\200\224*

of p

opposite

p.

F
T

since

(~q) \342\200\224\342

\342\200\224*

q (sometimes

which
is
(~g),
(~p)
to g \342\200\224\342\226\272
p. The
following
are

and

equivalent

q\342\200\224+p

q-+p

(~<7)-*(~p)

T
T

(-P)^(-Q)

F
T
T

F
T

T
T

of an
diagrams.

Converse

q^p.

qP\342\200\224

q.

If

for q.
p is sufficient
for p.
is
necessary
q

q, then

the converse).

p.

for p.
q is sufficient
p is necessary for q.

Contrapositive

Opposite

(~P)-M~<7).
not p, then not q

its

\342\200\224*

Implication

If

is

table and

and

~(~q)

The meaningsof contrapositive,


converse,and opposite
become
apparent
upon examining the following

and p V q

truth

implicationwill

p, then

case

equivalent.

P~+q

<7

If

is true

q)

In this

the contrapositive of

see that

\342\200\224*is

false

same

the

~(~p)

of p
the proppsition
<?)
the contrapositive of q \342\200\224\342\226\272
thus equivalent
p, and
truth table shows that p \342\200\224\342\226\272
q and
(~g) \342\200\224*
(~p)
the inverse

called

are

propositions.

(~q)

and ~(~(?)

is equivalent

(~p)

false.

then ~q \342\200\224*
is called the contrapositive
~p
contrapositive states that p \342\200\224*
q and

are equivalent

contrapositive

The

are

is true.

(~q)

If p

law. ~(p

DeMorgan

both p and q

or when

false

q is

41

of Logic

Fundamentals

1.5

(equivalent to

(~<7)-(~P).
not q, then not p

If

the

implication).

(equivalent

to

42

Chapter 1:Foundations
Converse

Theorem

q-^p

Q
P\342\200\224
If triangle

and

triangle

II

If

sides

the corresponding
I and
II are

similar,then

sides of
corresponding
II are proportional,
triangles I and

are

of triangles

the

and

triangle

triangle

II

are

then

similar.

True

proportional.

True

Contrapositive

Opposite
If

triangle

~p-+~q
and triangle

similar, then the

sides of

II

not

are

If

corresponding
I and

triangles

II

not

are

the

triangles I
then

proportional.

sides of

corresponding
and II are not
I and

triangle

proportional,
II

are

not

similar.

True

True

Converse

Theorem

Q-+P

Q
P\342\200\224
If the

ABCD is a

quadrilateral

square,

then

ABCD
quadrilateral

the

sides

are equal.

ABCD

of quadrilateral

are equal,then the


ABCD is a square.

of

sides

the

If

quadrilateral

False

True

Opposite

Contrapositive

~p-+~q
If

'

the

then the

square,

teral ABCD are

~q-+~p

ABCD is

quadrilateral

of quadrila-

side%

not

sides of quadrilateral
are not equal, then
the
quadrilateral
is not a square.
ABCD
If the

not

equal.

ABCD

True

False

The latter diagram shows


that
the
the
theorem
necessarilytruejust because

converse
is true!

of a

theorem is not

Summary

From the definition of

-, V,

and
\342\200\224\342\226\272,
+-+,

A,

let

us remember

the

following:

1.

Either

2.

It is

p is

true or ~p is true (not

not possible

(Thus,

if an

both

found to

for

assumption

both

be true, then we

q is

true,

then p

say

be true simultaneously.
situation where p and

~p to

leads to a

contradictionand the assumption


3. If

and

both).

that
must

must be true and

the assumption
be false.)
q must

be true.

~p

are

has led to a

Section 1.5

Fundamentals

4. If

q is

particular,

43

then at least one of p, q must be false. Hence, in


is false and p is true, then
be false; and,
q must
be false.
p must
q is false and q is true, then

false,
if

of Logic

A q

similarly, if p A
5. If p V q is false, then p must be falseand so must
q.
V
in
6. If p
Hence,
q is true, then at least one of p, g is true.
particular, if p V q is true and p is false, then g must be true; and,
be true.
(Note,
similarly, if p V q is true and q is false, then p must
conclude
however, that if p V q is true and if p is true, we cannot
that q is true or that it is false.)
be true. (Note, however,
7. If p \342\200\224*
q is true and p is true, then g must
is
if p \342\200\224
is
could
be
true
or false.)
and
true
q true, p
q
be false.
8. If p \342\200\224*
q is true and q is false, then p must
\342\200\224\302\273
9. If p
then either p is false or q is true, or both. (Note
g is true,
that
that we cannot in this caseconcludeexplicitly
p is false and q
is true.)
be false.
10. If p \342\200\224*
q must
q is false, then p must be true and
11. If p \302\253-*
is
and
the
value.
must
have
same
truth
true, p
g
g
12. If p \302\253-*
values.
truth
g is false, then p and g have
opposite
Exercises

1.5

for Section

1.

for the

tables

truth

Construct

(a) [(p V(/)A (~r)] ~


(b)

(c) {(p Ag)V (~p A r)} V


(d) [(pVg)A(~r)]~((?-r).

2. Provethe
(a)

are

following

following:

V (~r)).

((~p)

(pVq)A

g.

(g A

r).

tautologies:

^(pVg)V[MA(/]Vp.

(b) [(p-g)A(r-s)A(pVr)]-(gVs),

(c) [(p \342\200\224


r) A
(d)

{[p

\342\200\224 \342\200\224

(q

r)]

r)]

-((/V

(e) {[pV9)-r]A
3.

Consider
David

(-(?)}
(~p)}

(p

-*

\342\200\224

V q)

(g

r].

r).

\342\200\224

r).

the propositions:

p: David is playing
g:

[(p

\342\200\224

pool,

is inside.

r: David is doing his homework.

s:

David

to music.

is listening

Translate

the

p, q, r, s, ~,

V,

(a) Either David

(b) Neitheris

following

A, and
is

David

sentences

into

symbolic

notation

using

only.
parentheses
playing
pool or he is inside.
playing
pool, nor is he doing his homework.

Foundations

pool and not doinghis homework.


doing his homework, not playingpool.
David
is inside
doing his homework while listening to music,
he is not playing pool.
and
(f) David is not listeningto music,nor is he playing pool, neither is

(c)

(d)
(e)

David

is playing

David

is inside

he doing his homework.

4.

the

Using

q, r, and s of Exercise
acceptableEnglish.

of p,

specifications

following propositions into


A (~q).

(~p)

(a)

the

3 translate

r).

(b) pV(qA

(c) ~((~p)Ar).
[~r V s].

Vq]A

[(~p)

(d)

(e) [(~p) Aq]V

(a)

If he
If

the

\342\200\224*
in

q,

equivalent

form,

q.

fails to

(b) If the work


(c)

s].

the following implications,p

5. Restate

(~p)

[(~r)

triangle

follow

is not

ABC

on time,

is isosceles,

commission.
then I am in trouble.

lose his

he will

orders,

finished

then the base angles

and

B are

equal.

(d) If K-Mart does not

the

refund

money,

(e) If

lines AB

angles

6. Restate

are

and

CD

are

parallel,

not

will

anymore.

then the

shop

there

alternate interior

equal.

the following as implications


\"If..., then

..

.\":

ABCD
be a
condition that a given
quadrilateral
a
is
it
be
that
parallelogram.
rectangle
A sufficient
condition
that ABCD be a rectangle is that it be a

(a) A necessary
(b)

square.

(c)

(d)

(e)

necessary

sufficient

that it be

(b)

sufficient

condition

that

divisible by 18.
condition

its digits be divisible

7. State
(a)

that

condition

a given

integer n be divisible

by

9 is

a given

integer n be divisible

by

9 is

that it is divisible by 3.

for n
by

to be divisibleby

9 is

that

the sum

of

9.

the converse, opposite,and contrapositiveto the following:


ABC is a right triangle, then | AB |2 + | BC |2 = | AC |2.
then it is equilateral.
is equiangular,
If the triangle
If triangle

Section 1.6
Selected

1.

1.5

for Section

Answers

45

Inferences

Logical

(a)

pVq

F
F
T
T
F
F
T
T

F
F
T
T
T
T
T
T

F
F
F

T
T
T
T

T
F
T

~r

[(pV<7)A~r]- + q

~r

(pVq)A

F
F
T
F
T
F
T
F

T
\342\226\240

F
F

T
T

3. (a) pVq
A (~r)

(~p)

(b)

(c) p A (~r)
(d)
MAgAr

K-Mart refunds the money

5. (d)

(e) Lines
are

angles

and

AB

there anymore.
or the alternateinterior

not shop

I will

or

not parallel

are

equal.

(Converse) If

7. (a)

CD

\\AB\\2

- | AC

|SC|2

|2, then triangleABC

is

triangle.

right

(Opposite) If

triangle ABC

a right

not

is

triangle, then | AB |2

\\BC\\2*\\AC\\\\

If | AB |2 +

(Contrapositive)

| BC |2

\\ AC

|2, then

ABC is not

triangle

a right triangle.

1.6 LOGICAL

INFERENCES

have

We

statements

part

said

that a

appear

of the

well-founded proof of a theoremis a sequence


of
argument that the theorem is true. Some
some as warrants, and someareknown
as

an
represent
as grounds,

which

statements

frame of reference.Otherstatements
may

the hypothesis of the theorem,


assumed

someassertions

must

the

be

inferred

to

from

be true

those that

be

given

in the

as part

of

argument. But

have occurredearlierin

proof.

Thus,
deriving

to construct proofs, we need a meansof drawing


new assertions from old ones; this
is done

inference. Rulesof inferencespecify


known,
legitimately from assertions
Now in this contextlet us define

which

assumed,
logical

conclusions

conclusions

or previously
implication.

or

rules
of
may be inferred

using

established.
A proposition

46

Chapter

1: Foundations

of p,
implies a propositionq, and q is a logical
consequence
\342\200\224\342\226\272
is
for
true
all
of
the
truth
p
q
possible
implication
assignments
of p and qy that
Much care must betaken
values
is, if p \342\200\224*
q is a tautology.
not
to confuse
The
(or conditional) with
implication
logical
implication.
conditional
is only a way of connecting
the two propositions p and q,
whereasif p logically implies q then p and q are related to the extent that
T then so does q. We
value
do note
whenever p has the truth
that every
is
an
but
not
all
(conditional),
logical implication
implication
p logically
if

the

implicationsare

implications.

logical

examine the truth tableof the conditional


whenever the antecedent is false, the conditional
the
only time the implicationis false is when
If we

consequentis false.This allows

again,

true.

is

antecedent

we recall that
the
Moreover,
is true and the

in
the work involved
is
or
a
is
not
All
we
logicalimplication.
checking
need
do is check all possiblecasesin which
the antecedent
is true to see if
the
If
also
is
the
is
true.
this
t
hen
the
case,
consequent
implication
p \342\200\224\342\226
q
we would
draw the same
is, in fact, a logical implication. (Of
course,
conclusionif we checked all possible cases where the consequentis false
in those cases that the antecedentis alsofalse.)
and
determined
will
The word inference
be used to designate a set of premises
a
conclusion
by
regardless of whether or not the
accompanied
suggested
us,

to shorten

then,

a conditional

whether

of
conclusionis a logicalconsequence
premises.
and valid inferences.
faulty inferences
the

Thus,

We

say that
the

be

\342\200\224\342\226\272

of premises)

(conjunction

that is, if

can

implicationas follows:

as an

written

are

there

inference

Each

(conclusion).

is valid

this inference

implication

is a

if

the

implication

is a

tautology,

logical implication or, in otherwords,

if the

of all the premises.


logical consequenceof the conjunction
or invalid.
Otherwise, we say that the inferenceis faulty
whenever
all
The important
fact to realizeis that in a valid
inference,
the premises are true sois theconclusion
case
where
one or more of
(the
a truth value T,
the premisesarefalse automatically
gives the implication
regardlessof the truth value of the conclusion). Therefore we reiterate:to
to check
checkthat an inference is valid or not, it is sufficient
only those
are true, and seeif the
all the premises
rows of the truth tablefor which

conclusion

is a

conclusion

also is

true there.

of
It is important not to confusethe validity
of its conclusion.
Thefact that the conclusion
necessarilytruecanbeseen from the following

If Joe

reads TheDaily

Joe readsTheDaily

Worker,
Worker.

then
Therefore,

with the truth


valid inference is not

an inference

of a

argument:

a communist.
he is a communist.

he is

Section 1.6

Logical

If p

the statement \"JoereadsThe

Worker\"
and q is
Daily
the above inference is valid
q)]
implies q (we need only checkthe truth
(p \342\200\224\342\226\272
logically
and p \342\200\224+
But the conclusion of the above
q is true).
not be true, for Joe may
be a propaganda
for
interpreter

represents

substituted
because

A
p
need

argument

is

\"he

for

[p
when

table

47

Inferences

then

communist,\"

some government agencyor a politicalscience


instructor.
This
is an example of a valid
inference
but an unsound
argument since
if the
we define an argumentto be sound
inference
is valid and the

premises

true.

are

conclusion

and

familiar type of proof uses two

The most
inference.

in
Rule 1. Ifthe statement

Fundamental

also the statementp \342\200\224\342\226\272


q is accepted
must

we

circumstances,

accept

Symbolicallywe
.*. to

symbol

stand

have

q as

true.

the

following

for \"hence\" or

as true,

pattern,

rules

of

as true,

and

fundamental

is assumed

then, in these

where we use the familiar

\"therefore\":

:.q
In

of an argument, the assertions above


the
hypotheses or premises; the assertionbelow
the
line is the conclusion.
(Observe that the premisesarenot
a truth
accompaniedby
value, we assume they are true.) The rule depictedis
known
as modus
or the rule of detachment.
The
rule of
ponens
detachment is a valid
inference because [pA (p \342\200\224*
q)]\342\200\224*
(? is a tautology.
For example, suppose that we know the following
two
statements:
tabular

this

line

horizontal

presentation

are the

11:00 o'clock in Tallahassee.

It is

If it is 11:00o'clockin

Tallahassee,

then

it is

10:00 o'clock in

New

Orleans.
Then,

by

the

rule

of detachment

It is 10:00o'clock
in

New

we must

conclude:

Orleans.

between implication and inferenceis worth


not
this: the truth of an implication p \342\200\224\342\226\272
q does
both
and
the
truth
of
of
But
the
truth
either
or
p
p\342\200\224+q
guarantee
p q.
does
the truth of q.
guarantee
It is understoodthat in place of the propositions p,q in the statement
The

It
emphasizing.

distinction

is essentially

48

Chapter

1: Foundations

rule

of the

substitute

can

we

detachment

of

propositional

the
rule
any degree of complexity.For example,
the
us
to
make
where
inference,
following
permit
propositionabove

the

line as

horizontal

functions of
would

of detachment

we assume

the

premises:

pA(9Vr)

[pA(qVr)]->sA[(~t)

.*.

The

Since (p) two

sides

respectively,

equal,

A'B'C,

triangle

u]

V u]
is typical in

geometry:
and the included angle of triangle ABC
to two sides and the included
angle
(q) triangle ABC is congruentto triangle

of argument

line

following

s A [(~t)

are

of

A'B'C.

The
words

argument as
that
appear.

thus stated is abbreviated;thereismoretoit than


in parentheses,
Using p and q as indicated

the

the

as follows:
completed argument would
appear
Since p is true and p \342\200\224*
q is true (by a special caseofa previous
in the
framework
of geometry), hence q is
theoremestablished

true (by

Another rule

of detachment).

rule

the

q
true.

accepted

In pattern

law of

rule.

transitive

Fundamental Rule 2.
\342\200\224\342\200\242\342\200\242
r are

called the

is commonly

inference

of

or the

hypothetical
syllogism

two

the

Whenever

implications

we must acceptthe implication

as true,

\342\200\224*
and

\342\200\224*
r as

form, we write:

p-^q

:.p-+r
This

rule

is a

valid

rule of
(p

is a

tautology.

The transitive

inference becausethe implication

\342\200\224A

q)

(q

-* r) -*

to a
rule can be extended

as follows:

p-^q
q

\342\200\224
r

r\342\200\224*s

.\\p

\342\200\224
s

(p -*

larger

r)

number

of implications

49

Logical Inferences

1.6

Section

Most argumentsin
rules of inference,with

DeMorgan's

laws.

thoroughly

There are
in

ones

the

nothing

valid

following
will

You

limitations.

than a

more

we

Therefore,

other

based

uses

occasional

in understanding

versed

on the two fundamental


law
the
of
of contrapositiveand
that
the student become
suggest
at least these rules.
we list some of the moreimportant
are

mathematics

inferences;

table. We do not discuss them because


of space
notice that some of these otherrulesof inference
are

reinterpretation of the two

rules

fundamental

in the

light of the law of contraposition.


Rules

of Inference

Rule

Tautological

1. p

.'. P

to the Language of Propositions

Related

of Inference

Name

Form

\342\200\224

addition

(PV<7)

2. pAq

(pA

g)

\342\200\224

simplification

[pA

(p

\342\200\224
q
g)]\342\200\224

modus ponens

\342\200\242*.
P

3. P
P\342\200\224
Q
\342\200\242'.
Q

4. ~q

(p

NA

\342\200\224

q)]-+

modus

~p

tollens

p-+q
.\\

~p

5. pVq

[(pV<7)A~p]--

disjunctive

syllogism

~P
\342\200\242#.
Q

6. p-+q

l(p-*q)A(q-+r)]-+lp^r]

hypothetical
syllogism

q-+r

.'. p-+r
7.

conjunction

.*. P
8.

(p

A q

\342\200\224

q)A

(r-+s)

l(p\342\200\224q)A

(pV

s)A
(r\342\200\224

r)]-\302\273[qV

constructive

s]

p V r

/. qV
9.

dilemma

(p\342\200\224q)A

(r\342\200\224s)

s) A
[(p\342\200\224\342\226\272
q) A (r\342\200\224

(-qV

~s)]\342\200\224*
[~p

V ~r]

destructive

dilemma

-QV-S

~pV ~r

Since most of the rules


fundamental
list

them

rules,

in

DeMorgan's

as fundamental

rules.

the

above

laws, and

follow from the two


table
the law of contraposition,we

50

Chapter

1: Foundations

Rule

Fundamental

DeMorgan's laws.

3:

Fundamental Rule 4:

of

Law

contrapositive.

the above table of rulesof inferencesby saying


valid methods of reasoning\342\200\224valid
arguments\342\200\224
valid
inferences.
the truth of the conclusionneednot follow
Nevertheless,
from
the validity of the argument unlessthe premises
are
A
also
true.
on
the
other
sometimes
include
a
true
hand,
faulty inference,
may
conclusion.
We

these

can summarize
constitute

rules

Fallacies
Theijeare threeforms

1. The

of

fallacy

of

inferences

faulty

affirming

the

that we will

(or

consequent

now discuss:
the

affirming

converse).

2.

The

of denying the
non sequitur fallacy.

fallacy

3. The

The fallacy

of

affirming

the

antecedent (orassuming

consequent

the

is presented in

opposite).

the

following

form:

\342\200\224

Fallacy
-\"\342\226\240
P

the following

Consider

If the price of
is

Inflation

rising.
This
thoughp q

gold

surely

argument:
is rising,
then inflation
the
Therefore,
coming.

is surely coming.
price of gold is

the conclusion can be false even


because
\342\200\224\342\226\272
\342\200\224\342\226\272
that is, the implication.[(p
q) A q]
p is
not have been related to the
not a tautology: the causeof inflation
may
in
increase
priceof gold at all but perhaps to the price of oil,the overall
or
cause.
some
other
wages,
The fallacy of denying the antecedent takes the form:
argument

is

faulty

q are true,

\342\200\224\302\273
and

Q
P \342\200\224
\342\200\224

.\\ ~q

Fallacy

Section 1.6

LogicalInferences
the

Since

opposite

of p

opposite.

The

the

affirming

\342\200\224+
is

\342\200\224*

~p

converse

~g,

this

fallacy

need
p-+q
\342\200\224\342\226\272
p is equivalent

of
q\342\200\224+p

51

is the same as
not hold if p \342\200\224*
to q \342\200\224\342\226\272
p we

and since the contrapositiveof q


the
converse.
affirming the oppositeis equivalentto affirming
or opposite,
and
sense, the fallaciesof assuming the converse
of the
non sequitur
perhaps all logical errors, are specialcases
fallacy.
Non sequitur means\"it does not follow.\" A typical pattern of a non
error is the following:
sequitur
q is true,
see that
In a

:.q
This is like

the

of

pattern

Of course,

\342\200\224*
omitted.

the

if this

detachment
premise is known

law of

argument is valid, though abbreviated.But conceivably


could
hold, in which case the correctconclusion
~q
of q.

For example,consider
the

If Socrates

is a

Socrates

Therefore,

This

is a

be
the

would

premise

the

correct,

premise
be ~q

\342\200\224\342\2

instead

argument:

man, then Socratesis mortal.

man.

Socrates is mortal.
is

argument

valid

because

the

argument:

consider

However,

the

with

to

it follows

the pattern of modus ponens.

is a man.

Socrates

Therefore,Socratesis

mortal.

the conclusion
may be thought to follow
of \"man\"
does so only becauseof the meanings
Here

from
the premise,
and \"mortal,\" not

but it

by mere

inference.

Let

us

put

the

arguments

in symbolic

form:

p-^q

.-. q
The

second

has the

form:

.\\q

form. The first

argument

has

the

Chapter

1: Foundations

the form of the first which


form would also be

It is

same

the

this

not share

has

triangle

three

arguments

many

argument with

second

the

argument

of the

does

second form

as valid. For example:

not regard

we would

which

are

There

quality.

any other

it valid;

makes

valid. However,

sides.

Therefore, a triangle is a square.

Here

this

considerit a valid

but we would not

argument.

when arguments are symbolized

what remains

that

Notice

the form:

has

argument

of
bare logical bones,the mereform
in
common
have
regardless
arguments may

is the

sentences.It is
inference, deduction

precisely

has

for

in an

argument than with

more

their

that

form

this

to do

with

the

argument

of the
enables us

the

forms

this

way

content of the
to analyze the

of the

propositions

not

the following

meanings.

these ideas, let us determinewhether

To illustrate

in

which many

or

arguments are valid.

If a baby is hungry, then the baby cries. If the baby is not mad, then he
if a baby
does not cry. If a baby is mad, then he has a red face.Therefore,
is hungry, then he has a red face.

The

statements

basic

be represented

with

the

following

symbols:

baby is hungry,

h: a
c:

may

a baby

cries,

m: a baby is mad, and

r: a

baby

Then the

has

a red

face.

argument takesthe following

form:

h\342\200\224+c

m\342\200\224\302\273r

.*. fe \342\200\224
r

We

see

contrapositive

that

this is a valid inference because~m \342\200\224\342\226\272


~c
is the
of c \342\200\224\342\226\272
m. Thus,
with this replacement, we have:

h-+c
c\342\200\224\342\226\272
m
m\342\200\224+r

.-.

h-+r'

Section 1.6

LogicalInferences
the

final form,

this

In

the

of

form

is nothing

argument

FundamentalRule 2 and thereforeis valid.


the

Consider

Nixon will

keeps its air

If Tulsa

will be

Nixon

T: Tulsavotes

representations:

reelected,

for

the

of

form

and

Nixon,

is:

argument

R~

\342\200\224
R

/.

Now -J?

him.

reelected.

keeps its air base.

A: Tulsa

The

be

air base.

votes for

reelected.

Let us make the following


R:

lose its

only if Tulsa

base, Nixon will

Nixon will be

Therefore,

will

Tulsa

if and

reelected

be

more than

argument:

following

is not reelected,then

If Nixon

53

\342\200\224+
~A

and

canbe

\342\200\224*
R are

so that

equivalent

actually the argument

to:

simplified

R~
A

\342\200\224
R

.-. R

We suspect

neither

nor

that the non sequitur fallacy


a premise. Of course,we

T is

has

been
consider

could

\342\200\224*
R to see that we do not have
of [(A \342\200\224*
R) A (R *-* T)]
a valid
thus that the inferenceis invalid. Nevertheless,

have

been

If Tulsa

In words:

T,

keeps its air base,then

Tulsa

votes

for Nixon.

argument:

If a pair of anglesA
angles

A and

and

B are

B are

right angles,

then they are equal.

equal.

Hence, the anglesA and B must be right angles.


Represent the statementsas follows:
R:

a pair

a tautology
inference

\342\200\224\342\226\272
or

Consider the

The

committed
the truth

of angles

E: the anglesA

and

and

B are

B are

equal.

right angles,

since

table
and
would

54

Chapter 1:Foundations
of the form:

an argument

have

therefore

We

R-+ E

Obviously,

affirming

is faulty; in fact, it

this argument
the consequent.

demonstrates the fallacy

of

for Section 1.6

Exercises

each
first

as

following sets of propositions,so that


rule of detachment.
(In each case the
conformity
to
as
s
o
two
are
be
assumed
premises, that no question
propositions
to the actual truth or falsity of any of the prepositionsis to be
set

in the

blanks

the

Complete

is in

the

with

considered.)

N is
If the year N is a leapyear,
then
The number 1984isa multipleof four.

a multiple

of four.

Hence,...
2.

are to be continued,

interest rates

If high

industry
High interest
will

be

then

the

housing

hurt.

rates are to

Hence,...
If
is Thursday,
today

be continued.

ten days

from now will be Sunday.

ten

from

is Thursday.

Today

Hence,...

If today

is Thursday,

days

now

will

be

Monday.

is Thursday.

Today

Hence,...

1984is a leapyear.

Hence1984is

Therefore,
7.

If two

election

presidential

is Sunday, then I will

If today

I will go to
are

triangles

go

year.

to church.

church.

congruent,

then the

triangles are mutually

equiangular.

The

8.

are congruent.

two triangles

Hence,...
If the triangle

is

isosceles,

then

the triangle

angles.

Hence,

the

triangle

has

two equal

angles.

has two equal

Section 1.6

Logical

ABC and A'B'C are

If triangles

9. (a)

then

congruent,

angle A'.

(b) Triangles

A =

angle

are congruent.

A'B'C

and

ABC

55

Inferences

(c) Hence,...

10.

(a)

....

(b)

Price controls

(c) Hence,

the

are to be adopted.

11. Completethe
eachsetis conformity

in

blanks

with

in

1. (a) TriangleABC

is

be saved

will

country

the following
the transitive

from inflation.
sets of

triangle

implies

equilateral

propositions so that

rule.
ABC is

equiangular.

Triangle

(c)

Hence,...

If x is greater than y,
(b) If u is lessthan vf then

2. (a)

3.

1960

If

was a

....
(c) If 1960

z is

leap year,

= 60\302\260.

less than v.
greater than w.

u is

than

(c) Hence,...
(a)

implies angleA

is equiangular

ABC

(b)

then 1964was

a leap

year.

(b)

York

New

If

(a)

time

Denver

(b)

year, then 1968 was a leap year.


time is five hours slowerthan London time,then
time.
is two hours slower than New York

a leap

was

4.

If Denver

time is two

San Francisco

5.

slower

New

than

time,

then

New York

time.

York

(c) Hence,...

III.

Determine

If the

is guilty\" implies
\"Z is under

\"X

Since

(a)

innocent\"

faulty.

hours slowerthan

time is three hours

implies

\"Y

is

innocent,\"

and

each
of the following inferences is
whether
which
will
inference is valid, produce someevidence

a combination
its validity. If the inferenceis faulty,
produce
a fallacy,
or indicate a fallacy.
values that will confirm

1. If today
Today

2.

is David's
is January

birthday,
24.

then today

Hence, today is David's birthday.


client is guilty, then he was at the scene of the
The clientwas not at the scene of the crime.
The

The

days are
the

nights

valid

or

confirm

of truth

crime.

guilty.

becoming longer.

are

nights

Hence,

not

is

\"Y

is January 24.

If the

Hence,the clientis
3.

(b)

suspicion,\" hence, (c)...

shorter
becoming
are becoming

if the days
shorter.

are becominglonger.

Foundations

a =

If angle

4.

angle /?,

AB and

lines

the

then

Hence, angle a = angle/?.


earth is spherical implies that

The

5.

Theearthis
6. If

not

the moonis spherical.

spherical.

is not

the moon

Hence,

BC are equal.

= BC.

AB

know

We

spherical.

exam, then he will pass the course.


David will pass the course.
exam.
Hence, he will pass the final
If the patient has a virus, he must have
a temperature
above
The
is not above 99\302\260.
patient's
temperature
the patient
does not have a virus.
Hence,
If diamonds
then gold is sellingcheaply.
are
not expensive,

7.

8.

David

final

the

passes

99\302\260.

Goldis not sellingcheaply.

are expensive.

diamonds

Hence,

9. AB is parallel to EF or CD
AB is parallel to EF.

Hence,

is not

CD

to EF.

parallel

10. AB is parallelto EF or CD
CD is not parallelto EF.
A

12.

to EF.

is parallel

is parallel
to EF.
truth.
guilty and B is not telling
it is false that \"A is guilty
or B is telling

AB

Hence,

11.

to EF.

is parallel

the

is not

Hence,
Either

Mack

Mike

is not

is not

guilty or

truth.

telling the

the truth.\"

Mike is tellingthe truth.

Hence,Mackis not guilty.


13.

is studying

If Lowell

theologyand Greek.
is not

Lowell

14.

required

for the
to take

then

ministry,

he

is required

to take

Greek.

for the ministry.


Hence,Lowellis not studying
if the
The governor will call a specialsession
Senate
cannot
only
reach a compromise.
If a majority
of the
Cabinet
are in agreement, then the governor
will

a special

call

session.

cannot reacha compromise.


of the Cabinet are in agreement.
majority

The Senate
a

Hence,

15. The

governor

will

call

a special

session only

if

the

Senate

cannot

the

governor

reach a

compromise.
If a majority of the Cabinetare in

will

call

a special

The Senate

can reacha compromise.


of the Cabinet are in agreement.

a majority

Hence,

16. The

then

agreement,

session.

governor

reach a

will

call

compromise.

a special

session only

if

the

Senate

cannot

Section 1.6
If a majority of the Cabinetare in
will call a specialsession.

The Senate

reach
a

governor

a compromise.

reach

can

Hence, a majority
17. The governor will

the

then

agreement,

57

Inferences

Logical

of the Cabinetarenot

in

agreement.

only if the

session

a special

call

Senate cannot

compromise.

If a majority
of the Cabinet are in
will call a specialsession.

The Senate

the

governor

a compromise.

reach

can

then

agreement,

governor will not calla specialsession.


in the neighborhood have a beautiful boat.
people

Hence, the

18.

The

new

car.

a nice

have

also

They

Hence, they must benicepeople.


Fill

IV.

in the

in the

blanks

following arguments by

using

contraposition and/or modus tollens.

1. Ifitis

not

sun will
out.

the

raining,

The sun will

come

not

/? are

CD

and

law of

come out.

Hence,...

2. If lines AB

the

then alternate

are parallel,

interior anglesa and

equal.

But angles
Hence,...

a and /?

not

are

equal.

3. If the graphsareisomorphic,

their

then

degree

spectrum

will be

the

same.

Theirdegree

different.

are

spectra

Hence,...
then
the graph G is bipartite,
The graph G is not two-colorable.

G is

4. If

two-colorable.

Hence,...

C is on the perpendicular
bisector
is equidistantfrom A and B.
Hence, if C is not...

5. If

6. If Joedoes
graduate.

not

Hence, Joe...

pass

the

language

of

the

line segment

AB, then

then he

requirement,

does not

if

7. If

the graphs

are isomorphic,then

they

have

the

same number

edges.

The

graphs

have

numbers

different

of edges.

Hence,...

8. If Melindais late,then
Hence, if...

she

will

be placed

on restrictions.

of

58

Chapter

1: Foundations

is valid
whether each of the following
inference
V. Determine
patterns
a combination
of
indicate
or invalid. If the inferencepattern is invalid,
If the inference
truth values which will produce a counterexample.
which will confirm its validity.
some
evidence
patternis valid, produce

1. r\342\200\224+s

2.

.-.

3.

r\342\200\224\342\226\272
s

~r

rVp

'

.-. s

6. ~f-* ~r

5. (pA<7)-*~f

p-+(r-+s)

~s

~r^>~p

wV

iv\342\200\224\342\226\272p

f\342\200\224>w

/.iv

(ivVr)-^^

7. ~r-*

(s \342\200\224
~f)

.'. (p A<7)

P^Q

2l

9. ~r

8. p
p^q

p\342\200\224<7

~p^s

-IV

.*.

.-.

~p

.-. f^p

10. ~p

11.

p^q

P-^q

q-+

~r

12. If Tallahassee is not in Florida,then


Chicago.
Golf balls arenotsoldin Chicago.
13. If the cup is styrofoam,
If the cup is lighterthan

Hence,if
14.

15.

If wages

the

cup

it is

then
water,

is styrofoam,

are raised, buying

triangles

given

Therefore,
the

not sold in

lighter than water.


Joe can carry it.

then

then Joe

triangles

are

are

can carry

it.

increases.

If thereisa depression,
cannot
wages
if
a
there
is
Thus,
depression,buying
The given triangles are similar.

If the
similar.

are

balls

is in Florida.

Tallahassee

Hence,

golf

be raised.
cannot

increase.

mutually

equiangular,

mutually

equiangular.

then they

are

Section 1.6

Joe or Abe needsa vacation,then Teddeserves


an
if Joe needs a vacation, then Teddeserves
an

16. If

Hence,
VI.

that the following argument is valid


and using truth tables to checkfor tautologies:

Verify

symbols

59

Inferences

Logical

assistant.
assistant.

into

translating

by

mathematician, then heisambitious.


If Joeisan early riser, then he does not like oatmeal.
If Joeisambitious,
then
he is an early riser.
if
is
a
then he doesnot like oatmeal..
Joe
mathematician,
Hence,
is a

If Joe

VII.

the

that

Verify

is valid by

argument

following

using the rulesof

inference:

live in France, thenhe doesnot speak


Clifton does not drive a Datsun.
If Clifton
in France,
lives
then he rides a bicycle.
or he drives a Datsun.
EitherClifton
French,
speaks
does not

If Clifton

Hence,
Selected

for Section 1.6

Answers

I. 1. (c)
2.

(c)

conclusion.

No

Hence, the

housing industry will

5. (a)

If 1984 is a leapyear,

8.

The

(b)

triangle

(c) Henceif

II. 2.
III.

a bicycle.

rides

Clifton

x is

hurt.

a presidential

election year.

than y,

the

then z is greaterthan

w.

consequent.

the antecedent*

syllogism.

disjunctive

Valid;

it is

be

is isosceles.

of affirming
Fallacy of denying

12.

then

greater

1. Fallacy
5.

French.

18. Nonsequitur.

IV. 3.

Hence the graphs

8. Hence, if

not late.

V. 1.

are

not

isomorphic.

Melinda will not be placedon

Valid

(1)

(2)

~s-*~r

\342\200\224>5

(3) ~s
(4)

~r

premise

Rule 4

premise
by

(2), (3),

Rule 1.

restrictions,

then

she is

Chapter

1: Foundations

Let the statements have


of
one
are
truth-values. Thenthe premises
true

5. Invalid.

the
but

following sets of
conclusion is

the

false.

p
T

~t

F
T

T
F

F
T

T
T

F
T

7. Valid

(1) -rVu;
(2)

~w

(3)

~r

premise

premise
by (1) and

(4) (~r)

(2),disjunctivesyllogism

\342\200\224(s\342\200\224~t) premise

and Rule

1.

and Rule

2.

(5)

s-+~t

by

(6)

~p-+8

premise

(7)

~p\342\200\224~t

by

(8)

t-+p

by (7) and Rule 4.

(3), (4),
(5),

(6),

10. invalid.

OF PROOF OF AN

METHODS

IMPLICATION

previous two sections we introduced truth tablesto be ableto


\302\253-*.
several
and
V, A, ~, \342\200\224*,
Moreover,
logical connectives:
functions
truth
tables are used to determine which
are, in
propositional
in
are
the
foundations
then,
turn,
fact, tautologies. Tautologies
upon
In the

the

define

which valid

inferences

to

ways\342\200\224first,

are

based.

section, we apply valid

Now in this

validate

common

nine

warrants
and, second,to supply
drawn in each step ofa proof.

The

methods

nine

referred

frequently

known methods of

of proof

and

in two basic
inference
patterns
methods for proving implications,
for the conclusions
justification

list are so commonthat


but these are by no means

that we

to by name,
proof\342\200\224they

just

which to build.

provide

a good

they

are

all of

the

foundation

upon

describe in generaltermsis just the


proofs usually take. In developinga proof the
of
student
should
follow
the skeleton outline of some indicatedmethod
to
to
the
more
will
have
add
flesh
bones
than
student
the
but,
that,
proof;
of the skeletonby supplying
and documentation for each
the
details
deduction.Every conclusion
must
be made according to valid
inference
We

must

skeleton

emphasize

outline

patterns.

form

that

that

what we

Section

Brief
1.

of the

descriptions

nine methodsof proofarelistedbelow:

proof

regardless
Thus, the construction

of a trivial

the truth value of q is true.


2. Vacuous
proof of

implicationp q true
3. Direct proofofp

\342\200\224

If

q.

\342\200\224\342\226\272

of p

proof

shown to

p is

be false, then the

q.

p is true and then, from


of reference, the conclusion
q

direct proof of

of a

construction

\342\200\224*
The

\342\200\224\342\226
<?

from

information

available

assuming

the frame

that

showing

q requires

proposition q.

for any

\342\200\224\342\226\272
is

by

61

Implication

of p \342\200\224\342\226\272
q. If it is possible to establishthat q is true,
of p, the implication
of the truth value
p \342\200\224\342\226\272
q is true.

Trivial

then,

begins

of an

of Proof

Methods

1.7

to be

is shown

true by

valid

inference.

4.

Indirect

implication p
Consequently,

we

\342\200\224\342\226\272

the

the fact
(~p)

\342\200\224\342\226\272

(~p).

of that assumption and other available


frame of reference that p is false.
This method

contradiction.

q by

laws and

DeMorgan's
\342\200\224is true
q

that p

~p.

(^q)

true by a direct
is
true.
Thus, an indirect
~~q

that

from

iff

(~q)

of proof exploits

the equivalence of
is false. Thus, a

(c) Then the contradictiondiscoveredin


conclude that the assumption in step (a)
A

is false,

(~q)

so that

step
was

(b)
false

(Pi V p2

the different

\342\200\224

q by
. V

If p

cases.
pn)

\342\200\224
can

true.

is in the form
be established

and
\342\200\242>
pn
<?,- \342\200\242

is
given

. V pa,
separately
by proving
Pi

implications:

Pi ~^Q,P2-^

is
in

\342\200\224\342\226\272
is

the contradiction oneobtains in a proof by contradiction


Frequently
in this case, one could have
Hence,
p A (~p).
proposition
proof by contrapositive just as easily.

6. Proof ofp

that

leads
us to
and therefore

the

then

proof by

(a) Assumep A (-g) is true.


(b) Discover on the basisofthat assumptionsomeconclusion
false or violates some otherfact already
established
patently
the frame of reference.
that p

\342\200\224
to

as follows:

is constructed

contradiction

q by

\342\200\224\342\226\272

[derived

V q]

the

from

information

\342\200\224\342\226\272

to

assumption

basis

the

on

5. Proofofp

establishing
be shown to be

\342\200\224\342\226\272

as follows:

(a) Assume q is false.


Prove

implication ^q

of p

implication is likely

proof proceedingfrom
q proceeds
proof of p \342\200\224\342\226\272
(b)

to the

the truth

establish

The

of contrapositive).

proof

(direct

equivalent

can

this last

Of course,

of p

proof

\342\200\224\342\226\272
is

-> q.

V p2 V

. .

1: Foundations
method

The

thestatement

cases is valid

of proof by
V p2)

(px

\342\200\224*
and

(px

q)

of cases.

7. Proof by elimination
or in constructing a proof we

are

n =

when
\342\200\224

\342\200\224*
are

equivalent.

q)

in solving
a problem
two alternatives: either

Frequently

with

confronted

example, because

2, for

A (p2

p has to betrue or q has to be true. If for someotherreasonswe


conclude
we must
verify that p is, in fact, false, then obviously

on to

go

that q is

true.

To be sure,this
disjunctive

extendedto any
[{(Pi

a proof by

Likewise,

on the

V q]

pj

q,

more than the

be

\342\200\224

\342\200\242
\342\200\242
\342\200\242

(~pj]

elimination of cases can takeanother

based

form

following tautology:

words, if we are given


one
of the conclusions

In other

r, and if

that p

conclude

is a

third

instead the equivalent


of just

Suppose,

form p

statement

then

r).

(p

two possible

conclusions q or

definitely false, then, in

fact,

we may

r.

a proof

of

by elimination of cases.In this


r) is proved by proving
(q

\342\200\224\342\226\272
V

(pA-g)-*r.

proposition (p

prove, sinceonewould
instead

q is

form

\342\200\224 \342\200\224

implies

thatp

of the

a statement

The second

{~q)\\

impliesthe otherconclusion

there

Finally,
situation,

~q)

have

at least
two premises p
\342\200\224>
r is

the onepremise
p.

potentially simpler to

and ~q with

which

to

for
that
we wish to prove the following
statement
example,
number X: If X2 - 5X + 6 = 0, then X = 3 or X - 2.Then,
we
this by assuming X2 - 5X + 6 = 0 and X # 3 and then
accomplish

a real

for

could

that

demonstrating

= 2.

We might observe that this methodof


elimination of cases is quite similarin form

however, a proof by
further

assume

and

DeMorgan's
The next

contradiction

p A

law), and

(~q)

(~r)

proof

of

A q)

\342\200\224>
r are

equivalent.

two

\342\200\224*

(<?

r)

by

proof by contradiction;
of p \342\200\224*
(q V r) would
go one step
(since
by
-(<? V r) = (~g) V (~r)

then attempt to find

8. Conditional proof. The

to

a contradiction.

another
method of proof is actually
just
of cases,but we separate
it out for better recall.

(p

of

law

it can

of course,

and,

A (~p2)

(~px)

{[p-((/V r)] A

work

\342\200\224

(~p)]

of cases:

number

. . . V

is nothing

proof

[(p V q)

finite

p2

of

method

syllogism:

propositions

Therefore,

form

of elimination

\342\200\224 \342\200\224

a proof of

(q

r)

and

the conditional

Section

of Proof

Methods

1.7

be constructed

can

p\342\200\224+(q-+r)

of an

as follows:

(a) Combinethe two antecedents


p and q.
r
on
the
basis
of
Then
these assumptions
(b)
prove
available

63

Implication

other

and

information.

9. Proof of equivalence. Toprove


if a proposition q is true frequently

p is true if and
proof into two
of course,
we prove q \342\200\224\342\226\272
p. We may,

only

a proposition
break
the

that

we

then
halves: we prove p \342\200\224\342\226\272
q, and
choose any methodof proof to prove eitherhalf.

several basic patterns of proof in outlineform,


let us now
given
some
of
Since
we are
basic
these
give
examples proof following
patterns.
so
concerned with
trying to illustrate themethodsofproof,we will not be
the
view
of the facts that we are proving;
we
them primarily
importance
as instruments for practice.
Having

proof. First we list someelementary

of direct

Examples

direct

of

examples

proofs.

wish
to prove the statement: If X
= 0, then X = 3 or X = 2. Now since
we are discussing
numbers, the frame of referenceshould includeallthe
rulesof algebra.A direct proof of the statement proceeds as follows:
X2 - 5X + 6 = 0. Using
Assume
of algebra, we have X2 - 5X +
rules
the
=
=
6
(X
3)(X 2) 0. It is known (a fact from the frame of reference)
that if the product of two numbers
is zero then one or the otherofthe two
= 0orX-2
=0. ButX - 3 = 0
factors
must
be zero. Hence, X-3
=
=
=
X = 3 or X = 2.
2 0 impliesX 2. Thus,
\342\226\241
implies X 3, and X

1,7.1.

Example

is a number suchthat

a2

- 5X

X2

we

+ 6

If an integer a
divisible by 3.

1.7.2.

Example

then

Supposethat

1 is

is suchthat

2 is

divisible by 3,

\"a
the
statement
we give a direct proof. Here we let
Again
\"a2
3\"
we
is an integer such that a
and
let
divisible
q represent
by
3\"
1 is divisible by 3.\"Next, we translate
what
\"divisible
means.
Since
by
- 2 = 3k, wherek is
a - 2 is divisible
by 3, we know that a

- 2is

Therefore,

then

a2

is divisible by 3 sincea +
(a + l)(a - 1) - 3(k + l)(a

+ 1

- 1=

If a

1.7.3.

Example

p represent

someinteger.

1 =

- 2) + 3 = 3(k +
1) is divisible by 3.
(a

and b are odd integers,then

b is

1),

and

\342\226\241

an even

integer.

Let us recallthat

integer.

Likewise,

an
an

odd

has
integer
has
the
integer

even

the form

2k, where k is some

form 2m + 1, where

is an

64

Chapter 1:Foundations
since

Therefore,

integer.

we know that a

in a

respectively.But then,a +
even integersincek + m +
Before

b =

the antecedent,

assume

can

for integers k and m,


1) = 2(k + m + 1) is an

+ 1,

2m

1) + (2m 4an integer. \342\226\241

(2k +

1 is

more examples

some

giving

direct proof we

= 2k + 1 and

of proofs,let us

a well-known

recall

result called

The Division Algorithm. If a and b are integers where b is


positive, then thereare(unique)
q and r such that a =
integers
<
r < 6. The integersq and r are called,
0
+ r, where
bq
respectively, the quotient and the remainder.
Of

a is

course,

by b if and

divisible

division algorithm is zero.

Exampleofa proof

of

only if

r given by

remainder

the

the

equivalence.

Two integers a and b have


1.7.4.
Example
divided by the positive integer n iff the integer a

same

the

remainder

when

by n.

\342\200\224
bis
divisible

We are to prove the statementp+-+q9


where
p is the statement \"a and b
the
same
when divided by the positiveintegern\" and q is
remainder
b is divisible
the statement \"the integer a \342\200\224
by n.\" Thus, we make two
have

namely,p\342\200\224+qand

proofs,

let us

First,

q\342\200\224+
p.

give an interpretation of what

means.

If we

apply the

qx and rx are integers and 0 <


b = nq2 4- r2, where q2 and r2 are integers with
0 < r2 < n.
rx < n. Likewise,
The statement p
that
the
remainders
rx and r2 are equal.
we assume rx = r2 and
Now, let us give a direct proof of p \342\200\224\342\226\272
q. Thus,
b has
n as a factor. But
attempt to prove that a

divisionalgorithm,then

a =

nqx +

rx,

where

just asserts
-

asince

rx

(m(?! +

\342\200\224
=

r2

r^

- (nq2 +

0. Therefore,

r2)

- q2)

n(qx

\342\200\224
b is

divisible

(rx

r2) =

by n since

gx

n((?i

q2)

\342\200\224
is

q2

an

integer.

Next, let us give a direct proof cf the converse implicationq \342\200\224\342\226\272


p. Thus,
we assume that a - b is divisible
by n or, in other words, a - b = nk,
where k is an integer. Then, if a = nqx + rx and 6 = ng2 + r2, we are to
\342\200\224
that
6 = nfc, we substitute
the
prove
rx = r2. In the equation a
a =
expression nq2 + r2 for 6 and then transpose to get the equation
and
nq2 + r2 + nk = n(q2 + k) + r2. But since0 < r2 < n and quotients
remainders are unique when
the division
we
algorithm, we
apply

concludethat the remainder


rx must

equal

r2.

\342\226\241

Section

of Proof of an

Methods

1.7

remainder

has

We know that a

= (10)<7X
a +

Therefore,

integers.

a +

we conclude

integer.

and b

are

when divided by

2 and

b =

(I0)q2

6 = (lO)^ + <?2)
divisible

is

has remainder2
10, then a + b is

that a

such

integers

8, respectively,

by 10.

divisible

and

If a

1.7.5.

Example

and b

4-

8,

+ 8)

4- (2

10 since

by

65

Implication

qx and

where

= (lO)^
+

qx

+ q2
+

<?2

are

<?2

1),

1 is

an

\342\226\241

by contrapositive.

of proofs

Examples

some simple proofsby

and odd

of even

concepts

We

b is

or

even

Then

to prove
\342\200\224\342\226\272
~p.
By DeMorgan's
are

we

familiar

b is

a and

integers

even, then

even.

be the proposition\"ab

Let p

even.\"
instead ~q

uses the

integers.

Example 1.7.6. If the productof two

eithera is

to illustrate

now

wish

first example

Our

contrapositive.

is

let q be \"a

and

even\"

\342\200\224\342\226\272
but

is even or b is
we prove

by contrapositive

qf

law, ~q is the statement\"a is odd and b


is odd.\" Therefore, a = 2m + 1 and b = 2rc + 1, where m and n are
+ 2m + 2rc + 1 = 2(2mn+ m + n)
+ 1 is
integers. But then, ab = 4mn
odd. Thus, the assumption ~q has led to the conclusion ~p, and the proof

is complete.

\342\226\241

If n is the product of two positive


b < n1/2.
\"a < n1/2\" and g2 the statement
statement
law ~(qx V g2) = (~<?i) A (~(?2). Thus,

1.7.7.

Example

then either a < n1/2


Let

<7X

the

be

by DeMorgan's
a > nin and

6>

that ab > nl,2nin

bea prime.

Thisis

would be

n1/2.

then

But

true

6,

if we

n1/2.\"

Then

of inequalities, we know
from properties
n is not the product of a and
\342\226\241

The following fact


proof. If n is an integer,then

since,

\"6 <

let us assumethat

6.

= ra.
Hence,

1.7.8.

Example

contrapositive

a and

integers

or

assume

a smallerfactor of n.

is also readily
its

smallest

verified

factor

otherwise, p would have

p >
a factor

by

1 must
that

\342\226\241

for
an
two facts go together to provide the foundation
of a given
to find the smallest prime divisor
positive integer n
a
assume
and hence determinewhether
that
or not n is itself a prime. We
list of all primes lessthan
or equal
to the square root of n is available.
The

above

algorithm

Algorithm 1.7.1. The

smallest

divisor

prime

Input: a positiveintegern.
Output:

The

smallest

prime

divisor of

n.

of n.

66

Chapter

1: Foundations

Method:

1. Consider the integer n.If n is even, 2 is the smallest prime divisor


of
n is odd, go to Step 2.
2. Find the largest integer s less than or equal to the squarerootofn.
P be the set of all primes lessthan
Let
or equal
to s. Go to Step 3.
in order, determine
if x is a divisorof n.If
3. For each x\302\243P considered
x is a divisor of n, then output
x. If no x G P is
the currently
considered
of n, output
n.
a divisor
n. If

For instance, 167is a primebecause


12isthe largest integer less than or
The
less than or equal to 12 are 2,
equal to the squarerootof167.
primes
3,5,7,11,and none of these are divisors of 167.

Examples of proofs

contradiction.

by

We

in the
prove

13

has

In a room of 13 people,2 or morepeoplehave


same month.

1.7.9.

Example
birthdays

this

people

proposition
and no pair

month. But then sinceeach

by assumingthat theroom

by contradiction

of people have

their

in the

birthdays

in some

is born

person

their

same

month, and sincewe

that no two people were born in the samemonth,


there
months represented as the birth
months
of the people in the
room. This conclusion
is in violation
of the well-known
fact that there are
12 months.
Thus, the proposition is true. \342\226\241
only
are

assuming

be 13

must

Example
randomly

of3

positioned

around

consecutively

Let us give

a proof

Let X{ represent
we are to prove:

either

.,10

are
Suppose that the 10 integers1,2,..
a circular wheel. Show that the sum of someset
numbers
is at least 17.
positioned

1.7.10.

by contradiction.

the integerpositionedat positioni on


Xx

X2 +

or

X2

+ X3

X3

X10+

(since the tenth and the first


circularwheel).

and

Xx

Then

17,

X2 >

second

wheel.

> 17,

X4 >

the

17

positions

are consecutive

on a

Section

of Proof

Methods

1.7

the contrary, we assume that the conclusion


of
DeMorgan's laws we assume the conjunction

of an

If, on

is

the

67

Implication

then

false,

by

following

statements:

4- X2

Xx

X2 +

since each

Moreover,

each of the above

But the
integers,
inequality

is <16

sum Xx

4- X2

which we
becomes

is a

this

Example

white, blue,

balls, 15white

Let

we can say more; namely,


than <17. Now taking the

X10)

^ (10)(16).
10

positive
last

the

3(55) < (10)(16)= 160.


\342\226\241

If 41 balls are chosenfrom


a collection
of red,
1.7.11.
garnet, and gold coloredballs,then there are at least 12 red
4 blue, 10 garnet, or 4 gold balls chosen.
balls,
balls

gold

> 15, X3

> 4, X4

the number

respectively,

represent,

Xi,X2,Xs,X4iX5

12, X2

fact,

rather

\342\200\242
\342\200\242
\342\200\242
4-

contradiction.

blue, garnet, and


>

17.

\342\200\242
\342\200\242
4- \342\200\242
4- X10 is just the sum of the first
can observe is equal to 55. Therefore,

165 =
Clearly,

X2

17,

<

X2

17,

we discoverthat

these inequalities,

all of

of

X4 <

X, is an integer,in

inequalities

3(XX

Xx

X10 4- Xx +

and

sum

X3

+ X3 <

>

of red, white,

chosen.
We are to prove
10, or X5 > 4. Suppose,on

that either

the

contrary,
\342\200\242
\342\200\242
4-

thatX1<ll,X2<14,X3<3,X4<9,andX5<3.ThenX14-X24-\342\200\242

other
hand, the sum Xx +
X5 < 11 4- 14 4- 3 4- 9 4- 3 = 40. But, on the
\342\200\242
\342\200\242
of balls
chosen. Thus,
4- X5 = 41, since this is thetotal number
X2 4- \342\200\242
a result,
as
the
we have arrived at the contradiction41 < 40 and,
conclusion is verified. \342\226\241

idea of proof can be usedto prove

the

principle.

Let mum2i..

objectsare put
objects,

The same

1.7.12.

Example
pigeonhole

or the

.,mn

be

into

n boxes,

positive

second box

contains at least mn

objects.

integers.

If

mx

4- m2

4-

\342\200\242
\342\200\242
\342\200\242
4-

mn

- n 4- 1

then either the first box containsat leastmx


or the nth box
contains at least m2 objects,...,

68

Chapter

1: Foundations
\"the ith box contains at least mt
\342\200\242
\342\200\242
the
statement
+ m2 4- \342\200\242
+ mn p represent
\"mx
objects,\"
n 4- 1 objects are put into n boxes.\" Then we are asked to prove:p \342\200\224*
\342\200\242
\342\200\242
\342\200\242
v Qn)- We do this by contradiction,that is, we assume
p
(Qi v 92 v
. . . V qn).
V
V
q2
and~(gx
A
~(qx V q2 V . . . V qn) = (~qx) A (~g2) A ...
ByDeMorgan'slaws,
A
A
A
A
Thus
we
are
Now
assumingp (~(?i)
(~g2)
(~qn).
-*</,
(~gj.
in other words, the
the ith box contains lessthan m, objects;
means
that
ith box containsat most mt - 1 objects. But since we are assumingthe
of all the statements
conjunction
~qh we are assumingthat the first box
1
I objects,
has at most mx \342\200\224
and the second box containsat most m2 \342\200\224
\342\200\224
and
1
nth
box
at
most
then
the
contains
But
mn
objects,...,
objects.
- 1)
\342\200\242
\342\200\242
all n boxes contain at most (mx - 1) + (m2 - 1) 4- \342\200\242
4- (mn
\342\200\242
\342\200\242
\342\200\242
Sincethis
last
number
is
to
+
+
+
n, we
m2
mn
objects.
equal mx
\342\200\242
\342\200\242
see that all n boxescontainat mostmx + m2 + \342\200\242
+ mn - n objects, and
in that
hence the statementp is contradicted
not all of the mx + m2 +
\342\200\242
\342\200\242
\342\200\242
been
distributed.
This contradiction
+ mn - n + 1 objects have
the
is
valid.
\342\226\241
proves
pigeonholeprinciple
Let

<7i

statement

the

represent
and let

is known by its name because we often


think
of the
principle
as
and
the
a
s
What
boxes
the
pigeons
pigeonholes.
principle says
objects
is that if we distribute
a large number of pigeonsinto a specifiednumber
ofholes,then we can be assured that some hole containsa certainnumber
This

of

or more.

pigeons

1.7.13

Example
the
contains

is

average
at least

If
Another form of the pigeonhole
principle.
some
then
pigeons per hole,
pigeonhole
and
some pigeonhole
contains at most A
pigeons

number of
A

pigeons.

the same as above. If n is the number


of
in
of
ith
number
the
then
we
hole,
pigeonholes
pigeons
prove
that either m1>Aorm2>A,...,ormn > A. (The proof that some m, < A is
The

is almost

proof

and m,

is the

similar.)

us assume the contrary, namely,


<
A.
But then the sum mx + m2 4mn
Let

of pigeons. This clearly


equals

the

total

number

is a

contradiction

of

the floor of

A)
A)

L9.7J = 9. In

since

mx

4- m2

4-

<

m2

= the

Ar

total

. .,and

number

\342\200\242
\342\200\242
\342\200\242
4- m\342\200\236also

is necessarily
an integer,
us use the notation (called
integerx > A and L A J (called
x < A. Thus, T9.71 = 10 and

a pigeonhole
integer.

Let

to mean the smallest


to mean the largest integer
this
second
the
terminology,
T A1

A and

mn < n

of pigeons.

Now the number of pigeonsin


A need
but the average
not be <an

the ceiling

mx <

that

\342\200\242
\342\200\242
\342\200\242
4-

version

of the

pigeonhole

Section

Methods

1.7

can be

principle

If

is

contains
LAJ

the

of an

of Proof

69

Implication

stated:
number

average

at least

f~Al

of pigeons
and

pigeons

per hole,then

some

some

pigeonhole

contains at most

pigeonhole

pigeons.

of the

Applications

principle.

pigeonhole

then some
1 pigeonsaredistributed
n
among
In general,if k is
then some hole containsat least3 pigeons.
pigeonholes,
n pigeonholes,
an integer and kn + 1 pigeonsaredistributed
then
among
This follows since the average
some hole containsat leastk + 1 pigeons.
number of pigeonsperhole is k + 1/rc and \\k 4- 1/rcl = k + 1.
2. In any group of 367 people there must be at leastonepair with the
1. If n

hole

same

are distributed
2 pigeons. If 2rc +

1 pigeons

least

at

contains

among n pigeonholes,

birthday.

4 different pairs of socksarescrambled


select 5 individual socksin orderto guarantee
Here the pairs determine4 pigeonholes
and
3. If

impliesa
4.

a matching

finding

5 individual

socks in 4 holes

pair.

matching

61 peopleat least6 peoplewere

group of

In a

one need only


pair.

a drawer,

in

born

in

the

same

month.

5. If 401letters
delivered
receivedat most8 letters.

to 50

were

6.

50

Suppose

that

student

column

students,

some

most

8 students,

result follows from

rectangular array of 5 rowsand


randomly in the chairs
of course). Then some row contains at least 9
at least 5 students, somerow contains
at
contains
in a

are arranged

chairs

10columns.Suppose
(one
chair,
per

41

students

are seated

and some columncontains


the

then some apartment

apartments,

pigeonhole

principle

at

4 students.
The
the average number

most

because

average number per columnis 4.1.


7. Supposethat a patient is given a prescription of 45 pills with the
instructions
to take at least one pill per day for 30 days. Then prove that
which the patient takes
there must be a periodofconsecutive
days
during

of studentsperrow

is 8.2

and the

a total of exactly 14pills.

Tosee

taken
let a, be the number of pills the patienthas
through
why,
of the ith day. Since the patient takes at least one pill per day and
\342\200\242
\342\200\242
< 45. Also,
at most 45 pills in 30 days, we have
1 < ax < a2 < \342\200\242
a30
\342\200\242
\342\200\242
<
< \342\200\242
<
14
14
14
to
of
each
these
4+
a2
adding
inequalitiesgives ax
<
=
14
14
45
59.
now
have
60
We
444a30
integers: aua2y.. .,a3o,Gi 14,
between
a2 4- 14,.. .,a30 4- 14. Moreover, these numbersall liein the range
1 and 59. Thus, we have 60 pigeons in 59 pigeonholes, so there must
be 2
of these numbers that are equal.Sincealfa2,..
are
all
and
different
.,a30

the end

70

Chapter 1:Foundations
14,.. .,a304- 14 are all different, it must be that one of au
to one of the integers ax + 14, a2 4- 14,.. .,a304- 14. In
=
i
other words, there are i and J suchthat
a,
a, + 14. Thus, betweendays
and y, the patient takes exactly 14pills.
8 distinct
8. If*i>*2v \342\200\242
integers, then there is somepair of these
'9xsare
with the same remainder when divided by 7.
integers
are
the
If each integer is divided by 7 and their remainders
recorded,
for these remainders are 0,1, 2, 4, 5, and 6. Thus, we
only possibilities
from 0 to 6.
7 possibilities
the
have 8 remaindersto bedistributedamong
In otherwords, it is like distributing 8 pigeons among 7 pigeonholes.We
there
are at least 2 pigeons in somehole or in this
conclude
that
which
are
tliere are at least 2 of the remainders
framework,
equal.
in yet another
Let us rephrase what we have
way. The division
proved
algorithm impliesthat the set of integers can be partitioned into 7
ax

14, a2 4-

a2,..

is

.,a30

equal

3,

disjoint subsets (called

congruence

classes)

which

we

[0L[1]>[2],[3],[4],[5],[6]. Moreover, an integer x is in [r]


remainder when x is dividedby 7.
in the above example, we have
8 integers
Therefore,
distributed among 7 congruence classesso that, by the
two of these integers must be in the same congruence
principle,

denote
iff

is

which

by
the

are

pigeonhole

class. By

must
have
the same
the definition of congruenceclass,these2 integers
remainder when divided by 7.
This latter
approach, while in fact the sameasthe former,nevertheless
a slightly
requires
deeper technical understanding becauseof the appeal
of congruence
to congruences.
The
class is useful in the next
concept

example.

9.

distinct integers, there must exist2 integersin


difference is divisible
by 10.
If we apply what we learned in (8) above,
we
see that
we need 6
pigeonholesfor which if 2 integers a and b are in the samepigeonhole,
we must conclude that either a 4- b or a - b is divisible
then
by 10.
Our first thought is to let pigeonholes
bethe sets [r] = {integers x such
that x has remainderr when divided
by 10}. This choice for pigeonholes
would
have
the feature
that if 2 integers a and b are in the same hole, then
their difference a - b is divisible
too
by 10. But we have
many
pigeonholes
using this choice for we have 10 pigeonholes
(congruence
of
classes) determined by r = 0,1,2,.. .,9L We need to reduce the number
holes and also incorporate the extra featureabout sums beingdivisible
by
10. We use the following ploy: group the 10congruence
classes
into
a
of 6 pigeonholes according to the following
scheme:
group
Now we have our 6
{[0]},{[1],[9]},{[2],[8]},{[3],[7]},{[4],[6]},{[5]}.
pigeonholes. Moreover,
since we have 7 integers, there is someoneoftheseholes
which
contains
at least 2 of these 7 integers.Say a and b are in the same
pigeonhole.If a and b are in [0] or [5], then both a 4- b and a - b are

this

Given

set

any

whose

set

of 7

sum or

Section

of Proof

Methods

1.7

by 10.

divisible

However,

{[2],[8]}

pigeonholes,

if

Examples of proofs

b are in some one of the other 4


then it may be that a and b are in [2], in
10, but their sum is not divisibleby 10. Or
in [8]. In this case, a + b is divisible
by 10
and

to recall

the definition

have

Before

cases.

by

need

71

Implication

for example,

which case a - bis divisible


by
it may be that a is [2] and b is
we
but their differenceis not. Nevertheless,
set out to prove.

we

of an

what

accomplished

the next example,

we give

of the absolutevalue

we

of a

real number.

If x

value of x, denoted by \\x\\9 is the


is a real number,then the absolute
number
x itself if x is nonnegative; but if x is negative,
then the absolute
value
of x is the number -x.
x

If a

1.7.14.

Example

real number x is suchthat

x | >

4, then x2

>

16.
At

first

this proof

may not

in the

definition

of

if x

> 4, then

glance,

are hidden

absolute

appear to requirecases,but the cases


value.
Note | x | > 4 meansx > 4 or

> 4.
\342\200\224x

Therefore,

(-*)(-*)

>42 = 16.

by

3, then

>

42 =

16. Likewise, if

If the integer a is such that


- 1 is divisible
by 3. a

1.7.15.

Example
divisible

x2

\342\200\224
x >

4, then

x2 =

\342\226\241

a2

1 or

a - 2 is

prove: If the integera is such that a - 1 is divisibleby 3, then


- 1 is divisible
m is an
where
3. In this case, since a - 1 = 3m,
by
- 1 = (a + l)(a - 1)- (a + l)(3m)
a2
is
divisible
it
followsthat
integer,
by 3 since m(a + 1) is an integer.
a - 2 is divisible by 3, then
we prove: If the,integer a is suchthat
Next,
a2
1 is divisible by 3. We
have
this in example
already
proved
1.7.2. \342\226\241
First, we

a2

An example
1.7.16.
of a proof by elimination
of
Suppose that we are to prove:If p isan odd prime, then p has the
form
6m + 1 or 6rc + 5 or p = 3.
6 into p, then we
we see that if we divide
the
division
By
algorithm,
have
6 possibilities
for remainders, namely, 0, 1, 2, 3, 4, or 5.
only
we conclude that either p = 6n, p = 6n + 1, p = 6n + 2, p =
Therefore,
=
6m
some of these casesmay
6m + 4, or p = 6rc + 5. Nevertheless,
+ 3, p
be eliminated
since p is an odd prime.The cases
p = 6n, 6m + 2, 6n + 4
can be eliminatedsincep is
case
and
the
p = 6n + 3 can be
=
=
eliminatedexceptfor the special case n 0 or p 3,for in all other cases
Example

cases.

odd,

p would be divisible
As
proof.

a final

example,

by

3 and

not prime.

\342\226\241

let us illustrate theuseofthemethodofconditional

72

Chapter

1: Foundations

(i) If a is a primeinteger,then

be, thena

(ii)

b or

divides

if a

divides

a divides

c. [p

of two integers

the product

\342\200\224*
\342\200\224\342\226\272
r V

s)]

(q

to:
By conditional proof (i) canbechanged
the product of two integers be,
If a is a prime integerand a divides
b or a divides c. [(p A q) \342\200\224\342\226\272
thena divides
(r V s)]
of cases (ii) can be
Not only is this so, but also by elimination

reducedto

(iii)

of conditional proof. Suppose

to prove:

are

we

An example

1.7.17.

Example
that

proving:

integer such that


a doesnot divide
and
integers be,
a prime

a is

If

~r)

divides

b, then

the product
of
a divides c. [(p A

two
q

\342\200\224*].

of the
used valid inference patterns to changethe form
But we have not proved
(i) to another equivalent form
(iii).
we have just reformulated the problem.We
(iii)
yet;
anticipate
anything
will be easier to prove since we can use the three premises, but
and details still have to be supplied in orderto
additional
facts
nevertheless,

we

Now

have

proposition

(iii).

prove

actually

complete the

proof of (iii)assuming

the
has in his arsenal
reader
common divisor of two integers
d and e,
dx + ey, wherex and y are
as a linear
combination
in Chapter 4.)
(This fact will be proved
integers.
this
extra
With
we prove (iii). Sincea is primeand a does not
weapon,
b is 1. Hence, there are
divide b, the greatest commondivisor
of a and
x and
integers
y such that 1 = ax + by. But then if we multiply this
equation by c, we have c = acx + bcy and clearly a divides acx since a is a
a divides
be since this is one of the premises
factor.Moreover,
of the
a divides acx and bcy, so a divides
their
sum\342\200\224or in
Thus,
proposition.
other
words, a divides c\342\200\224andthis is what we were to prove. \342\226\241

Let us

the fact that if 1 is


then 1 can be written

Exercises

for

the

greatest

1.7

Section

1. Use the division

casesto
(a)

prove

Every odd

and

algorithm
the

by cases

proof

or elimination of

following:

integer is eitherofthe form

(b) The squareof any

odd

integer

is of

4rc

+ 1

or 4rc

the form 8n

+ 3.

1.

Sn or 3rc + 1.
The square of any integer is eitherofthe form
of the form 9n, 9n + 1, or
is either
(d) The cubeof any integer

(c)

9m

+ 8.

(e) The
(f)

Any
Conclude

equation

x3

that

Illy3

= 5 has

no integer solutions.

0 is either of the form 6k, 6k + 1,.. .,6k


+ l)(2n + l)/6 is an integer.
n(n

n >

integer

+ 5.

Section

of Proof

Methods

1.7

(g)
(h)

Ifp = p\\

+ pi

4-

(i) Ifp isa prime> 3,


integer,

then

(j) If integer
case 64
with

2.

Give

prove

direct

x is

or In + 1.

for the

proofs

then one

1(c).

divisible by 3.
12& +

the form

p2 has

is simultaneously
= 82 = 43), verify

an

form In

use

73

Implication

are primes,

andp3

wherep,px,p2,

p2,

of themisthe prime3.Hint:
If x is an integer, then x3 -

of an

1, wherek is an

a square and a cube (as is the


that the integermust be of the

following: For

integers a, b, c, and

d,

that

a divides a.
(a) a divides 0; the integer1 divides
a; and
(b) a divides 1 iff a = 1 or a = -1.
If a divides
b and c dividesd, then ac divides
bd.
(c)
(d) a divides b and b divides a iff a = b or a = -b.
b and
b is not zero, then | a | < | b |.
(e) If a divides
a divides
bx + cy for
If a divides b and a divides c, then
(f)

arbitrary integersx and y.


be.
divides 6, then a divides
divides b and a dividesc, then

(h)

If a
If a

(i)

a divides b iff

(g)

ac

divides

be, where

6c.

a2 divides

c #

0.

3. Prove or disprove: if a divides (b + c),then a divides b or a divides c.


4. Prove for integers
a and 6:
If
a
6
a + 6 is even and ab is even.
and
are
then
(a)
even,
If
a
6
a
and
then
are
+ b is even and ab is odd.
(b)
odd,
If
a
b
is
is
evenand
(c)
odd, then a + 6 is odd and ab is even.
a
If
a2
is even.
is even, then
(d)
If
b
a
6
and
is odd
is even,
then a is odd.
+
(e)
If
a2
a
is odd,
then
is odd.
(f)
5. Prove for

an

integer

a,

(a) 2 divides (a)(a + 1), and


(b) 3 divides (a)(a + l)(a + 2).
If a is an odd integer, then
(c)

squareof

an

odd

integer

is of

24

divides

the form

a (a2

8n +

- 1). Hint:the

1.

odd integers,then 8 divides (a2 - b2).


6. (a) If the sum of 2 real numbersis lessthan 100, prove that one of
the numbersis lessthan 50.
that one of
(b) If the sum of 4 real numbersis lessthan
100,
prove
the numbersis lessthan 25.
If the sum of 11 real numbers
than 100, prove that
is greater
(c)
one of the numbers
is greater
than 9.
is less than r, where r is a real
(d) If the sum of n > 1real numbers
lessthan r/n.
numbersis
one
of
the
then
at
least
number,
If
than
is
the
sum
of
n
>
1
numbers
real
r, then at least
(e)
greater
(d)

If a

and b are

oneofthe

numbers

is greater

than

r/n.

74

Chapter 1:Foundations
7.

certain2-digitdecimal
thenthetens
of n is 1.

If the product of a
by contradiction:
n by 5 is a 2-digit number,

Prove
integer

8. (a) If

n are

and

mn > m
(b) If m and

each integers

> 2, prove

digit

that

contradiction

by

n.

n axe positive integers,give a direct proof that mn > n.


If a is an odd integer,then
9. (a) Prove by contrapositive:
there
are
- X - a.
no integral roots for the polynomial
/ (X) = X2
Prove
There do not exist 3 consecutive
(b)
by contradiction:
integerssuch that the cube of the largest is equaltothe sum of
the cubes of the 2 other integers.
If n has the form
4k
+ 3, where k is an
(c) Prove by contradiction:
x2 + y2 = n has no integral solutions
integer,thenthe equation
for

10. Use
(a)

x and

y.

the pigeonholeprincipleto prove


the
following:
distinct integers, then somepair of them have the
same remainder when divided by 9 and so their difference is
Given 10

divisibleby
(b)

Given

n +

9.

1 distinct integers,then

suchthat their difference

is divisible

pair of them
positive integer n.

is some

there

by the

then there must be at least 4 of


same remainder when divided
by 12.
(d) Among 13 different integral powers of the integer 5, there
must
be at least 2 of them that have
the
same
remainder
when
divided by 12.
61 different
(e) Among
integral
powers of the integer 5, thereare
at least
6 of them that have
the
same
when divided
remainder
by 12.
n + 1 different
(f) Among
integral powers of an integer a, there
2 of them that have
are
at least
the
same
remainder
when
divided by the positiveintegern.
a man hiked 6 miles the first
11.Suppose
that
hour
and 4 miles the
twelfth hour and hiked a total of 71 milesin 12 hours. Prove that
he must have hiked at least 12 miles within
a certain
period of two
consecutive hours. (Hint:prove
by contradiction.)
12. Suppose that the circumferenceof a circular
wheel is divided into
50 sectorsand that the numbers
1 and
50 are randomly assigned to

(c)

Given

them

37

integers,

positive

have the

that

these sectors.
(a)

Show

that

assigned

there

numbers

(b) Show that there


assigned numbers

are
is at

3 consecutive
least

are 5

sectors whose sum of

77.

consecutive

sectors

is at least 122.
13.Show that among n + 1 positive integers lessthan
there are 2 consecutiveintegers.

whose

or

equal

sum

of

to 2rc

Section

that for an

14. Show

contains only
M3

0 and

digits

- 555 ...

.Mn

555,..

arbitrary integeriV,

the

5\342\200\224the decimal

5-

is a

there

5. (Hint:
+

(5)10n

75

Implication

of N that

multiple

ConsiderMx
(5) Iff1\"1 +

has N

of MN

expansion

of an

of Proof

Methods

1.7

. .

5, M2 - 55,
. + 5 \342\200\242
10 +

5s. Then

the

apply

principle.)

pigeonhole

15. A typewriter is used for 102 hours over a period of


that
on some pair of consecutivedays,
the
typewriter

12 days.

Show

was used

for

at least 17hours.

16.

direct

Give

15y =

either x or y

17. If n is a positive

A positive

n.

proper divisors.Give
18. Give

integer

a prime.

a contradiction

number.(Hint:Use

square rootof2 isnot a rational


implies x is even, if x is an integer.)

that the

proof

is even

x2

19. Use a

if 0 < d < n
d is a proper divisor
n is perfect if n is the sum of its
of the following:A
argument

a contrapositive

is not

integer

perfect

5x

an integer.

is not

an integer

integer,

and d divides

are numbers such that

if x and y

that

proof

116, then

contradiction argumentto verify

the

valid

following

inferences:

(a)

(b) ~p

q-+t
s\342\200\224+r

qV

\342\200\224\342\200\224

(q

~w)

~s\342\200\224+q

~t

.*. w\342\200\224+s
20.

argument to

a contrapositive

Use

the

verify

valid

following

inference:
w\342\200\224+
(r\342\200\224+s)

.-. (w

21.

Use the

A r)

\342\200\224*
s

pigeon-hole principle to
is divisible
by n.

showthat one of

any

consecutive
integers

22. Use the pigeonhole

a rationalnumber

to show

principle
must,

after

23. The circumference


of two
sections each.Forthe outer
and

sections

concentric

disk,

that the decimal expansionof


point, become periodic.
disks

100 of

is divided

the sections

into 200

are painted

of the sections are painted white. Forthe inner


disk
are painted red or white in an arbitrary manner.Show
that
it is possible to align the two
disks
so that 100 or more of the
sectionson the inner disk have their colors matched with the
sections
on the outer disk.
corresponding

24.

red

the

some

Given

100

20

French,

and 17English

25 German, 20 Italian, 50 Russian,


30 Spanish,
how many books must be chosento

books,

guaran-

76

Chapter

1: Foundations

at least

tee that

(a) 10

one

of

books

language

(b) 6 French, 11 Spanish,

Englishwere chosen?

25.If

are

there

pairs of

different

104

were chosen?
4 Italian,
German,

party of 30 people,then

show

people who
some

that

know

person

20 Russian, or 8
each other at a
has 6 or fewer

acquaintances.

26.

Show

27.

any 52 integers, there exist two


given
is divisible
else whosedifference,
by 100.

that

sum, or

of

them

whose

From the integers 1,2,3,.. .,200,101


Show
that
integersarechosen.
the
chosen
there are two such that one of them is
integers
among

divisibleby

the

other.

has 37 days to preparefor an examination.


From past
will
no
more
knowsthat
she
she
than
60 hours
require
experience
of study. She alsowishes
at least 1 hour per day.
to study
Show
no matter how she schedulesher study
time
whole
that
number
(a
is a succession
of days during which
of hours per day),
there
she
will have studied exactly 13 hours.
29. Provethat in a group of n people there are two who have the same
number of acquaintancesin the group.
30.
Given
the information
that no human beinghas morethan 300,000
has
a population
on his head, and that the stateof Florida
of
hairs
in Florida
10,000,000, observe that there are at leasttwo persons
heads.
What is the largest
with the same number of hairson their
integer that canbeused for n in the following assertion? There are
in Florida
n
with the same number of hairs on their
persons
28.

A student

heads.

31.

are prime integers,


of prime integers.
Write
(b)
Twin
are primes a and b such that b - a + 2. Thus5
(a)
primes
and
7 are
twin primes. Find 4 other pairs of twin
primes.
twin
or not there are infinitely
Whether
is not
many
primes
known.
(b) Threeprimesa,b,csuch that a + 4 = b + 2\302\253c might be called
it is
triple primes. Find a set of triple primesand
prove
(a)

that

Prove

91001

32.*

421 and 2477


as a product

unique.

primes are primes and


a pair of adjacent
and
prove

(c) Adjacent

primes

(d)

primes

Quadruple

c + 2 - d.
Find
another

Thus,

set

are

primes

11,13,17,19

of quadruple

b such

that

that b - a + 1.Find
no other pair exists.

a,b>c,d where a + 8 =
a set of quadruple

are

primes.

6+6=
primes.

if the
number
(e) Show that in a set of quadrupleprimesa,b,c,d
in fact
a + 4 is a multipleof 15.
a + 4 is as largeas 15,then

Section

Methods

1.7

33.

(a) Give

the
that

Show

(b)

34.

a direct argumentthat
of

sum

reciprocals
28 and 496

if

of all

of Proof

n is

of an

77

Implication

a perfect

divisors of n is 2.

integer then the

and 8128are perfectintegers.

sum of 5 integersxl9x29x3yxA9x5
is 14, and if each 0 < x{< 3,
5
2.
that
the
and
proof
integers are 3,3,3,3,
give
If counters are placed on 14 squaresof a bingo
board (which
5 columns
of squares), then
consists of 5 parallel rows
and
row
or
2 adjacent
that
some
some
column
contains
prove
If the

(a)

a direct

(b)

squares with
35.

counters.

triple of

An ordered

positive integers(a,b,c)

called

is

the integers a and b can


+ b2 = c2. (Therefore,
the length of two sidesofa right triangleand c the length
represent
of the hypotenuse.) A primitive
is an ordered triple of
triple
\342\200\224
+ n2) where m and n are integersand
n2,m2
integers (2mn,m2
0 < n < m. Give a direct proof that any
is a
primitive
triple
iff a2

Pythagoreantriple

triple.

Pythagorean

36. Given

distributed among k pigeonholes:


necessary and sufficient conditionon n and k that, in
at least two pigeonholes must containthe
distribution,
to be

n pigeons

is a

What

(a)

every

same

of

number

pigeons?

Suppose that the pigeons are distributedso that


How many pigeonsmust we choose
nonempty.

(b)

sure that we have

box?Hint:
is, if

the

chosen
the

Use

pigeonhole

fewer

than

n pigeons

pigeonholes, then

some

pigeonhole

37. Let S be a

of

square

side

each

hole

is

to be

in order

contents of at least one


in reverse form; that
principle

entire

are distributed among n


is unoccupied.

length

1 unit.

Choose any

five

points

the interior of S. Let dti be the distance from P, to P;.


Demonstratethat for at least one pair of the points P, and P; where
i # ;, that dy < 1/V2. Is the statement true if 1/V2
is replaced
by a
.yP5 in

Pu..

smaller number?

38. Let
for

.,an

aua2>..

39. Let p be a
of

power

for

40.

(a)

be

n (not

pair of integers
\342\200\242
\342\200\242
\342\200\242
+ am is divisible
some

different

prime

p whose

- 1,2,..

necessarily distinct)
k and m where 1 < k
by n.

last two

integers. Showthat
<

m <

n, ak +

ak+i

from 2 or 5. Showthat there is some


decimal digits are 01.Hint:Consider
p*

.,100.

A be the set of all integers that can bewritten


Let
as a sum of
two squares of integers. Provethat if a and b are in A, then so

is ab.

(b) Prove that no integer of the form

Hint:Look
at

possible

squares

8n

modulo

+ 7

8.

is a

sum of 3 squares.

78

Chapter 1:Foundations
41.

If a

is an

k is a divisor

integer, let D(a)bethe


of a,

of all

set

is, where a

that

positive

integers k where

= kl, where/ is an integer.Then

if

divisors
integers D(a) D D(b)isthe setofall positive
common
to both a and b.
(a) Give a direct proof that if a or b is not zero,then D(a) f) D(b)
is bounded above by some integerM. That is, for each x G
D(a) p| D(b), x < M.
Then
(b) Supposethat a = bq 4- r, where a,6,g, and r areintegers.
=
a
direct
that
D(6) O D(r).
D(a) C\\ D(b)
proof
give
divisor
of a and b, where a
(c) Let us define the greatestcommon
and b are not both zero as the largest integerin D(a) C\\ D(b).
b
of a and
Prove then that the greatestcommondivisor
a
b
is
that
and
are
not
both
zero)
(where
unique positive

h are

a and

integerd

that

such

(i) d divides both a and bf and


d! divides
d.
then
(ii) if d' divides both a and
r
a
r
if
where
and
are integers and
Prove
that
+
(d)
bq
a,b,q>
6 # then the greatest
common
divisor of a and b is the same
as the greatest common divisorof b and r. (This is the basis for

6,

0,

Euclidean

the

for finding

algorithm

the greatest common

divisor.)

42. In

calendar

any

there

be.

can

Friday the thirteenths


possible?
integers is 74, prove that the sum of
is at least 30,and the sum of some set

how many
determine
year,
What
is the smallest number

43. If the
of 10 nonnegative
somesetof of these integers
of 5 of them is at least37.
sum

Selected

11. Let

Xi

1.7

Section

for

Answers

distance

hiked in the ith


xx
xx

implies

x2 4-

+
+

hour.

xl2 =

10

x2 +

\342\200\242
\342\200\242
\342\200\242
4-

x12

- 61.

\342\200\242
\342\200\242
\342\200\242
4-

xn

Xi

If

4- x2

< 12

x2 4- xz <

*n +

xl2

<

12

12.

- 71

Section

1.8

Order

First

and Other

Logic

79

Methods of Proof

Then their sum


+

\342\200\242
\342\200\242
\342\200\242
+

< 12

2(x2 +

\342\200\242
\342\200\242
\342\200\242
4-

< 122

+ 2(x2

+ *i2

*i

*n)
xn)

\342\200\242
11 =

122 < 122.Contradiction.


We actually
prove a stronger result. Let x, =
the typewriter is usedon day i. Suppose

132

which implies
15.

4- x4

Then 102

xx

4\"

17
1/

X\\2 <

xl2 <

\342\200\242
\342\200\242
\342\200\242
4-

4- x2 4-

of hours

< 17

x5 4- x6 <

X\\\\

number

17,and

xx + x2 <
x3

the

\342\200\242
17 =

102. This

contradiction

shows that either


\\xx
jc3

4- x2
4-

> 17

xA > 17

23. Let's hold the outerdisk fixed

the 200possible
alignments.

number

and
For

or
or

inner disk through


let us count the
alignment,

rotate

each

the

The
sum of the counts for the 200 possible
be
must
becauseeachof the 200 sections on the
20,000,
alignments
inner disk will match its corresponding
section on the outer diskin
100
of
we
have
the
to
Thus,
20,000
exactly
alignments.
pigeons
in
200
holes.
the
We
conclude
that
hole
must
have
at
some
place
matches.

of

least 100pigeons.

25.If

each

has

person

l/2(7)(30) 105
=

1.8

FIRST

To

this
down

simple

discover

more acquaintances,

there are at least

LOGIC AND OTHER METHODSOFPROOF

ORDER

them

7 or

pairs.

point we have analyzed sentences and


into constituent
simple propositions

blocks.

By this

something of what makesa valid

argument.

propositions

as

building

arguments,
and regardingthese
breaking

means we

were

Nevertheless,

to
there

able

80

Chapter 1: Foundations
are
let

are not susceptible to


the following argument:

that

arguments
us consider
All

are

mathematicians

Joe is

would

we try to
get

an

rational.

a mathematician.

Therefore,Joeis
We

sucha treatment.Forexample,

rational.

symbolize the form

argument

of the

this argument

regard

intuitively

the

of

argument

as a valid
as we

form:

if

but

argument,

have been doing,we

P
Q

.-.

to what

According

we have

learned

far, this

thus

is not a valid

form.

But,

in

case, not

fact,

the

upon the

of the

and
parts of the sentences

short,

upon

the

is valid

argument
form

upon

of the

content

and the

but
argument,
the form of

argument
this

in

depends,

validity

upon relationships between


the sentences themselves;in

sentences.

First-order logicis that part of logicwhich

and G

represents

In case

as the

of

content

the

emphasizes

the sentences involved


form
arguments.
arguments
From a purely grammatical point of view,
declarative
sentences
simple
must involve a subject and a predicate,eachof which
of a
consist
may
single word, a short phrase,ora whole clause. Putting it very roughly, the
subjectisthe thing about which the sentence is making an assertion,and
the predicaterefers to a \"property\" that the subject has.
From a mathematicalpoint of view, it is convenient to represent
to
predicatesby capital letters and subjects by small letters and thereby
as
to
a
in
reflect
sentences
such
a
symbolize
way
subject-predicate
is a state\"
could be
relationship. For example,the sentence\"Florida
S
Florida
and
as
where
symbolized
/ represents
represents the
S(f)
the
could
\"is
a
state.\"
be used to
Likewise,
symbols M(j)
predicate
a
mathematician.\"
t
he
sentence
\"Joe
is
Moreover, the
represent
sentences
\"Joe
is a gossip,\" \"Joe gossips,\"and \"Joeis gossipy\"
all have
the
same meaning and can be symbolized
as G(j),
where j represents \"Joe\"
as well

in

of

\"is gossipy.\"

our predicate is a negationwe

sentence\"Thenumberwhose

square

have

is

-1

For instance, in

a choice.

is not

the predicate \"is not real\" and let i


represent
whose
could
square is -1,\" and then the sentence
On the other hand, we could
let R represent
sentence can be symbolized
as ~R (i).

real,\"

represent

\"the

be
\"is

symbolized
and

real\"

let

could

we

the
S

number

as S(i).
then

the

Section 1.8

Order

First

It should be clearthat compound


all
symbolsjust by symbolizing
But we still need something

1. In all

cases, if

rational.

2.

\"a

Always

be translated into
sentences.
simple
more than subject-predicate analysis to
mathematicians
are rational.\" We might,

is a

person

in

the

form

\342\200\224\342\226\2

q.

then that person is

mathematician,

mathematician\"

is a

person

can also

sentences

the constituent

sentencesof this type

to write

attempt
example,
could say:

We

\"All

like

sentences

symbolize

for

81

Methods of Proof

and Other

Logic

implies

\"that

is

person

rational.\"

glance, we may

At first
p

\342\200\224*>

q.

However,

the phrase

all

\"in

are two

cases\"

indicates

the p

Second,

implication.

and q

a mathematician\"

is

and q

themselves

not

could

here

of proposition,

definition

to our

propositions according

statements
are not unlike the form
or
differences. First, the word \"always\"
an
that more is beingassertedthan
just

these

think

there

\"that

determine whether it is true or false that an unspecified


mathematician, baker, or candlestickmaker? Likewise
determine whether or not that unspecifiedpersonis rational?
If

we

the sentence
then, we

write

\"a

is

person

be
be

\"a

person

can we
is a
person

How

rational.\"

is

person

p would

for

a mathematician\"

we

can

how

as

\"x

is

realize that x is an unspecified variable.


Moreover,this sentenceis such that once the variable is specified the
For
\"Carl F. Gauss is a
sentence becomesa proposition.
example,
mathematician,\"

is a true proposition.
mathematician\"
We

course, we

can

have

\"x

is

shows.

definition

following

sentence

the

to

refer

Of
example of an open propositionin one variable.
of more than one variable as the
open
propositions

as an

mathematician\"

Definition
1.8.1. An open
variables from a set Uis a function

(or

proposition
f:Un

\342\200\224+

{T,F},

in n
predicate)
Un denotes the

where

Cartesian product ofn copiesofthe set U and T and F respectively stand


and
true
false. The set U is calledthe universe of discourse
for short)
of the open proposition /.
(universe,

for

Thus,

generally

speaking,

an open

proposition

is a declarativesentence

which

1.

contains

one or

more variables,

2. is not a proposition(exceptin

singletonset),

the

trivial

case

when the

set U is a

and

3.

produces
specific

a proposition
element

when each of

from the

set U.

its variablesis replacedby

82

Chapter

1: Foundations

Some

1.

examples

of open

rational

number.

is a

2. y >

5.

3. x +

5.

climbed Mount

4. x

propositionsare:

5. Heis

Everest.

lawyer

a computer

she is

and

scientist.

not specified
We
have
the universe of discoursein any of the above but
in (1), (2),
for the universe
we would presumablychoosesetsofnumbers
assertions
such as \"Joe > 5.\"
and (3)to avoid meaningless
of sentences, let us introduce
Just as in our subject-predicate
analysis
that open propositions are functions
of
functional
notation
to emphasize
and
that
we
when
values
to
the
variables
we
variables,
assign specific
of function
obtain \"values\" of this function, the latter \"values\"
being
that
are
or
W
e
either
true
false.
the following
might
adopt
propositions
notation for the indicatedpropositions:

number.

a rational

x is

R(x):

G(y): y>5.

S(x,y): x +y

x climbed

E(x):

5.

Mount Everest.

L(x): x is a lawyer.
y is

C(y):

a computer

scientist.

is true, G(4) is false, and G(7)is


(3/4)
while
S
Likewise,
S(2,3)
(4,3) is false.
combined
with
connectives
propositions
Open
logical
just as
are.
For
\
"x
the
sentence
is
a
rational
or y is
number
example,
propositions
V
than
5\"
can
be
as
Likewise
the
sentence
R(x)
symbolized
greater
G(y).
\"If x is a rational number,then
x is greater
than 5\" can be symbolized
as

Then we

see

that

true.

R( V2)

is false, R

is true,
can be

G(x).

R(x)-+

But still we

sentences
roleof word
like

the

not

have
\"all

been

able to

\"all\"

in these

completely analyze the contentof


Let us now discussthe

are rational.\"

mathematicians

sentences.

Certain declarative sentencesinvolve


indicate
words
that
quantity
such as all, some,none or one. These words help determine the answerto
\"How
the question
Since such words indicate quantity they are
many?\".

called

quantifiers.

Consider

the

following

statements:

1. All isosceles
are equiangular.
triangles
2. Some parallelogramsare squares.
3. There are some real numbers that are not

rational numbers.

Section

Order Logic

First

1.8

83

of Proof

Methods

Other

and

4. Not all prime integersareodd.

5.

cannot

birds

Some

6. Not

are

All smokers

7.

9. Each
Not

with

flirting

is one and only

8. There

10.

fly.

all vegetariansare healthy


one

persons.

danger.
even prime

integer.

rectangleis a parallelogram.
angle

every

trisected by ruler

can be

and compass.

we realize that there are two main


all
thought,
quantifiers:
where someis interpretedto meanat leastone.For example,
(1) uses \"all\"; (2) can be restated as \"thereis at leastone
parallelogram
that
is a square\"; (4) meansthat thereisat leastone prime
that is
integer
not odd, and (10)can be restated
to say \"there
is at least one anglethat
cannot
be trisected
by ruler and compass.\"
The quantifier
\"all\"
is called the universal
quantifier, and we shall
it by Vx, which is an inverted A followed
denote
x. It
by the variable
of
each
the
since
all
have
represents
following
phrases,
they
essentially
some

After

and some,

same

the

meaning.

For all x,
For every x,
For each x,

All

such that
such that

x are

x is

Every

Eachx is

that

such

\"some\" is the existential


it by 3 x, which is a reversedE followed

The

quantifier

denote

the following

by

x. It

we

and

represents

shall

each of

phrases:

that

an x such

exists

There

quantifier,

There is an x suchthat....
x

some

For

There
Some

is at
x is

that....

such

For a given

discourse,F(x) is
least one x the
symbol

x is

we

even
had

prime\"
already

or

true,\"

universe

read \"there

only one x suchthat.\"


one

(like, for

\"Vx, F(x)\" meaning

in

3!

F(x)

proposition

open

write

can

we
mathematician)

least onex suchthat....

For

can be

write
of discourse

we can

prime integer,\" then the

cryptically:3! x,P(jc).

each

3 x,

F(x)\"

3!

P(x) as
above

the universe

meaning

of

\"there is at

F(x) is true.\"The

\"there
is one and
sentence \"there is one and only
[x is an even prime].\"Moreover,if
or

the

example,
\"

x in

such that

is a unique x suchthat\"

written

designated

\"

example, x is a

\"for

x,

the openproposition\"x

sentence

could

be written

is

an

even

even more

1:

Foundations

then

Now

denotes the

if M(x)

R(x) denotes

the sentence\"x
are

mathematicians

is

sentence \"x

as \"For all x, if

rational\"

is rational\" and then symbolically

as

is

we can

rational\"

For

x is

all x,

a mathematician\"

write the

and

sentence \"All

a mathematician,

then x

M(x)

as Vx,

\342\200\224\342\226\272
or

R(x),

[M(x)-fl(x)].

\"some parallelograms are squares\"would


of the sentence
least one parallelogramthat is a square\"or \"thereis at
x is a
leastone object x in the universe such that x is a parallelogram
and
now
be represented
as 3x, [P(x) A S(x)],
square.\" The sentence may
where
and \"x is a square,\"
P(x) and S(x) mean \"x is a parallelogram\"
A

be

rephrasing

is at

\"there

respectively.

In translating sentences with


into
we find a
quantifiers
symbols
is very
common, but not universal, pattern. The universal
quantifier
often followed by an implication becausea universal
is most
statement
often of the form
it also has
any x, if it has property A, then
\"given
on the
other hand, is very often
property B.\" The existentialquantifier,
followed
because an existentialstatementismostoften
by a conjunction,
A that also satisfies property
of the form \"there exists an x with
property
J3.\"

Still
sentences,

1.

when
speaking
generally,
we should
pay attention

the subject,

2. the

predicate,

3.

the

4.

the quality,

quantifiers,

and

5. the universeof
By

we are considering the content of


to at least five elements:

the

we mean that we

quality

satisfiesthe

discourse.

property

determine whether or not the subject

in the predicate.
is P [predicate]\" the
S is not P\" the quality

described

For example, in a

quality is affirmative
is negative.
The universe
a
role
when
plays
significant
analyzing sentences.In fact,
P
P is defined as the subset
for a given
set
the
truth
of
open proposition
of the
universe
of
x
such
that
all
P(x) is true. Then to say that
consisting
the quantified statement \"Vjc, P(x)\"
is true is the same as assertingthat
the
truth
set of P is equal to the entireuniverse.
The
statement
\"3x,
if
is
true
for
the
truth
set
is
The
P(x)\"
\"Vx,
sentence, example,
nonempty.
x > 2\" is true if, in fact, the universe consistsof numbersall greaterthan
this sentence is false if there
is some object in the universe that is
2, but
not greaterthan 2. Thus, if the universe includes the number 0, then the
\"
The sentence
(x > 2)\" is true
sentence,
3x,
\"Vx, x > 2\" is false. Likewise
if the
sentence
universe
but
the
isfalse if the
the
number
includes,
5,
say,
universe
consists of, say, only negative integers.

sentencelike \"all
whereas

in the

[subject]

sentence

\"all

Section

Order Logic

First

1.8

then from these


propositionsoncethe variables
We see

are

Of course,thereisthe possibility

never true for

of x in

value

any

such that F(x) istrue.\"Later,we


in greater detail.
Of

modifier

the

using

course,

form eight different

exist

[~F(x)]

open proposition
the

use

F(x) is
symbol

universe
of
negation
quantifiers
of x in the

values
the

discuss

will

universe.

and then we

any

- and the quantifiers

3, we

and

can

proposition F(x).
each x in the universe, F(x) is
the open

involving
\"for
means

expressions

For example,Vx,

a given

the universe

to mean \"theredo not

\"~[ 3x9F(x)]\"

the truth

but

upon the

that

propositions become
value of the

open

quantified

heavily

depends

proposition

quantified

that

examples

85

of Proof

Methods

Other

and

form \"all false.\"


Likewise
or in abbreviated
~~[Vx9F(x)] means \"it is
is true\" that is, this says that
not
that for each x> F(x)
always
or in abbreviated
form \"not all true.\" Similarly,
true
~~{3x,[-F(jc)]}
us
list these
means
\"none false\" while ~{3x,F(x)} means\"none
false\"

F(x) is

false

true\".Let

quantified

eight

and their abbreviatedmeaningin

statements

the

list:
following

Abbreviated

Sentence

Vx,F(x)
~[3x,F(x)]

at least one
none true

Vx,[~F(x)]

all

3x,[~F(x)]

at least

~~{3x,[~F(x)]}

none

~{Vx,[F(x)]}

not

all

true

~{Vx,[~F(x)]}

not

all

false

\"all

false\"

\"not

all

\"not

all false\" meansthe sameas

the

means

means

two

have

the

same

one

least

\"at

eight expressionscan be grouped

where the

one false

false

as \"none false,\"
same as \"none true,\"
the same as \"at least one

true\"

Thus, the

false

the same

means

\"all

true\"

true

we concludethat

some thought

after

Now

true

all

3x,F(x)

Meaning

meaning.

into

false,\"

and

true.\"
four

We list

of two each,

groups

these

four

types

equivalences:
\"all

true\"

\"all

false\"

\"not

all

\"not all

* {~[3jc,

{Vx,F(jc)}
{Vx,[~F(x)]}
true\"

false\"

{~[Vx,

~F{x)]}

- {~[3x,F(x)]}

F(x)]} =

{3x,[~F(x)]j

= {3x,
{~[Vx,{~F(x)}]}

F(x)}

\"nonefalse\"
\"nonetrue\"
\"at

least

\"at

least

false\"
one true\"

one

as

86

Chapter 1:Foundations
information about the negationof this
the first statement we have Vx, F(x), its
and is equivalent to
negation ~[Vx, F(x)] occursin the third statement
of \"all true\"
is \"at least one false.\"The
3x,[~F(x)]. Thus,the negation
is \"all false\" and its negation is the fourth
secondstatement
statement
The

also provide
In
statement.

equivalences
of quantified

type

to \"at least
is equivalent
We list these facts as follows:

true.\"

one

which

Statement

\"all

true\"

\"at

least

Negation

one false\"

\"all false\"
one true\"

least

\"at

\"at least

Vx,F(x)

3x,[~F(x)]

3x,[~F(x)]
Vx,[~F(x)]
3x,F(x)

Vx,F(x)
3x,F(x)
Vx,[~F(x)]

\"all

true\"

\"at

least

\"all

false\"

one false\"
one true\"

that to form the negation of a statement


one
involving
we
need
the
universal
to
only
change
quantifier
from
quantifier
existential
to universal, and negate the statementwhich
it
existential,or from
see

We

quantifies.

Revisited

Laws

DeMorgan's

Let us recordthe following


observations:
V
the
universal
quantified by
quantifier

F(x)
open proposition
just the conjunction of
\"
3 x, F(x)\"
the sentence
is just the
Likewise,
many
propositions.
\"
disjunctionof many
In
other
and
F(x)\"
\"Vx,
words,
propositions.
3x, F(x)\" are
the
the
of
all
the
a
nd,
just
conjunction respectively,
disjunction
propositionsF(x)
x runs through all the elementsofthe universe.
where
if the universe consists of only a, 6,c,and d, then Vx, F(x)
For
instance,
means the sameas F(a) A F(b) A F(c) A F(d).
In the light of thesecomments,
we
conclude
that the rule for negating a

quantified open propositionis nothing

DeMorgan'slaws.Again,
F(a)

A F(b)

F(b)

A F(c)

same

F(b)

as
V

3x, ~F(x).
F(c)

a glorified version of
than
- {a,b,c,d},then Vx, F(x) and, therefore, ~[Vx,F(x)] = ~[F(a) A
more

universe

the

A F(d),

F(c)

A F(d)].

same as hF(a)]

if

An

is really

But, by DeMorgan'slaw,

[~F(b)]

[~F(c)]

Likewise, if U

this

V [~F(d)l,

= {a,6,c,d},
then

last

expression

3x,

F(x)

= F(a)

VF(d),sothat

~[3x,F(x)]

= ~[F(a)

- [~F(a)] A
=

Vx,

[~F(b)]

(where

[~F(x)]

obtained

V F(c)

F(b)

from

V F(d)]

A [~F(c)]

the third

DeMorgan's

is the

which, in turn, is the,

A [~F(d)]

expression is
law).

Section

1.8

Order

First

and Other

Logic

87

Methods of Proof

there are four main types of statementsinvolving


a
and
namely Vx, F(x), 3x, F(x)9Vx,[~F(x)],
quantifier;
single
3x,[~F(x)].
The following
chart shows when eachmain type of quantified
proposition
is true and when it is false.For example,
the
third
entry of the three
columnsgives the following information
about the sentence Vx,[~F(jc)];
if
is
true
for
all
is
the sentence
c, F(c) is false,but the sentence
Vx,[~F(x)]
if for at least one c, F(c) is true.
false
in the universe of the quantified
an object
Let c represent
have

We

that

seen

proposition.

The

Is True

Statement

Vx,F(x)

if for

all c,

for

if

Is

3x,F(x)

one c,

at least

for

if

if for

all c,

for

if

if

From this

at least

for

if

one c,

if

F(c) is false.

chart we

more

observe

all c,

for

at least

one c,

F(c) is true.

F(c) is false.

3x,[~F(x)]

one c,

false.

F(c) is false.

F(c) is true.
Vx,[~F(x)]

at least

F(c)is

F(c) is true.

False

for

all c,

F(c) is true.
techniques:

proof

by example. To show 3x9 F(x) is true, it is sufficient to


showF(c) is true for some c in the universe. This type is the only
situation where an exampleproves anything.

1. Proof

2.

Proof

by

exhaustion.

of the

statement

form Vx, [*~F(x)]9that

false) or, equivalently, that there are no


will
have
been proven
is true (nonetrue)
have been examined and none
after all the objectsin the universe

F(x) is false for

which F(x)

x for

values

with

found

3. Proof
sufficient

x (all

all

F(x).

property

by counterexample.
to

a specific

exhibit

F(c) is false.This

one

assertion Vx,

statement

Vx,

Proof

of assertions

existence
proofs
nonconstructive.
and

In

F(x).

value

actual

To

is false, it is
that
Vx, F(x)
in
that
c
the
universesuch
example
to the
c is called a counterexample
fact, a counterexample disproves the
show

F(x).

of the
proofs
Constructive

form

3x,

are

are referred

F(x)

classified
proofs

as either

actually

to as existence
constructive or

exhibit

a value

for

88

Chapter

1: Foundations
rather
is true or sometimes,

which F(c)

specifies a process(algorithm)for
A

existence

nonconstructive

without

most

proof

assumption that ~{3x9


of

some

previous

For example,

and

yu

of

root. Thus, the proofof


x2f...9xn

where the x/s aredistinct.

real numbers,

specified

construct

to

points. Suppose xu

at specified

values

specific

shows how

formula

interpolation
with

\342\200\242
->yn are

y2>-

the

polynomial

P(X)

this real

with
any polynomial
root. But the proof

is nonconstructive.

theorem

Lagrange's
polynomial
Then

a real

have

to find

how

say

that

asserts

must

odd degree

this theoremdoesnot
this

an absurdity or the negation

result.

there is a theoremthat
and

coefficients

real

that the

it shows

contradiction;

leads to

is true

F(x)}

proof

a value.

the assertion 3x, F(x)


such that F(c) is true.Such a

a value c

involves a proof by

commonly

c, the

exhibiting

such

establishes

proof

to find

how

indicating

than

obtaining

(X \" Xj)

]T [il
l<i<n L

X2)(X - x2)(xx -

(X
'

(xl

%i

i*j

- Xl)(X -*,)...
(X
xn)
y2
*
\342\200\242
\342\200\242
(X2
*i)(*2 *3>
(*2
Xn)
- Xl)(X - x2) . \342\226\240
\342\226\240
(X
(X

\342\226\240
\342\226\240
\342\200\242

(X

X3)

Xn)

- xn)

\342\200\242
\342\200\242
\342\200\242

(x,

x3)

(X

\342\200\224

(Xn

*\342\200\236_,)

\342\200\224 \342\200\242
\342\200\224
\342\200\242
\342\200\242

Xi)(Xn

X2)

(Xn

Xn_i)

polynomial such that P(x,) = y; for each


For example, suppose xl = 1,x2 - 3, x3 = 4 and yx

is the

unique

i.
= 5,

y2 =

-6,

y3

= 2.

Then,

wv.
PW

\"

- 4) (5) +
1)(X - 3)

- 3)(1

(1

(X - 1)(X - 4) / e^
- 1)(3 - 4) (-6)
(3

(X-3KX-4)
-

(X

(4 - 1)(4-

(X2

- IX

3)

+ 12)fel + (X2

5X +

4)(3)

\302\251

(X2

- 4X

+ 3)
\302\251

is a polynomial
we know

such

Lagrange's

polynomial that
construction.

that

P(J)

==

interpolation

5, P(3)

-6, and

P(4) - 2.Thus,

formula we can show

attains specificvalues

at

specified

the

points

existence

by

once

of a

Section

First Order

1.8

Logic and

make a proof
following proposition:
To show how to

Thereare

P(X) = 2X8

To

this

prove

some

need

we

by exhaustion
that
theorem

X1 +

enable

the

consider all rational numbers,


consider only a finite
set
of

us to

is

theorem.

roots

rational

the

If P(X) - a0 + a}X + . . . + anXn


integer coefficients, then any rational
a and b are integers
where
form
alb
b divides

we consider

to the polynomial
8X4 + X2 - 5.

we cannot
will

This is provided by

numbers.

rational

89

of Proof

Methods

exhaustion,

by

roots

rational

no

Other

root

polynomial
of P(X)

with

has the

such that a divides

a0 and

an.

as universe for the above


Thus, this theorem enablesus to consider
we can determine
that
Since
propositionthe set U = {\302\261l,\302\2615,\302\261l/2,\302\2615/2}.
P(c) # 0 for each c in 17, we have proved the propositionby exhaustion.

of a proof by counterexample. Letn be a positive


and
define
of partitions
of n; that is, the
integer
p(n) to be the number
n
number of different
to
write
as
a
sum
of
ways
positive
integers,
order. Since 5 can be written
as
disregarding
An

1 +

example

1 + 1+

1 +

we have

= 7.

p(5)

+ 1

1,2

In fact, it
- 1,

p(l)

+ 1,2 +

+ 1

2 +

1, 3

p(2) =

2, p(3) -

this

the

However,
Thus,

the

conjecture,
credence

adds

conjecture

we
to

that
has been

calculation

2, 4

3,p(4)- 5,

p(5)

positive

prime integer.

To test
p(6) = 11

+ 1,
+ 1,

and 5,

n,p(n)

is a

is easy to establishthat

Foreach
to prove the conjecture:

and attempt

+ 1

calculate
p(6)
the conjecture,

7,

integer

and the observationthat


(but does not prove it!).

p(7) = 15 provides a counterexample.


proved to be false by counterexample.

with
So far we have considered
multiple
quantifiers.
existential
those
in
which
universal
and
sentences
the
only
quantifiers
in
occur
which
the quantifiers
shall
cases
now consider
appear singly. We
in
in combinations. These combinationsbecomeparticularly
important
the
For
the case of sentences involving
one
variable.
than
more
example,
can
be
fact
that
the
of two real numbers is a real number
product
Sentences

written:

(Vx) (Vy)

[x G

A y

G R

\342\200\224

xy

G R].

90

Chapter 1:Foundations
In

is any predicate involving

if P(x,y)

general,

y, then the following

(Vy) P

(Vx)

If

always works

P (x,y)

(3y)

(3x)

(Vy)(Vx)P(x,y)

(3y)(Vx)P(x,y)

(Vy)(3x)P(x,y)

(3y)(3x)P(x,y)

left

from

the universal

both

be careful

must

(Vx) (3y) P (x,y)

(x,y)

(3x)(Vy)P(x,y)

involves

sentence

quantifiers, one

x and

variables

two

the

exist:

possibilities

and the existential

about the

order in which

they

to

For instance,

of the

right.)

are

written.

(One

sentences

two

real numbers:

concerning

(Vx) (3y) [x

+y

( 3y)

5],

(Vx) [x

+ y = 5],

sentence
while the second is false. The first
first
is true,
says that if x
is any real number,then there exists a real number y such that the sum of
that every
sentence
5 - x. The second
x and y is 5. Of course,y is just
says
5 - y, where y is somefixed
real number x is equal to the samenumber,
sentence says, in effect, that all real
second
the
real number.
Thus,

the

numbers are equal.


are

There

logical

between

relationships

same predicate

if the

is

relationshipsin the following

sentences

each

in

involved

\342\200\242'

(Vx)(3y)

i^

quantifiers

We depict

these

diagram:

(Vy)(Vx)

(Vx)(Vy)

(3y)(Vx)

two

with

sentence.

^(3x)(Vy)

^i(Vy)(3x)
\342\226\240\342\231\246\342\226\272\342\200\242

(3*)(3y)

Oy)(3x)

Figure 1-5. Graphical representationof


two

What

this diagram

(Vy) P (x,y) and


(Vy)

among

relationships

sentences

involving

quantifiers.

(x,y)

(Vy)

logically

tells us, for


(Vx)

(x,y)

implies (3y)

above relationshipsin the following

example,

(Vx) P
list:

the sentences (Vx)


equivalent while (Vx)

is that

are logically
(x,y).

Let

us

restate

all the

Section

First Order Logicand

1.8

(x,y) ~ (Vy)
(x,y) \342\200\224
(3y)
\342\200\224
(x,y) (3 x)

(Vx) (Vy) P
(Vx) (Vy) P
(Vy) (Vx) P

(Vx)
(3y) (Vx) P (x,y) \342\200\224
(3x) (Vy) P (x,y) \342\200\224
(Vy)

Methods

Other

91

of Proof

P (x,y)

(Vx)

P (x,y)
(Vy) P (x,y)
(Vx)

(3y)

P (x,y)

(3x)

P (x,y)

(Vx)(3y)P(x,y)-*(3y)(3x)P(x,y_)

(Vy)(3x)P(x,y)-(3x)(3y)P(x,y)

(3y)(3x)P(x,y)~(3x)(3y)P(x,y)

The

of

negation

sentence

any

involving

by systematically

accomplished

one quantifier. Let us

with only

applying the rulefor


illustrate.

prove by contradictiona sentencethat

you must show that


false sentence such as r A
as follows:
negation

Thus,

-r.

F =

Letting

\302\253

negating

asked to

H(x,y)].
sentence

(F-

some

implies

F(x,y), etc., we

[~(3y)

(3x)

be

can

a sentence

Suppose
your were
the following
form:

the negationof this

VH)]

~[(Vx)(3y)(F-G

has

[P(x,y) -* G(x,y)

(Vx) (3y)

one quantifier

more than

GV

find

the

H)]

-(3x)(Vy)[~(F-GvlrY)]

= (3x)(Vy)[FA~(GV#)]

Therefore,

the

with

of

work

= (3x)(Vy)[FA(~G)A(~if)]
of a few tautologies and rulesof logic,the
sentence becomes almost mechanical.

knowledge

a complicated

negating

Exercises for Section1.8

1.

All

the

can

birds

following
and

variables,

quantifiers,

(a)

of

each

Translate

statements

predicate

into symbols, using

symbols.

fly.

Not all birds canfly.


are illogical.

(b)

All babies

(c)

(d) Somebabiesare illogical.


If x is a man, then x is a giant.
(e)
(

Some

f)

men

are giants.

(g) Somemenarenot
All men

(h)

giants.

are giants.

(i) No men are giants.

(j

There

is a

student

who likes mathematicsbut not history.

Foundations

(k)

x is

an odd

(1)

For

all

(m)

For

each

integer and x is prime.


xf x is odd and x is prime.

integers

integer

(n) Thereis an

(o)

Not

(q)

Some numbers

(s)

Not every

(u)

x is

actor

every

(p) Somenumbers

(r) Notall

(t) If
2.

Let

x is

xy

integer

odd and x

is prime.

that x is odd and x is prime.


is talented who is famous.
x such

rational.

are

are not rational.


rational.

are

numbers

graph is planar.

students
are lazy, then all students
rational implies that x is real.
universe
consist of all integers and let

some

the

P(x):

Q(x):

x is

is a

are lazy.

prime,

positive,

E(x): x is even,

N(x): x is

3.

divisible

by

9,

a perfect square,and
is greater than 2.

S(x):

x is

G(x):

in symbolic
form.
Then expresseachofthe following
x
x
is
even
or
is
a
(a)
perfectsquare.
x is a prime and x is divisibleby 9.
(b)
2.
(c) x is a prime and x is greaterthan
x
If
is
a
t
han
thenx
is
(d)
prime,
greater 2.
If
x
is
a
is
and
not even.
thenx
(e)
prime,
positive
Translate each of the following
into symbols,
sentences
first using
no existentialquantifier,
and
second
no
universal
using
quantifier.
(a) Not all carshave carburetors.
(b) Some people are either religiousor pious.

(c) No

are

dogs

intelligent.

are illogical.

(d) All babies

(e)

Every

number

(f)

Some

numbers

is negative
are not real.

either

or has a square root.

(g) Every connectedand circuit-freegraph


(h) Not every graph is connected.
4. Determine
or falsity of the following
the
truth
universe U is the setof integers.
(a) Vjc, [x2 - 2 > 0].

(b) Vx, [x2- 10*+ 21= 0].


3x, [x2- 10* + 21 = 0].

(c)

(d)

Vx,

(e)

3x,

1 #0].

[x2-x[2x2

3x + 1
- llx
+

(f) 3x,
(g) 3x,[x2-3
[15jc2

0].

- 0].
2 = 0].

is a

tree,

sentences

where

the

Section

First Order Logicand

1.8

Other

Methods

of Proof

93

3x, [x2-9 = 0].

(h)

(i) 3x,

{x is

10} A

>

[{x2

(j) Vx,{3y,[x2= y]}.


(k) 3x,{Vy,[x2 y]}.

even}].

(1)

= y]}.

Vy,{3x,[x2

= y]}.

(m) 3y,{Vx,[x2

5.

the

Write

6.

through

(a)
the

Write

universal or
(i) in Exercise 4.

(as

negations

sentences

following sentences by changing

of the

negations

existential propositions) of

quantifiers.

each integer x, if x is even, then x2 + x is even.


There
is an integerx such that x is even and x is prime.
(b)
(c) Every complete
bipartite
graph is not planar.
x
that x is prime and x + 6 is prime.
such
Thereis
no
(d)
integer
x2
>
5 or x < 2.
3
For
each
(e)
integer x, +
x
either
For
each
(f)
x,
x, - 1, x - 2,orx - 3isdivisible
integer
(a)

For

by

4.

(g)

integer x, if x2 is even, then x is even,


or x is negative.

For each

(h)

Vx,

(j)

There

= 25

x2

(i) 3jc,jc2= 25andx>0.


is an

that

x2

= 9.

open propositions over the universe U =

the

7. Consider

x such

integer

{-5,0,1,2,3,4,5,6,7,8,9,10}.
P(x): < 5.
x2

x>3.
R (x): x is a
Q(x):

S(x):
Find

x2

the truth

(a) P(x) V
(b)

sets of:

Q(x).

A#0c).

P(x)

(c) [~P(x)]
(d)

multiple of 2.

25.

Q(x).

A [~Q(x)].

P(x)

(e) ~{[~P(x)] A
(f)

[~Q(x)]l

A [-/?(*)]}.

[~P(x)]v{Q(x)

(g) S(x).

(h) S(x) A
(i)

Q(x).

A [~Q(*)].

S(*)

(j) [P(*)aQ(*)]aS(*).

8.

the

of

Which

neither?
(a)

(,b)

x <

2.

1<

2.

(c) Heis

following

baseball

player.

are propositions,

open propositions, or

Foundations

Jackson is a baseballplayer.

(d) Reggie

(e) 2

3 =

2.

3 +

(f) This sentenceis false.


(g)

WOW!

(h)

There

is an

integer x suchthat

(i) For eachintegerx,there

9.

the

Using

such

P(5)

= 0.

that

P(l)

10. Use Lagrangeinterpolation

25 =

integer

+ y = 5.
construct a polynomial

= 420,P(3) -

360,P(4)

a polynomial

construct

to

0.

y such that x

formula,

interpolation
= 360, P(2)

Lagrange

P(x)

is a

x2

and

195,

whose graph

(-1,1),
(0,1), (1,1), and (2,-5).
passesthrough the points
11. If xl9 x29..., xn are distinct real numbers and if
,

,l m

'

- *,)(X -

_ (X

x2)..

.(X

- xi+1).. .(X

x^HX

xJiX; - x2)...(X,,- x^HXt

(X,:-

then the Lagrange

xn)

- xn)

.(X;

that

states

formula

interpolation

xi+l)..

P(X)

is the unique polynomial

Yl Li(X)yi
i-i

P(*i) =

for

yi

each

such

that

i.

= 1. Hint: use uniqueness.


that, in general,S-Li Lt(X)
This fact in (a) enablesone to compute P(X) more quickly
in many examples. For instance,using
of exercise 10,
the
data
=
=
=
=
(-1>1)>(*2>y2)
(1,1), and (x4,y4)
(0,1),
(xi>yi)
(^3^3)
the
can
be
two
P(X)
(2,-5),
computed ways: first,
polynomial

(a) Prove

P(X)

by the
by

(a)

P(X)
_

L4(X)

= LX(X)

interpolation
since

can be

and

formula,

- 5L4(X)

L3(X)

P(X)

second,

(X+1)(X)(X-1)

(2 +
6(x3\" x)
1-

then

Since

1)
=

X3-X

y,

But

S6e that

'We
\342\200\2246\342\200\224

+ x

-x3

(b) Using the fact in (a) compute


formula polynomialP(X) for the
xt

- 6L4(X)

L4(X).

= 1

+ L3(X) + L4(X) - 1.

+ L2(X)
computed easily by computingonly

LX{X)

1)(2)(2

p(x)

+ L2(X) +

the

+ 1
Lagrange

following

table

interpolation
of values:

Section

First Order

1.8

(c) Compute

Logic and

P(X) as in (b) for

the

following

Methods

table

95

of Proof

of values:

Xi

Other

yi

(d) Derive

P(X) as in (b) for

the

of values:

3'

Xi

table

following

yi

(e) If xt

for i =

= i

1,2,.. .,rc,prove that

f]iL,.(X)-Xand
i-l

i-l
Can

generalize?

you

P(X) for the following

12. Derive

can be

degree of P(X).

13.

not

continue

However,v

14.

(a)

X3

yi

1 1

2X

of ones neednot
the

continue;

interpolation
1 substantially

any

value

polynomial
reduces the

following table:

Xi

yi

a sequence

of the

roots

+ 1

11X2+

X2

of

the specialchoicev =

(b) 2X3 + 6X2 + 4X + 1


- 3X - 1
X3
(c)

(d) 2X3 (e) 3X3 -

of values beginning1, 2,3,4 need


as the next value.
with 5; any value v can be justified
5 substantially
reduces the degreeofP(X).

rational

all

Find

that

conclude

Thus

for the

P(X)

Derive

justified as the next value

P(X). Note that

4 5

Xi

a string

that

observe

Thus

table:

6X

17X

+ 2

following polynomials:

Foundations

15.

Suppose that we have

Problem)

Squares

(Magic

nine lxl tilescontaining

a 3

x 3

square and

problemis to
the
numbers
across
sumof
the
place
each row, down each column, and along eachdiagonal
is the same.
Such an arrangement is calleda magicsquare.
First
discover
what each row sum (and thereforewhat
each
(a)
column
and diagonal sum) must be.
in the second
row and second
(b) Observethat 9 cannotbeplaced
column.Neithercan 9 be placed in any corner position.Why?
in
Thus
there
are only 4 legitimate positions for 9. Moreover,
in the

tiles

the

the

1 through

digits

9. The

squares so that

location

there
is a limited number of
observe
that 5 must occupy
the
positions
observe
second
row and second column position. Finally,
that
1, 5, and 9 must occurin the same row or column.
to find all 8 magic squares using the
(c) Use proof by exhaustion
1
9.
Note
that any one of these can be
digits
through
transformed
into
other by either a rotation or a
any

any legitimate
for

for

9,

8. Next

7, and

6,

reflection.

(d)

the magic
Change
8. Indicate how to

(e) Indicate

(f)

such

all

0 through

11.

through

all 3 x

Find

(g) Indicate

3 magicsquaresusing
to

how

5x5

generate

any

9 consecutive

magic squares

integers.

using the first

is

of the
two

integers in eachrow,
is the

diagonals
of

sum

the

the magicsum

integers1,2,..

is

.,rc2

2x2

16. Define a

as

entries,

and does

Can

and in each of the


column,
number s is calledthe magic

an n

x n magic square usingthe


Observe that there are no

Find a 4 x 4

Latin squareas an
n

through

of

the

each

+ l)/2.

n(n2

magic squares.
1,2,.. .,16.

integers

in

same. The

square.

magic

Show that

x n

magic square using

table that

so in such a

the

uses the integers1


way

that

no

integer

appears more than oncein the samerow or column.


n is a
1 through
(a) Observe that an n x n table of entries
squareif and only if each integer appears exactlyoncein
row and column.

(b) Find
(c)

both 2x2

Use proof by

Latin

25

Hint: consider
17.
you
odd?
the integers1,2,...,n2
the sum s
sucha

as labels on the individual tiles.


middle
3x3
square using the entries 9 through
to an n x n square where n is
generalize
In general,
an n x n magic square using
n x n array of these integersin
that
an
way
integers

(h)

use the digits


squares.

magic

3 magic squaresusing the integers

all 3 x

find

to

how

squares problem to
find

Latin
each

squares.

exhaustion to

find

all

12

3x3

Latin squares.

Section 1.9

for Quantified

of Inference

Rules

(d) Find oneofthe 576 4x4 Latin


(e) Find a 5 x 5 Latin square.

Propositions

97

squares.

SelectedAnswers for Section1.8


(a)

Vx,[B(x)->F(x)].

(b)

~[Vx, (B(x)

(d)

3x9[B(x)Al(x)].

or 3x, (B(x)A

-FW)]

[~F(x))).

(e) M(x) \342\200\224


G(x).
(f)
3x, [M(x) aG(x)].

(j) 3x,[S(x)AM(x)A~H(x)].

(k) 0(x)AP(x).

(1)

Let

(n)

3x, [0(x)

be the

universe

the

set of integers Vx,

(0(x)

A P(x)).

AP(x)].

(p) 3x,[iV(x)Afl(x)].

(r)

~[Vx,

(s)

~[V*,(G(*)

(c)

Vx,

(d)

Vx, [\302\243(*)-/(*)];-[

(f)

~[V*,

(c)

Write

or 3x,

R(x)]]

[N(x)-+

[N(jc)

~R(x)].

\342\200\224P(*))].
\342\200\224

[D(x)

{D(x)
3 *,{\302\243(*) A

~[ 3x9

-/(*)];

[N (*) \342\200\224
/?(*)]];

3x,

/(*)}].

-/(*)}].

A ~fl(x)].

[N(jc)

Let

as follows:

sentence

the

\302\2437
be

of graphs.

universe

the

Vx,[C(x) aB(jc) \342\200\224


~P(x)]
where
x is

C(x):

complete,

jB(x): x is bipartite,and
x is

P(x):

The negation

planar.

is:

3xy[C(x)AB(x)A(P(x)]

1.9 RULESOF

FOR

INFERENCE

rules of inferenceare necessary

Additional
involving
open

and

propositions

is beyond our scope,but


following
quantifierscan

quantifiers.
we

describe

rules

four

be added

includethe four

to or
rules

form

Vx,

P(x)

will

from

Universal

an

assertions
prove
of these
treatment

some of

illustrate

of inference

is assumed

to
careful

when the

deleted

Fundamental Rule 5.
the

PROPOSITIONS

QUANTIFIED

rules

the techniques. The

universal and existential


assertion.

we have

We continue

our list to

already discussed:

Specification.

to be true, thenthe universal

If a

statement
quantifier

of
can

98

Chapter 1: Foundations
be

Pic) is true for

to obtain

dropped

This rulemay

be

an

object

arbitrary

universe.

c in the

as

represented

Vs,P(s)

for all c'

..Pic)

Thus,supposethe

denotes

humans, and supposethat Mix)


if we can establishthe truth
then
of
mortal,\"
set of

is the

universe

\"x is

statement

the

then
sentence
the rule of
\"Vx, Mix),99 that is, \"allmen aremortal,\"
ismortal.\"
universal specification allowsus to conclude\"Socrates
the
next rule says that what is true for arbitrary
stated
Informally
in
universe
is
true for all objects. This rule permits the
the
objects

the

universal quantification of assertions.

Fundamental Rule 6.
Pic) is true
quantifier

may

c of

Pic) for

.\\Vx,
This rule holds
universe.

The next

rule, informally
we

then

Fundamental

Pic)

is true.

all c

In

symbols,

this

universal

rule

true,

may

'

then

This rule

to this
Existential

7.

Rule

there

c in

the

that if a statement is true of


object by assigningit a name.

says

stated,

refer

is

P(x)

provided we know P(c) is true for eachelement

someobject

assumedto be

If

then the

to obtain Vx, Pix).

be prefixed

a statement

Generalization.

the universe,

Universal

element

each

for

is an

Specification.

element c in

If 3x,

Pix) is

the universesuchthat

takes the form


3x,Pjx)

.'. Pic)

for some

'

Notethat the element c is not arbitrary (as it was in Rule 5), but must
be one for which
is true. It follows from the truth of 3 x> Pix) that at
Pix)
least one suchelementmust exist, but nothing more is guaranteed. This
on the proper
if we
use of this rule. For example,
know
placesconstraints
that 3x, Pix) and 3x, Qix) areboth
then
we can conclude Pic) A
true,
^
is true for some elements c and d of the universe,
but
as a general
Qid)
rule
we cannot
conclude that Pic) A Qic) is true. For example, suppose
that the universeis the setofintegers
is the sentence \"x is even\"
and
Pix)
while Qix) is the sentence \"x is odd.\" Then
3x, Pix) and 3x, Qix) are
both
A Qic) is false for every
but Pic)
c in the universe of integers.
true,

Section

c in

element

some

8. Existential
the universe, then

Rule

Fundamental
for

for

of Inference

Rules

1.9

Quantified

99

Propositions

Generalization.If P(c) is true


3 x> P(x) is true. In symbols, we

have

for

Pic)

some

.:3x,P(x)

inference.
An

quantifiers is

the

of

because

beyond

are involved,

of proofs
is more
construction
care required in the application of the rulesof
of proofs involving
into the subtleties
exploration
our intention,
but we shall give a few simple examples to

When quantifiers
complicated

rules.
illustrate the applicationofthe above
in order to draw conclusionsfrom
quantified
Generally
speaking,
the
need
to remove quantifiers properly, argue with
premises, we
and then properly prefix the correctquantifiers.
propositions,

All

are

men

All kings

fallible.

are men.

Therefore,all
is

kings

are

fallible.

denote the assertion \"x is a man,\" K(x) denote the assertion


and F(x) the sentence \"x is fallible.\"
the above
Then

Let M(x)
\"x

the argument

Consider

1.9.1.

Example

a king,\"

argument is symbolized:
Vx,

Vx,

[M(x)

[K(x)

\342\200\224

F(x)]

\342\200\224

M(x)]

.\342\200\242.Vx,[K(x)-F(x)]

A formal

resulting

proof is as follows:

Reasons

Assertion

1. Vx,

[M(x)-+ F(x)]

2.

M(c)-+F(c)
3. Vx, [K(x)-\302\273M(x)]
4! K(c)-^M(c)
5.

[/C(x)

Step 1 and
Premise

\342\200\224

F(x)]

Step

Rule

Step 3 and
Steps

K(c)\342\200\224>F(c)

6. Vx,

Premise

2 and

5 and

Rule5

4
Rule

Rule

and

100

Chapter

1: Foundations
1.9.2.

Example

the following argumentand checkfor

Symbolize

validity:

Lions

animals.

are dangerous

There are lions.


are

there

Therefore,

animals.

dangerous

L(x) and D(x) as \"x is a lion\" and


argument takes the form

Represent

is

\"x

dangerous,\"

Then the

respectively.

Vjc,[L(jc)-DW]

3x,L(x)

.-. 3xD(x).
A

formal

is as

proof

follows:
Reasons

Assertion

1.

Premise 2

3xtL(x)

2. L(a)

Exercises

Premise 1

5. D(a)
6. 3x, D(x)

Steps 2 and

Step 5 and

in the

a conclusion

Obtain

Step3 and

Rule 7
Rule

4, Rule
Rule

1.9

for Section

1.

1 and

Step

3. Vx, [L (x)-* D(x)]


4. L{a)-+D(a)

(a) If there are any


either

\302\2611
or

\302\2612
are

not the casethat


Hence,...

No rational

to the

roots

equation X2

- 2 = 0, then

roots.

It is

(b) Somenegative

following:

rational

\302\261
1 or

are

numbers

\302\2612
are

rational

roots

of the

equation.

numbers.

numbers are imaginary.

Hence,...

(c)

Some politicians
All

corrupt

persons

are corrupt.
should

be sentenced

Hence,...
(d)

(e)

All

Democrats

All

squares

are not

conservative.

Hence, all conservativesare ...


are

All rectangles
All

parallelograms

Hence,...

rectangles.

are parallelograms.
are

quadrilaterals.

to prison.

its

Section 1.9

for Quantified

of Inference

Rules

Propositions

101

of the following
2. Prove or disprovethe validity
arguments:
is a plant or an animal.
(a) Every living
thing
David's dog is alive and it is not a plant.

dog has a heart.

Hence, David's
(b)

hearts.

have

animals

All

No

mathematicians

All

ignorant

are ignorant.
are haughty.

people

Hence, some haughty


(c) Babies are illogical.

who can

is despised

Nobody

Illogicalpeople

are

of

Students
A

student

not mathematicians.

manage a crocodile.

despised.

manage crocodiles. [LewisCarroll]

cannot

babies

Hence,

(d)

are

people

can do
intelligence
average
intelligence

average
without

arithmetic.
is not a capable

student.

(e)

do arithmetic.

cannot

students

Your

Therefore, your students are not capable.


All integers are rational numbers.

Someintegersare

of

powers

2.

numbers are powers

some rational

Therefore,

Some rational

(g)

Therefore, some integers are powers


All clear explanations are satisfactory.

All

of

3.

are unsatisfactory.

excuses

Some

2.

numbers.

rational

are

integers

of

numbers are powersof 3.

(f)

excuses are not

Hence, some

clear

explanations.

[Lewis

Carroll]

(h)

Some cats are animals.


some

Therefore,

(i)

animals.

dogs are

Some

All

are

dogs

dogs

are cats.

carnivorous.

are dogs.

Some animals

Therefore,some

are

animals

carnivorous.

that
define sets. Use
following propositions involve
predicates
these
sets.
Use
the properties to concluderelationshipsbetween
Venn diagrams to check the validity
of the arguments.

3. The

(a)

cigarettes

are

hazardous

All

Smokums

are

cigarettes.

Hence, all
(b)

Smokums are hazardousto health.


are not

scientists

Some

Some astronauts are not


Hence,

(c)

to health.

All

All

some

scientists

Some astronauts

Hence,some

engineers.

are not

astronauts.

scientists.

are

astronauts

engineers.

are engineers.

engineers

are

scientists.

102

Chapter 1: Foundations

Therefore,

mammals.

are

humans

All

are vertebrates.

humans

Some

(d)

some mammals

(e) Nomothersare

are vertebrates.

males.

are politicians.

males

Some

Hence, some politiciansare not mothers.


Some females are not mothers.

(f)

Somepoliticiansare

females.

not

some

Hence,

(g)

All

are

doctors

Some doctors

Hence,

some

(h)

All

are not golfers.

All fathers

(i)

graduates,

males.

are fathers.
are

students

males.

are males.

Some

fathers.

are

students

Hence,

not college

are

golfers

Some students

Hence,all

mothers.

graduates.

college

are

fathers

are not

politicians

are males.

some students

Selected Answers for Section1.9


2.

(a)

Let

the universe

consist of all living


x is

P(x):

A(x): x is

and

let

a plant.
an

x has

H(x):

things,

animal

a heart

a: David's dog

Thenthe inferencepatternis:
Vjc,

V A(x)].

[P(x)

~P(a).

Vx,[A(x)-+H(x)].

Hence, if (a).

The proofof
(1)

Vjc,

validity

V A(x)]

[P(x)

(4) i A
(5)

A(a)

(a)

Vjc,

following:

Premise

Premise

(2) ~~P(a)

(3) P(a)

is the

[A (x) -> H(x)]

From

(1) and

Universal Specification

From

(2) and

(3) and disjunctive

Premise

syllogism

Section

(6) A (a)
(7) H(a)

Specification

(4), (6),and

Rule

Inference

INDUCTION

MATHEMATICAL

In mathematics, as in sciencethereare two


deductive
whereby we can discover new results:

have said the deductive


premisesand axiomsand
search

the

with

involves

aspect
then

deducing

general rule by
may arrive at a conjecture that we
at

for a

a conjecture

integersn.

we

the truth of
in verifying

useful

is

that

on the

and

main

aspects

and

other hand, is concerned


arrive

experimentation\342\200\224we

inductive

to

believe

be true

for all

put any confidencein our conjecture


the conjecture.Thereisa prooftechnique
that
such conjectures. Let us describe

of Mathematical Induction. Let P(n) be


integer n, may be either trueor false.Toprove
all integers n > 1,it suffices
to prove:

The Principle
is true

positive

now.

technique

statement

we

Frequently

reasoning.

we can

before

then

But

to verify

need

of inquiry
inductive. As we
certain statements as
accepting
other statements
on the basisof

The
inductive
aspect,
for facts by observation

inferences.

valid

(1)

(f), (g), and (h) areinvalid.

3. (b),

1.10

(5) and

\342\200\224if
(a)

103

Induction

Mathematical

1.10

which,

for

each

for

P(n)

is true.

1. P(l)

2. Forallk > 1,P(k)

implies

P(k

-f

1).

(1) and (2) by (1') P(n0) is true, and (2') For all k > n0,
is true for all n > n0, and
+ 1), then we can prove
P(n)
the starting
point n0, or basis of induction, may be any integer\342\200\224positive,
or zero. Normally
we expect to prove P(k) \342\200\224+
+ 1) directly
P(k
negative,
so there are 3 steps to a proof using
the
of mathematical
principle
If one

replaces

implies

P(k)

P(k

induction:

(i) (Basisof induction)Show P(n0) is true,


hypothesis) AssumeP(k) istrue for k
step) Showthat P(k + 1) is true on
inductive hypothesis.

(ii) (Inductive
(iii) (Inductive

We

emphasize

assumingwhat

the inductive
hypothesis is
be proved; it is just part of proving

that
is to

P(k)-+

P(k +

l).

> n0.
basis
the

of the

not tantamount to
the

implication

104

Chapter

1: Foundations

methodof
principle of mathematicalinductionisa reasonable
(1) tells us that P(l) is true. Then
(2) and the fact
using
that part (1)tellsus that P(l) is true, we conclude P(2) is true. But then
in this way
that P (2 + 1) = P(3)istrue,
and
so on. Continuing
(2) implies
we would ultimately reach the conclusion
is true for any fixed
that
P(n)
Now the

proof

for

part

ofmathematical
positiveintegern. The principle
the game we played as childrenwhere
we would
if

over

fell

one

it would

collide with

Then
part (2)ofthe principle.

we

what

Then

fall

down\342\200\224like

the

tip over the first domino (this is


would
All the dominos
happen?
that P(n) is true for all positive

would

likepart (1)ofthe principle).

would

next

the

is much like
up dominos so that
in line. This is like

induction

stand
domino

conclusion

n.

integers

on the
1.10.1. Let us use this approach
of
Example
problem
for
the sum of the first n positive integers.Let
determining a formula
\342\200\242
\342\200\242
values
for S(n) and
4- n. Let us examine a few
S(n) = 1 + 2 + 3 + \342\200\242
list them in the following
table:

S(n)

10

15

21

28

of guessing a formula
S (ra) may not be an easy one and
for
sure-fire approach for obtaining a formula. Nevertheless,
one
observe
the following
pattern:
task

The
there

is no

might

2 = 1-2

2S(1)=

2S(2)= 6

2-3

2S(3)

= 12

= 3-

2S(4)

= 20

= 4- 5

2S(5) = 30 = 5- 6

2S(6)

This leads

= n(n

+ 1) or that

S(n) -

\"(\"

X).

this
formula.
Let P(n)
us use mathematicalinductionto prove
statement: the sum S(n) of the first n positive integers is equalto,

Now let
n(n

= 6 -

us to conjecturethat
2 S(n)

be the

42

4- l)/2.

Section

Mathematical Induction

1.10
1.

Since S(l) -

of Induction.

Basis

true for

1(1

105

the formula

l)/2,

is

= 1.

Assume the statementP(n)

2. Inductive
Hypothesis.
n = k, that is, that S(k) = l +

= fe(fe +

2+...+fe

is

true

for

l)/2.

3. Inductive Step. Now show that the formula is true for n = k + 1,


that is, show that S(k + 1) = (k 4- 1) (k 4- 2)/2 follows from the inductive
that
+
S(fc + l) = l + 2+--hypothesis. To do this, we observe
(* + !).
(* + l)-S(*)+
Since

S(k +

by the inductive

= k(k 4- l)/2

S(k)

1) = S(k) +
(fc

1) =

(k

(k +

we have

hypothesis,

1) +

(fe

1) =

(k +

1)

(^

l)

+ 2)

1) (k

2
was
true for
+ 1. So, by assumingthe formula
the
formula
holds for k + 1, and the proofis
of mathematical
the
induction.
by
principle
complete
is based
The principle of mathematicalinduction
on a result that may
one of the axioms for the set of positive integers. This
be
considered

and the formula


holds
for k
k, we have been ableto prove

axiom is calledthe well-ordered


property
statement is the following:
Any
nonempty

integers; its
of positive integers

the

of

positive

set

contains a leastpositiveinteger.

Example1.10.2.

and

Find

cubes,

that

is, l3

We consider

4- 23

the first

for the

sumof the first

cases:

few

13 =

13+
l3 +
l3

a formula

prove

\342\200\242
\342\200\242
\342\200\242
4- n3.

1 =

12

23

= 9

23

4- 23

= 32

33 =

36

4- 33 4- 43

62

100

= 102

From this meagerinformation


we expect
that l3 4- 23 4- 33 4- 43 4- 53 to
we
But
of
what
After
the
perfect square.
computing
integer?
square
find that it is 152.Still we may
not
see the pattern at first, but by
we have
the
table for S(n) in Example 1.11.1we see that
comparing
obtained thus far,
be a

[S(l)]2

= l2,

[S(2)]2 =

32, [S(3)]2\302\253
62,

[S(4)]2

\302\253

102,

and

[S(5)]2

= 152.

106

Chapter

1: Foundations

then that l3

We conjecture
this

verify

1. Basis of Induction.Since
n =

4- n*

23

+ l)/2]2.

[n(n

= [1

l3

(1 +

l)/2]2 the formula

for

holds

l.

2. Inductive Hypothesis. Supposethe formula


\342\200\242
\342\200\242
4- k3 - [k(k + D/2]2.
Thus, suppose l3 + 23 + \342\200\242

3. Inductive Step.
l3

show

replace

23

+ (*

23

4-

4-

(*

1)

n =

4-

l3

4-

23

+ 1; that is,

4- (*

+ k3

4-

\\k2

+1)2

Uk +

1
the

formula

D3

k2

14

\"*

21 2

(k +1)2

+ (* +

to

41

+ 1)

- (* +1)2

+1

4fc +

k(k

l)3

(*+\302\273\"[g)'

(k

of

and

k.

+ 2)/2]2.

\342\200\242
\342\200\242
\342\200\242
+ k3

\342\200\242
\342\200\242
\342\200\242
4- k3

+ k

Hence,

for n = k

holds

+ l)3 - [(* 4-

for

holds

4- (k 4- l)a'is nothing morethat the sum


(k 4- l)3, so we use the inductive
hypothesis
\342\200\242
\342\200\242
134- 23 4- \342\200\242
4- k3 by [k (k 4- l)/2]2. Thus,

Now l3
4-

+ 23

\342\200\242
\342\200\242
\342\200\242
4- k3

formula

the

Show

l3

Let us

induction:

by mathematical

formula

1) (k + 2)12

2
holds for

mathematicalinductionfor

all

1.10.3. Prove
Example
l2\"*1 is divisible by 43 for each

4-

positive

by

and

integers

integer

principle of

n.
induction

mathematical

positive

by the

thus

that

6'n+2

4-

n.

1. First we show that 61+2


4- 72+1 = 63 4- 73 is divisibleby
follows because 63 4- 73 = 559 = 43(13).

2. Next we suppose
6k+2 4- 72*+1= 43* for
that
3. Then we showthat, on thebasisofthe inductive
72(fe + l) + l
6*+3 + 7^+3 is divisible
by 43.

some

integer
hypothesis,

But

43.

this

x.
6

*+3

in Section 1.4 that 6*+3 + 72*+3 - 6(6*+2 4- 72*+1)


+
or
6k+3
72*+3
44443(72*+1).
43(7^+1)
6(43jc)
Thus,
43[6x 72*+1]
6*+3 + rj2k+3 = 43^j
where y is an integer.
Hence, 6*+3 4- 72*+3 is divisible by 43, and by the principle of
We

showed

Section

induction

mathematical

72n+1 is

by 43

divisible

for each positive

n.

integer

For each positiveintegern,

1.10.4.
Example
prime integers.

Let P(n) bethe

1. P(l) is
2.

P(k)

al9 a2,

...,

is not

divisible

by

3 are

than n

integers.

primes.

is true.

since P(k)
- axa2

divisibleby
a new

1 distinct prime integerswhose


is true. Formthe integer

k +

be

ak+l

ak,

is guaranteed

existence

Now N

2 and

more

are

there

than n prime

are more

there

proposition:

since

true

Assume

3. Let

is

6n+2

107

Induction

Mathematical

1.10

prime

...ak

any
afc+2.

ak+l +

of the
In

1- H

primes ar
either

+
a\302\243

1.

But N is eithera primeor


are more than k + 1

case there

primes.

1.10.5.
Suppose the Postal Departmentprints
stamps. Prove that it is possibleto makeup any
n-cents using only 5- and 9-centstampsfor n > 35.

Example
and 9-cent

1. First, we see that


5-cent stamps.

postageof exactly35centscan be

5-

only

of

postage

made

with

up

seven

2. Assumethat n-centspostagecan be made


with
up
stamps wheren > 35.
3. Now consider postage of n + 1 cents. Therearetwo

5- and

9-cent

possibilities

to

consider:

cents postage is madeup with


at least one 9-centstamp
there
is
(b)
n-cents postage.
(a) The n

In case

(a),

the

number

of 5-cent

only
involved

stamps is at

5-cent
in

stamps, or
makeup

the

least seven sincen

>

of

35.

replace those seven 5-centstampsby four 9-cent stamps


and make up n + 1 centspostage.
In case (b), the n cents postage includes at least one 9-centstamp.
if we replace that one 9-cent stamp by two
we
5-cent
Therefore,
stamps
can make up n + 1 cents postage.
how to make up n + 1 cents
shown
Therefore, in either case we have
postagein terms of only 5- and 9-cent stamps.
Thus,

we can

108

Chapter

1: Foundations

Example
Let P(n)

statement: 3n >
P(4) is true because34
be the

for

all

n >

integers

4, 3n

n3.

>

n3.

= 81 > 43 = 64.
>
is true for n
Assume
P(n)
4, that is, assumeSn > n3 for n > 4.
We
we
4 1) is true on the basisof our assumption.
P(n
Thus,
prove
must
(n + l)3 = n3 4 3n2 4
prove 3n+1 > (n + l)3. Let us rewrite
3m + 1 = n3(l 4 3/n 4 3/n2 + 1/n3). Since the inductive hypothesis
also prove that
us that
3n > n3, we would be doneif we could
gives
3 > 1 + 3/n 4 3/n2 4 1/n3 for n > 4. We now prove this. Observe
= 1 4 3/n 4 3/n2
as n
that the function
4
1/n3 decreases
f(n)
n is smallest.
In other words
increases, so then /(n) is largestwhen
/ (4) is the largestvalue of / (n) when n ranges over the integers
than or equal to 4. Since
greater

1. First,

2.
3.

Prove that

1.10.6.

(4)

3/4 4- 3/42 4-

1 +

1/43

= 125/64

n > 4, 3 > 1 4 3/n


is obviously less than 3, we have
for any integer
facts:
3 > 1 4 3/n 4 3/n2
3/n2 4 1/n3. Thus, combining the two
1/n2 and 3n > n3 for n > 4, we can multiply and obtain
3n+1

>

3n3 >

= (n

n3(l 4

3/n 4

3/n2

4
4

1/n3)

4 l)3, and the proofis complete.

Recursion
In

programming

computer

execution of

a procedure

is usually

the evaluation
of a function or the
achieved at machine-languagelevel by

subroutine. The idea of a subroutine which


is common; however, it is frequently
subroutine
subroutine that contains a call to itself.Such

recursive subroutine. Informally

the name

of a

use

the techniqueof defining


itself

where

it is
be

a set,

a function,

generally understood that

of \"previous\"values. Thus, a

objects would

we give

speaking,

defined

recursive

in terms

sublists.

beneficial

routine

subroutine

of applying

will

applied

function

terms of

be in

terms

to a

list of

the subroutineto proper

the set N of nonnegative


and
for
of / at 0 is given
defined recursively if the value
n is defined in terms of the values
integer n the value
of/at
0 < k < n.
Moreover,

recursion to

or an algorithm in

the definition

the

another
to have
a
is called a

calls

itself

/ from

integers

each
of/at

is

positive
k where

Section

Mathematical

1.10

we are
the mechanism
Conceivably,
defined
a function. Thus, if the object
fact, a function we say that the function

Hence, when a function

the

function

is defined

The sequence
can

(0 T(0) = 1
T(n

(ii)

+ 1)

= 3T(n)

for

3n

It is clear

that

all

for

The

the two
of

property

\"defined\"

T(n

= 3n

T(n)

clear that

+ 1)

actually
definition

by the

define
is,

in

definition.

it is necessary to prove that

for

can

example,

all integers

n >

be defined

0, but the samefunction

as follows:

the
Here part (ii) embodies
feature of \"self-reference\".

not be

not

recursive

is well-defined

recursively

1,3,9,27,..., 3n,...,

formula
T(n)
be defined
recursively
the

explicitlyby

by the

well-defined.

in fact,

is,

describingmay

109

Induction

integers
salient

n >
feature

0.
of recursion,

namely, the.

the conditions (i) and (ii),but it may


alone
are enough to define T.
is the area of concern\342\200\224we
have
that
T(n) is defined, but we
provided
T is
in the case that the function
only

satisfies

conditions

self-reference
\302\253

3T(n)

normally expect T(n) to bedefined


itself already defined. This stateof affairs
makes
the recursive
definition
vulnerable to the chargeof circularity.
for T is, in fact, not circular, but we must
The
recursive
definition
by (i) and (ii).
clarify what we mean when we say that T is well-defined
We mean two things: first, that there exists a function from the setN of
into
the set of integers satisfying (i) and (ii),and
integers
nonnegative
a
that
that
there is only one such function. Therefore,
second,
any
proof
must
two proofs:
function is well-defined by a recursivedefinition
involve
one of existenceand oneof uniqueness.
in the present case for we have a
us no problem
The existence
causes
the
fact that there is only one
candidate,
namely, T(n) = 3\\ Moreover,
function
induction.
(i) and (ii) can be verified
by mathematical
satisfying
the
recursive
definition
for T
(We leave the proof as an exercise.)
Thus,
is, in fact, well-defined.
A thorough
discussion
of recursive definitions (and all the machinery
that certain functions are well-defined
to prove
recursive
necessary
by
is beyond our intentions for this book. We shall be content to
definitions)
mention only the following theorem; this theorem can be usedto verify
that
functions
are well-defined by recursive definitionseven in
many

cases

where

no

explicit

formula

is known.

from a set S
The Recursion Theorem. LetF bea given function
set
into S. Let s0 be a fixed element
of
of S, and let N denote the
\342\200\224\342\226\272
S
function
is
a
Then
there
f:N
nonnegative
unique
integers.
satisfying

110

Chapter

1: Foundations

1. /(0)=s0,and

2. f(n + 1) = F( f (n))

n G

all integers

for

The interestedreader find


Leon
Henkin
article
by

a proof

can

theorem in an excellent
on page 74 of [15]. Another

of this

[16] or

written

N.

discussion of recursive definitions


interesting
found in the article by R. C. Buck [7].
The condition (1) of the Recursion
Theorem

condition and condition(2)


Both

rule.
generating

parts

Example1.10.7.

may

initial

the

called

be

relation or

ofthe theorem.
for the conclusion

show how to apply the


function h satisfying

us

of a

existence

the

obtain

is

the recurrence

called

are necessary
Let

to

is

induction

and

RecursionTheorem

(i) MO)-9
for

n >

all

= 5Mn)

+ l)

h{n

(ii)

+ 24

0.

Let s0 = 9 and let F(k) =

In

it

cases

many

explicit formula

for

5k

+ 24

k.

to obtain from
a recurrence
term of a sequence; in fact

is possible
the

for all

general

relation

an

Chapter 3 is

devotedto developingtechniquesto obtain


But even if
formulas.
explicit
one cannot obtain a formula,
a recurrence
relation
provides a powerful
computationaltool.Indeed,from a strictly computational
point of view, a
not be as valuable as a recurrencerelation.
formula
may

Let

us

familiar.
1.

list

several

defined functions

recursively

For example, the recursively

defined

some of

which

are

quite

function

/(0)-l

2. f(n
is just

+ l)/(n)foralln>0

!)-(*

the factorialfunction
if a

Likewise,

and d

/ (n)

are

n\\.

numbers

given

then

the

recursively

defined

function

1. A(0) = a

2.

A(n

1)

- A(n)

+ d for

all

n >

A (n) = a + nd.
the function
is usually
called the
Moreover,the sequenceof numbers
{A(n)}^-0
arithmetic progression with initial term a and common
difference
d.
On the other
hand, if multiplication is used in the above
definition
instead of addition we get the geometric progression
= adny and in this case d is calledthe commonratio.
G (n)

is just

Section

The famous

Fibonaccisequenceis defined

l.F0-l-Fl

2. Fn+1 =

To

Fn

for all

recursively:

integers n >

number

Fibonacci

a new

find

Fn_x

111

Induction

Mathematical

1.10

1.

simply add

the last two:

F2 = F, + F0= 2
F3

= F
2 +

Ft

= 3

F4 = F3 + F2 -

In

this

because
n

- 1. A

relation

recurrence

and

discuss this

of

form

stronger

existence

conditions which are required


defined in terms of both n and
the Recursion Theorem is neededto prove
the
of a function
these
conditions.
We
satisfying
two initial

have

we

example

the

uniqueness

5,etc.

for Fn+1 is

sequencein greaterdetailin

3.

Chapter

likethe Fibonacci
This
mathematical
principleof mathematical
induction.

To prove properties of sequences


form of the principle of
another
induction.
is actually equivalent to the
we shall call it strong mathematical
nevertheless,

Strong MathematicalInduction:

Let

which, for
for

all

each integern,

if there

integers

positive

may

be

is an

integer q

>

principle

induction

but,

statement

be

P(n)

true or

either

need

we

sequence

false. Then P(n) is true


1 such

P(2),..., P(q) areall true.


k > q, the assumptionthat P(i) istrue for
implies that P(k + 1) is true.

that

1. P(l),
2.

When

As

in

the

integers

1 <, i

<k

the principle of mathematicalinduction,this form can


to apply to statements in which
value is an
the
starting

case of

be modified

integer different

from

as before,

just

Thus,

all

1.

there are 3 stepsto proofs

by

mathematical

strong

induction.

1. Basis of Induction.
P(l),
P(2),...,
2. Strong InductiveHypothesis.
k > q.
integers i suchthat 1 < i < k,
3. Inductive
Showthat
P(k 1) is
Step.
strong
hypothesis.
Show

P(q) are all true.

Assume

P(i)

is

true

for ail

where

true

on the

basisof the

inductive

In

allowed

a proof

using the

to assume

principle of mathematicalinduction

P(k) in orderto establishP(k + 1).But

in

we

using

are

strong

112

Chapter 1: Foundations
we assume not only P(k) but also P(k - 1),
well, to establish P(k + 1).
induction is a natural choicefor proofs
in which
the properties of elementsin the (n + l)th step depend on the properties
in several previous steps.
of elements
generated
To illustrateproofs
mathematical
by strong
induction, let us consider
induction

mathematical

P(k

2),.. .,P(1) as
mathematical
Strong
-

the

examples.

following

each positive

that for

Prove

1.10.8.

Example

nth

the

n,

integer

Fibonacci number Fn is less than (7/4)n.


< (7/4)n.
Then clearly P(l) and P(2) are
Let P(n) be the sentence:
Fn
=
=
<
<
2
that
is true for all
truesinceF, 1 7/4 and F2
P(i)
(7/4)2.Assume
<
<
<
>
1
i < ft. Then,
<
for
each
1 i ft, where ft 2, that is, suppose Ft (7/4)1
of
the
inductive
show
hypothesis.
strong
Fk{l < (7/4)*+1 on the basis
Since ft > 2, ft - 1 is a positive integer and thus Fk < (7/4)* and Fk_x <
(7/4)* l. Hence,Fk+1 - Fk + F^ < (7/4)*+ (7/4)*\"1 - (7/4)*\"1 (7/4 + 1)
- (7/4)* l (11/4) < (7/4)*-1 (7/4)2 = (7/4)*+1since (11/4) = 44/16<
(7/4)1

function

unique

(1) 6(0)

defined

function

First, it is easy

- 1) -

to

- 5 is the

= 2(3n)

b(n)

by

= -3, 6(1)= 1,and


- 4b(n

b(n)

(2)

that the

Prove

1.10.9.

Example

Sb(n

that

check

2) for n

b(n) =

> 2.

2(3n) - 5 does,in

satisfy

the

relations

(1)

fact,

(1) and (2).

relations

Next, we

that

claim

if a(n)

is any other

then a(n) = b(n)for all n.


is a true statement
We
P(n)
prove
induction.

and (2),

function

LetP(n)
for

satisfying

be the

all

statement: a(n) = b(n).


integers

nonnegative

n by strong

1. Basis of induction.
is true. This is immediate
and P(l)
P(0)
since know 6(0) = -3 and 6(1) = 1 we are assuming a (0) = -3 and
= 6(0) and a(l) - 6(1).
a(l) - 1.
a(0)
Show

we

and

Thus,

2. Strong inductivehypothesis.

Assume

0<i <k
0 < i

<

k >

where

3. Induction
+

6(fe

1. In
> 1.

where

1).

By

step. Showthat P(k


(2), a (ft

inductive hypothesis,a (ft)


ft

1 >

0.

is

P(i)

other words,assumea(i) = 6(0 for

1) = 4a (ft)
= 6 (ft) and a

1)

is true

- 3a (ft
(ft

1) =

all

all

integers

a(fe + 1) =
by the strong

or that
But

-1).

6 (ft

for

true

1) since

ft

>

1 and

Section 1.10

Induction

Mathematical

+ 1)

Thus,a(/2

result is proved by

and the

1.10.10.

Example

- 4(2(3*)- 5) - 3(2(3*\"1) - 5)
- 5
- (8)(3*)- (6K3*-1)
- (8)(3*) - 2(3*)- 5

(6)(3*)

b(k

- 2(3*+1)-

1)

induction.

that if

Prove

Fn

is

the

nth Fibonacci

then

for

all

n >

integers

0.

Proof: Basis of induction.When

Likewise

Sothe

when n =

for n

- 0 and n = 1.

Strong inductivehypothesis.

Now

\"-^[P-tT-P-tTI
for

each

Inductive

integer

step.

= 0,

1,

is valid

formula

k where

113

0<k

< rc.

Prove that

'\".-il^r-P-rTl

for

n >

1, assume

number,

114

Chapter

1: Foundations

the proof, let

To expedite

a=

and

we know that

Then since

Fn+l

^n =

-F

+ Fn_x and

Fn

[<*n+1

and

&n+1]

V5

by

the

inductive

Fn+x

that

it follows

hypothesis,

[an+1

~fE

bn+l

- bn]

an

+ l)-6n(6

-^[an(a

D].

Now

1
a + 1 = 1+V5.3+V5
+

and

so that

a + 1 = a2.Likewise,

= \342\200\224
[an(a

Fn+l

=
ar23+V5

+ 1

\342\200\224

= b2. Therefore,

+ l)]

+ l)-bn(b

= -t= [an+2

6n+2] and

the proof is complete.

V5

1.10.11.
In section 5.6 we shall have
occasion
to consider
Example
= 2 and V(n + 1) = V(n) +
the function V(n) where V(0) = 1 and V(l)
- 1) + 1 for all n > 1. We wish to showthat V{n) =
- 1 for all
V(n
Fn+2

integers n > 0.

Basis of induction.

When

Likewise,

Strong

V(l)

= 2

inductive

for all 0 < k

<

n.

and F3 = 3 hypothesis.

= 0,
=

V(0) =

1 and F2

1 =

- 1 = 1.

2.

For n >

1, assumeV(fc)

Ffe+2

- 1

Section

Mathematical Induction

1.10
Inductive

1 = (Fn+2
1 by definition of Fn+3.

V(n) +

V(n

Fn+3

expression

for

Exercises

for

1)- +

we

Fn+2

1) +

Fn+3

+ Fn+1

1 =Fn+2

closed

1.10

Section

I. Use mathematicalinduction
to
prove
is true for all positive integers n.
statements

1. ir+2
2. If an

- 6an_2 for

5an_x

each of

that

the

following

by 133.

is divisible

122n+1

4-

n > 2 and a0

12 and

- 29, then an

ax

+ 7(2n).

5(3n)

3. I2 +

32 +

22

= m(m +

\342\200\242
\342\200\242
\342\200\242
+ n2

1)

\342\200\242
3 +

\342\200\242
5 +

(2n

for n

(2n +

-1)

= n/(n

>: 1.

l)/3.

4- 1).

(2n + 1) -

- 1)

\342\200\242
\342\200\242
\342\200\242
7 + \342\200\242
+

l)/6

(2m

\342\200\242
\342\200\242
4. I2 + 32 + 52 + \342\200\242
+ (2m - l)2 = m(2m
\342\200\242
\342\200\242
5. 1/(1)(2) + l/(2)(3) + \342\200\242
4- 1)
4- l/n(n

6. 1

V(n 4- 1) =
- 1=

1. Now

(Fn+l - 1) +

shown V(n) = Fn+2 - 1 and we know a


can get one for V(n), namely,

we have

since

Now

1) -

V(n +

Prove

step.

115

n(4n2

6n

D/3.

7. I3 + 33 +
2 + 2
8. 1 \342\200\242
9. 1

53 +

\342\200\242
\342\200\242
\342\200\242
+

(2m

\342\200\242
3 +

- l)3

= n2

\342\200\242
\342\200\242
\342\200\242
4 + \342\200\242
+

n(n

\342\200\242
\342\200\242
\342\200\242
4 4- \342\200\242
3 \342\200\242
4-

\342\200\242
2 \342\200\242
3 4-

n(n

(2n2

1).

= n(n + 1) (n +
1) (n + 2) = n(n +

+ 1)
+

2)/3.
1)

(n

+ 2)

(n 4- 3)/4.

10. I2-

II.

- 42

4- 32

22

- (-l)\"\"1

\342\200\242
\342\200\242
\342\200\242

(-ir-V

a factor of the polynomial

y is

xn

x2n+1
12. x 4- y is a factor of the polynomial
13. n(n2 4- 5) is an integermultipleof 6.

14.
15.

n(n2
3m5

16. an

1) (3n

4- 5m3

(1) a0

an

4- y2n+1.

4- 2) is an integermultipleof 24.
In is divisible by 15 for each positive
1 is the unique
function defined by

integer

n.

11,
-

3a\342\200\236_!

2ah_2 for n

17. For any real number


18. Showthat the sum
progression

yn.

6,

ax =

(2)

4-

= 5(2n) 4-

n(n + l)/2.

initial

with

n/2 [2a

4-

(n

l)d].

x >
of

the

term

> 2.

-1, (1 4first

x)n

> 1

4- nx.

n terms of an arithmetic
and common difference

d is

116

Chapter 1:Foundations
n terms
the sum of the first
of a geometric progression
a and common ratio r # 1isa [(rn - l)/(r - 1)] =
term

that

Show

19.

initial

with

a[(l-r\/(l-r)].

20.

Let

table

formula

for

terms of n. Prove that this


induction. (Hint: Search for a

23. Supposethat
that

each

integer

9.
24. Showthat
by

222 and 555,555,555


n

joining

collinear,
26.

g(n) ==
1. *(0)

27.

be paid

can

%n

of 3n identical digits is divisible


composed
222 and 555 are divisible
by 3, while 222, 222,
are

>

is the

unique

- 10

1)

JL +

VT+V2

28. For eachintegern

>

10, 2n

each integern

>

4, 3n

29. For

n
30. For
integer
31. Foreachinteger
each

> 2,
>

n3

5, 4n

>

1.

r-

V^>V\"

+ 64.

1 >

n2 +

n.

rc4.

32.

For

each

integer

n >

17, T > n\\

33.

For

each

integer

n >

9, n\\

34.

For each

>

by

> n3.

> T
+

n >

for

--,

defined

function

1)

- lg(n)

J-

number of lines obtained by


are
plane, no three of which

2, the

in the

distinct
points
is n(n \342\200\224
l)/2.
+ (7)2n

by 9.)

divisible

*(1) = 29

g(n

by

a system

- I0g(n For each integer n > 2,

2.

valid

describing

n2.

positive integern

(3)5n

pattern

! > 2n.

T >

5,

of

example,

25. For every

4, n

have

debt

integer

any

3n. (For

>

is

formula

of currency that has $3 and $5 bills.


with only $3 and $5 bills for
> 8. Do the sameproblem
for
$7 bills and n >
$2 and

we

any

>

polygon.

a
3, and then conjecture

Dn in

21. For eachintegern


22. For eachintegern

convex

n-sided

an

of

for n >

of Dn

values

of

mathematical
2 A,)

Show

of diagonals

number

the

be

Dn

Make a

4n.

integer n > 1,the nth

Fibonacci

number

Fn is

less than

Section 1.10
an = 2n
(1) a0 =

35.

ax

an =

(2)
36.

Suppose
-

&n

1 is

3a\342\200\236_x

that
+

bn

2an_2 for

II.

function
6n_3 for all

integers n.

1 and

an

1.

Recursion

the

Apply

do in
=

\302\243(0)

3. k(0)
fe(n

integers n >

+ 1

yJSan_l

for n >

an_2

4-

bx

1,

b2

1.Provethat an
for

an_3

2, 63

4. Provethat 6n

n >

= 3, and
<

< 7/2

2n for

for all

3. Prove that

an

<

0.

Theorem

= 3g(n)2+

1) =

7 /i(n)3

7 for

- 3 for

=1
+

defined by

to verify

that the following

recursive

fact define functions.

2. /i(0) - 3
/i(n

+ 1)

g(n

>

i^ the
4-

bn_2

rc

positive integers n.
38. Leta0 = ax = a2 = 1 and an
(4/3)n for each integer n >
definitions

by

all positive
ax

defined

function

^n-i

37. Let

the unique

117

Induction

Mathematical

1) =

ylSk(n)2 +

n >
n >

0.
0.

7*(n) - 3 for

n >:

0.

is known
as the
III. Perhaps the oldest recordednontrivial
algorithm
Euclidean Algorithm. This algorithm computesthe greatestcommon
of 2 nonnegative
divisor
integers,
integers. If a and b are nonnegative
d such that d
then gcd(a,b) is defined as the largestpositive
integer
divides both a and 6.If a > b > 0, then the Euclidean algorithm is based
upon

the

facts:

following

(a) gcd(a,b) = a if b = 0
(b) gcd(afb) =gcd(b,r) if 6 * 0
and a = b q + r where0 < r < 6.
Thus

the

the above

common

greatest

division

of 22 and 8 canbefound

gcd(22,8)

= gcd(8fi)

Find the

greatest commondivisors

(a) 81and

36

118

144 and

(c) 1317and 56

(d) 10,815
and

(e)

applying

510 and

6489

374.

\302\243cd(6,2)

= 2.

gcd{2fi)

(b)

by

facts recursively as follows:

of

the

following

pairs of

integers.

118

Chapter

1: Foundations

IV.

Number

Theory

1.10.4
we
1. (a) In example
either
a

or is

prime

proof of

fact

this

that every integer a > 1is


a
by prime. Give a contradiction
the
well-ordered property of the
using
fact

the

used

divisible

by

integers.

positive

a > 1 is a
(a) to concludethat every integer
of
product primeintegers.
(c) Write 1235 and 5124 as products of primes.
Prove
that the
(d) (The FundamentalTheoremof Arithmetic.)
factorization of an integer a > 1 into a product
of primes is
of factors.
Hint: use
unique except for rearrangement
(b)

Extend

the proof in

contradiction

and

well-ordered
property.
.,pk are distinct primes
px,p2,..

the

(e) Show that

if

and eue2,.. .9ek

are

of n =
then the number of positive divisors
integers,
positive
Hint:
each
\342\200\242
is
Note
that
+
+
+
D1)..
l)(e2
.(ek
(ex
PeiPe2- -Pkk
1
2
or
or
or
times
a
of
0
or
as
factor
will
e,
appear
prime pt

...

any positive
2. If

of

division

p is a prime, let E(p) be

to and includingp, that is,


better word,callp a Euclidean

of Example1.10.4
was

(a) Show that


(b)

3.

For

n <

4. (a)

to the product of all primesup


= (2 3 5 7
1. For lack of a
+
if E(p) is a prime.
prime

1 added

E(p)

... p)

13is not a Euclidianprime.


primes less than or equal to 21.
n > 2, prove that there is a primep

each

integer
n\\.

Show

integer

consider

Hint:

each

that

prime

q =

n\\

is of

the

Modify

such

that

apply exercise 1(a)).


in + 1 or 4n + 3 for some

1, and
form

n.

(b) Show that the productof2 integersofthe form


n is an integer, is again of that form.

(c)

(Theproof

by Euclid.)

published

all Euclidian

Find

p <

first

n.

the

proof

many

infinitely

of Example
of the
primes

4rc

1, where

1.10.4 to show that there are


form 4rc + 3, that is, show
that

4rc
than k primes of the form
+ 3 for any
k.
Hint:
are
positive integer
SupposePi,p2,...,p* k primes of
- 1 and use exercises
the form in + 3. Consider4pxp2..
.pk
and
4(b).
1(a),4(a),
6rc + 1 or 6n + 5.
(d) Show that each prime is of the form
Show
that
the
of
two
(e)
product
integers of the form 6rc + 1,
where n is an integer, is again ofthat form.
1.10.4 to show that there are
the
of Example
(f) Modify
proof
form
6rc 4- 5.
of
the
infinitely
many
primes
- 2
Show
that
there
are
(g)
infinitely many primes p suchthat
p
is not a prime. Hint:useexercise
4(f).

there

are

more

119

Induction

Mathematical

Goldbach conjecture is a famous


unsolved
which
problem
that
even
than
4
is
the
sum
of
two
every
integer larger
conjectures
odd primes. For instance,6 = 3 + 3, 8 = 5 + 3,10 = 5 +5, and so
on. Verify the Goldbach conjecture for all even integers
between 12

5. The

and 50.

6. Let

an integer; prove that exactly one integer


in any
m.
consecutive
is
divisible
sequence
by
integers
= n2 - n + 2 takes
Observe
that
the
function
(a)
polynomial
f2(n)
=
on
n
for
values
0,1.
only
prime
(b) Observethat/3(n) = n2 - n + 3 takes on only prime values for
1 be

>

of m

7.

n =

0,1,2.

(c) Define an integer m to be \"lucky\" if/m(rc) = n2 - n + m takes


on only prime values
for n = 0,1,2,..
.,m - 1.We have observed
in (a) and (b) that 2 and 3 are lucky
numbers.
Show
that 5,11,
41
and
also
are
numbers.
17,
lucky
also be prime.
(d) Prove that a lucky integer m must
In fact, show that if p is a
Show
that
13is
not
a
(e)
lucky
integer.
>
the
then
units
10,
lucky
integer
digit of p must be 1 or 7.

Hint: considerthe units digit of several values of n2 - n.


= n2 + n + m takes
that
on
(f) If m is a lucky number,prove
g(n)
=
n
2.
values
for
0,1,2,...,m
only prime
= m2 - m + m is not a
If m is a lucky number, showthat fm (m)
(g)
s
how
not prime.
is
+
1)
prime. Likewise,
that/m(m
if
n2
n + p is a primefor
Call
a
(h)
lucky
prime
p super-lucky
n = p + 2. Check that of the sixlucky
41
2, 3, 5,11,17,
primes
all are super-luckyexcept2.
for n = p + 3.
a similar
Make
investigation
n = p + 4.
n2 - n + p is always
that
Show
composite
One
to
search
for
formulas
that
be
(i)
tempted
general
might
we
observe
that
the
generate only prime integers.First,
= 2n + 1 takes on prime values
polynomial
for
h(n)
infinitely
is
n.
for
values
of
of
not
But,
course,h(n)
many
prime
n
values
of
also.
infinitely many

Prove

the

that

where a
every

and

value

quadratic

are

of n.

integers,

g(n)
polynomial
take on
cannot

Hint: observe that

n2

an

+ 6,

prime values

there is an integern0

for

such

m = g(n0) > 1 and g(n) > m for all values of n > n0. Then
observethatg(n0 + m) - g(n0) is divisible by m.
The sameideas of proof prove that for any nonconstant
that

g(x)

polynomial

such

that

g(k)

with

integer

is not

coefficients

prime. The

only

there is a
other

technical

value

fact

the proof of this fact is the Binomial


Theo2.7. For instance, use the Binomial

required

to complete

Theorem

of Section

120

Chapter

1: Foundations
rem

that for

to observe

divisible

always

any integersm

m. Choosen0

is divisible by

and

+ m)1 -

n0, (n0

concludethatg(n0 +

by m. Then

according

hint given

the

to

is

nl0

- g(n0)

m)

for

quadratic polynomials.
8.

that is not prime is saidto be composite.There


long sequences of consecutivecomposite
24, 25, 26, 27, 28 is a sequenceof5 consecutive

A positive
integer
can
be arbitrarily
integers.

For

instance,
integers.

composite

sequence of 7 consecutivecompositeintegers.
integer n, find an integer a (dependingon n)
such that none of a, a + 1, a + 2,.. .,a + n - 1 is a prime

(a)

Find a

(b)

Given

a positive

integer.In other

9.

find

words,

of n consecutive

sequence

(c)

composite integers. Hint: considera = (n + 1)! + 2, where


(n + 1)! means the product (n + l)(n)(n - 1)... (2)(1).
2n - 1 for some integer n.
Find
four primes of the form
n is prime.
if 2n - 1 is prime then
Hint: use
Prove
that
I.
and
11of
The
exercise
of the
part
primes
contrapositive
form 2n - 1, for n an integer, are calledMersenneprimes.
Prove
that
the converse of part (b) is false by showing
that
23

(d)

Prove

(a)
(b)

divides 211-

is a

= 2.

then a

(e) Prove

positive integersuch

- 1 is prime, then 2n_1

if 2n

that

(Thus,

1.

if a

that

all positivedivisions

sum of

is the

an

that

(2n

1)

of N

\342\200\224
1 is

prime,

- N is perfect.
different

from

N.)

10. (a) Find four

of the

primes

(b) Prove that

if

2k

1 is

form

2n

1 for

prime, then n

an integer

n.

= 0 or n = 2k

(c)

The
Show

that Fl9F2,F39
11.

for

some

k. Hint: use exercise12of part I.


of the form Fk = 22* + 1 are called Fermat primes.
primes
that
of F5. Show
F5 is not prime. Hint: 641is a divisor

integer

and F4

are

a prime of the form


(b) Find a primeofthe form
(a) Find
(c)

Prove

that

(d)

Prove

that

the prime
the prime

primes.

for some integer n.


1 for some integer n.

n2

+ 1

n2

of (b) is unique.
you found in (a) is not unique.

Section

1.10

Selected

for Section 1.10

Answers

3.

Inductive

1 +292

i2 j.

121

Induction

Mathematical

4-

step:

/
_l rc
\342\200\242
\342\200\242
\342\200\242
4- \342\200\2362
+,

+ 1) =
(n \302\2611^2

4- 1)

4- l)(2rc

n(n

+ 1) + 6(n +

+ l)(2ra

n(n

+ ,(n + ^2
1)J
)

D:

(n + l)[(n)(2i

i + 1) + 6(n

D]

l)[2n2 + In + 6]

(n

6
(n +

Inductive

5.

11
1-2

4-

2)(2n + 3)]

step:
+

2-3

!)[(\302\273

\342\200\242
\342\200\242
\342\200\242
4- \342\200\224

n(n

4- 1

4-

n(n
(n

4-

4-

(n

1)

4-

, (rc 4- l)(n
2)

l)(n

+ 2)

+ l)(n

+ 2)

4-

2)

n2 4- 2rc 4- 1

(n +

l)(n

\"

2)

(n +

l)(n 4 1)

(n +

l)(n 4 2)

=n + 1
n

13.

4-

for n - 1
Inductive hypothesis: Supposen(n2

True

5)

t is

where
6\302\243,

some

integer.

Inductive step:

.(n

where

l)((n

+ l)2

multiple

- (n + l)(n2
- (n + l)(n2
= n(n2 4- 5)
- 6t 4- 3[(n)(n

+ 6)

+ 2n
4- 5
4-

3rc2

4- 2n 4- 1)
4- 3(rc

+ l)

+ 2]

4- 2)

- 6(* +

s),

4- 2) = 3[(rc)(n 4- 1) 4- 2] = 65. Note that


4n, n(n
1) 4- 2 is even so that 3[(n) (rc 4- 1) 4-

3rc2 4- 3(rc

integer

4- 5)

of 6.

for

any

2]

is

122

Chapter

1: Foundations

26.

that / (n) is any


that f (n) = g(n) for all
Suppose

n >

integers

induction.
(a)

of induction.

Basis

(1) and

(2). We show

0 by strong

mathematical

satisfying

sequence

= 10 = /

Clearly g(0)

fill

(b)

Inductive

0 < i

hypothesis.

< k where k >

1.

= /

thatg(t)

Suppose

and

(0)

(i) for

~ f (k
that
(c) InductionStep.
g (k + 1)
>
k
Since
1, k + 1+ >2sothat/(fc + l)-7/(*)
Show

But

inductive

by the

then

f(k +

integers

- 10/(k-

1).

(7)2*

/(fc)-*(*)-(3)5*+
1) - g(fe - 1)

5* + 7
1) = 7(3 \342\200\242

(3)5*\"'

\342\200\242

2*)

= 5*-!(7

10

\342\200\242
3 \342\200\242
5

= 5*-!(3 . 52)
- 3

1).

all

hypothesis

and / (k
But

- 29

g(l)

\342\200\242
5*+1 +

(7)2*\"'.

10(3

\342\200\242
5*\"1 +

\342\200\242
+

2*_1(72

3)

\342\200\242

2*\"1)

.2-10-7)

\342\200\242

2*-1(22
\342\200\242
2*+1 =

7)

g(k

+ 1),

and the proof is complete.

III.

(c)

Since

+ 29

= (23)(56)

1317

56 -

(1)(29)

27

29 = (1)(27)

+ 2
27 = (13)(2)+ 1

gcd(1317,56) = gcd(56,29)
=

2-(2)(l)

gcd(29,21)

=gcd(2,l)

gcd(21,2)

-gcd(l,0)

-1.

REVIEW FOR CHAPTER ONE

1.

and

converse

Write.the

(a) If < y
(b) If p is
x

congruent

the contrapositive

and y<)t,

then x = y.

odd

then

an

to

prime,
5 modulo

6.

p is

of the

statements.

congruent to 1 modulo 6 or

Section 1.10

(a) x is an integer or y is
(b) In order for a relation

be

for an

it be divisible
3. Write a nontrivial
(b) No
x >

(a) 3n >
(b) / (n)

not

are

by

for

of each of
transitive.

the following statements:

and /(*) -

Euclidian

the

7/(n

1)

- 12/(n

follows:/(0) = 7,
2)

for

all

algorithm

at a party

pairs

Prove that

15 people.

of

to find

the GCD

integers
+

5(4n)

(greatest common

and 4410.

924

of

8. Suppose there are59different

who know each other


of people
at least onepersonat the party

persons at the party.


and
A bag of M&M's contains brown, tan, yellow,
orange
green,
the bag to
from
M&M's. How many M&M's must you
grab
guarantee that you will have 8 brown or 5 tan or 6 yellow or 10
fewer other

7 or

knows

greenor 12

M&M's?

orange

10.

recursively as

defined

/ is

function

2.

2. Prove by mathematicalinduction that/(n) = 2(3n)


all integers n > 0.

divisor)

that

is sufficient

m and n

then

m/ny

- 26,

7. Use

9.

6, it

are both even integers.


the
by finding a counterexample:
conjecture
following
n\\ for all positive integers n.
= n2 - n + 17 is
primefor all positive integers n.
=

6. Supposea
n >

it

3.

5. Prove by mathematicalinductionthat
(a) 4n > 3\" for all integers n > 1.
(b) 2n\"x (3\" + 4n) > T for all integers n >
5n > n5 for integers n > 6.
(c)
/(I)

it is necessarythat

prime numbers are even.


2 or y is negative.

V2

Disprove

2 and

negation

relations

(d) If

integer.
to be asymmetric,

integer n to be divisible
by

(a) Some
(c)

an

antisymmetric.

In order

(c)

\"If...

form.

then...\"

4.

equivalent statement in

each statement, write an

2. For

123

Induction

Mathematical

Tell
(a)

whether
If there
March.

banks
(b) If

each argument belowis valid or invalid.


in March,
is a legalholiday
then the banks will close in
in
the
There is no legal holiday
March.
Therefore,
close

not

will

is

an

reflexive.
R

equivalence
is

an equivalence

(c) If xy = 0, then

in March.

reflexive

then R is transitive
relation,
but not transitive. Therefore, R is

relation.
x

= 0

or y =

0. x = 0. Therefore,
y

0.

and
not

124

Chapter 1:Foundations
12.

the

a valid conclusion for


Supply
following
If the positive integer n is even

of n is

6 or 8.

If the units
of n2

digit

The

13.

positive

or 6.

digit

the

that

Suppose

of the

digit

is 4

units

argument:

and perfect,then

of n2

is not

circumference

the

units

digit

integer n is 6 or 8, thenthe units

4 and not 6. Therefore,...


of a circular wheelis divided

into

40
are
integers 1 through
randomly
of 4
assigned to these sectors.Provethat thereisat leastone group
is 82 or more.
consecutive sectors whose sum of assignednumbers
14. Suppose that no pine tree has more than 9000 pine cones and that
in Leon County. What is the largest
trees
there are 6,381,400
pine
integerthat can be used for n in the following assertion?Thereare

sectors

40

at

least

and

n pine

that the

trees in Leon

County

with

the

same

number

of pine

cones.

15. Constructa truth table for the propositional function


(p~ ~r) A [(r\342\200\224q) V ~q]
\342\200\224\342\226\272
\342\200\224is a
16. Prove that {[(p V q) \342\200\224*
r)
r] A (~p)}
(q
tautology by
to
an
abbreviatedtruth
table.
appeal
17.Find the error in the following \"proof\" by induction that 1 +
2

2+

\342\200\242
\342\200\242
\342\200\242
+ n

(l/8)(2n
(l/8)(4n2

the

truth

= (l/8)(2n

n. \"If 1
+ l)2 for all positive
integers
- (1/8)(2m + l)2, then l + 2+...+n
+ n + l
+
+ (* + l) - (l/8)(4n2+ 4n
+ 1 + 8n + 8)
l)2
+ 12m + 9) - (l/8)(2n + 3)2 - (l/8)(2(n
+ 1) + l)2.Thus,
of the statement for n impliesits truth for n + 1.\"

\342\200\242
\342\200\242
\342\200\242
4- n

Elementary

Combinatorics

INTRODUCTION

of computers to problems,onenormally
needs
to
and
approximately, how much storage will be required
of
about how many operations are necessary.A major
component
be determining
the number of items
estimating the storage needed may
of a particular type that have to be stored. Similarly, a knowledgeof how
the computation
involves will help in assessing the
many
operations
of program
execution
time, and thereby aid in determiningthe
length
able to answer such questionsof
potentialcostofthe computation.
Being
the form \"How many?\", is important if one attempts to compare
of computation
or even to decide whether or not a
different
methods
For

know,

most

applications

at least

is feasible.

computation

given

to determine
by the methods and concepts
are (n - 1)!- (n - l)(n - 2) . . . (3)(2)(1)
and
different
of visiting
each of n cities exactly onceby starting
ways
each trip at a given
the most straightforward
Furthermore,
finishing
city.
the
round trip would be to list all (n - 1)!routes
shortest
way of finding
and
each
route.
Such a
calculate
the total distance associated with
has the
or \"exhaustive
process of \"completeenumeration\"
searching\"
of using such an
virtue of being easily programmed,
but
the
problems
of cities is not small. For
algorithm become apparent if the number
the
for a single route requiresn additions
total
distance
instance,finding
and
total
number of
the
since there are (n - 1)! different
routes,
to
additions is n\\ Thus, if there are 50 cities, 50!is approximately
equal
3 x 1064,and even if the computer
109 additions per second,it
performs
in

For example,

we will

this

that

chapter

be

able

there

12G

Chapter

Combinatorics

2: Elementary

1047 years

than

more

take

will

just to perform the additions

by

required

this algorithm.

Therefore, we need to find


searching. If on the other hand,

required only

be

n2

after

found

could

algorithm

then for n = 50 cities, a


2500 operations
and these could

operations,

only

by the

1 second

than

another

mere exhaustive
be found that

than

better

algorithms

shortestroutecould
be performed less
in

same computer that required1047

to perform

years

50! operations.

The basic ideas,techniques,and concepts


of storage
assessmentof the amount
and

the topicof

this

numbers of a certain type,

n -digit

the reader

but

etc.,

form,

plates,

or

numbers,

should keep in
would

words

certain form,

require

settings suchas
of

number

the

of prescribed

of words

number

the

to make an

algorithms entail is

very elementary

plates of a

of license

number

the

counting

will use

We

chapter.

for one

necessary

work that

mind that a list of suchlicense


that amount of storage in a

computer.

BASICSOF COUNTING
If

is a

set, let

us use | X

| to denote

in X.

of elements

number

the

Two Basic Counting Principles


Two

problems.The
its parts;

as \"building blocks\" for all counting


of
essentially
says that the whole is the sum
act

principles

elementary
first

it is at

principle

onceimmediateand

we need

elementary,

the details.

SumRule:

the
|S2|+.

union

of

The

of

principle

nonempty

disjoint

counting.

disjunctive

subsets

Su..

then
.,S\342\200\236,

clear on

If a set X is
- | Sx | +

|X |

\342\200\242
\342\200\242

+|SJ.

must
We emphasize
that the subsets SUS2>..
.,Sn
\342\200\242
\342\200\242
common. Moreover, sinceX = Sx U S2 U \342\200\242
US,,

in exactly oneofthesubsetsSt.In otherwords,


ofX.
If the subsets SX,S2,..
principle

profound

only be

will

were
.,S\342\200\236

be

needed\342\200\224the

allowed
principle

no elements in
each element of X is
.,Sn is a partition
SUS29*.

to

have

overlap,
of inclusion

then a

more

and

this principle later in Section2.8.


of asking
for the number of elementsin a set per
instead
Frequently,
some
ask
how
for
many ways a certain event can happen.
problems
The difference
in semantics, for if A is an event, we can let X
is largely
bethe setofways that A can happen and count the numberof elementsin
X. Nevertheless,
events.
let us state the sum rulefor counting

exclusion.

se,

We

will

discuss

Section

Basics of Counting

2.1

127

If Ei9...
J5n are mutually exclusive events, and Ex can happen
ex ways,
E2 cart happen e2ways,..., En can happen
en ways, then Ex or E2 or... or
\342\200\242
\342\200\242
can
4- en ways.
En
ex + e2 4- \342\200\242
happen
exclusive
events
Ex and E2 mean
Again we emphasize that mutually
that Ei or 2?2 can happen but both cannot happen simultaneously.
The sum rule can also be formulated in terms of choices:If an object
in ex ways and an object can be selected
canbeselected
a reservoir
from
in e2 ways, then the selection
from
ofone object from
a separate
reservoir
either one reservoir or the othercan be made
in ex + e2 ways.

Example 2.1.1. In

how
can we draw a heart or a spade
many
ways
of playing cards? A heart
or an ace? An ace or a
2 through 10? A numbered
card or a king?
king? A
Since there are 13hearts
and
13 spades
we may draw a heart ora spade
in
13 + 13 = 26 ways; we may drawa heartor an ace
in 13 4- 3 = 16ways
since
there
are only 3 aces that are not hearts.We may draw an ace or a
10 in each
2 through
king in 4 4- 4 = 8 ways. There are 9 cardsnumbered
of 4 suits, clubs,diamonds,hearts,or spades,
so we may choose a
numbered card in 36 ways. (Note: we are counting acesas distinctfrom
numbered
in 36 4*
cards.)
Thus, we may choose a numbered cardora king

an

from

4 =

deck
ordinary
card
numbered

40 ways.

Howmany

2.1.2.

Example
two

distinguishable

rolled? Howmany

can

ways

Let label the


the ordered
us

pair

ways

outcome
(1,3).

can

we get

a sum of 4 or of

one die is red and the


we get an even sum?

dice (say

of a

Then

other

8 when

is white)

are

1 on the red dieand a 3 on the white die as


that the outcomes (1,3),(2,2),and

we see

whose sum is 4. Thus,thereare 3 ways to obtain


obtain
the sum 8 from the outcomes(2,6),(3,5),
whose sum is 4
and (6,2). Thus, there are 3 4- 5 = 8 outcomes
(4,4),
(5,3),
number of ways to obtain an even sum is the sameas the
or 8. The
or 12. There is 1 way
of ways to obtain either the sum
number
2,4,6,8,10,
to obtain
the sum 2,3 ways to obtain the sum
4,5
ways to obtain 6,5 ways
to obtain an 8, 3 ways to obtain a 10, and 1 way to obtain a 12. Therefore,
= 18 ways to obtain an even sum.
there are 1 + 34-54-54-34-1
(3,1)

are

the sum

only ones

the

4. Likewise,we

is worthwhile to discuss the semantical


distinct and distinguishable. In the above
becausewe had two dice and not just
the
two
dice
were
distinct
example,
one die;moreover,
the two dice were distinguishable
by color so that their
from the outcome (5,1). Yet if the
outcome(1,5)could be differentiated
as size, color,
two distinct
dice had no distinguishingcharacteristics
(such
a
such
differentiation.
make
not
or
we
could
then
smell)
weight, feel,

Perhaps

at

differences

this

between

it
stage
the words

128

Chapter

Combinatorics

2: Elementary

Example

2.1.3.

How many

can

ways

indistinguishable dicearerolled?

An

even

we get
sum?

Had the dice been distinguishable, would


outcomes(2,6),(3,5),
and (6,2), but
(5,3),
we

(4,4),

a sum of 8 when two

of 8 by the
dice are similar,

a sum

obtain

since the

and (6,2) and, as well, (3,5) and


cannot
be
(2,6)
(5,3)
and thus we obtain the sum of 8 with the roll of two similar
dicein only 3 ways. Likewise, we can get an evensum in 1 + 2 + 3 + 3 +
2 + 1 = 12 ways. (Recall from Example 2.1.2 that we could get an even
sum from 2 distinguishable
dice in 18 ways.)
Now
let us state the other basic countingrule.
outcomes

the

differentiated

Product Rule: the


..

Su

Cartesian

,Sn

product

are

Sx

illustrate Sx x
Sx

S2by

of elementsin the
II-Lx

13,

|. That

is,

\342\200\242
. \342\200\242

xSJ-IISLJSJ.

a tree

diagram
and

{aua2,az,a4,a5}

Figure

counting.

sequential

then the number


\342\200\242
\342\200\242
x S2 x \342\200\242
x Sn is the product

|SxxS2x
Let us

of

principle

sets,

nonempty

2-1

(see Figure
S2 =

\\bub2,b3}.

2-1) where

If

Section

Basics of Counting

2.1
that

Observe

the 5 elements

there are 5 branches in the first


of Sxand to eachof thesebranches

stage
there

the second stage corresponding


to the3 elements
ofS2

129

corresponding
are 3 branches
giving

to

in
of 15
x S2 can be
U (a5 x S2),
a total

branches altogether. Moreover,the CartesianproductSx


x S2) U (a2 x S2) U (a3 x S2)U (a4
x S2)
where (a, x S2) = {(di9bi)y(ai9b2)9(ai9b3)}.
for example, (a3 x S2)
Thus,
tothe third branch in the first stage followed by eachof the3
corresponds
partitioned as (ax

the

in

branches

second

stage.

.,an are the n distinct elements of Sx and


elements of S2,then Sx x S2= U-Lx (a, x S2).
For if x is an arbitrary element of Sx x S2,thenx = (a,b) where a E Sx and
b G S2.Thus,a = at for some i and b = by for some j. Thus, x = (a,,b,) G
(a, x S2) and therefore x G UT-i (<*i x S2). Conversely, if x G U-Li (a,- x
x S2) for some i, and thus x = (a,-,&,-)
where
S2), then x \302\243
(a;
bj is some
element of S2.Therefore,x G Sx x S2.
Next
that (a, x S2) and
x
if
observe
S2) are disjoint
(a,
i \302\245=
if x G (at xS2)H (a, x S2)then
x = (ahbk)
for some fe and x j since
(a;-,6,) for someI.But then (a,-,6fc) = (aj9bi) implies that a, = a}and bk = bt.
But since i ^ 7, a, # a;.
we conclude
that Sx x S2 is the disjointunion
of the
sets (a, x
Thus,
a one-to-one
S2). Furthermore \\at x S21 = |S21 since there is obviously
between the sets a, x S2 and S2, namely,
correspondence
(abbj) \342\200\224*
bj.
=
=
Then
x S2|
(n summands)
by the sum rule \\SX x S2|
2JLX
|a(\342\200\242
\342\200\242
= n|S2| = nm.
\342\200\242
+|S2|
IS2I+ IS2I+
Therefore, we have proven the product rule for two sets. The general

More generally,

bu..

rule
We

the

are

,ybm

follows

by

can

if

au..

m distinct

induction.

mathematical

reformulate
the product
can happen ex,e2,...,

,En

EuE2f...

sequence of eventsEx
\342\200\242
ex
e2 .....
en ways.

first,

followed

\342\226\241

rule in terms of events.If events


and en ways, respectively,
then the
by E29..., followed by En can happen

In terms of choices,the productruleis statedthus: If a first object can


be chosenex ways, a second e2 ways,..., and an nth object canbechosen
then a choice of a first, second, ... , and
an nth
en ways,
object can be
made in ele2-\342\200\242
-en ways.
2.1.4.

Example

If 2 distinguishable dice are rolled,in

how
many
ways can they fall? If 5 distinguishabledicearerolled,
if 100 distinguishable
dice are
are there? How many
outcomes

how

many
possible

tossed?

fall
can
(event
Ex) in 6 ways and the second
= 36 outcomes when 2 dice are
rolled.Also the third, fourth, and fifth die each have 6 possible outcomes
so there are6 \342\200\242
6 \342\200\242
6 \342\200\242
6 \342\200\242
6 = 65 possible
outcomes when all 5 dice are

The first

E2) in 6

die

can

fall (event

6 = 62
ways. Thus, there are6 \342\200\242

130

Chapter

Combinatorics

2: Elementary

are

Likewise there

tossed.

6100

outcomes

possible

when

100 dice

are

tossed.

Example 2.1.5.

of a certain state
How many
different
can be manufactured if repetition of letters and digits are allowed?
plates
can be repeated? (c)
(b) How
many plates are possible if only the letters
if only the digits can be repeated?
How
How
are possible
(d)
many
many
at all?
are possible if no repetitions are allowed

require3

and 10 possibilitiesfor

3 letters
(c) 26

by 4

followed

104 since
(a) 263 \342\200\242

Answers,

\342\200\242
24 . 104.
25 \342\200\242

the digits 1,3,4,5,6,8, and

of 4

\342\200\242
25 - 24

9?

10

plates

digits, (a)

are 26

there
each

(a) Howmany

2.1.6.

Example

(d) 26

license

the

that

Suppose

letters

English

possibilities for each of the


9 \342\200\242
10 \342\200\242
8 \342\200\242
7.
(b) 263 \342\200\242

digits,
- 9 - 8

3-digit

(b) How many

- 7.

can be formed using


can be formedif no digit can

numbers

be repeated?

There are 73 such 3-digit numbers in (a) since eachof the3 digits can be
with 7 possibilities. Likewise,the answer
to question
6 \342\200\242
5
(b) is 7 \342\200\242
since
there are 7 possibilities for the hundreds
but
once
one
is
digit
digit
usedit is not available
for the tens digit (since no digit can be repeated
in
this
Thus
are
6
for
there
the
tens
and
only possibilities
problem).
digit,
then for the samereasonthere
are
for the units digit.
only 5 possibilities
filled

of combinatorial
problems call for the
rule and the productrule,perhapseven a repeated
the
speaking,
application of both principles.Generally
solution

the

Frequently
applicationof

the sum

both

intermixed

and

approach any counting problemis by using


produce a thorough caseby case decomposition
the
counting
manageable subproblems. Then frequently
once one has decidedexactlywhat to count.
way to
principles to
best

Let us

illustrate
2.1.7.

Example

that

involve

We

can

plates

1, 2,

form

or 3

plates

a few

3 letters

26 .

followed
exclusive

104 +

262

examples.

(a) How many

different

license

plates

are there

letters followed by 4 digits?


with 1 letter

104 ways,
followed by 4 digits in 26 \342\200\242

104 ways,
and plates with
followed by 4 digits in 262 \342\200\242
These separate events are
104 ways.
by 4 digits in 263 \342\200\242
that
there
so we can apply the sum ruleto conclude
. 104 + 263 . 104- (26+ 262
+ 263)104
plates with 1, 2,
we have
to
Now we can use what
learned
by 4 digits.

with 2 letters

mutually

are

with

these
two
into small,
itself is easy

or 3 letters followed
solve the nextquestion.

Section

Basics

2.1

(b) How many


followed

different

1, 2,

by

3, or

are there

plates

4 digits?

131

of Counting

that involve 1, 2, or 3 letters

to (a) we see that there are (26+


Followingthe patternofthe solution
followed
+ 263)10 ways to form plates of 1, 2, or 3 letters
by 1 digit,
(26 +
(26 + 262 + 263)102 plates of 1, 2, or 3 letters follwed
by 2 digits;
262 + 263)103
platesof 1,2,or 3 letters followed by 3 digits, and (26 +
262
+ 263)104
Thus, we can
by 4 digits.
plates of 1, 2, or 3 letters followed
apply the sum rule to conclude that there are (26 + 262 + 263)10 + (26 +
262
+ 263)102
+ (26+ 262 + 263)104 = (26 + 262 +
+ (26 + 262 + 263)103
to form
+ 102 + 103+ 104)
263)(10
ways
plates of 1,2, or 3 letters followed
by 1, 2, 3, or 4 digits.
can you now conjecturehow
seen
the above
(c) Having
explanations,
1 to 10 letters
followed by from 1
there are that involve from
many
plates
to 10digits?
262

the

using

digits

already seen in

We have

three-digit

Likewise,

7-6-5
(b)

are

there

that

\342\200\242
6

2-digit

possible

no

is allowed?

repetition

there are

no

no

with, the maximum

number of digits would

product rule, we

that

see

we may

two-digit

numbers, 7-6-5

numbers,

numbers,

and

The

ruleto see

there

that

7-6-5-4-3-2

7 integers to
be 7. Applying

7 +

+ 7-6-5-4-3-2-1

7-6 +

6 = 42
numbers, 7 \342\200\242
four-digit

\342\200\242
4 \342\200\242
6 \342\200\242
5 \342\200\242
3 \342\200\242
2

six-digit

events

7-6-5

different

work
the

two-digit numbers, threeso we apply the sum

numbers,
exclusive

mutually

are

to

so we can form

seven-digitnumbers.

one-digit

forming

the

numbers,

7-6-5-4-3-2-1
of

6, 8,

4, 5,

numbers, etc. But

three-digit numbers,7-6-5-4

five-digit

events

only
have

form 7 one-digit

\342\200\242
4 \342\200\242
6 \342\200\242
5 \342\200\242
3

digit numbers,etc.,are

problem

or three-digit

and we have

are allowed

repetitions

in this

specified

numbers,

two-digit

numbers,

1, 3,

are allowed?

repetitions

The number of digits are not


one-digit

7-6-5

apply the product ruleto


numbers. Hence, there are 7 \342\200\242
6 +
we can

possible two-digit or three-digit numbers.


How
numbers
can be formed using the digits
many

and 9 if

since

or 3-digit numbers can be

(b) that

2.1.6

Example

possible.

numbers

see

(a) How many 2-digit


1, 3,4, 5,6, 8, and 9 if

2.1.8.

Example

formed

numbers

7-6-5-4

we can

7-6.5-4-3

form under

the

restrictionsof this problem.

Example2.1.9.

evenand have

9.)

For

no

How

repeated

many

digits?

three-digit

(Here we

are there which are


numbers
are using all digits 0 through

to be even it must end in 0,2,4,6,or 8.Thereare two cases


First, suppose that the number ends in 0; then there are 9
possibilities for the first digit and 8 possibilities for the second since no
a

number

to consider.

132

Chapter2: Elementary

Combinatorics

\342\200\242
numbers
that end
digit can be repeated. Hence there are9 8 three-digit
not end in 0. Then there are4 choices
does
in 0. Now supposethe number
this
for the last digit (2,4,6, or 8); when
is specified, then there are
digit
for
first
8
the
since
the
with
cannot
number
digit,
only
possibilities
begin
0. Finally, there are 8 choicesfor the second
are
and
therefore
there
digit
that
do not end in 0. Accordingly since thesetwo
cases
8-8-4 numbers
are mutually
9-8
even three-digit
+ 8-8-4
exclusive, the sum rule gives

numberswith
Indirect

no

digits.

repeated

Counting

It is sometimesbeneficial
some combinatorial
to solve
problems by
the complement
of a set. We will
that
is,
counting indirectly,
by
counting
this more when we consider the principleof inclusion
and
discuss
but for now let us list a few examples.
exclusion
us determine, by counting indirectly,
integers less than 109that contain the

Let

2.1.10.

Example

of nonnegative

number

the

like 000002578

a representation
course,
9 positions
can
consider

8, or 9.

are

There

are 109 -

there

99

to be filled with

99 such integers that


- 612,579,511
integers

1.

digit

containthe
9-digitnumbers.
is actually a 4-digitnumberso

the integers lessthan 109that do not


we determine
First,
1. We are considering
1-digit, or 2-digit,..., up to

digit

Of

we

of the digits 0, 2, 3,4,5,6,7,


any
do not contain the digit 1. Thus,
less than 109that do containthe

1.

digit

Example

cards and

be

drawn

We

2.1.11
a deck
of 52
Suppose that we draw a card from
replaceit beforethenextdraw. In how many ways can 10 cards
so that
the tenth card is a repetition of a previous
draw?

draw 10cardssothat

10th

the

First, choose what

as follows.

this

analyze

indirectly. First we

this by counting

answer

ways we can

card

the

count

is not

10th

card

the

of

number

a repetition. We
will be. This can

then each
be donein 52 ways. If the first 9 draws are different
from
this,
51 cards. Thus, there are 519ways to
of the 9 draws can be chosen
from
draw the first 9 cards different from the 10th card. Hencethere are
ways

(519)(52)

the previous

to choose
9 draws.

cards where

the

there are

10th

card

replacements.

Example

2.1.12.

In how many

that a certain pair of

them

are

different

5210- (519)(52)
ways

the 10th is a repetitionsincethereare

cards with

row so

10 cards with

Hence,

5210

ways

from any of
to

ways can 10peoplebe seated


to each other?

not next

10

draw

to draw

10

in a

Section

of Counting

Basics

2.1

133

10!ways

of seating
all 10 people. Thus, by indirect counting,
the number of ways of seating
the 10 people where the
certain pair of people (say, A and B) are seated nextto eachother.If we
then
there
are 9 total entities to arrange
treat
the pair A B as one entity,
in 9!ways. But A and B can be seated nextto eachother in 2 different
orders, namely A B and B A. Thus, there are (2)(9!) ways of seating all 10
to our problem
people whereA and B are next to each other. The answer
then is 10! - (2)(9!).

There are
need

we

count

only

One-to-OneCorrespondence
There

is,

another

finally,

technique

that is

in counting.

used

often

In

the problemat hand is replaced by another problem where


of objects of the
it is observedthat there are exactly
the
same
number
In other
first
as there
are of the second type.
words, a one-to-one
type
of the first type with
those
the objects
correspondence is set up between
B is
of the second. (A one-to-one correspondencebetween2 sets A and
A onto B.) Of course, we would hope that
from
just a one-to-one function
in the new context
ofthe second type
we can see how to count the objects
more readily than those of the first
type.
this technique

single elimination

Suppose that there are 101players


tennis tournament. In such a tournament,

who loses a match

must drop out, and

2.1.13.

Example

some

players remaining

no

are

player\342\200\224there

players

victory

problem

until

is: how

this

left

someone

player

of

the

in a

any player

in a

victory for

tournament,

as possible,

pairs

the

but if there

a bye (which meansan


round) Enough rounds are

receives

in this

player remains who


many matches must be played

single

ends

match

round

are matchedinto as many

is an odd numberof
for
automatic
played

every

In each

ties.

entered

wins the
in

tournament.

The

total?

two approaches to this problem.The straightforward


The
50
analyze each round of the tournamentas follows.
winners
and bye will go into the second round and pair into 25 matches
will
and
a bye.
After this the 25 winnersand the bye
go into the third
round wheretherewill be exactly 13 matches. The fourth round will have
3 matches
and a bye; the sixth,2
six matches
and a bye; the fifth
round,
matches;the seventh will have 1 match and the winner of the seventh
must
be 50 + 25 + 13 +
round wins the entire tournament.In total,there
6 + 2 + 1 = 100matches.
thereis a better way to solve this problem. Observethat
Nevertheless,
of matches and
thereisa one-to-one
the number
between
correspondence
the numberof losers.Each match has one and only one loser and each
loserwas eliminated
in one and only one match. Therefore,the total
There

approach

are

is to

134

Chapter

Combinatorics

2: Elementary

number of matches is the sameas the total number


there are 101 players and at the end thereis only

there must

Consequently,

100

been

have

of losers.
one

player.

100 matches

and hence

losers

start

the

At

undefeated

are requiredto determinewinner.


a

of the

One

nice features of the secondapproachis that

its solution can be


similar to the one above

generalized.

Any

that

starts

with

single

n contestants

matches in orderto determinea winner.


the number

Determine

2.1.14.

Example

the

will

and

problem

tournament

elimination

require

- 1

of subsets of a set with

elements.

Let Sn be the
calculate the value

number of subsetsof a set with


of

Sn for a

few values of n to

sn

16

Then

elements.

we

determinea conjecture.

if
where the set contains the 3 elements
then
a,b,c>
the 3 singleton
total of 8 subsets includingthe empty
sets:
set,
3 subsets with 2 elements
each: {a,M,{a,c},{6,c}, and finally, the
{a},{6},{c},
entire set {ayb,c}. From this meager information, we conjecture that, in
to the reader).
general,Sn = 2n (a fact perhaps already familiar
Now let us give a proof that Sn = 2n. We could prove the result by
but we shall apply the productruleand the idea
mathematical
induction,
of one-to-one correspondence. Let V = {xlfx2,..
.,xj denote the entire set.
Then if T is any subset of V, assign the rc-digit binary sequence
G T and yt = 0 if xt $ T. In this manner we
- ->yn) where
y{ = 1 if xt\342\200\242
(yi>y2v
to each subset of V. For
associate a unique rc-digit
sequence
binary
if T = {jc1,jc3,jc5},
then the associatedn-digit
is
instance,
binary
sequence
(1,0,1,0,1,0,0,..
.,0) indicating xx G T, x3 G T, x5 G T but that the other
n 3 elements are not in T. Moreover,to eachn-digit
binary
sequence
is a unique subset of V. For
the binary
there
example,
sequence

For example,

n = 3

is a

there

We
understand
(0,1,1,0,0,1,0,.. .,0) correspondsto the subset {x2,x3,x6}.
that we have establisheda one-to-one
between
the
correspondence
of all n-digit binary
of subsets
of V and the collection
collection
sequences.Thereare clearly 2n n-digit binary sequences so that there are,

then

2n subsets

likewise,

of V.

to Computer Science

Applications

of n variables is defined by
0 or 1 to eachofthe 2n n -digit binary
How many Boolean functions of n variablesarethere?

2-valued

assignment

of

a value

Boolean

function

of either

the

numbers.

Section

Basics

2.1

are 2

Since there
rc-tuples,

by the rule

to

ways

assign

to each of

a value

of product thereare

2-2

135

of Counting

the

2n

binary

22\"

T factors

ways to assign all the values,and therefore22\" different


of n variables.
A 2-valued
can be represented
function
Boolean
the

n -digit

binary numbers

and their values

Sucha tabular form is also known


function. For example,
the
following
Booleanfunction
of four
variables:
Four-Digit

Binary

are

as the truth

in tabular form

table of a 2-valued Boolean


table of a 2-valued

Number

Value

0000

0001

0010

0011

0
1

0101

0111

0
1

1000

1001

0
0
0
0
0
0
0

1010

1011

1100

1101

1110

1111
2-valued

after

unchanged

How

many

all the

self-dual

there?
Partitionthe set of

Boolean

Boolean

is one which will


remain
table are interchanged.
of n variables are
functions

n -tuples

into

function

O's and l's in


2-valued

2n

binary

where

table below.

is a truth

table

0110

self-dual

in the

given

0100

functions

Boolean

the

truth

2n_1

each

blocks,

block

a self-dual
In constructing
containing an n-tuple and its l's complement.
the
value
block
a
fixes
a
to
either
memberof
value
function,
assigning
value
that must be given to the other member.
So,independent
there are 22\"_l
assignments may
be made for only 2n~l of the 2n rc-tuples.
Thus,
n
variables.
different
of
self-dual
Boolean
functions

The applicationsof the 2-valued


is quite important
the nature and applicationsof switching
Boolean functions

Boolean
to

computer
functions

and

functions,

scientists
and

self-dual
who study

logic design.

It is

136

Chapter

Combinatorics

2: Elementary

therefore

important
Further

them.

enumerate

to understand their propertiesas


discussion
of this subject is given

well
in

to

as

6.

Chapter

Factorials

Frequently it is useful to

each positive integer we define n\\ =


1 = the productofall integersfrom 1 to n.

For

2.1.1.

Definition

...3.2.

(n-l)(n-2)

Also define

0! = 1.Notethat

Thus,

4! = 4

\342\200\242
2 \342\200\242
3 \342\200\242

6! = 6

\342\200\242
4 \342\200\242
5 \342\200\242
3 \342\200\242
2 \342\200\242

1,

7.6.5.4.3.2.1

We read n\\ as \"n factorial.\"


It is true that 4! = 24 and

relation

n\\

rather

n[(n

6! =

than

Exercises

\342\200\224-\342\200\224

3-2-1

3!

6,

4!-

6! =

720,

7!

frequently we leave our answers


Nevertheless, the

us to computethe values

362,880,

of

n! for

small n

2! = 2,

5!- 120,

24,

= 5,040,

10! =

the factorials.

1!-1,

0!-l,
9! -

720 but

evaluating

- 1)!] enables

fairly quickly. For example:

\342\200\242

1,

3!

in factorial form

- 1

1!

7!
\342\200\236
\342\200\236
K
A
\342\200\242
\342\200\242
\342\200\242
4 = \342\200\224

and

such as

or 7.6.5.4.

6.5.4.3.2.1,

4.3-2-1,

for products

notation

a simple

have

3,628,800,

8!
=

11!

40,320,

- 39,916,800.

for Section 2.1

1.

How

many

seven

digits,

possible
telephone
the first two of

numbers are there when there are


which are between2 and 9 inclusive,

digit between 1and 9 inclusive,and eachofthe remaining


0 and 9 inclusive?
may
Supposethat a state's license plates consist of three letters
followed
by three
digits: How many different plates can be
the third

be between

2.

manufactured

3.

company

are

(repetitions

locks, the combinations consist


39 inclusive. Because of the construe-

combination

produces

of three numbers

allowed)?

from

0 to

Section

2.1

Basics

tion no

number can occur twice

different combinationsfor locks


4. (a) Howmany
numbers
4-digit

5,6,8,

9 if

and

(b) Howmany
(c) Howmany

(d)
(e)
5.

How
How

repetitions
repetitions
in (b)
those

if no
if

many

of those

many

of those

How many

in

can

are even numbers?

to be

(a)

How

ways are
a deck of

many

replacement) from

(b)

(d)

there to
52?

and a woman

are

who

not

select 2 cards(without

is an

at least

ace?

an

one of the cardsdrawn

is an

ways are thereto rolltwo


sum that is divisible
by 3?

8. How many
9. How

many integers

between 1 and

one 9?

10.

a, b, c, d,

letters

ways

card

first

the

(e)
(f)
(g) neithercardis
(h)

the

are there to select the 2 cards suchthat:


card
is a king?
ace and the second
the first card is an aceand the second is not a king?
the first card is a heart and the secondis a club?
the first card is a heart and the secondis a king?
the first card is a heart and the secondis not a king?

How many

(c)

using

4000?

used?

(b) either a or b or both a and b are used?


(c) the letter a is not used?
6. How many ways are there to pick a man
married from 30 married couples?

7.

using the digits 2,3,

numbers in (b) are greater than


in (b) are divisibleby 5?

3-letter words can be formed


a letter
only once if:

e, and / and using


(a) the lettera is

How many

a combination.
be attained?

can be formed
are allowed?
are allowed?

137

of Counting

How

license

different

many

plates

ace?

distinguishable

104

contain

dice

exactly

to yield

one 8

and

are there (allowing

repetitions):

3 letters and 4 digits if the 3 letters


must appear
involving
or at the end of the plate?
together either at the beginning
if the letters
(b) involving
1, 2, or 3 letters and 1, 2, 3, or 4 digits
must occur together?
11.How many 5-letter words are there where the rlrst and last
(a)

letters:
consonants?

(a)

are

(b)

are vowels?

(c) are vowels

(d)

How

many

and

the

5-letter

(if at all)asthe first

middle
words
or

last

letters are consonants?


are there if vowels can
letter?

only appear

138

Chapter 2: Elementary

Combinatorics

12.

are there (leading

How many 7-digit numbers


allowed like 0123456)?

(a)

(b)
13.

assuming no repetitions are allowed.

Do (a)-(d)

(e)

How

with

many

5?

one

exactly

is a word that reads the sameforward


9-letter palindromes are possibleusing

palindrome

How

are there

numbers

7-digit

many

not

are

zeroes

backward.

or
the

English

alphabet?

are five

14. There

roads

from

different

roads

to City

City

from

City

C, and three

to

different

B, three

City

that

roads

different

directly from A to C.
(a) How many different ways are thereto gofrom
different
(b) Howmany
ways are there from A to
How
different
(c)
many
ways are therefrom A to

A to

C via

go

JB?

C altogether?

C and

then back

to A?

(d)

How

(e)

15.

16.

different

many

to A

visit

that

How

B both

different

many

from A to C
and
going
coming?
trips are there that go from

trips

are there

and back
A

to

again

C via

and return directly


from
C to A?
How
different
are there that go directly from
A to
(f)
many
trips
C and return to A via B ?
A to C and back to A
(g) How many different trips are therefrom
that
visit B at least once?
(h) Supposethat once a road is used it is closedand cannotbe
usedagain.Then how many different trips are there from A to
C via B and backto A again
via Bl
in
different
the
how
(i) Using
assumption (h)
many
trips are there
from A to C and back to A again?
Find the total number of positiveintegersthat
can
be formed
from
the digits 1, 2, 3,4,and 5 if no digit is repeated in any one integer.
A newborn child can be given
1, 2, or 3 names. In how many
ways
can a child be named if we can choose
from 300 names (and no

namecanbe

repeated)?

17.

takes

9 positions on
on a road
players

are

There

25

(a)

how

many

(b)

how

many

pitchers

different
different

18.

teams
batting

can he field?
orders can

he make if

and he always placesthe pitcherin

his batting

(c)

a baseball team.If the baseballcoach


trip,
the

9th

has

10

position

of

he

order?

how
can the coach field if he has 4 catchers,
10
teams
many
pitchers, 7 infielders,and 4 outfielders?
In a certain programming language,an identifieris a sequence
ofa
first
character
must
a
certainnumber
the
be
of characters
where

Section

Basics

2.1

letter of the Englishalphabetand

the

either a letter or a digit.


How

(a)

are there

identifiers

many

(b) In particular, some


is a sequenceof
in

up

may be

characters

remaining

of length 5?

to 8

an identifier

of Pascal

implementations

from

139

of Counting

characters

the

with

above

Pascal identifiersare there?


19.(a) There are 10 telegrams and 2 messengerboys. In how many
to the
different ways can the telegramsbedistributed
if
are
the
distinguishable?
boys
telegrams
messenger
(b) In how many different
ways can the telegrams be distributed
and
delivered
to 10 different
then
to the messenger
boys
How many

restrictions.

people if

the

are distinguishable?

telegrams

the
that
(c) Rework (a) under the assumption
indistinguishable?
20. A shoe store has 30 styles of shoes.If eachstyle is
different lengths, 4 different widths, and 6 different
many kinds of shoes must be keptin stock?
21.

letter is sent to 10peoplein

A chain

next

each

week

(a) How many

have

people

(b) at the endofthe


22.

has 750

A company

2 people with
23.

first

the

a letter

available
colors,

are
in 12
how

week of the year. The


sends lettersto 10new

so on.

and

people,

who received

person

telegrams

the

received

letters

employees. Explain why

same

after 10 weeks?

year?

pair

there

be at

must

least

of initials.

carries 10 different sizes of tires, eachin both


tube
and
either
cord, or steelvariety, each with
nylon,
rayon
or plain black. How many
belted, and eachwith white sidewalls
kinds
of tires does the store have?
different
A

store

tire

tubeless

24.

How

integers

many

(a)

have

no

digits

(b)

have

no

digits

25.In

how

a row
(a)
(b)

(c)

many

105 and 106


between
other than 2, 5, or 8?
other than 0, 2, 5, or

8?

different

orders

can 3 men

and 3 women

be

seated

in

of 6 seats if

of the seats?
must be filled by
men occupy the first 3 seats and women
anyone
may
the
first and

sit in any
last seats

men?
occupy

the

last three

seats?

(d) all membersof the samesex are seated in adjacent seats?


are
seated
(e) men and women
alternately?
26. Find the sum of all 4-digit numbersthat
can
be obtained
by using
7.
and
the
(without repetition)
2, 3, 5,
digits

Chapter2: Elementary
27.

Combinatorics

A new state flag is to be designedwith


white, blue, and red.In how many ways

2 adjacentstripeshave

can this

in yellow,
stripes
be done sothat no

color?

same

the

6 vertical

ways can one right and oneleft shoe be selected from 10


a pair?
obtaining
pairs of shoeswithout
29. (a) If 6 men intend to speakat a convention,
in how
many orders
can they do so with B speaking
before A?
immediately
orders
are there with B speaking after A ?
(b) Howmany
30. Given 8 different English books,12different
German
and 5
books,
different Russian books, determinehow many
to
ways
arrange
these books on a shelfwhere
28. How many

(a) allbooksofthe same


(b) the 8 Englishbooksare
(c) the 8 English books are
are the right.

are

language
on
on

the
the

grouped

together.

left.
left

and

the 12

German books

on

the number

Determine

of ways to select two

books

from

different

subjects.

31. Of the integers50to 500inclusive,


(a) are there in total?

how

many

integers

(b) are

even?

(c)

are

odd?

the digit 7?

(d) contain

(e) are
(f)
(g)

100?

than

greater

are greater
are divisible

than 100and do not containthe digit

7?

by 5?

order?
(h) have their digits in strictly
increasing
32. Prove by mathematical induction that one-halfof the 6n outcomes
n distinguishable dice have
of rolling
an even
sum.
choose
a
can
we
black
33. (a) In how many
ways
square and a white
board?
on
x
8
chess
an
8
square
(b) In how many ways can we choose a black squareand a white
must not belong to
square on a chess board if the two squares

the samerow

34.

(a) In

an

(b) In (a)
diamond

ordinary

how

column?

4 cards of different suits be selected


of 52 cards?
where
the
ways can the 4 cards be selected
many
selection
as the
hearts
has the same value
selection

how many

from

or

ways

can

deck

as the club?
and the spade has the samevalue
can be made to beama red,a yellow,
35. Each of n different
posts
li^ht
the
or a green
by
light. How many different signalscan be beamed
of light posts?
array

Basicsof

Section2.1

141

Counting

athletes compete in a contest. Eachof3 judges


20
assign
to be named
ratings to the 20 athletes. For an athlete
winner he must be given
the
highest
by at least 2 judges.
rating
of cases
for which a winner is named.
Computethe fraction
of a certain
37. Ifthe population
has
3
city is 25,000 and eachresident
determine
whether or not there must be2citizenswith the
initials,
36. Twenty
different

3 initials.

same

38.

railroad

10 seats,

has

compartment

the

facing

engine

and

facing away
engine.
passengers, 4 prefer to facethe
3
face
from
to
the
and 3 have no
away
engine, prefer
engine,
In
how
can
the
preference.
many
ways
passengers be seated
Of 10

the

from

accordingto their preference?

39.

(a)
(b)

40.

distributes

mother

How

1. 8

at most

no restriction

chosen

from

on
10

2.1

Section

\342\200\242
8 \342\200\242
9 \342\200\242
104.

2.

263

7.

(a)

52

(b)

4
4 \342\200\242
47.
1 . 48 +

\342\200\242
103.
\342\200\242
51.

\342\200\242
4.

(c)
(f)

48
52

(g)
(h)

receives

child

each

one apple?

for

Answers

10.

apples among 8 children.

done if

How
can this be done if there
is
ways
many
the numberof applesa child can receive?
How many ways can a committeeof k peoplebe
people if k can be 1,2,3,...,or 10?

Selected

9.

ways

many

5 different
can this be

12 \342\200\242
47.

\342\200\242
47.

- 48

\342\200\242
51

\342\200\242
47.

\342\200\242
3 \342\200\242
82.

(a)

(b)

(2

\342\200\242
263 \342\200\242
104.

\342\200\242
10 +

\342\200\242
102 +

\342\200\242
103 +

\342\200\242

104)(26

+ 262

+ 263).

11. (a) 212

\342\200\242
263.

(b)

52

\342\200\242
263.

(c)

52

\342\200\242
213.

(d)

262

(e) 32
5
18

- 21B +

\342\200\242
213

\342\200\242
5 \342\200\242
214 +

\342\200\242
20 \342\200\242
24 \342\200\242
5
23 \342\200\242

22;

\342\200\242
4 . 21

21

\342\200\242
20 \342\200\242
19 +
-

20

- 19

18

52 . 213.

\342\200\242
4 \342\200\242
5
24 \342\200\242
23 \342\200\242

22;

\342\200\242
21 . 20

- 17.

19 . 18

\342\200\242
4 \342\200\242
21 \342\200\242
20 \342\200\242

19;

+ 5 . 21 . 20. 19.

142

Chapter 2: Elementary
14.

Combinatorics

\342\200\242
3 =

(a)

15.

+ 3 = 18.

(b) 15

(c) 182.
(d)

152.

(e)

15

- 45.
45.
\342\200\242
3 + 3 \342\200\242
15 + 152
\342\200\242
3

(f) 3
(g) 15

\342\200\242
15 =

(h) 15

- 182 -

32

15 . 18

+ 3

. 15.

\342\200\242
8.

15.

15-8

5 +

5.4 + 5.4.3

16.

300

17.

(a)

251/16!

(b)

(15!/7!)

(c)

18.

3 + 3-

+ 15-

(i)

\342\200\242
2.

+ 5.4.3.2.1.

+ 5.4.3.2
300

\342\200\242
299
+

300

15

\342\200\242
\342\200\242
299
298.

\342\200\242
\342\200\242
10.

\342\200\242
7 \342\200\242
4 \342\200\242
4 \342\200\242
2.
10 \342\200\242
6 \342\200\242
5 \342\200\242
3 \342\200\242

the identifiers are of length5 and the first character


may be
4 characters
one of 26 letters,while the remaining
can be any of the
2 or 10 digits 0 through 9. Thus, eachof the
26 letters a through
4 characters
can be filled in 36 ways.
Hence
there
are
remaining
In (a)

26

of length 5.
to count

\342\200\242
36\" identifiers

(b) Here we

asked

are

the number of identifiersof length


36 of length
2,...,
length1,26\342\200\242

up to 8. There are 26of


367 of length
8. Hence there
and 26 \342\200\242
. . . + 26 \342\200\242
367 Pascal
identifiers.

1,

or

2 etc.,

are 26 + 26 \342\200\242
36 +

26

\342\200\242
362 +

210.

19. (a)

(b) 210(10!).
give

11;

(c)

first boy

the

0, 1, 2,...,

10

telegrams

and

the

rest

to

the second boy.

20. 30
21.

\342\200\242
12 \342\200\242
4 \342\200\242
6.

10 +
10 +

(a)
(b)

23.

10

24.

(a)

\342\200\242
\342\200\242
\342\200\242
+ 1010.
\342\200\242
\342\200\242
\342\200\242
+ 1052.

\342\200\242
3 \342\200\242
2 \342\200\242
2.

36.

(b) 3
25.

102+ 103+
102 + 103+

\342\200\242
45.

= 720.

(a)-6!

(b) 3

\342\200\242
2 \342\200\242
4! =

144.

(c) (3!)2 = 36.

(d)

2(3!)2

= 72.

36 = 72.
(e) 2(3!)2 = 2 \342\200\242
26. There are 24 = 4!such
numbers.

Each

oneof the4 positions.


Thesum

these

24

numbers

is (6)(17)

of the

\342\200\242

(1111).

digit
digits

occurs 6 times in every


is 17. Hence the sumof

Section

Combinations

2.2
27.

color for

Choose the

of the

one

be

can

first

the

in 4 ways. The secondstripe


colors.Thenthe third stripe can be

3 colorsexcludingthe colorofthe
35.
The number is 4 \342\200\242
10 .

143

Permutations

stripe

3 remaining

any of
28.

and

second

stripe,

and

so on.

29. (a) 5!
(b)

2.2

6!/2

PERMUTATIONS

AND

COMBINATIONS

Definition 2.2.1. A combination


ofn objects)
(calledan r-combination

the objects.
A

of n

permutation
r of the
objects.

simply defining

the

mentioned

not

have

these

example,

element

may
it

words,

may

of the

usage

n objects

remarks will help

Some

terms

these

clarify

say

more
appear
be that the n

the properties of the n objects.For


nothing about whether or not a given

about

anything
definitions

Note that we are


and r-permutations here and

definitions.

r-combinations

the list of n objects.In other


constitutea setin the normal
do
not
objects
than once in

word.

Example 2.2.1. Supposethat


are to be madeare: ayayaybyc. Then

are:

aaa,aabyaacyabc.

taken r at a time
selection of r of

taken r at a time (also calledan ran


is
ordered
selection or arrangement of
objects)
of

permutation

n objects
unordered

of
is an

The

5 objects
the
from
the 3-combinations
are:
3-permutations

aaa, aab,

aba, baa, aac9

abc, acb9 bacy bcay caby

aca,

which selections
of these 5 objects

caay

cba.

Neither do these definitions


about any rules governing
say
anything
the selectionof the r-objects:
on
one
could be chosen
extreme,
objects
where all repetitionis forbidden,
or on the other
extreme, each object
be chosen
be some
rule of
may
up to r times, or then again there may
selection between these extremes;for instance,
the rule that would allow
a given object to be repeated up to a certain specifiednumber
of times.
\342\200\242
\342\200\242
either (1) that
We will use expressions like {3 \342\200\242
c] to indicate
by 5
a, 2
that
we have 3 + 2 + 5 = 10
3 a's, 2 b% and 5 c's, or
including
we have
3 objects aybyc where
are constrained
selections
by the conditions

objects

(2)

144

Chapter

Combinatorics

2: Elementary

that a can be selectedat mostthree

and c canbechosen
The numbers

to five

up

3, 2, and

this

in

be selected

b can

times,

at most twice,

times.
example

be

will

called

repetition

numbers.
\342\200\242
\342\200\242
of {3\342\200\242
The 3-combinations
c] are:
a, 2
b, 5

2.2.2.

Example

aab, aac,

aaa,

ccc,ccb,

ebb.

cca,

In orderto

\342\200\242
of {3 \342\200\242
a, 2
b, 2 -

The 3-combinations

2.2.3.

Example
are:

abb, abc,

aaa,

aab, aac,

cca,

ccb,

ccd,

c,

d}.

aad, bba, bbc,bbd,


abc, abd, acd, bed.

there is no limit on the number of


in
a
selection
repeated
(exceptthat imposed
by the
size of the selection)we use the symbol ooas a repetition numberto mean
that
an object
can occur an infinite numberof times.
times

an object

include

the

case

where

can be

Example2.2.4.

The

of

3-combinations

{oo

a, 2

\342\200\242
oo

b,

. c\\

are the

a and c can be repeated an infinite


same as in Example2.2.2even though
This is because, in 3-combinations,3 is thelimiton
number
of times.
of objects to be chosen.
number

If

the

selections
where each object has oo as its
we
as
then
selections
with
repetition
designate such selections
r
In
of
i
n
unlimited
a
this
case
selection
particular,
repetitions.
objects
will be called r-combinations with
unlimited
and
ordered
repetitions
any
with unlimited
arrangement of these r objectswill be an r-permutation
are

we

considering

number

repetitions.

ofa,b,c,dwith
Example 2.2.5. The3-combinations
repetitions

are

the

of

3-combinations

{oo

a\\

oo

b,

oo

such 3-combinations,namely:
aaa,

aac,

aab,

aad,

bbb, bba, bbc, bbd,


ccc,

cca,

ccb, ccd,

ddd, dda,

ddb, ddc,

abc,abd,acd,bed.

c,

oo

unlimited
. d\\.

There

are 20

Section

and Permutations

Combinations

2.2

145

with
unlimited
Moreover, there are 43 = 64 of 3-permutations
repetitions
4 ways
since the first position can be filled
(with a, 6, c, or d), thesecond
positioncanbefilled 4 ways, and likewise for the third position.

We

leave

a,b,c,d

with

The

to make a list of

the student

it to
unlimited

of
so

{\302\253>
a,

we tabulate

oo

6,

oo

c,

oo

. d\\

concreteness.

We

might,

combinations

chosen 0 or

Repetitions

aa

ab

ab, ba

ac

ac, ca

ad

ad,

da

bb

bb

be

be, cb

bd

bd,db

cc

cc

cd

cd,dc

dd

dd

10

16

that

constraints

We

list some

can be placed on
more examples just

consider selectionsof {oo.a, oo .


an
number
of times. Thus,
even
and this constraint would
numbers
and where b is chosen
repetitions

for example,

\342\200\242
.
.
The 3-combinations of {<\302\273
d}
c, 1
a, \302\253>
6, 1 \342\200\242
be chosen only an even number of times are the
3of a,b,c,d where a can be chosenup to 3 times, b can be
2 times, and c and d can be chosen at most once.The

2.2.6.

can

Unlimited

aa

where b can be chosen only


5-combinationswith these repetition
be those5-combinations
unlimited
with
0, 2, or 4 times.
Example
b

With

Repetitions

. c}
b9 oo

where

present such a

do not

2-Permutations

Unlimited

Of course,
these are not the only
are
endless.
selections;the possibilities
for

of

following table.

them in the

2-Combinations

With

3-permutations

repetitions.

2-permutations

formidablelist and

64

all

3-combinations
subjectto

these

constraints

aaa,aac,aadybba,bbctbbd,acd.

are:

146

Chapter 2: Elementary

Combinatorics

we might be interested in, say, selections


of {\302\253>.
a,
be chosen a prime number of times.Thus,
the
to these constraints would be all those 8subject
a can be chosen 2,3,5, or 7 times, b can be chosen
where
up

As another
3

example,

a can

\342\200\242
1 \342\200\242
where

c}

b,

8-combinations
combinations

to 3 times, and c canbechosen


There are, as we have
said,

place

up different
regardlessof
tion

You

selections.

on

constraints.

the

according

constraints
to our

objects

interested in two

once.

most

variety of constraints one could


let your imagination go free in conjuring
Nevertheless,
any selection of r objects,
on the selection, would constitute an r-combinadefinition. Moreover, any arrangement of these r
infinite

can just

an r-permutation.

constitute

would

While there may

at

an

be an

major

infinite

have already
unlimited
repetitions,

types:

with

described\342\200\224combinations
and
permutations

we are

of constraints,

variety

primarily

one we

the other

we

now

describe.

If the repetition numbers are all 1, then


called r-combinations without
repetitions

objects are r-permutations

without

repetitions.

r objects

of

selections

and

arrangements
We remind

are

of the

you that

r-combinations without repetitions are just subsetsof the n elements


the
containing
exactly r elements. Moreover, we shall often
drop
1 when considering
repetition number
r-combinations without repetitions. For

example,

considering

each

number is

when

repetition

we mean that in a
but,

if

it is

chosen,

given

r-combinations

1 unlessotherwise
an

selection

then in this

of {a,6,c,d}

element

we will
and,

designated,

need not

that

mean

of course,

be chosenat all,

selectionthis elementcannot

chosen

be

again.

2.2.7.
Example
objects a,6,c,d.

Suppose selections are to be made

2-Combinations
Without

Repetitions

from

the

2-Permutations

Without

Repetitions

ab

ab, ba

ac

ac, ca

ad

ad, da

be

be, cb

bd

bd,

cd

cd, dc

12

db

four

Section 2.3

without
There are six2-combinations
a total
two 2-permutations giving
repetitions.

Note the totalnumber

of

there are
without

to each

and

repetitions

of twelve

2-permutations

repetitions in

unlimited

with

2-combinations

147

and Permutations

of Combinations

Enumeration

without
of
repetitions
Example 2.2.5 includedthe six 2-combinations
2.2.7 and as well 4 other
2-combinations
where repetitions
Example
with
unlimited
actually occur. Likewise, the sixteen2-permutations
included the twelve 2-permutationSwithout
repetitions.
repetitions

3-Combinations

3-Permutations

Without Repetitions

Without

abc

abct acb,

abd

abd,

acd
bed

Repetitions

bac, bca,cab,cba
bda, dab,

bad,

adb,

dba

acd, adc,cad,cda,dac,dca
bed,

cdb, dbc,

cbd,

bde,

deb

24

without
Notethat to eachofthe3-combinations

there

repetitions

possible 3-permutations without repetitions. Momentarily,


that this observation can be generalized.

will

we

are 6
show

2.2
ExercisesforSection

1.

List

all

of {oo .

5-combinations

even number of times.

2. List

all

64

a,

of {oo .

3-permutations

oo

a,

oo

6,

oo

. c},

b,

oo

b is

where

c,

oo

chosen an

. d}.

\342\200\242
of {2\342\200\242
all 3-combinations and 4-combinations
c}.
a, 6, 3
.
\342\200\242
oo
of
5-combinationsof
the number
Determine
{l a,
b, oo . c,
\342\200\242
number
of
for
formula
the
a
1 d}. More generally,
develop
whose
letters
of a collectionof
r-combinations
aua2,...,ak
repetition
numbers
are each either 1 or oo.

3. List
4.

2.3

OF

ENUMERATION

COMBINATIONS

Generalformulas

for

now be presented.At
and
combinations

We

permutations

will wait until

enumerating
this

time,

without

AND PERMUTATIONS
and permutations
combinations
we will only list formulas for
repetitions

or with

later to use generatingfurfctions

unlimited

will

repetitions.
to

give

general

148

Chapter 2: Elementary

Combinatorics

numberof r-permutationsofn

elements

(Enumerating r-permutations

without

denote the

Let P(n9r)

where other rulesgovern

combinations

for enumerating

techniques
selections.

the

without

repetitions.

2.3.1.

Theorem
repetitions).

(n - r +

- 1)

= n(n

P(n,r)

1)

(n

r)\\

of an
are n distinct objects, the first
position
in
n
can
be
filled
This
the
second
done,
ways.
position
may
r-permutation
1 ways
since no repetitions are allowedand there are
be filled in n \342\200\224
- 1
be filled in n - 2 ways
n
can
objects left to choosefrom. The third
and soon until the rth position is filled in n - r + 1ways (see Figure 2-2).
that
By applying the product rule,we conclude

there

Since

Proof.

From the definition

of

- l)(n

= n(n

P(n,r)

this

to r

reference

explicit

are to be arranged;thus

objectswe

mean

the

case r

permutations

of

n\\

-^

\342\226\241

- n\\.

made, we

we

talk

that
all the objects
the permutations of n

assume

about

= n.

Example 2.3.1. Thereare


24

+ 1).

that

- r)\\'

is not

when

Corollary 2.3.1. Thereare

4! =

(n

becomes

formula

P(nfn)

When

- r

\342\200\242

n\\

(n

= rc,

it follows

factorials,

P(n,r)
When r

2)

n\\ permutations
3!

= 6

{a,6,c,d}.

permutations
The number

of n

distinct objects.

of {a,b>c}.
There are
of 2-permutations of

Fill

Fill

Fill

Fill

first

second

third

rth

position

position

position

position

Event 3

Event

Event

Event

Figure

2-2

Section

2.3

5!/(5- 2)!

{a,b,c,d,e}is P(5,2) words

= 20.

The number of
a,b,c,ci, and e at mostonceis P(5,5)= 120.
\302\273
5

the letters

using

149

and Permutations

of Combinations

Enumeration

. 4

5-letter

There are P(10,4) = 5,0404-digit


numbers
that
is just an arrangement
digits since eachsuch number
of four of the digits 0,1,2,3,... ,9 (leadingzeroesareallowed).
There
are
3-letter
words formed from
the
with
no
P(26,3)
English
alphabet
license
formed
repeated letters. Thus,thereare P(26,3)
(10,4)
P\\
plates
by
3 distinct letters followed
by 4 distinct
digits.
2.3.2.

Example

no repeated

contain

arranged

There are 3!ways


if

ways

many

must always
the 3

of arranging

other, we treat

to each

X. Then

how

3 men

if the

a row

in

next

In

2.3.3.

Example

7 women

and 3 men be

other?
men. Since the 3 men always
stand
to each

next

stand

them as a singleentity,

which

the women,

,W7 represents

W1,Wr2,...

can

we denote

by

we next are interested

of ways of arranging {XyWltW2fW3f...


There
are 8!
fW7}.
of
these
8
H
ence
there
are
(3!) (8!) permutations
permutations
objects.
has
to be a prescribed order of an
altogether (of course, if there
arrangementon the 3 men then there are only 8!total permutations).
number

the

in

Example 2.3.4. In

alphabet be

letters
a

can the letters of the English


are exactly 5 letters between the

ways

many

there

6?

and

to arrange the 5 letters between


a and 6,2 ways to
to arrange any 7-letter word treatedas one
remaining 19 letters. The total is P(24,5)(20!) (2).

place a and 6,and


along

20! ways

then

the

with

How many 6-digit numbers without


such that the digits are all nonzero
and

2.3.5.

Example

digits

that

are P(24,5) ways

There
unit

how

so

arranged

are there

appear consecutively

in

either

repetition

1 and

2 do

of

not

order?

asked to count certain 6-permutationsof the 9 integers


1,2,... ,9.Inthe following table we separate these 6-permutations into 4
disjoint classesand count the number of permutations in each class.
We are

Number

Class
(i)

1 nor

Neither

as a digit
(ii)

1, but
2, but

(iv)

Both

Class

7!

2 appears

not 2, appears

6P(7,5)

as a digit

(iii)

of Permutations

in the

6P(7,5)

not 1, appears
2 appear

(2)(7)(4)P(6.3)+

1 and

(4)(7)(6)(3)P(5,2)

Total

7! +

(2)(6)P(7.5)

+ (56) P (6,3) + (504)

P (5,2)

150

Chapter 2: Elementary

Combinatorics

us explain

Let

in
count the elements

how to

class

hundred thousands digit is 1 (and thus


is not 2). The seconddigit can be chosen

1. The

position 2 in 4
Hence,thereare
for

ways; then

2. The units digit is 1 (and

thereare
P(6,3)
3. The integer 1

in this

immediately to

digits

digit

ways. Choose the


positions P(6,3) ways.

2). Likewise,

category.
different from the
2 cannot appear

a position

in

appears

thousands digit and the units

ten thousands

in 7

3
in this category.
tens digit is not

the

hence

numbers

(7)4

the

other

the

fill

numbers

P(6,3)

(7)4

(iv).

hundred

Hence,

digit.

the right of 1. Since1 can be any one of the


be
digit up to the ten thousands digit, 1 can
4 ways. The digit immediately
to the left of 1 can be filled
of 1 can be filled
while the digit immediatelyto the right

the

left

in
placed
in 7 ways,

or to

tens

the

from

in any
of the remaining
ways. The integer2 can be placed
in
a 2-permutation
3
and
other2
are
thenthe
digits
ways
positions
of the remaining 5 integers. Hence,thereare (4) (7) (6) (3) P(5,2)
numbers in this category.

in 6

are

there

Thus,

+ (4)(7)(6)(3)P(5,2)

(2)(7)(4)P(6,3)

numbers in class (iv).Then,by

rule,

there are

P(7,6) + (2)(6)P(7,5)+

(56)P(6,3)

four classes.

the

in all

elements

sum

the

(Look for

(504)P(5,2)

The permutations we

linear permutations
insteadof
objects

have
for

in a

arranging

Example
themselves

line, we arrange

more properly called


arranged in a line. If

them in a circle,then

the

2.3.6. In how

5 children

can

ways

many

arrange

a ring?

in

5 children are not assigned


relativeto
oneanother.Thus,
arranged
are consideredthe sameif the children
Here, the

Hence,

the

the 4

counting

decreases.

of permutations

number

are
considering
are
objects
being

been
the

indirect

shorter

solution.)

position

of child

Cx is

other children relative to

to particular
the

the same order clockwise.


immaterial and it is only the position of
Cx

are in

that

fixed in position, there are 4!arrangements


This can be generalized
to conclude:

Theorem2.3.2.
objects

in

a circle.

There

are

arrangements

places but are only


(see Figure 2-3)

(n

counts.
of

Therefore,
the

remaining

keeping Cx
children.

1)! permutations^ of n

distinct

Section

2.3

and Permutations

of Combinations

Enumeration

151

Figure 2-3

As we did beforediscussing
\"permutation\" for \"linear

Notation. Let C(n,r)


1
distinct objectswhere
if

S is

a set

is the

with

unless

elements,

the word
would result.

we will use

permutations,

ambiguity

of r-combinations of n
number
for each element.Thus,
repetition
is the number of subsets of S with
C(n,r)
the

denote

is the

Or in the

r elements.

exactly

circular

permutation\"

number

terminology of the previoussection,C(n,r)


of n elementswithout
repetitions.

of r -combinations

number

emphasize that selections are being


are called binomial coefficients
C(n,r)
Frequently,
of (x + y)n. Moreover, it is common
becauseof their rolein the expansion
of C(n,r); nevertheless, we shall
(?) instead
practiceto usethe notation
have
to be
most
of the time so that lines of the text will
not
use C(n,r)
will
We
binomial
identities
the
theorem
and
widely spaced.
study
in Section 2.6.
binomial
coefficients
involving
of n
for
r-combinations
Now let us discussa formula
enumerating
n
without
without
of
repetition. Any r-permutation
objects
objects
the r elements [this can be
repetition can be obtainedby first choosing
done in C(n,r) ways] and then arranging the r elements in all possible
=
that
orders(this can be done in r! ways). Thus, it follows
P(n,r)
2.3.1
and
thus
We
a
from
Theorem
know
for
formula
r\\C(nfr).
P(n,r)
We

read

made.

C(n,r)

\"n

the

obtain a formula
Theorem

as

for

r\" to

choose

terms

C(nyr)

by dividing

by r!

2.3.3. (Enumeratingr-combinations
without

repetitions).

C (n,r)

Example
a deck

from

n\\

P(n,r)

r!

2.3.7.
In how many
of 52 cards?

r\\(n

r)\\

ways can a hand of5 cardsbeselected

152

Chapter

Combinatorics

2: Elementary

of52cards.Thus
is essentiallya 5-combination

Each hand

52

52!

C(52,5)

. 49

\342\200\242
51 . 50

. 48

5.4.3.2.1

5! 47!

52

such hands.

\342\200\242
51 \342\200\242
49 \342\200\242
2 =
10 \342\200\242

2.3.8. (a)

Example

2,598,960

How

5-card

many

hearts?

to
hearts
13
Since there
of 13objects.
5-combination

choose

are

C(13,5)

5-card

(c)

How

from, each
a total of

only of

such hand is a

. 9

10

5.4.3.2.1

L(lSfb)=w&r

- 13

consist

hands

13! 13. 12. 11.

rm.

(b) How
For each

is

there

Thus,

are

there

\342\200\242
11 \342\200\242
9 =

1,287.

many 5-cardhands consistof cardsfrom a single suit?


of the 4 suits, spades, hearts, diamonds, or clubs, there are
hands.
there are a total of 4 C(13,5)suchhands.
Hence,
many 5-card hands have 2 clubsand 3 hearts?

Answer. C(13,2)
C(13,3).
(d)

How

many

hands

5-card

have 2 cards of one suit

of a

3 cards

and

different suit?

Fora

Thus,

ways.

3 tens

suits there

of the suits and 3 from

C(4,2)

are 2C(13,2)C(13,3)ways
other.

the

are 2C(13,2)

there

two of

that

Recall

of 2

choice

fixed

from one

a kind

are calledthreeofa

there

Thus

choose

C(13,3) C(4,2) such 5-cardhands.

means2 aces,2 kings,

kind.

to

choose the 2 suits in

We can

2 queens,

are 13 \"kinds\"

etc. Similarly,
a deck of 52

in

cards.

(e)

How

many

Answer.
(f)

How

C(4,2)

many

hands

5-card

contain

2 aces and 3 kings?

C(4,3).

5-card hands

contain exactly

of

one

kind and

3 of

another kind?

Choosethe
choose the

first

kind

choose 2

13 ways,

second kind 12ways

and

choose

of the
3 of

first

kind

Hence
there
are (13) C(4,2) (12) C(4,3) 5-cardhands
kind and 3 of another kind.

ways.

C(4,2)

ways,

the second kind in C(4,3)


with

2 of

one

Section

Example

chosen

from

(a) In

2.3.9.

and

of Combinations

Enumeration

2.3

how

of 5

a committee

can

ways

many

153

Permutations

be

9 people?

Answer.

C(9,5) ways.

(b) Howmany

C(9,5) +

Answer.

of 5

committees

or more

C(9,6) + C(9,7)+

can be chosenfrom

9 people?

+ C(9,9).

C(9,8)

can a committee
of 5 teachersand 4 students
be
(c) In how many
ways
from 9 teachers and 15students?
The
teachers
can be selected in C(9,5) ways while the studentscan be
in C(9,5)
in C(15,4) ways so that the committeecan be formed
chosen
C(15,4) ways.
in (c) be formed if teacher
A
can the committee
(d) In how many
ways
refuses to serve if student B is on the committee?
We
this
the
answer
by counting indirectly. First we count
question
number
of committees where both A and B are on the committee. Thus,
there are only 8 teachers
from which 4 teachers are to be
remainirg
there
chosen.Likewise,
are only 14 students
remaining from which 3
more students
are to be chosen.Thereare C(8,4)
committees
C(14,3)
containing both A and B, and hence there are

chosen

C(9,5) C(15,4)committees

do not

that

have both A

C(14,3)

C(8,4)

and

B on

Example 2.3.10. There are 21 consonants


words
English alphabet. Consideronly 8-letter

and 5 different

consonants,

How many

(a)

Answer. C(5,3)C(21,5)8!

(Choose

consonants,

and

(b)

then

arrange

many

How

many

(d)

How

many

words contain
the letters
contain
the letters

How

many

contain

How

many

begin

such

contain

while

there

the
with

begin with

Example 2.3.11.

class

are

5 vowels

3 different

in the

vowels

such words can be formed?

the

vowels,

choose

the

the letter a? C(4,2)C(21,5)8!


a and 6? C(4,2)C(20,4)8!
b and c? C(5,3)C(19,3)8!
letters a,b, and c? C(4,2)C(19,3)8!
a and end with
6? C(4,2)
C(20,4)6!
b and
end with c? C(5,3) C(19,3)6!

How

(g) How many

and

with

the 8 letters.)

(c)
(e)
(f)

the committee.

There

are

25 females

and 35 males in the junior


30 females
and 20 malesin the seniorclass.In how

154

Chapter

Combinatorics

2: Elementary

committeeof 10be

many ways can a

femalesand 3 juniorson

there

that

so

chosen

and

of

Number

Male

Female

Male

Female

3
2
1
0

0
1

the

junior-

Seniors

Juniors

Thus,

are exactly

committee?

chart illustratingthe possiblemale-female


of the committee.

us draw a
constitution

Let
senior

the

2
3
4
5

number of ways

total

column:

is the

Ways

of Selecting

C(30,0) C(35,3)

C(30,1)

C(25,5) C(20,2)

C(35,1) C(25,3)

C(30,2)

C(30,3)C(35,0)C(25,2)
sum

C(20,3)

C(25,4)

C(35,2)

of

the

terms

C(20,4)
C(20,5)

in the

last

+
C(30,0)C(35,3)C(25,5)C(20,2)+ C(30,l)C(35,2)
C(20,3)
+
C(30,2)
C(35,l) C(25,3) C(20,4)
C(30,3)C(35,0)C(25,2)C(20,5).
C(25,4)

ExercisesforSection
2.3
1.

2. How many

no

if

how

(a)

In

(b)

In how
are

are

ways

15people

3.

and

P(8,5)

Compute

person

C(6,3).
there to distribute
is to receive more

10 different books among


than 1 book?

many ways can 6 boys and 5 girlssit in a row?


many ways can they sit in a row if the boys and the girls
to sit

each

together?

(c) In how many ways can they sit in a row if the girls are to sit
together and the boys do not sit together?
4. Solve Exercise 3 in the caseof m boys and g girls (leave your

answersin factorial form).

5.

(a)

Find

number

the

seated

in

row

which 5 boys and 5 girls can be


alternate
boys and girls are to have

of ways in
if the

seats.

(b)

Find the

number of ways to seat themalternately

if boy

A and

sit in adjacentseats.
Find
if boy A
the number
of ways to seat themalternately
(c)
B
in
seats.
must
not
sit
girl
adjacent
6. Find the number of ways in which 5 children canridea toboggan
1 of the 3 oldest childrenmust
drive?
girl B are to

and
if

Section

Enumeration of Combinations and

2.3

155

Permutations

How many ways are thereto seat10boys and 10 girls around a


circular table?
(b) If boys and girls alternate, how many ways are there?
8. In how many ways can the digits 0, 1, 2, 3,4, 5, 6, 7, 8, and 9 be
arranged so that
7. (a)

(a) 0 and 1 areadjacent?

(c) 0,1,2,

3 are

and

9.

adjacent and in the order01?

1 are

0 and

(b)

is composed of 5

8 scientists

of

group

adjacent.

psychologistsand 3

sociologists.

ways can a committeeof 5 be formed?


many ways can a committeeof 5 be formed
and 2 sociologists?
psychologists
In

(a)

10.

how

many

In how

(b)

consists

hand

bridge

of 13

cards dealt from

that

has

deck

of

get exactly 6 spadesand

an

ordinary

52 cards.

(a) How many possible


(b) In how many ways

bridge hands
can a -person

are there?

hearts?

11. How

many 4-digit
digits?

12. In how
(b) In

ways can 10
10 chairs?

many

(a) In a

telephone numbershave
people arrange

one

or more

repeated

themselves

of

row

a row of 7 chairs?

(c) In a circleof10

chairs?

A collection

13.

In

(a)

(b)
(c)

14.

how

of 100 light bulbs contains8 defectiveones.


be selected?
ways can a sample of 10bulbs

many

In how many ways can a sampleof 10bulbs


which
be selected
ones?
contain 6 good bulbs and 4 defective
In how many ways can the sampleof
so
bulbs
be selected
that either the sample contains6 goodones and 4 defective
ones or 5 good onesand 5 defectiveones?

10

(a)

How

(b)

How

15?

binary sequences are there of length


are there of length
many
binary
sequences
six l's.

many

exactly

15

with

who has 9
from
a man
buys 3 cows, 8 pigs, and 12chickens
does the farmer
choices
How
cows, 25 pigs,and 100chickens.
many
have?
that
the
16. Supposethereare 15 red balls and 5 white balls. Assume
balls
are distinguishable
and that^
sample of 5 balls is to be

15.

'

farmer

selected.
(a)

How

many

samples

of 5

balls are there?

156

Chapter

2: Elementary

Combinatorics

samples containall redballs?


contain
3 red balls and 2 white
balls?
(d) How many samples contain at least 4 red balls?
4 choices
and
A multiple choice test has 15 questions
for each
answer. Howmany ways can the 15 questions be answeredso that
(b) How many

(c)

17.

How

samples

many

(a) exactly3
(b)

18.

books,17

French

(a) Howmany

(b)
(c)

How

books including
50 distinguishable
and
15
books,
Spanish books.
2
can
books
be selected?
ways
can
3
books
be
selected that there
ways

are

there

Suppose

correct?

are

answers

3 answersare correct?

at least

many

18 English

so

is 1

book

from each of the 3 languages?


How
ways are there to select 3 books where exactly
many

is missing?

language

19. In how many


to

ways

can

a team

of 5 be chosenfrom

10

players

(a) includeboth the strongestand the weakest player?


the strongest but excludethe weakest
player?
exclude both the strongest and the weakest
(c)
player?
Consider
the set S = {a,e,t,b,c,d,/,g,/i,m,rc,p}.
How
many
2 different vowels and 3 different
words containing
consonants
can be formed from the lettersin S?
(a)
the letter 6?
(b) contain

so as

(b) include

20.

(c) beginwith
(d)

5-letter

a?

with 6?

begin

(e) begin with a and contain


21. Find the number of ways

6?
in

English books, 6
books
can be
the same language are

5 different

which

French books,3 German books,and


arranged on a shelf so that all books

of

Russia^

together.

22.

How

many

words

9-letter

can be

formed that contain 3, 4, or 5

vowels,

(a)

repetition

Allowing

(b) Not allowing


23.

A committee
ways

many

of letters?

repetition?

is to be chosenfrom a set of 9 women and 5 men. How


to form the committeeif the committee
has,

are there

3 women,and 3 men?
of people but equal numbersof women
6 people and at least 3 are women?
6 people
including Mr. A?

(a) 6 people,
(b)

(c)
(d)

any

number

and

men?

(e) 6 people but Mr. and Mrs.A

157

and Permutations

of Combinations

Enumeration

be on

both

cannot

the

committee?

sex, and Mr. and Mrs. A

3 of each
6 people,
the committee?

(f)

friends of whom

15 close

has

man

(a) In

how many

ways

women.

6 are

3 or

he invite

can

party?

(b) In how

more of

his

to a

friends

moreof his friends


(including himself)

can he invite 3 or
ways
same number of men

many

the

wants

be on

both

cannot

if he
as

women?

certain collegehas
and
3 statisticiansfrom
psychologists,
5-member
committees
(a) How many
this

(b)

of a

dean

The

to form

can the

dean appoint

formed that

have

at

the

and

C,

How

1 of

most

How many
number of

Professor C and ProfessorP on

so that
the
5-member committees can be formed
chemists is greaterthan or equal to the number of

(a

4 aces?

(b

4 of a kind?

(c

exactly

(d

a full

(i
(J

the

a pair

another

kind)?

(Here

the ace

values)?

card.)

1 pair?

of the samekind?

no cards

one

suit)?
(a set of 5 cards in
flush (a set of 5 consecutive
straight

a flush

cards

(m)

an

(n

(p:

2 of

and

of aces (and no otherpairs)?

exactly

a royal flush

(o

lowest

or

highest

(t

(1

is greater

a spade

(a straight

flush

with

ace-high

flush?

ace-high
full

than

2 pairs?

hoyse (that is, 3 of a kind


a straight (a setof5 consecutive

at

committes

of psychologists
psychologistsand the number
of statisticians?
or equal to the number
How many 5-card poker hands have

(g
(h:

have

Professor P,
can be

psychologist,

5-member

many

that

committee?

the

(f

from

pool?

Professor

(e

10 chemists, 7
a committee.

of

pool

How many 5-member committeescan be formed


least 1 statistician member?

(c) The chemist,


do not get along.
(d)

which

house

spade
with

flush?
3 aces

and another

3 of a kind (without
another
pair)?
3 aces (and no other aceor pair)?

pair?

in

one

card)?

suit)?

can be

Chapter

Combinatorics

2: Elementary

27. In how many

(a)

exactly

(b)

one

pair,

(c) at least
(d)

least

at

(no 3

pair

or 2

hand have
of a kind or 2 pairs)?

a 6-card

can

ways
one

pairs, or 3 of a kind, or 4

1 cardof eachsuit?
1 of each of the 4

a kind?

of

cards:

honor

queen, and

ace, king,

jack?

(e) the same


(f) at least one

of

number

28. How many

of an ordinary
29. Compute

of 365

no

of the

clubs?

the

each of

from

chosen

be

and the values


of

the 12months

days?

the number of 6-lettercombinations

English alphabet if

of

of the

letters

the

combinationmore

appear in a

is to

letter

2 times.

than

30.

greater than the values

ways can 5 days


year

one club

at least

and

are all

diamonds

as clubs?

diamonds

diamond

booksbe distributed
ways can 30 distinguishable
C
so
and
that
among
receive exactly twice as many
books
as C?
(a) A
at
least
twice
as many
(b) C receives at least 2 books,B receives
at least 3 times as many
books as C, and A receives
books
as
In how many

3 people
A,J3,
B together
and

B?

31. How many

13-card bridgehands from

a 52-card

deck are

there that

have

all hearts?

(a)

(b) all cardsin the samesuit?


( c ) exactly 2 suits represented?
(d) 4 spades, 3 hearts, 3 clubs, and 3 diamonds?
(e) 4 cards each of spades, hearts, and diamondsand 1 club?
4 cards of 3 suits and 1 cardofthe fourth
suit?
( f)
3
4
cards
of
3
suits
and
cards
of
the
fourth
suit?
(g)
(h) 4 cards of two suits, 3 cards in a third suit, and 2 cardsin
fourth

4 cards in two

(i)

the

suit?
5 in

suits,

a third

suit, and a void

in

fourth

the

suit?

5 cardsin onesuit,

(j)

4 in

another,

3 in a

third, and 1 in

jack,

queen,

a fourth

suit?

no face cards (a facecardisa

(k)

(1) all four

10,

10 cards in one suit and 3 cardsin


10 cards in one suit?

(m)

(n)

another

Determine
(a)

There

whether

are

C(4,2)

the following solutions


at
C(50,3) 5-card hands with

or not

5-card
are C(52,5)- C(36,5)
eachof the honor cards (ace, king,

(b) There

ace)?

suit?

(o) exactly3suits?

32.

king, or

kings?

hands

with

are correct.
least

2 aces.

at least

queen, and jack).

one of

Section2.3

(c) There are C(39,5)5-cardhands


hearts, and diamonds. For any

C(39,5)5-cardhands

suits.

Thus,

the

choose

deck,

cards

suits.
(40)

(44)

that contain
cards
because
matching
all
remove
ways,
kings from
hands

5-card

no other

and
in

C(4,2)

48 ways, remove all cards of that


44 cards in 44
the remaining
a last
of that kind, and, finally,
choose

card

another

all

remove

only spades,
3 suits, there are

one card in

kind, choose
ways,

of

from at most these 3


5-card
hands that contain
C(39,5)

C(4,3)

cards from at most three


are C(4,2)(48)
There
(d)
exactlyonepair of kings
we can choosethe2 kings

159

contain

that
choice

contain

that

are

there

and Permutations

of Combinations

Enumeration

cards

from

card from the remainingcardsin 40 ways.


A team can either win,
or tie each game it plays. Thus,
lose,
213 different
team records with exactly 7 wins
thereareC(20,7)

(e)

in a 20-gameseasonsincewe

can

the games

choose

for wins in

(lose or tie) in
C(20,7) ways and then thereare 2 possibilities
are
313 team
the other 13 games.Therefore,
there
C(20,7)
records with at least 7 wins.
33. A man has 5 female and 7 male friends and his wife has 7 female
and 5 male friends.In how many
ways can they invite 6 malesand 6
and wife are to invite 6 friends each?
femalesif husband
34. Ajar contains 10 counters numbered 1,2,.. .,10. Someoneremoves

3 of the countersfrom

the

jar.

numbers on the 3 countersbe


(a)

exactly

9?

(b)

at least

9?

How many

ways

will

sum

the

of the

20 distinguishable
balls of which 6 are red, 6 are
blue. We draw out 5 balls with at least one red ball,
replace them, and then draw 5 balls with at most one white one.
How
ways can this be done?
many

35. A

contains

bag

36. How

many

.,30 so

1,2,..

37.

How

can 3 integers be selected from


ways
that their sum is even?

the

integers

person invite 3 of his 6 friendsto lunch every

20 days?

answer 12 of 15 questionson
does the studenthave

is to

student

many choices
(a)

can a

ways

many

for

day

38.

8 are

and

white,

an

examination.

How

in all?

(b) if he must answerthe first


(c) if he must answer the first

two
or

questions?
the
second

question

both?

(d)

if

(e)

if he

he

must

answer

3 of the first
least 3 of the first

exactly

must answer at

5 questions?
5 questions?

but not

160

Chapter 2: Elementary

Combinatorics

many
people can sit on each sideofa boat.How
ways can one
select a crewfor the boat if out of 30 candidates 10preferthe port
no preference?
side, 12 prefer the starboard side, and 8 have

39.

Four

40.

A coin

is tossed 12times.How

outcomes

many

are possible

(a) in all?

(b)

with

exactly

(c)

with

at

(d)

with

a head

(e)

with

the

3 heads?

3 heads?
on the fifth
same
number

most

seventh

and

of heads

toss?

as tails?

Selected Answers for Section2.3


2.

P(15,10).

3.

(a)

11!.

(b) 2!6!5!.

(c) 5-6!5!.

6. 3
7.

\342\200\242
4!.

(a)

19!.

(b) 10!9!.

9. (a) C(8,5).
(b)

10.

C(3,2).

C(5,3)

(a) C(52,13)

(b) C(13,6)C(13,5)C(26,2).

11.104-P(10,4).

13.

(a)

C (100,10)

(b)

C (92,6)

C (8,4)

(c) C(92,6)

C(8,4)

14. (a)

C(8,5).

C(92,5)

215.

(b) C(15,6).

15. C(9,3)
C(25,8)
C(100,12).

16.

(a)

C(20,5).

(b)

C(15,5).

(c) C(15,3)

C(5,2).

17. (a) C(15,3)312.

18.

(b)

415

(a)

C(50,2).

(b)

18

(315 +

314C(15,1)+ 313C(15,2)).

\342\200\242
17 \342\200\242
15.

<\302\253>

G'Kf)

(}8)(\.")

(i')G5)

Recall

+ G8)(i5)

C(\302\273,r)

(\.

\342\231\246

(i8)(!5)

\342\231\246

GfKi7)

Section 2.3

161

and Permutations

of Combinations

Enumeration

19. (a) C(8,3).


(b)

C(8,4).

(c)

C(8,5).

21. 4!5!6!3!7!.
\302\253.w

\302\273)

fflffl

25. (a)

*\342\200\242-.-(!\342\200\242)-(?).(5B)

0\302\251

\342\231\246

...

00-

C(20,5).
-

a7)(?)+(Dd)+a7)\302\251

\302\253=)
(i\302\260)

<* (f)
(a)

\342\231\246

fflffl

0\302\251

\302\253\302\273>

26.

(jB)

(J)

a8)

a8) - (D

(i0)

a7)-

- a8)-

\342\231\246

(no\342\231\246e0)\302\251+g\302\260)G)\302\256+a0)\302\251\302\251-

\342\200\242
48.

*>(!3)\302\251-^

<c)63)0\302\251-\302\253.

(d) 13(8 \342\200\242


120'
\342\200\242
(e) 10 45 (choose

(l )(2/(3
other3

(h) (g3)(4)5
(i)

(j)

(ch\302\260ose

)^^3

kinds,

choose

the

the

choose

kind,

the pair,

choose the

3 cards),

= 52 \342\200\242
44 \342\200\242
48 \342\200\242
40 \342\200\242
36/5!

) (choose

fijfc

card in 10 ways).

the top

the suit, choose5 cardsin

the

suit).

\302\251(10).

<\302\253(?)-4.

(J3)

\302\253(f)

(3/(1)
the

pair

(2)

(ck\302\260ose

12 ways

the

3 aces

L) ways,

choose the

choose the 2 of that kind (2) ways).

kind

for

162

Chapter

Combinatorics

2: Elementary

(o) (j j

(p) L) (2 )

erer
There

3 of that

a kind,

\342\200\242
4

(choose

kind, choose2other

5th cards),

4th and

3 aces,

(choose

(4)

(4)

5th

and

29.

the

pick

kinds,

2/4

y^J

choose 2 other kinds, pick 4th

cards).
(?)\342\200\242

are C(26,6)

combinations

C(25,4) combinationswith

6 letters

all

with

distinct; C(26,l)
and 4 other letters,etc.
+ C(26,3).
C(24,2)

of letters

1 pair

Total:C(26,6)
+ C(26,l)

C(25,4)

C(26,2)

30. (a) C(30,10)220.


(b)

of Books

Number

24

2
2
2
3

23
22

21

21

C(28,4)

+ C(30,2)

C(28,5)

C(30,2)

C(30,2)

C(28,7)

ENUMERATING

Number

eHas

C(30,2)

2.4

of Books
A Has

of Books

Number

CHas

C(28,6) +

C(27,6).

C(30,3)

AND PERMUTATIONS WITH

COMBINATIONS

REPETITIONS

Now let
combinations with

us turn our
unlimited

r-permutations
denote the

of

number

repetitions.

That

r-combinations
and

attention to countingpermutations
of

is, if aua2,

...

,an

2.4.1

{oo

al9

oo

a2,...,

designating)

r-permutations

titions).
U(n,r)

so

(without

(Enumerating

n objects,

the

are

of

r-permutations

We have already used U(n,r)


2.1.5, 2.1.6, 2.1.10,2.1.11,and 2.2.5.
Theorem

and

Let U(n,r) denote


unlimited
repetitions
r-combinations
of n objects

repetitions.
with
objects

nr

with

the number of
and let V(n,r)
unlimited

with

we are

counting

\342\200\242
<\302\273

aj.

in examples

unlimited

repe-

Section

2.4

Combinations

Enumerating

and

Each of the r positionscan

Proof.

filled

in n

= nr.

U(n,r)

rule,

product

be

163

with Repetitions

Permutations

so by

ways and

the

Example 2.4.1. Thereare25


How
examination.

she can

many

also chooseto leavethe answer

The results of 50 football

2.4.2.

Example

be predicted. How

Answer. Choose28

remaining22games
with

forecasts

Example 2.4.3.
dot and a dash.What

lettersof

the

different

Since

there

tie)

exactly 28

ways. Each of the


Thus, there are C(50,28)-222

can

transmit

two different

signals: a

symbols is needed to encodethe 26


and the ten digits 0,1,... ,9?

of these

alphabet
are

for each character,the number


k is 2\\ The number of nontrivial

two choices

of length

sequences

or,

predictions.

telegraph

length

English

Answer.

forecasts.

28 correct

exactly

lose

can contain

C (50,28)

results

correct

2 wrong

has

games (win,

forecasts

different

many

correct results?

of

or

if he

blank?

325.

Answer:

are to

true
or false questions
on an
can
a
student
do
the
examination
ways

different

less is 2 + 22 + 23 + - - \342\200\242
+ 2n = 2n+1 - 2.If n - 4
this
total
is 30, which is enough to encode
the
letters
of the English
the digits
the
To encode
alphabet, but not enough to alsoencode
digits.
we need to allow sequences
of length
up to 5 for then there are possibly
25+1 - 2 = 62 total sequences.
in Morse code all letters are
is why
(This
transmittedby sequences
of four or fewer characters while all digits are
of length

sequences

transmitted

by

n or

sequences

of length

5.)

sequencesof dots and dashesarein one-to-one


of 0's and Ts, the so-called
Thus,
sequences.
binary
we conclude there are 2k binary
of length k, or, in other words,
sequences
- 2
are 2k fc-digit binary numbers. Moreover, there are 2n+1
there
binary
1 if we include
sequences of positive lengthn or less. (There are 2n+1
the sequenceof length 0.)
Of course,

correspondence
with

Example
exactly

six

sequences

2.4.4.

How many 10-digit binary numbers are therewith

l's?

Answer.
we
The key to this problemis that
number by choosingthe subsetof 6 positionswhere

can

specify
the

l's

a binary
go (or

the

164

Chapter

2: Elementary

Combinatorics

subset of

4 positionsfor

such

the

O's).

binary

the formula

recall that

We might

P (n,r) by

for

formula

to

difficult

permutation result

C(10,6) = C(10,4)-

210

(when

V(n9r)

of

by dividing
repetitions gave rise to r!
unlimited
repetitions is

cannot

U(n,r)

repetition,

combinations

give rise to the samenumber


combination aab gives rise

was obtained

C(n,r)

without

obtain\342\200\224we

unlimited

for

different

since

appropriate
factor

for

r-combination

each

r! since

permutations.The
allowed) is more

with

n\\

permutations.

by

For

an

not in

will

repetition

the

divide

simply

example,

general
the 3-

3-

to 3 different
permutations while the
rise
to
6
gives
permutations.
is an understandable explanation of
what
we believe
with unlimited repetitions, we
combinations
enumerating
abc

combination

To

there are

Thus,

numbers.

the

give

for

formula

different ways.
,an so that selections are made
al9a2,
\342\200\242
.
oo
oo .
will be of the form
r-combination
from
{oo
an}.
ax,
a2, ...,
Any
\342\200\242
\342\200\242 \342\200\242
are
the
where
numbers,
...,
au x2
a2,...,
an]
xu
xn
{xi
xn
repetition
\342\200\242
\342\200\242
= r.
and xx + x2 + \342\200\242
each xt is nonnegative,
4- x\342\200\236
Conversely,
any
\342\200\242
\342\200\242
\342\200\242
xx 4- x2 4sequence of nonnegative integers xu x2,..., xn where
\342\200\242
4- xn - r corresponds to an r-combination{xx \342\200\242
xn \342\200\242
al9 x2
a2,...,
aj.
the

reformulate

will

in several

problem

Let the distinct objectsbe

...,

oo

xn =

\342\200\242
\342\200\242
\342\200\242
+

We

The number
the number
an\\ equals
r in nonnegative integers.

observation:

First
. a2,

...

next

the

believe

of

r-combinations

makes it easier to

formulation

problem.

Secondobservation.

The

solutions

xn = r

\342\200\242
\342\200\242
\342\200\242
+

+ x2+

ofXi

r indistinguishable

interpreting

number

box

contains

xx

{oo

x2

alyoo
4-

conceptualizethe

integral

of nonnegative

is equal to the numberof

balls in n numbered boxes.We

that the fcth

of

of solutions of

of placing

ways
see

this

by just

xk balls.

The numberof ways of placing r


boxes is equal to the number
of binary
numbers
with (n - 1) l's and r O's. We see this as follows!If there areX\\
in box number
balls
1, x2 balls in box number 2, ..., xn balls in box
number n, then in a correspondingbinary
be xx 0's to
number
let there
the left of the first 1, x2 0's between
the first and second 1, x3 O's between
the second and third,...,
and finally xn 0's to the right of the last 1.(Two
consecutive
l's mean that there were no ballsin that box.)
- 1) l's and r O's we
to any
such binary number with
(n
Conversely,
Third

indistinguishable

observation:
balls

in

n numbered

Section

Enumerating Combinations and

2.4

distribution of r balls into

associate a

165

with Repetitions

Permutations

boxes

by reversing

the above

process

Perhaps

an

will

example

be instructive.

Suppose r = 7 and n = 10 in

of
7-combinations
we

axaxaxaAaAasas

... +

xl0

{<\302\273.ax,

the

associate

to the

7. Then

the

that

above,
.

<\302\273\342\200\242
a2, ...,<\302\273

solution

a10}.

is, we are interested in


To the 7-combination

(3,0,0,2,0,0,0,2,0,0) of xx

solution (3,0,0,2,0,0,0,2,0,0)
we

x2 +
the

associate

balls in box 1, 0 ballsin boxes 2, 3, 5, 6, 7, 9, and 10,2


2 balls in box 8. Then to this
of balls
distribution
associate the binary number 0001110011110011.
in one more example for further
We
reverse
the process
clarification.
in
The binary number 1100011010111001signifiesthat thereareno balls
boxes 1, 2,4,7,8, or 10,3 ballsin box 3, 2ballsin box 9, and 1 ball each in
boxes 5 and 6. To this distribution
of balls is associated the solution
of Xx 4- x2 + ... 4- xl0 = 7. Then to this solution is
(0,0,3,0,1,1,0,0,2,0)
of 3

distribution

balls

4, and

box

in

associatedthe

\342\200\242 \342\200\242
\342\200\242
{3 \342\200\242
a3,1
a5,1
a6, 2
a9}.

7-combination

The number

observation.

Fourth

of binary numbers with

- 1 4- r,r). For
l's and r 0's is~C(n
just as in Example2.4.4,we have
be
n - 1 4- r positions and we need
choose which r positions will
only
\342\200\224
l's.
n
are
filled
the
1
a
and
then
0,
by
by
occupied
remaining
positions

We summarize:

Theorem 2.4.2.

with

r-combinations

(Enumerating

unlimited

repetitions).

= the

V(n,r)

of r-combinations of n

number

distinct objectswith

unlimited repetitions

= the
Xx

= the

C(n

(n

oo

an} is

Of

solutions to

of ways of distributing r similarballs into

boxes

number of binary numberswith


- 1 +
- 1 + r,n = C(n
ryr)
4- r
l)!/[r!(n 1)!].

Remark.
...,

integral

nonnegative

= r
. . . 4- x\342\200\236

number

numbered

= the

of

number
4- x2 4-

course,

the same

1 one's

and r zeros.

1)

.
of r-combinations of {\302\253>
the number
ax, oo . a2,
\342\200\242
of {r \342\200\242
as the numberofr-combinations
al9r
a2,

\342\200\242
\342\226\240
\342\226\240
\342\200\242
>r
an}.

The

following

examples

will clarify

the conclusionsof Theorem2.4.2.

166

Chapter

Combinatorics

2: Elementary

a3,

oo

of{oo
(a) The numberof 4-combinations
- 1 + 4,4) = C(8;4) = 70.

2.4.5.

Example
oo

a4,

oo

oo

alf

a2,

a5} is C(5

of5 objectswith unlimited


(b) The number of 3-combinations
- 1 + 3,3) - C(7,3)
= 35.
is C(5
(c) The number of nonnegative integral solutionstox14-x2 + x34- C(54,50) - 54!/4!50!= 27 . 53 . 17.
+ x5 - 50 is C(5 - 1 + 50,50)

repetitions

x4

13
=

316,251.

of ways of placing10similarballsin

number

(d) The

is C(6

- 1 + 10,10)
-

of binary

number

(e) The

boxes

6 numbered

C(15,10)

5,5)- C(15,5)3,003.

3,003.

numbers with

l's

ten

five 0's

and

is C(10 +

Other

though

problems
2.4.2.

Theorem

2.4.6.
(a) How many
10
similar
coins?
tossing
Example

Answer. Thisis

the

Answer.
This is the same as
there
are
numbered boxes.Therefore
How

C(ll,10)

ways

many

can

10

placing

C(15,10)

boxes

two

10 similar

tossing

into 6

balls

similar

- 3,003

possibilities.

books be placedon

20 similar

by

= 11.

from
different outcomesare possible

(b) How many


dice?

(c)

balls into

10 similar

- 1 + 10,10)
=

by

are possible

outcomes

different

as placing

same

and \"tails.\" C(2

\"heads\"

labeled

settings canbe solved

couched in different

different

shelves?

Answer.
(d)

Out

how many

C(5

- 1 + 20,20)-

C(24,20).

of pennies, nickels,dimes,and
10
coins
can
beselected?
ways
of a

large supply

C(4 - 1 + 10,10)=
10
similar
balls in 4 numbered
placing
Answer.

and

\"nickels,\"\"dimes,\"

(e) How many

chosenfrom

Answer.

ways are there to fill

First,

that

since

boxes

is equivalent

this

labeled

in

to

\"pennies,\"

\"quarters.\"

varieties

8 different

immaterialso

C(13,10)

quarters,

we

order

observe

does

box

with

a dozen

doughnuts

of doughnuts?
that

relative

not count.

positions

Therefore, this

in the box are


is a combination

Section

2.4

Secondly, a

problem.

and

Combinations

Enumerating

with

Permutations

box might consistof a

Now let

us considera slight

unlimited

of

variety
repetitions.

above examples.

of the

variation

one

of

dozen

doughnut, so that we see that this problemallows


- C(19,12).
The answer then is C(8 - 1 4- 12,12)

167

Repetitions

Example 2.4.7. (a) Enumeratethe number


each
indistinguishable balls into 5 boxeswhere

of placing
ways
is nonempty.

of

box

20

We analyze this problemas follows:


one ball in each of the 5
First,
place
Then
count the number of ways of distributing the 15
we must

boxes.

balls

remaining

into

5 boxes

unlimited

with

By Theorem

repetitions.

2.4.2, we can do this in C(5- + 15,15) = C(19,15) ways.


Of course, we can alsomodelthis problem
as a solution-of-an-equation
the number
of balls in the ith box, then we are
problem. If xt represents
to enumerate
asked
the number of integral solutionsto xx 4- x2 4- x3 41 ball into eachof the5
x4 + *5 = 20 where eachxt > 0. After distributing
boxes,we then are to enumerate the number of integral solutionsof yx +
^2 + y3 4- y4 4- y5 = 15 where each y( > 0.
Likewise
we can solve the following:
How

(b)

>

with

to

solutions

4- x2 4-

x3

+ x4

4- x5 =

model this problemas a distribution-of-similar-balls


first we place 2 balls in each of 5 boxesand
then
in 5
10 balls
the number of ways of placing the remaining
In other words the number of integral
unlimited
repetitions.
Xi 4- x2 4- x3 4- x4 4- xb = 20 where each xt > 2 is the same as

the numberofintegral
>

there to xx

whereby

enumerate

yt

solutions are

2?

we can

Here
problem

boxes

integral

many

20 where eachxt

know

We

0.

of yx

solutions

that there

are

4- y2

10,10)

where

each

C(14,10)

such

= 10

y4 4- y5

4- y3 4-

C(5 - 1

solutions.

(c) How
20 wherexx

many
> 3,

x2 >

2, xz >

First, distribute3ballsin
in

box

4, and

boxes with
number

0. There

0 balls in
unlimited

of

integral

are C(5

(d) Howmany
20 where

are there

solutions

integral

4, x4

>

Th&t

repetition.

of

integral
>

xx > - 3, x2

yx

4- y2 4-

= C(9,5)

5,5)

solutions
0, xz

4- x2 4-

xz

4- x4

4- x5 =

2,4 ballsin box 3,6 balls


to be distributed into 5
is, we now wish to count the
y3 4- y4 4- y5 = 5 where each yt >

balls in box

box 5. That leaves

solutions

- 1 4-

6, and

1, 2

box

to xx

x5 > 0?

5 balls

such solutions.
are there

> 4, x4 > 2, xb

>

to
2?

xx

^^

4-

xz

4- x4

4- xh

168

Chapter 2: Elementary

Combinatorics

we interpret
Here
the
placing -3 balls in box1 as actually
increasing
20 to 23. Then placing 4 in box 3, and
total number of balls from
2 in each
=
15 balls. Thus, we have C(5 of boxes 4 and 5, leaves
4- 15,15)
only
15 where each y( > 0.
C(19,15) solutions of yr+ y2 + y3 + ^4 + Vs
These ideas can be incorporatedto prove
the
theorem.
following

xn

The numberof integralsolutions

Theorem
2.4.3.
= r where each xt
= the

=
-

C(r

of ways of distributing r similar balls into


with at least oneball in eachbox
+ (r - n), r - n) = C(r - 1, r - n)
that

suppose

ru

r2,..., rn
... 4- xn

of

ways

numberedboxeswhere
at least r2 balls in the
nth box

-l

Finally

consider the

Example

2.4.8.

solutionsto the

there

integers.

- r

where

- rx

rn,
rn,n

Enumerate
xx

...

the number

Then
X\\

>. V\\y X2 >

rx

in the

balls

and at least rn
- rt 1).

r2

of

and

balls into n
first box,

r similar

least

r2,...,

...

in the

balls

- rj

example.

following

inequality

distributing
are at

second box,...,

- r2
+ r-r!-r2-...+

are

4- x2 4-

= the number of

C(n

- 1).

- 1, n

- C(n -

4-

boxes

integral solutionsofxx

...

number

numbered
- 1
C(n

Likewise,

x2 4-

of xx 4-

>

4- x2

the number of nonnegative

4- x3 4- x4 4- x5 <

integral

19.

Of course,this asks for the number of nonnegative integral solutions to


20 equationsxx 4- x2 4- x3 4- x4 4- x5 = k where k canbeany integer
from 0
to 19. By repeated applicationof Theorem
2.4.2we see that there are
C(5 - 1 4- 0,4) 4- C(5 - 1 + 1,4) + ... + C(5 - 1 + 19,4) such

solutions.

From

this

the number

of view we have 19 similarballs and we


point
of ways of distributing either0 or 1,or 2,...,

ballsinto the 5 boxes.

But

are

counting

or 19

of these

way to approach the problem.Ifk is some


of k balls into 5
distribution
for every
then
19,
integer
k
19
balls
into a sixth box.
onecoulddistributethe
boxes,
remaining
Hencethe number of nonnegative integral solutions of xx 4- x2 4- x3 4- x4
of nonnegative
4- x5 < 19 is the sameas the number
integral solutions of
more
one
we
have
19
+
4+
44variable, y6). By
(note
y\\
^2
y3
^4
y5
y6
there

is also

between

an alternate

0 and

Section

2.4

are C(6 -

2.4.2, there

Theorem

and

Combinations

Enumerating

solutions.Hence

we have

what

from

C(24?5)

Exercises

19,5)

1.

C(24,5)

19

+ *,k)

C(4
\302\243
'k-0

= EC(fe

+ 4,4).

*-0

2.4

Section

for

169

Repetitions

- C(24,19) such
we
concludethat
already seen,

19

with

Permutations

of a football team has a repertoire of 20 plays


and
60 plays in the course of a game.
in the
interested
of the play-callingshowing
distribution
how
times
frequency
many
each of the various plays were
How
such
many
frequency
A

quarterback

Thecoachis

runs

called.

are there?

distributions

2. In how

5 similar

can

ways

many

books be placedon

different

shelves?

outcomes are obtainedfrom

3. How many
dice?

4.- How many


(a)

are

dominos

(b) doubleblank

n indistinguishable

set which are numberedfrom

six?
nine?

double

to

in a

there

to double

blank

double

rolling

how many ways can 5 glasses be filled with 10 different


are
Kool-aid if no mixing is allowedand the glasses

5. In
(a)

indistinguishable?

(b)

distinguishable?

6. How many
xb

= 50

7. Find the

of

number

integerssatisfying

8.

How

many

(a) equal to

(b) less
each

yt

> 0.

Find
X3

distinct

between

triples

4- *3 < 15.

x2

4-

xz

+ x4

(xlf x2, x3)

of nonnegative
of

a sum

7?

integral solutionsof yx 4- y2 4Then list all integral solutionsto xx


>

y$

- 2 where
= 22
x3 4- x4

4- y4

4- x2 4-

5.

> 4.

of
number
10.
4- X4 4 X5
the

xx

1,000 inclusivehave

1 and

all integral solutionsto yx 4list all integral solutionsto xx

-2, andx3

11.

equation

all C(5,3)

where each xt
10. Find
Then

to the

7?

than

Find

there

of

integers?

xx + x2

integers

digits

9.

are

solutions

in nonnegative

kinds

nonnegative

y2 4- y3
+

x2 +

- 3 where eachyt
x3 = 8 wherexx > 3,

integral solutions to

xx

>

0.

x2 >
x2 +

170

Chapter 2: Elemenfary
12.

Combinatorics

Find the
where xx

number of integral solutionsto xx


> -4, x2 > 7, x3 > -14, x4 > 10.

13. Find the

of

number

integerssatisfying
14. How

the

(a) equal to

4- x3

(xux2,x^) of
triples
xx 4- x2 4- x3 < 6.

distinct
inequality

1 and

between

integers

many

digits

4- x2

4-

xA

50,

nonnegative

1,000 inclusivehave

a sum

of

10?

(b) lessthan

10?

is it true that

= r has no integral
xx 4- x2 4- x3
<
<
4
5
and
x2,
xlf
x3?
16. Forwhat values of r is it true that xx 4- x2 4- x3 4- x4 = r has no
with
7 < xu 8 < jc2, 9 < x3,10 < x4?
integralsolutions
17. A bag of coins contains 10 nickels, 8 dimes, and 7 quarters.
that
the coins of any one denominationare
Assuming
15.

values of r

For what

solutions

2 <

where

from
ways can 6 coinsbe selected
are
makea
thereto
selection
o
f
coins
many ways
worth of identical pennies, $1.00worth
of identical
$1.00 worth of identical dimesif a total of
(a) 10 coins are selected?

how

indistinguishable,in

many

18. How

(b)

bag?

from

nickels,

$1.00

and

are selected?

coins

20

the

(c) 25 coinsare selected?

19.

How

ways

many

adjacent

20. How many


21.

are there

to arrange a

deck of 52 cardswith

no

hearts?

ways are thereto place20identical

balls

into

6 different

boxes in which exactly2 boxesareempty?


(a) How many ways are there to distribute20 chocolate
and 24 cream-filled
doughnuts, 12
cherry-filled
doughnuts,
(b) How

students?

4 different

doughnuts to

many

can

ways

the

distributedto students
of doughnut?
each

kinds of doughnuts be
different
student receives at least 2of

if each

the

kind

22.

How many integral


30 where for each i

(a)

%i

(b)

x^l;

(c)
(d)
23.

xx
xt

>

>

solutionsare thereofxx

4- *2 4~ \302\2433
4\" X4 4~ X5 =

0;

2, x2
> L

> 3, x3 >

4, x4

>

2, x5

> 0;

a communication
Six distinct symbols are transmittedthrough
A total of 12 blanks are to be inserted
between
channel.
of symbols.
with at least 2 blanks between every
pair
symbols
how many ways can the symbols
blanks
be arranged?
and

the

In

Section 2.4
24.

wishes to give

A teacher

is to be worth
25. In how

more

2 or

171

Repetitions

a total

points?

wear 5

a lady

can

ways

many

with

with 10 questions. In how


of 30 points if eachquestion

examination

an

test be given

can the

ways

many

and Permutations

Combinations

Enumerating

rings on 4

her

of

fingers

hand?
m < n. In how many
where
26. Let m and n be positive
ways
integers
where
order is
can n be written as a sum of m positive
integers
= 14-2 + 1 =
4 = 1 + 1+2
taken into account? (Note that
in
2 + 1 + 1sothat 4 can be written as a sumof 3 positive
integers
3 ways.)

27. In how

pomegranate,

ways can 6 (identical)apples,1 pear,


1 persimmon, 1 peach,and 1 quince

distributed

3 people?

How many

(a)

12 similar

partition

among

is the

(b) What

coins into 5

batches?

nonempty

28.

we

can

ways

many

numbered

to

answer

if each

(a)

1 plum,

be

person receives

exactly 4

fruits?

29.

In how many ways can we place


in 6 numbered boxes?

balls, 4 white balls,and 4

4 red

blue

balls

30. How

(a)

distribute

can we

ways

many

12 white ballsand 2 blackballs

boxes?

9 numbered

into

9 numbered boxeswhere
white ball?

(b) into

31.

How

1 and

between

integers

many

How

among

1. C(60+ 20 -

3. C(n + 6 (a)

C(8,2).

(b)

C(ll,2).

5. (a)

1,60)
(60

into

balls

20 numbered

boxes).

l,n).

C(10 -

5,5).

105.

(b)

9. For
yt

of

sum

2.4

for Section

Answers

4.

the

one

2 fruits?

exactly

Selected

at least

(identical) apples and 5 (identical)oranges


5 people such that each person receives

can 5

ways

many

distributed

be

contains

10,000,000 have

digits equal to 18?

32.

box

each

a solution (yu
Xi = y( +

or

10. For

xx

5. Then
yx + y2

solution

4, then

y2i y3,

x2 +

xx

y4) where yl + y2 + y3 + y4 =
+ x2 + x3 + x4 = 22.
y3

x3 = 8.

3, let yl

xx

3, y2 = x2

2, let xt
+ 2, y3

5 =

x3

172

Chapter

Combinatorics

2: Elementary

+ 5 - 1,5- 1)- C(14,4).


+ 4 - 7 + 14 - 10+ 4

11. C(10
12.

C(50

13.

Count

14.

of

number

the

2,3,4, 5

and

Let xx =

units digit, x2

(a)

*2 + *3

(b) Count

1,4

sum.

digit, and x3 = hundreds digit.


of nonnegative
integral solutions to
= 10.
where
xt

= tens

number

the

Count

- 1) - C(54,3).
solutions for xx + x2 + x3 = n where n = 0,1,
-

= 10, and excludethe 3 cases

the number of nonnegativesolutionsfor

- 0,1, 2, 3,4,5,6,7, 8,
19. Let nonheartsbe dividers
to determine
n where n

cells

which

in

nonhearts

to

x2 + x3

xY +

sum.

9 and

40 cells. Choose 13 of these


Then arrange the hearts and the
14
to form
or use heartsas dividers
last
may be empty but others are

a heart.
13!39! ways,

place

C(40,13)

which the

cells of

xx

and

first

nonempty.

20.

the 2

Choose

be empty;

place

of 4 remaining

in each

1 ball

~~

~~

boxes.

Then

21.

boxes to

the

distribute

remainder,

(o) (

\302\253(20+^\342\226\240')(1!t,S ~l)?i+A

-1)-

i)r+d-

-w+i<\302\273(u+,i-

).

ig

-1)-

22.

(0 (g).
<\302\253

(!o)-

23.

Fill

boxes

2 or

with

ways.Thenarrange
24.

2.5

more blanks in C(5 6! ways.

6 symbols

the

2,2)

(I)

Total6!

('\302\247\342\226\240

\302\251

PERMUTATIONS

ENUMERATING

WITH CONSTRAINED

REPETITIONS

There

are,

repetitions

of

and

course,

intermediate

selections

with

cases between
unlimited

repetition

selections
of

the

with

no

objects.

Section2.5

Suppose that we are given

are some
permutations

selection

a particular

What

repetitions.

on this

with Constrained

Permutations

Enumerating

of r objects

formula

where there
of

number

the

for

of r objects.

selection

given

is a

desire

we

173

Repetitions

2.2.3 we listed
exampleis in order.Recallthat in Example
\342\200\242
\342\200\242
\342\200\242
all 3-combinationsof {3 \342\200\242
1
In
the following table we
d}.
b, 2
c,
a, 2
will
list
all permutations
of each of these 3-combinations:

Perhaps an

of

3-combinations

{3

\342\200\242
a, 2 \342\200\242
b, 2 \342\200\242
c, 1 -

The

number

aaa

3 (aab,

aab

aac

aad
bba

bbd
bbc

cca

ccb

ccd

abc

abd

acd

bed
14
(See Example
We

each

for a

2.2.7

that in
note
3-combination

of

3-permutations

d\\

aba, baa)
3
3
3
3
3
3
3
3
6
6
6
6
52

list of the last 24 permutations)

3 permutations
the above table there corresponded
and
where one object wasrepeatedtwice
another

to

was

6 permutations
there
were
once. While, on the other hand,
3
3-combination
where
distinct
to
each
were
objects
corresponding
selected. We ask: is therea ruleherethat holds in general? The answer is
example.
yes, and we begin to explain why by considering the following

repeated

How many

2.5.1

Example
letters

a, 6,

a, a,

and c?

This is
for
5-combination{3
permutations.

the

asking

\342\200\242
1

Now

consider

lettersa

were

a,

a particular
that

distinct,

different arrangements are thereofthe

number
\342\200\242
1

b,

of 5-permutations
x be the
c}.

\342\200\242Let

for example, aabca.


were written as aua2,a3,
then

permutation,
is, if they

of the particular
number of such

If the
this

174

Chapter 2: Elementary

Combinatorics

give rise

would

permutation

to 3!different

namely;

permutations;

axa2bca3

a2axbca3

a2a3bcai

a3a2bcal

aiajbca2

a3aibca2

different ways of arrangingthe 3 lettersaua2fa3.


\342\200\242
\342\200\242
of {3 \342\200\242
c] will
a, 1
6, 1
give rise to 3!
a
the
are
where
letters
distinct
letters. Thus
replaced
by
permutations

These

Likewise

to the

correspond
each

there are 3\\x

permutation

the

of

permutations

letters

there

But

\\alya2ia^b,c\\.

3\\x = 5! and X = 5!/3!


Thus
permutations of the letters{alfa2,a3,b,c}.
Hence there are 20 permutationsof {3\342\200\242
a,b,c}.
One more example will be enough to see the generalpattern.

Example2.5.2
2

How

\342\200\242
of {3 \342\200\242
a, 4
6,

are there

10-permutations

many

are 5!
= 20.

\342\200\242
1 \342\200\242

d}?

c,

Let x be the number of such permutations.


as in Example
Reasoning
if we replace the a's by al9 a2,
2.5.1, we see that there are 3\\x permutations
if we also replace the b's
and a3. Likewise there are (4!)(3bc)
permutations
and
to
number
of ways of arranging
the
bu
b2,
b4
by
63,
corresponding
if
that
we
see
there
are
(2!)
(4!)(3!)x
bub2,b3,b4.
Continuing
permutations
we also replace the c's by cx and
c2. But then we know that there are 10!
of

permutations

Hence,

{aua29a39bub2yb3yb4ycuc29d}.

(2!) (4!)

(3!)* - 10!orx -

12,600.

an alternate solution.Note there are10letters


with
3 alike
4 alike (the6's),2 alike (the cJs), and 1 alike (the letter d).Thus,
we
10 positions
to be filled with
these
have
letters
to give the various
first
choose
the 3 positions
for the
permutations. Fromthe 10positions
7 positions, choose the 4 positionsfor the b's;
a's; thenfrom the remaining
from the remaining 3 positions, choosethe 2 positionsfor the c's; and
finally, choose the last positionfor the letter d. This can be done in
Let

us give

(the aJs),

C(10,3)
(Note

the

C(l,l)

C(3,2)

C(7,4)

of certain

cancellation

Now let us introducethe following


are

nonnegative

...,

at

are

^^L

factorials.)
notation.

such that n

integers

moreover, that au

t distinct

Suppose

qx

4-

q2

objects.

that

qX9q29...,

qt

...
4\342\200\242\302\245

qt. Suppose,

Let P(n;quq2,

...

,qt)

Section

2.5

Permutations

Enumerating

the number

denote

Constrained

175

Repetitions

n-combination

of the

n-permutations

of

with

{ql

\342\200\242

au

q2

\342\200\242

\342\200\242
\342\200\242
- \342\200\242
y Qt
\302\2532,
aj.

two examples and this notation we

with the above


theorem.

Armed

following

2.5.1

Theorem

(Enumerating n-permutationswith

prove

the

constrained

repetitions).

P{n\\qu...,qt)
...qt\\

qx\\q2\\

C(n - qlfq2)
-qi'-q2...-

= Cin^i)
...C(m

were all

qx ax's

different there would

each old

permutation would

corresponding

to

the

row. If

qx

q2,q3)

Qt-uQt)

Let x = P(n; qi,q2,...,qt)>

Proof.
If the

C(n

were

a2s

there

reasoning

number

the
q2

would

give

of ways

we know

However,

Equating these two

the theorem.

be
qx\\

since

permutations

{q^x
new

permutations

in a
of arranging the qx distinct
objects
by distinct objects, then by similar
If we repeat this
(qjjx
permutations.

all replaced

be

(q2\\)

procedureuntil all the objectsare


permutations.

to

rise

that there are n\\

quantities

and

we will

distinct

have (qt\\)...
of n

permutations

solving

for x gives

(q2\\)

distinct

(qjjx

objects.

the first equality of

the qx positions
is obtained as follows. First choose
from the remainingn - qx positions, choose q2 positions
for the a2'sand so on. Note that at the last we will have left n \342\200\224
qx
=
\342\200\242
\342\200\242
so C(n
to fill with the qt a/s,
<?2 \342\200\242
qx
q2...
Qt-i
Qt positions
-Qt-uQt) = C(qt,qt).
The last equality
follows because both numbers
of
the
theorem
or we can obtain it by
of permutations,
representthe samenumber
second

The

for the

equality

a^s; then

cancelingfactorialsas in Exaipple2.5.2.
2.5.3.

Example

TALLAHASSEE

The number
is

of arrangementsof lettersin

P(ll; 3, 2, 2, 2,1,1)
this

since

equals

\342\200\242
1 \342\200\242
The

if,

T and

T).

end

with

\342\226\241

the

word

1L

3!2!2!2!1!1!

\342\200\242
\342\200\242
\342\200\242
the number of permutations of {3 \342\200\242
A, 2
L, 2
S,
E, 2
that
with
number
of arrangements of these
begin
E is 9!/3!l!2!2!l!.

letters

Chapter2: Elementary

176

Combinatorics

In how many

2.5.4.

Example

to 5

students so that 2 of the students

other3

will

5 books

have

ways can 23 different


have

will

be given

books

4 books

each and

the

each?

Choose the 2 studentsto receive4 books each in C(5,2)


Answer.
Then
each such choicethe 23 books can be distributed in
to
ways.
Thus
there
are C(5,2) (23!/4!25!3)
P(23;4,4,5,5,5) 23!/4!4!5!5!5!
ways.
total distributions.

* Example 2.5.5.
number

of

ways of

number

\342\200\242
2 \342\200\242
2 \342\200\242
1 \342\200\242
4 \342\200\242
3 \342\200\242
3 \342\200\242
The

a,

b,

Selection

(1)

(2) 4

From

5-Combinations

Each Selection

12

alike and

(5)

3 alike,

20

4C(6,2)=

2 alike,

C(6,2)5

-5L.6

12-5-60

5!

20 . 10= 200

60-20= 1,200

3!1!1!20

5!

= 75

. 30

75

= 2,250

30

2!2!1!

alike and

6C(6,3) =

120

different
All

1 different

and

(7)

of

Number

5-Permutations

5!

60

others alike,
(6) 2

g}.

alike

others different
j

the following

4!1!

alike, 2

others

(4)

/,

as in

5!

1 different

(3) 3

e,

of Arrangements

Number of

5 alike

All

classified

be

to the

Number

of

Types

d,

c,

selecting 5 letters may

of each type, but eachonewill


combinations
be several
that
same number of permutations so we can compute
2.5.17
Theorem
by applying

table. Theremay
rise

and the

of 5-combinations

number

the

of {5

5-permutations

different
give

Find

5!

2MMM!

C(7,5)= 21

5 different

120-60 = 7,200

60

5!

21

120

\342\200\242
120 =

2,520

1MMMM!

309

Total

13,431

The table should be self-explanatory


the numbersin columntwo. Let us
Selection

{5 \342\200\242
a}].

(1) can

except

possibly

how we

arrived at

explain.

be made in only

1 way

[namely

by

the

selection

Section

Enumerating

2.5

Selection (2)

Permutations

with

can be made in 12 ways;

Constrained

choose

the

Repetitions
4 alike

177
in 2 ways

then choose the 1 different


in 6 ways.
letter
a] or {4 \342\200\242
g}], and
[either {4 \342\200\242
Selection (3) can be made in 20 ways;
choose
the 3 alike from the a's,
6's,cTs, or #'s, and once one of these is chosenthereare5 choices for the 2
alike (since the c's and e's can now be chosen).
in 4C(6,2)
Selection (4) can be made
ways since there are 4 ways to

\342\200\242
\342\200\242and
choose3 alike letters [either{3 \342\200\242
once
a}, {3 \342\200\242
6}, {3
d}, or {3
g}],
these have been chosenthereare6 different
letters
from which 2 must be
chosen.
Make selection(5) as follows. First, note that there are only 6 letters
numbers >2 (only /has repetitionnumber
with repetition
the
1). Choose
2
in
2 different letters that are eachto have
number
C(6,2)
repetition
ways. Now after choosingthese2 lettersthere are 5 letters that remain (/
This can
from which to choose the 1different
letter.
can now be included)
can
be made in C (6,2)5 = 75 ways.
be done in 5 ways.Thus,selection
(5)
in much the same way as was selection
5.
Selection
(6) is explained
in 6 ways.
There are 6
Choose the letter that is to be repeatedtwice
from
which
3 are to be chosen.Thus,selection
distinct lettersremaining
be made in 6C(6,3) - 120ways.
can
(6)
there
are 7
because
Selection
(7) can be made in C(7,5) = 21 ways

distinct letters

from

5 are

which

to be

chosen.

The total numberof 5-combinations


is 1 + 12 + 20 + 60 + 75 + 120+
is 1 + 60 + 200 +
21 = 309, and the total number of 5-permutations
1,200 + 2,250+ 7,200 + 2,520 = 13,431.

Ordered

and Unordered Partitions


is reformulation of
Theorem 2.5.1 from a different
The following discussion will be suggestive.
perspective.
A carpet
manufacturer
has 1,000 rugs in his warehousefor sale. Upon
in quality.
he
finds
that
He decides to classify
they differ
investigation,
and
3.
Each
is
them in three quality
1, 2,
grades,
rug inspected,and a tag
of
is attached
one
the
numbers
or
1,2, 3.
bearing
let us give a mathematical descriptionof what
Now
has been
The

problems.

very

of combinatorial
us, therefore,
interpret

essence

Let

mathematics

accomplished.

S denote
the set of 1,000rugs.By attaching
a tag bearing one of the
Let
numbers 1, 2, or 3 to eachof the rugs, the manufacturer has defined a
\342\231\246
function
is {1,2,3}. This function
/ whose domain is S and whose
range
three
of S:
defines the following
subsets

Al-{aeS\\f(a)-l],
A2

|a\302\243S|/(a)

A3^(aGS|/(a)

- 2}, and

= 3|.

178

Chapter

Combinatorics

2: Elementary

The sets

(a)

Ax

(b)

Ai

the

have

AlyA2,A3

A3 =
=
0 for
Aj
A2 U

properties:

following

S; their union equalsS.


i # j; they are disjoint.

say, the setsAuA2yA3

form
an (unordered)
partition
of S. But,
a definite orderingon the sets themselves,
for the manufacturer may want to charge more for the higher
quality
form
a (3-part)
ordered
rugs. Thus, the ordered triple of sets(AUA2,A3)
the ordered
partition of S. Of course,
triple (A2,Al9A3) gives rise to a
want
different
ordered
of S (for example the manufacturer may
partition
to charge
more for rugs of quality grade 2), even
this
would
though
constitute the same unordered partition of S.

That

is to

\342\231\246more
than

2.5.1.

Definition
be

a positive

integer.

of S,

t subsets

can be

there

this,

Au

...,

Let S

be a set with

t-part

partition

At such

that

S = Ax

Ai Pi Aj

A2 U

= 0

and let t
elements,
set S is a set [Al9...,At) of

distinct

of the

\342\200\242
\342\200\242
\342\200\242
U

At

for

i * j.

The subsets At are called parts or cells of S. Frequently, we will suppress


the words \"t-part\" and occasionallywe will
use the term unordered
this
between
definition
and the
partition to emphasize the distinction

following one.
An

there

ordered

is a

(AX,A2,

form a

...

of S is first of all a partition of S but,


partition
secondly,
an ordered
of sets
t-tuple
specified order on the subsets.Thus,
,At) is a t-part ordered partition of S if the sets Al9 ...,
At

partition of S.

Example 2.5.6.
of S = {a,6,c,d}

Ax

whereas

(A3yAlfA2)f(AuA3fA2)
same
3 subsets.

form

{a,6},

A2 =

{c},A3

{d} form

a 3-part

partition

(AlfA2fA3)y(A2fAlfAs)y(A2fA3fAl)y(A39A29Al)9

6 different

ordered partitions of S using

these

of S, for example,
Of course, there areother3-partpartitions
Bx = {a,c},
=
=
is nothing in our definition to exclude the
{d}. There
B2 {6},and B3
as one of the subsets, so Cx = {ayb,c)> C2 = {d}, and C3 = 0 is
set
empty
another 3-part partition of S.
in ordered
interested
We
are
partitions of certain types. For this
we usually
reason,
specify the numbers of elementsof the subsetsin the
ordered
Thus, by an ordered partition of S of type
partition.
(qi,q2,
... ,qt), we mean an ordered partition (Au..., At) of S where | A, | == q( for

Section

2.5

with Constrained

Permutations

Enumerating

A2

^M

<ii

<il-\\

<7i

elements

elements

Since S has n elements,clearly

each i.
We

might

Figure 2-4.

depict

all

List

<ii

n =

have

must

we

ordered

elements

2-4

a partition of S of type

Example 2.5.7.

'

elements

Figure

179

Repetitions

(<?!,

...,

qt) as

of S

partitions

qx

q2

\342\200\242
\342\200\242
\342\200\242
+

4-

illustrated in

= {a,b,c,d}of type

(1,1,2).

Of course,
many\"

rather

Theorem
of

number

|S|

({a},{&},{c,d})

({bUaUc,d})

({a},{c},{6,d})

({c},{a},{6,d})

({a},{d},{6,c})

({d}f{aUb,c})

({bUd{a,d})

({cUbUa,d})

({b},{d},{a,c})

({dUb},{a,c})

({cUdUa,b})

({d},{c},{a,6}).

we have
than

list

often we

are interested in \"how

of all.\"

(Enumerating ordered partitions of a set). The


...
of a set S of type
where
(qifq2y
,<?<)

2.5.2.
ordered

most

that

learned
\"a

partitions

= nis
n\\

P(n;ql9...yqt)
qx\\q2\\.

Proof.

subset

We see this by choosingthe qx


in C{n,qx) ways; the q2 elements

C(n - 91,92)ways,
(quQ2y

\342\200\242
. . ,Qt)

etc.

is

Cin.q^Cin

Qt-iyQt) and we know


Thus

number

in Example
of ordered

Then

the

number

- ql9q2)

.qt\\'

to

elements

for

the

of ordered
\342\200\242
\342\200\242
\342\200\242

C(n

the first

occupy

subset in

second

partitions of type
-

qx

that this equalsP(n;ql9... ,qt).

q2

. .

\342\226\241

the
could use Theorem2.5.2to compute
=
=
n
for
here
S
of
of
(1,1,2)
{a9b,c,d}
type
partitions

2.5.7 we

180

Chapter

Combinatorics

2: Elementary

4, <?!-

1,

q2

1, and

- 2. Thus,thereare

q2

- 12

4!/l!l!2!

such ordered

partitions.

Example 2.5.8. In game of


and
seated
West)
North, East,
the

South,

of 13

\"hand\"

many

cards be dealt to the four

the 52

can

ways

52I/13!4

(b) In how

in a

cards.

(a) Howmany
Answer.

(usually called
are
order
eachdealt a
specified
four players

bridge,

(Here order
will one

ways

counts.)
player be dealt all four

Choose
the player to receive the kings
the
partition
remaining cards. There are 4(48!/9!l3!3)
C(39,13) C(26,13) C(13,13) ways.
Answer.

deals
(c) In
many
other6hearts?

Answer. Choose

7 hearts

the

other

6 hearts

North

will

how

to South) in

be dealt 7

for North

C(13,7)ways;

In

how

many

ways

will

North

and

kings?

4 ways;
then
= 4C(48,9)

in

hearts and Souththe

(and automatically
then

partition

cards. C(13,7) 39!/6!7!13!2


hands.
(d)

players?

the

kings?

Number

for

of kings

North

South

2^

of hands

Number

48!

9!13!3

cu

48!

CK1)12!10M3!2
n ( a o\\v
CK2)

CU 1)

48!

111*13!'

48'

C(4,1)12!10!13!2
48!

9!13!3

the

remaining

have together

South

give

all

four

Section

Permutations

Enumerating

2.5

48!

48!

v '
2C(4,l)-^-,

9!13!3

complex
have

the same

Theorem 2.5.3.

follows

unordered

(Enumerating

deals

the

recall

Here

can 14 men be partitioned


members, the secondteamhas 2

ways

many

team

first

has 3

team has 3 members,and the fourth,


have 2 members?

the third

members,

teams each

cell
of

the fact that each unordered partition


ordered partitions. There are 1/4!(52!/13!4)
dealing order.

(a) In how

2.5.9.

Example

the number

to t\\

rise

disregarding

into 6 teamswhere

of equal

partitions

from

immediately

of thet subsetsgives
bridge

subsets

all

number of elements.

t. Then
size). Let S bea set with n elements where n = q \342\200\242
unordered partitions of S of type (q,q,... ,q) is 1/tl (n\\/(q\\Y).
that t equals the number of subsets.

This

much more

of unordered partitions is a
give a formula only in the casethat

will

We

matter.

11!213!2

number

the

Determining

48'
48'

+ C(4,2)
v ' '

'12!10!13!2

181

Repetitions

number of dealsis

The total

Answer.

Constrained

with

Answer. This calls


there
(3,2,3,2,2,2);

for

the

of ordered

number

fifth,

partitions

and

sixth

of type

are

P(14;3,2,3,2,2,2)

14!

3!2!3!2!2!2!

14!

3!22!4

such ways.
many ways cari 12 of the 14peoplebe distributed
has
first team has 3 members,the second
the
where
5, and
In

(b)

teams

how

into

the third

has 4 members?

to
of ways to choose the 12people
number of orderedpartitions of type
are C(14,12) (12!/3!5!4!)such ways.

Answer. First

count

be

into

placed

(3,5,4).
(c)

teams

There
In

how

of 4

C(14,12)

count

then

many ways

each?

Answer.
then

teams,

First,

count

the

number

count the

can 12 of the 14peoplebe distributed


the

number

number
of unordered
such
(12!/4!33!)
ways.
the

into

to choose the 12people;


of
type (4,4,4).Thereare
partitions
of ways

182

Chapter2: Elementary

Combinatorics

many ways can 14 peoplebepartitioned


each
and secondteamshave 3 members
sixth teams have 2 memberseach?

In how

(d)

the first
fifth,

and

Answer. 14!/(3!22!4)

the

(Count

(e) In how

many

Answer.

ways

(f) In

how

many

with

teams

ways

2 teams

order

us be clearhow

2 each?

3 each

rise to 2!
partition
gives
and 4! arrangementsof the 4

this

people be distributed into 6 teamswhere


teams
have 2 members
each? Let
differs from (d) and from
Problem
(e).
(d)

can 14

have 3 eachand 4

problem

counting the number of orderedpartitionsof type


there is a specified order. Thereare of course

calls for
that

partitions.)

2 each.)

with

some

of ordered

fourth,

people be partitioned into 6 teamswhere

2!4! becauseeachunordered

arrangements of the two

in

third,

when

14!/(2!4!3!22!4)

(We divide by

teams

can 14

and 4 teams have

3 each

have

teams

two

number

6 teams

into

and the

is,

ordered partitions with

(3,3,2,2,2,2),

other

types

of

numbers, (2,3,2,3,2,2), for


occupancy
=
t
here
are
different
6!/2!4!
C(6,2)
example.Indeed,
types of orderingsof
these6 numbers
four
2's
and
two
3's.
For
eachselection
of a
including
of
there
are
of
ordered
that
14!/3!22!4
type
partition
partitions
type.
Hence there are (6!/2!4!) (14!/3!22!4)
suchpartitionsin some order. Note
in (e). Perhaps
this answer is 6! timesthe answer
one more example of

this kind

will

(g) In how
in

some

order

teams have

these

make

the concept

many

ways

2 teams

same

clear.

can 14 people be partitioned into 7 teamswhere


have 3 memberseach,3 teamshave 2 each, and 2

1 membereach?

Answer. (7!/2!3!2!)
(14!/3!22!3l!l!)
Some

Hints

focused our attention on these types


of problems:
and
combination,
permutation,
partition problems.
We
have
two major subtopics to each of these
of
discussed
types
with
or
combinations
with
without
problems: permutations
repetitions,
or without
and ordered or unordered partitions.We have
repetitions,
seen in our examples that these problems
in all sorts of
canbe formulated
What
will
determine
we
that
whether
need
are
some
clues
settings.
help
Basically

we have

Section 2.5

the problem is callingfor

Repetitions

183

r-combinations,

or

with Constrained

Permutations

Enumerating

r-permutations,

counting

partitions.

First, we suggestlookingfor key


of combination is selection while

arrangement. Nevertheless,not
problems

these

use

counts (a permutation

that order
reference

to

order

the
all

some for

words;

words\342\200\224the

But these clues are not


order are only implied
by
need

phrased

It

want

mentioned

or

assigned

is in

sets

of

are

objects

this context

where

the number
to n cells.

enumerate

to

objectscanbe

problem).

involved either

many

problems. The generalideais that

as distribution

objects and we

that suggest
make no

and
sometimes
arrangements
the context
rather than being
additional
clues. Frequently in combination
two

explicitly or implicitly.

phrases

others

while

for

fail-safe,

explicitly.
and permutationproblems
we

Thus,

use

may

problem)

in the definition
for permutation
is
or combination
word

key

word

permutation

example,

a combination

(probably

key

distributed

are

problems
we

have

of ways in which

these

r
For example,we may wish to count the number of ways of assigning
to n teams.
balls to n boxes, r cardsto n hands,or r players
in others
In some applications the objectsare indistinguishable;
they
are distinguishable; the cellsmay be distinguishable,
they are
(maybe
cells may be
or the
numbered or equivalently ordered in someway),
identical.

Type

Order
Counts

Set of r

of

Theorem

Repetition

Name

Allowed

Objects

Reference

Number

Yes

Distinguishable

None

r-permutation

P(n,r)

2.3.1

No

Indistinguishable

None

r-combination

C(n,r)

2.3.3

Yes

Distinguishable

Unlimited

r-permutation

with

2.4.1

nr

unlimited

repetition

No

Indistinguishable

Unlimited

r-combination

with

C(n +

r- 1,r)

2.4.2

unlimited

repetition

Yes

Constrained

Ordered

partition
No

Constrained

Unordered
partition

Figure 2-5

P{n\\qu-

-,Qt)

2.5.1

&

2.5.2

No general

formula

184

Chapter

Combinatorics

2: Elementary

speaking, if the objects and the cellsare distinguishable,


in both sets are distinguishable,
we
suspect
if the objects
are
problem. But, on the otherhand,
permutation
and
the
cells are distinguishable
(or in other words,
indistinguishable
of only one of the sets are distinguishable),
elements
then
we suspect
combination problem.
Generally

that

is,

if elements

Ordered partitions are really


permutation
the clue here is the mention
of

frequently

to be

are

elements

which

permutations or

of ways

number

The

of choosing/arranging

2-5.

in Figure

illustrated

for

counting

or not repetitions are


determine whether to count ordered

allowed.Or, the case


orunorderedpartitions.
in

subsets of a set to

next whether

determine
of partitions

combinations,

assigned.

whether the problemcalls

After determining

the

nevertheless,

problems;

or more

two

r objects from

is

objects

Exercises for Section2.5

1.

Use

to calculate

2.5.2.

Theorem

(a) P(10;4,3,2,l)
2.

(b)

P(10;3,3,2,2)

(c)

P(16;4,7,0,3,2).

the following expressions:

to celebrate
of the store
store
has 25 flags to hang along the front
a special occasion.If thereare 10 red flags, 5 white flags, 4 yellow
flags, and 6 blueflags, how many distinguishable
ways can the flags

be displayed?

3.

In how
(a)

many ways

(b) 2 teamsof 4
(c)

can 8 students be divided

into

of 2 each?

4 teams

one

3 teams

each?
with

1 student,

one with

2 students,

and onewith

students?

4. From
the
from

200 automobiles 40 are selected


to test whether
meet
they
are selected
requirements. Also 50 automobiles
the same 200 autos to test whetheror not they
meet
the safety

antipollution

requirements.

(a) In how many

ways

can

many

ways

can the

(b) In how

10 automobiles

exactly

5.

that

Suppose

Florida

many

ways

can 24

there

are

that undergoboth tests?

University has a residencehallthat has


and 3 rooms for 3 students each.In
rooms,

State

5 singlerooms,5 double
how

be made?
selections be made sothat

the selections

students be assignedto the 13rooms?

Section

2.5

Permutations

Enumerating

that a set S has


ordered partitions(AX,A2,

6. Suppose
has

How many rc-part


in which each set At

elements.
,An) are there

distinct

...

185

Repetitions

1 element?

exactly

7. In how many
(b) if the

sized apples,

share 15 different

3 boys

can

ways

5?

takes

if each

(a)

Constrained

with

youngestboy

and the

7 apples

gets

other

two

get

boys

each?

8.

(a) If the
(b)
*(d)

different colors.

one block of each color, in how many


ways
be arranged in a line?
In how many ways can the 6 blocks be arrangedin a circle?
If the child selects 4 blocks
of each color, in how many ways
can these 24 blocks be arranged in a line?
In how many ways can the 24 blocks be arrangedin a circle?
can

(c)

of 6

blocks

has

child

selects

child

these

9. How many different 8-digit


the digits 1,1,1,1,2,3,3,3?

10. Find the number

of

numberscan be
of the

arrangements

formed

arranging

by

letters of

(a) Mississippi.
Tennessee.

(b)

11.

How
7

(arrangements of the letters) are there

anagrams

many

of

\342\200\242
1 \342\200\242
5 \342\200\242
1 \342\200\242
5 \342\200\242
1 \342\200\242
3 \342\200\242
4 \342\200\242
7 \342\200\242
9 \342\200\242
5 \342\200\242
tl

a,

12. How

d,

c,

e,

h,

g,

i,

m,

many ways are theretodistribute10balls

most 4 balls in the first 2 boxes


in box f, then xx + x2 ^ 4) if:

is, if

(that

xt

n,

= the

o,

with at
of balls

6 boxes

into

number

(a) the ballsareindistinguishable?


(b)

the

are distinguishable?

balls

\342\200\242
\342\200\242
of {8 \342\200\242
are there
13. How many
c} in which
6, 7
a, 6
arrangements
a?
each a is on at least onesideofanother
are there without any pair of
numbers
14. How many ft -digit
binary

consecutivedigits beingthe same?


and
of rows of 6 Americans,7 Mexicans,
number
15.Compute
the
and a

Mexican
(a)

Compute
the digits
How

the number of
1,2, and 3 with

of these
is divisible

many

integer

stands

and

a Mexican

10

between

a Canadian

side.

10-digitnumbers which
the

exactlytwice,
(b)

invariably

Canadianand in which

never stand sideby


16.

an American

in which

Canadians

numbers
by 9 iff

2 appearing

digit

contain

in each

only

number

are divisible by 9? (Recallthat


the sum of its digits is divisible

an
by

9.)

17.

(a) In

how many

100 so

ways

that their

can

3 of the

we choose

sum is divisible

by

3?

numbers from

1 to

186

Chapter 2: Elementary

Combinatorics

how many

In

(b)

ways can

positiveintegersso

18. In how

choose

sum

can we distribute
ways
balls into 6 different

many

10 blue

and

we

their

that

3 out of 3rc
is divisible by 3?

successive

10 red balls,10white
boxes (any box may

balls,

be left

empty)?

19.

places black and white


of
2 rooks, 1 queen, and 1 king
In how many
a chessboard.
ways

chess

player

bishops,
of

rows

20. (a) In how


4

(a) if

packages

two

package 20 booksinto 5 packagesof


contain

2 packages

and

3 each,

contain

21. In

can

knights,

color) in the first


this be done?

each?

books

Solve problem

(b)

can we

ways

many

chess pieces(2
each

1 package

5 books each, 2 other


has 4 books.

messages be deliveredby 3
is
The
order
messenger
messenger boy left unemployed?
in which a messenger delivershis message
is immaterial.
22.How many ways can 12 white pawns and 12blackpawns be placed
on the black squares of an 8 x 8 chess board?
23. Given the integers 1,2,3, ... ,15, two groups are selected; the first
group contains5 integersand the second group contains 2 integers.
In how many ways can the selection be made if (a) unlimited
but
a group
is allowed or (b) repetition is allowed
repetition
contains either all odd integersorall even
and, moreover,
integers
if one group contains even integers,thenthe othergroup
contains
is allowed,
and
only odd integers, and vice versaor (c)no repetition
the smallest number of the first group
is larger
than the largest
numberof the secondgroup?
how

5 different

can

ways

many

boys if no

24.

sells 20

A shop

different

flavors

4 ice
can a customerchoose

of

ice

In how many ways


(one dip of ice creamper

cream.

cones

cream

if they

cone)

of different

(a)

are all

(b)

not necessarily
contain
only 2 or
contain
3 different
are

(c)
(d)

25. Howmany

bridge

flavors?

of different
3 flavors?

deals

flavors?

flavors?
are there

in which

the spades?

26.In

how

many

committeeswhere

division

division

North and Southget all

people be dividedinto disjoint


must contain at least 2 people?(A
of 3,3, and 4 is considered
the sameas the
of 3,4, and 3.)

can 10
ways
each
committee

committees
into committees

into

27. Considerthe

word

there

(a) altogether?

TALLAHASSEE.

How

many

arrangements

are

Section

2.5

Permutations

Enumerating

no two

(b) where

(c) where

with

A appear

letters

the letters S are

Constrained

187

Repetitions

together?
E are

letters

the

and

together

together?

(d) of 4

taken from

letters

the

of

28. Considerthe word

TRIANNUAL.

(a)

How many

arrangements

(b)

How

9-letter

many

separated by
(c)

How

6-letter

many

are there of these9 letters?

words are there with


the
2 of the other letters?
words can be formed

exactly

TRIANNUAL
29.

TALLAHASSEE?

of

letters

the

from

N's?

no

with

and U

T, I,

letters

are n housesin a housingproject,


and
to make
them
r of them are paintedwhite,
s of them
are painted
In how many ways can
blue.
yellow, and t of them are painted
Suppose there
look different

colorsbe assigned

30. How many

each

to

52 cards

distribute

among 4

of 3 suits and 4

of each

3 cards

gets

player

houses?

the

ways can we

players where
of the

cards

fourth

suit?

31. Suppose that

we

black

place

bishops,2 rooks,1
an 8 x 8 chess board.

and

queen,

(a)

How

many

of the
(b)

How

ways

can 16

ways

can the

chessboard?

many

and

white chess pieces (2 knights, 2


of each of the two colors)
on

1 king

pieces be placedon

the

first

pieces be placedon

the

entire

two rows
board?

if the
6-letter words can be formed
letters
are taken
no letter can appear more
from a set of 20 different
and
letters
than twicein a word?
the number of 10-digitintegersthat
contain
(a) Compute
only the
the
3 appearing
exactly twice in each
digits 1, 2, 3 with
digit

32. How many

33.

integer,
(b)

34.

How

many

of the

integers in (a) are divisible

balls, 1 red ball, 1


the
numberof
rows
compute
Given

3 yellow

different

35. How

many

each half

ways

can we

SelectedAnswers for Section2.5


2.-\342\204\242-.

10!6!5!4!

5. P(24;l,l,l,l,l,2,2,2)2)2,3,3,3).

6. P(n;l,l,...

divide a

is to contain2 kings?

,1) -

n\\.

white

of 4

ball,

9?

by

and

of these

1 blue

ball,

balls.

deck of 52 cardsinto

2 halves

if

188

Chapter

Combinatorics

2: Elementary

7-

(a)

15!

15!

(b) 7!4!2

12.

k =

For

(a)

balls

remaining

xx

x2 = fc,
(

boxes

. ) ways.

1 and

(box

fc

ways to

=
X)

(k+*)

to
)
into the remainingboxes.
ways

The

\302\261(*

(b)

are (* J

2 boxes. (

first

the

in

0,1,2,3,4 there

+1)

0,1,2,3,4.

For each

box 2).
Total

ft

balls

the

distribute
is

total

(V)
Choose

k balls

to go into the first

of these there are2 arrangements

The remainingballs have


=

place

4 choices

each.

f:(1l)2k410-k.

16. (a) 28C(10,2).


P(10;2,3,5).

(b)

17.

(b)

is.

+ (34)

<a> 2P1)

3(2)

ft)'.

(>\342\200\242+$-\302\273)\342\200\242\342\200\242

19. P(16;2,2,2,2,2,2,l,l,l,l)

,20.

+ (^(33),

16!

-^.

20!
(a)

5!(4!)5

20!

(b)

2!23!24!5!2'

3
messagesare partitioned
Hence3(5!/3!l!l!)
+ 3(5!/2!2!l!)

21. The
\342\204\242

99

into

cells

of sizes

3,1,1 or

2,2,1.

32!

(12!)28!

(Note: there

are 32 black squaresso8 will

not

have

a pawn

on them.)

Section2.6

- 1+

(a) C(15

23.

are

There

(b)

5,5)

8 odd

are to

there

- 1 + 2,2) =
C(15
(^) (^).
and 7 even integersto choosefrom,

rjj9

either

+ flljgjways.

the 2

since

and

be 5 odd and 2 even or 5 even and 2 odd to be

chosenin^gj
(c)

189

Coefficients

Binomial

groups are

determined oncethe 7

are

integers

selected.

24. (a)
(b)

(2\302\273)

1 +

4) .(23)

(20-

<c>ra-H)-2o
(d)

2.6

There

are

cones

with

g) ways

to choose 3 flavors

exactly 3 flavors

times

3 ways

to

fill

=3( A

COEFFICIENTS

BINOMIAL

In this

section we will

some

present

coefficients.In formulas
arising
computer science,the binomial
for
that a facility
manipulating

from

basic
the

coefficients

involving binomial
analysis of algorithms in
occur
over and over again, so
identities

is a necessity. Moreover,different
in
rise to formulas that are different
of binomial coefficients reveal that they are, in
them

often give

approaches

to problems

appearance

yet identities

fact, the sameexpressions.

is itself a major field of study in combinatorial


of necessity merely scratch the surface.Fora
more
we
recommend
Riordan's book [36].In this section
study
thorough
involved
and an
of identities
we only hope to get a good ideaofthe type
idea as to the methodsby which these identities are obtained.
The

study

of identities

mathematics

we

and

Combinatorial

will

Reasoning

The

C(n,r)

symbol

factorial.In

other

has
words,

two
C(n,r)

meanings:
represents

the combinatorial and the


the number of ways of

from n distinct objects (the combinatorial


meaning)
C(n,r) equals n!/r!(n-r)! (the factorialor algebraic
meaning).
as a general rule, all theorems and identitiesabout
Therefore
factorials
and binomial
for
of statements
coefficients can be viewed as two kinds
which two kinds of proofs
and an
can
be given\342\200\224a combinatorial
proof
choosing
and,

r objects

as well,

190

Chapter2:Elementary

Combinatorics

on
proof. Roughly speaking, a combinatorialproofwill be based
a set into subsets in a certainprescribed
manner
and
then
decomposing
an
the number of ways of selecting these subsets,while
counting
proof will be patterned mainly on the manipulation of
algebraic
factorials. We
are
feel, as a general rule, that combinatorialproofs
preferable
and
in that they are intuitive,
instructive,
easy to remember. While
algebraic

than
combinatorial
proofs, they have an
algebraic proofsare moreformal
of
advantage in that verifications can be madeeven when understanding
an
awareness
of
the combinatorial meaning is missing.Nevertheless,
both proofs is probably necessary for a thorough
of the
understanding
meaning of an identity.
Let us give an example of how combinatorial reasoningcanbeused.

is an integer. The first hint


(n2)\\/(n\\)n+1
Example2.6.1.
of Theorem
that
this number is reminiscent of the conclusion
2.5.3.In
number
is the clue to the solution,
(n2)\\/(n\\)n
Prove

we have

that

is

fact,

enumerates
elements
(n2)\\/(n\\)n+1

this

for

the

the ordered rc-part partitions of a set S containing


where
each cell contains n elements. On the other
such unordered
enumerates
rc-part partitions of S.

Moreover,it is often the casethat


used
reflectsthe combinatorial
reasoning

the

Example 2.6.2. Supposethat there


roads from B to Cand c different

form
very
to solve the

n2

hand,

of one's solution
problem.

roads from A to
from A to C.
Howmany different
are there from A to C and back to A that
visit B
trips
at least once? The answer (ab)c + c(ab)
+ (ab)2 could be arrived at by
counting first, the abc trips from A to C via B that return directly to A;
then
the trips directly from A to C and that return via B and,
counting
those
(ab)2 trips that go and returnvia B.
finally,
counting
a different

are

B9 b different

roads

directly

Of course,
there are a total of ab + c trips from A to C and thus
(ab + c)2from A to C and back to A, and there are c2 trips that go directly
to C and return directly
from
C back to A. Thus the difference(ab + c)2
- c2
represents the number of trips that visit B at least once.
Another approach couldobservethat thereare(ab)(ab
from
+ c) trips
A

to

return to A

B that

C via

anyway.

directly to C and returnvia B. Thus,


in all that visit B at leastonce.
Now,

c(ab) +

of

course,

(ab)2,

(ab

there

Moreover,

there

simple algebra will show


+ c)2 - c2, and
(ab)(ab

are (ab)(ab
that

are c(ab)

+ c) +

trips to go
c(ab)

trips

expressions: (ab)c +
+ c(ab) are the same.

all 3

+ c)

What
we wish
of the expression
to point out here isthat the form
suggests
the combinatorial reasoningusedto obtain
solution.
the
This point of view will be very
when
beneficial
you are called upon to
some
identities
binomial coefficients.
verify
involving

Section2.6
Some

Identities

of Combinatorial

Examples

fact
by
>y factorials.

Representation

(1)

191

Coefficients

Binomial

r\\{n-r)\\

for

every

proved

pair of
in Theorem

integers n and
2.3.4.

(2) Symmetry property:

r where n > r > 0. This identity


=

C(n,r)

was

C(n,n-r).

A combinatorial
is easy
to see because when we
proof of this identity
n - r
chooser objectsfrom n objects there are n - r objectsleft.These
\342\200\224
to every
Hence
r) -combination.
objects can be consideredas $n (n
- r) -combination
r-combination automaticallythereis an associated
(n
and conversely.In other words
the same number of
there
are precisely
which
is just what identity (2)
r-combinationsas (n - r)-combinations
states.
a proof
Alternatively,
using factorials follows from the factorial
because

representation

n
since
- r).

But
C(nyn

(3)
integers

The

C(nyr)

= nl/(n

C(n,n

- r) =

- (n -

Newton's
n > r >

r)

r,

\342\200\224

r)\\rl

(n -

we have

while

(n

(n

C(n,r) C(ryk)

Identity:

k > 0.

r))l(n

- (n =

r)\\

r))\\

r! and

C(n

C(n,k)

- k,r

C(n,r)

k)

for

number of ways of selecting two sets:


from A, a set B of k objects. For example,
we
be counting
the number of ways to selecta committeeof r people
may
and
then
to select a subset of k leadersfrom
this
committee.
On the other
of ways we could select the
the
number
hand, the right-handsidecounts
of k leaders
from the n people first, and then selectthe remaining
group
r - k people for the committee
from the remaining n - k people.
A special
case of this identity is:
first

side

left-hand

a set

of r

(3a) C(n,r)r-

Here just let


committee
ofr.
Then,

of course,

of constants from

and then

nC(n

if r

the

counts

objects

1; in

l,r

- 1).

other

words, choose only

# 0, we can rearrangeto give

binomial

coefficients:

one leaderof the

a rule

for the

removal

192

Chapter 2: Elementary

Combinatorics

Another

Here
of

C(nyr +

(3d)

1.

Newton

Isaac

This

other

the

rth

the

\342\200\224
r

+ 1

(4a)

r-

for

formulas

interpretation.

in arranging n

objects we can fill


-

first

the

1 objects in

r - 1

that any r-permutation of n objectscan


r - 1 of the objectsin some
order
and
The first r - 1 positions
can
be filled
in
rth position can be filled in n - (r - 1) =

arranging

position.
the

while

ways. Thus,
- P(n,r

P(n,r)

some

l,r - 1)

first

- 1) ways

> r + 1>

we observe

hand,

attained.by

filling

C(n,r).

and then arrangethe remaining

n ways

alsobe
n

Then,

the importance of this identity:

from

at this point to list

because

holds

identity

positions.
then
P(n,r

and 1, respectively.
for integers n

C(n,r)

1)]

a combinatorial

with

nP(n -

P(n,r) =

position
On

+ 1

discovered

compute C(rc,r+1)

along

permutations

r)/(r

be instructive

might

(4)

1) = [(n (1646-1727)

how to

it shows

It

C(n,r).

r)

we have:

course,

Sir

= (n -

identity (3) by

r and k in

replace

C(n,r).

identity (3) is:

+ 1)

1) (r

C(n,r

case of

special

(3c)

- 1)

- l,r

C(n

(n/r)

(3b)

we seethat
- 1) (n -

1).

associated
very useful; it is commonly
although an equivalentversionwas known

The
result is
following
Blaise Pascal (1623-1662),
M. Stifel (1486-1567).

with
by

(5) Pascal's Identity.


C(n,r)

Let

us

give

an exercise.

xe

S.

(For

S might

example,

(A) those

consist of n - 1 women
into

two

factorial

easy

one of
and

proof

as

the objects, say


The

1 male.)

classes:

selections that includex and


do

that

In (A), we need merely


C(n

l,r - 1).

Distinguish

objects.

of S canbedivided

(B) thoseselections
in

+ C(n -

proof; we leave the

a combinatorial

Let S bea setofn

r-combinations

objects

- l,r)

C(n

to

choose

l,r - 1)

ways.

include

not

r
In

x.

- 1 objectsfrom
(B),

we choose

the

remaining

r objects

from

- 1
the

193

Binomial Coefficients

2.6

Section

Number

Row

n =

n=

C(0, 0)

C(l, 1)

C(1,0)

* =

n =

C(3,

C(3,0)

C(3,3)

C(3f 2)

1)

C(4,1)

C(4,0)

C(2,2)

C(2,1)

C(2,0)

C(4, 2)

| C(4,3)

C(4f4)

\342\200\242v
n

C(5,0)

C(5,2)

1)

C(5,

Figure 2-6.

C
C(5f4)

C(5, 3) 1

C(5,5)

Pascal's triangle.

- 1 objects (excludingx) in C(n - l,r) ways. Since these two


we can apply the sum ruleto obtain
classes
are disjoint,
the
identity.
is the sum of the number
Thus, the number of committeesof r people
of committees that containa given
and the number of committees
person
n

remaining

that do not containthat

person.

the
gives us an alternate methodfor determining
numerical values
of C(n,r).
For example, if we know C(4,0), C(4,l), C(4,2),
and
C(4,3),
C(4,4), we can determine C(5,l), C(5,2),C(5,3),and
C(5,4)
simply
by addition.
= C(n,n)
= 1 for all
C(rc,0)
Using identity (5) and the fact that
This

identity

nonnegative integers n,

rows in the

successive

build

can

we

binomialcoefficients,calledPascal'striangle
(Figure
What
Pascal's identity says is that the numbers
found by adding the two nearest
coefficients
binomial

For instance,

is

C(5,3)

it.

above

Since

C(4,3)- 6 +
Let's list

6 and C(4,3)= 4

we

entered.
or,

* =

8-

21

28

with

in other

n = 8 by

numerical

values

56

row

7 and

/\\

/\\

/\\
70

using

21

35

35

56

the

on the nth

number

is C(n,r).

row are

row above it.

row along
words, the rth number on the nth

The

We can construct the row correspondingto


Pascal's identity as follows:
7-

rth

the

in the

10.

binomial coefficients
the rth diagonalis C(n,r)

n =

on

circled binomial coefficients


see that
C(5,3) = C(4,2) +

Pascal's triangleagain (Figure2-7)

of the
row

of the two

sum

the

C(4,2) =

table of

2-6).

28

Chapter 2: Elementary

Combinatorics

h =

n=

n =

Numbers

Diagonal

*-1

13

\342\226\272
1

*\342\200\242
1

\302\253=2

r=

Numbers

Row

*\342\226\240

, =

*~14

n=4
n =

/i =

10

15

\342\226\272

\342\226\272
1

2-7.
Figure
entered.

Pascal's

We might

with

triangle

note that

15

21

35

35

21

10
20

15

\342\226\272
1

the numerical

values of the

on

the

l's. Thisis because


of,

C(n,0) =

the

number

second

binomial

extreme

coefficients

the left has


right has only

0 on

the

1 - C(n,n).

corresponding

diagonal

1, 2, 3,4, 5,6, etc.,and

from

Conditions.

Boundary

Likewise

to r =
the diagonalcorresponding

all Fs and likewisethe opposite


diagonal

(6).

extreme

right.

same

the

This is

to r = 1 always
has
the
row
is true for the oppositediagonal

because,

(7) Secondary Conditions.

C(n,l)
=

Indeedthereis
proceed

from

the

symmetry

left to right

- C(n,n

- 1).

of the triangle: on any row as we


the numbers are the sameas we proceed

property

Section

2.6

Table of Binomial

Figure 2-8
n

0
1

C(/7,0) C(/i.1) C(nt2)

4
5
6
7
8
9

1
2
3
4
5
6
7
8
9

10

10

11

12

13
14

15

Coefficients

C(nfi)

C(nt5)

C(nA)

C(nt3)

C(/i,8)

C(nj)

C(/?,9)

C(/i,10)

3
6

10

10

20

15

35

35

21

56
84

70

56

126

126

210
330

252
462
792

15

21
28
36

120

45

11

78

165
220
285

55

12

66

13
14

15

495

1287
2002
3003

715

91

364

1001

105

455

1365

1
7

36

210

120

45

10

462

330

165

55

11

924

792

495

220

66

1716

1287

286

3003

3432

5005

6435

715
2002
5005

16

120

560

1820

4368

8008

11440

17

136

680

2380

6188

12376

19448

18

18

19

19

20

20

3060 8568 18564 31824


969 3876 11628 2713250388
77520
1140 4845 15504 38760

190

For coefficients missing


= C(20,9)=

1001
3003
12870 11440 8008
24310 24310 19448
3003

6435

816

171

the Table

from

use the

1716

17

153

1
9

28
84

16

C(20,11)

195

Coefficients

Binomial

relation

43758

48620

43758

75582

92378

92378

125970

167960

184756

= C(ntn

C(ntr)

r)

167,960

from the

extreme right to left.This follows

Thus,

because

we
know approximately
need
only
binomial
coefficients in Pascal's triangle
from symmetry.
Thus, if we have
computed

C(20,10)then by

we

symmetry

C(20,8),C(20,13) C(20,7),
=

row

on

20. Thus,

we can

values of C(n,r) that


sum

of

take

first

1 in row

the

Pascal's

on a

number immediately

For example,
the

(see
by symmetry
or the
triangle

below

of the
have,

say,

the

last

The

out

this
that

same

explanation

yes as shown

in

Figure

to

left

diagonal.

with

2-8.

other

we

diagonal

number directly
10 + 20+ 35+
for
next column). Is therea mathematical

the
answer is

84 in

from

on a

number

row

termsof

the

the

known

with
diagonal of Figure 2-8starting
1 + 4 + 10+ 20 + 35 equalsthe 70

8 directly
below the 35 of row 7. Check
For
instance, by adding more
diagonals.
have 1 + 4 +
56
+ 84 = 210 (the
in

are

Figure 2-8).
table of Figure2-8:

diagonal (proceedingdownward

entries

3. Then we

of

values

C(20,0),
C(20,l),
..., and
= C(20,9), C(20,12)=
know C(20,ll)
and the rest of the binomialcoefficients
in
a tabular
form by omitting those

obtain

about

all numbers

right) is the

one half the


as the other values

list more

can

we

Note oneotherthing

the

etc.,

- r).

= C(n,n

C(n,r)

below

this?

196

Chapter 2: Elementary

Combinatorics

Summation.

Diagonal

(8)

C(n,0) +

C(n +

+ C(n

1,1)

+ 2,2)

+ . .

C(n

+ r,r)

= C(n

a combinatorial

us give

Let

distribute r indistinguishable

proof by

the

counting

number

+r

4-

l,r)

of ways

to

boxes.Thiscan
bedone in C(n + r + l,r) = C(n 4- 2
l,r) ways.But the ballsmay
also
be distributed
as follows: For each0 < k < r, distributek ofthe balls
in the
n
1
in the
first
last box. This can
+ boxes, and thenthe remainder
be done in 2\302\243_0C(n 4- &,&) ways.
An
can be made by repeated applications of Pascal's
alternate
proof
In this proof we start with
4- r 4- l,r) = C(n + ryr)
+
C(n
(5).
identity
4- r,r
C(n
1) and then decomposeC(n + r,r - 1) into
C(n 4- r - lV - 1) + C(n + r - l,r - 2).This gives C(n + r + l,r) =
C(n + r,r) 4- C(rc 4- r - l,r - 1)4- C(n + r - l,r - 2).Again decompose
=
the last term by Pascal's identity and combineto get C(n
+ r + l,r)
C(n + r,r) + C(n + r
1) + C(n 4- r 2,r -2) +
l,r
can be continued
until the last term is
4- r - 2,r - 3).This
C(m
process

C(n,0).The

balls

is the

sum

into

n 4+ r -

2 numbered

one desired.

Thus in several ways, we can computemoreentries


of the
table\342\200\224for
for row 21, we know C(21,0) = 1, C(21,l)= 21, but
then we
example,
the sum of the
(8),
compute C(21,2) by using identity
by computing
diagonal 1 + 19 + 190 or using identity (5), C(21,2)= 20 4- 190 = 1 + 18 4- 171
C(20,l) + C(20,2). Thus, C(21,2)= 210.Likewise,
C(21,3)
=
=
1140
190 4- 1140
+
C(20,2) + C(20,3);C(21,4) 11404- 4845 =
=
C(20,3) 4- C(20,4)
5985,etc.
The sum of the numbers of the nth row of Pascal's trianglegives the
identity.

following

(9)

Row Summation.

C(n,0) +

C(n,l)

\342\200\242
\342\200\242
\342\200\242
+

C(n,r)

4-

\342\200\242
\342\200\242
\342\200\242
4-

C(n,n)

- 2n.

This

just

elements

means

and this

of S respectively

...,

and

of a set S with
n
that there is a total of 2n subsets
number is also the sum of the number of all the subsets
1 element, 2 elements,..., r elements,
with
0 elements,

n elements.

is that
we have n people to be
place none in the first bus and all n in the
secondbus in C(rc,0) ways; we can put 1 in the first bus and all n - 1 in
the secondbus in C(n,l) ways, and so on, until we placeall n peoplein the
is a total of 2n ways
first bus and none in the secondin C(n,n)ways.
There
to do this since each of the peoplecanbeplaced
two
ways.

Another

put into two

way of
buses.

interpreting this identity


We

can

Section

2.6
Row

(10)

Summation.

Square

C(n,0)2+ C(n,l)2+
each

for

\342\200\242
\342\200\242
\342\200\242
4-

C(n,r)2

says that the sum

triangleisthe middle
To verify this, let Sbe
of
counts
the
(10)
B of
of n men

A and
a set

have

the

the nth row of

Pascal's

with 2n elements.
Then the right-hand side
n-combinations
of S. Now partition S into two
S where A and B have n elements each. (We might
and n women,for example.)
Then
an n-combination
a

subsets

+ C(n,n)2= C(2n,n)

of
squares
2nth row.

the

of
in

number

identity

. .

+ .

n.

integer

positive

This just

197

Coefficients

Binomial

set

ofA and an (n - r) -combination


of B
is a union of an r-combination
n. We might be choosing r men and n - r women.
Then
for r = 0,1,...,
of A and C(n,n - r)
for a given r, there are C(n,r) r-combinations
r)-combinationsof B. Thus by the product rule there are C(n,r)
(n
\342\200\224
which are unions of an r-combinationof A
r) n-combinations
C(n,n
x C(n,n - r) =
and
an (n - r) -combination
of B. By symmetry,
C(nfr)
C(n,r)2.Henceby the sum rule the number of n-combinationsof S equals.
But
we have already observed that this is also equal to
C(n,r)2.
2JL0
of S

the

hence

C(2n,n),

After observing

sameideasto

is proved.

identity

the proof of this identity


a more

obtain

general

we

see

that

we could

use the

identity.

(10a)
C(m,0)C(n,0) + C(m,l)C(n,l)
m > n > 0.
C(m 4- n,n) for integers

4-

\342\200\242
\342\200\242
\342\200\242
4-

C(m,n)C(n,n)

we have a set S includinga subsetA of m men


that
suppose
subset B of n women.We can choose n people from this set. Any
n-combination
an (n \342\200\224
of S is a union of an r-combinationof A and
n. Thus, for a given r, there are C(mfr)
recombination
of B for r = 0,1,...,

Here we

and a

of A

r-combinations
(n

(since

has

m members),

and C(n,n

of B (since B has n members).Thus,


are
are C(myr) C(n,r) n-combinationsof S which
the

- r) = C(n,r)

- r)-combinations

there

the
r-combination of A and an (n - r)-combinationof B. Apply
as r = 0,1,..., n to get the identity.
binomial
coefficient
The sum of all numbers includinga given
numbers above it in a column in Pascal's triangle(orin Figure
number in the next columnand in the nextrow.

(11)

Column

Summation.

C(ryr) 4- C(r 4for

any positive

l,r)

integer n>ir.

4-

\342\200\242
\342\200\242
\342\200\242
4-

C(n,r)

= C(n

4- l,r

each

for

4-

1)

sum

2-8)

r,

of an

union

rule

and all
is the

198

Chapter

Combinatorics

2: Elementary

Following

counts in 2

the pattern of Example 2.4.8,we see that the above identity


of nonnegative solutions of the
the number
ways

different

inequality

*i

use

can

We

+ *2

Pascal's

identity

= rP(n

- l,r -

- r

^n

xr+i

to obtain a

correspondingidentity

for

permutations.

P(n,r)

(12)

1)

P(n

l,r).

from
This can be obtained
(5) just by multiplying by r!.
identity
- l,r - 1)
- l,r)]
For P(n,r) - r!
C(n
r\\[C(n
r! C(n
1) + r! C(n
1)! C(n
l,r)
l,r - 1)]
r[(r
easily

4-

C(n9r)

-Xyr

- l,r)

r! C(n

Of course,
that identity

= rP(n

- l,r - 1)

P(n

l,r).

there is a combinatorialmeaning
(5) was obtained
by dividing

classes:(a) thoseselections
include
selections
did
not

included

that

for

Recall

(12).

identity

all r-combinations
fixed element x or

into two
(b) those

x. Likewise, all r-permutations can be


of class A by placing
x in one of r
each
selection
obtained
by arranging
r
1
elements
from
n - 1
a
nd
then
the
other
chosen
positions
arranging
or by arranging
elements [this is done in rP(n - l,r - 1) ways],
the r
elements chosen in each selectionof class B [this is done P(n - l,r)
that

ways].

are

There

more interesting properties of


on to other
topics.
from
other identities
to obtain

many

let us move
Let us showhow

for now

Pascal's

but

triangle,

combinatorial

identities.

Note
n(n +

Evaluate

2.6.3.

Example

that

we observe

25-i & = 222.xC(k,2)


Here

Exercises

we have

for Section

1.

2 +

3 +

... + n.
+

C(n

1,2)

l)/2 by identity (11).

Example2.6.4.
Here

2JU k = 2^x C(k,l) -

so that

C(k,l)

the sum

(a)

the

Evaluate

that k2
+

- k(k -

2JJ.!

COM)

l2 + 22

1)+

+ 32 +

= 2C(fe,2)

= 2C(n

... +

n2.

Therefore,

+ C(fe,l).

+ 1,3) + C(n +

C(k,r) = 0 if

used the convention that

k <

1,2)

by

(11).

r.

2.6

k* - k(k
+
6C(fe,3).
6C(fe,2)
Show

sum

that

- 1)

(k

2) + 3fe2

2fe

C(k,l)

Section2.6
(b)
(c)

\342\200\242
\342\200\242
J3 + 23 + \342\200\242
+ n3.
k4
fact
that
the
k(k
Using
fe4
for
4- 6fc, derive a formula

199

Coefficients

Binomial

Evaluate

1)

(k

like

2) (k

- 3) + 6fc3 - life2
of binomial

(a) in terms

coefficients.

2. Use

summation

column

the

(11) and

identity

r = 1, 2, and

3 to

the formulas

derive

(a) 1 + 2 +

\342\200\242
\342\200\242
\342\200\242
4- n

= n(n

4- l)/2,

\342\200\242
\342\200\242
2 4- 2 . 3 4- 3 \342\200\242
4 4- \342\200\242
4- n(n
(b) 1 \342\200\242

4- 1)

= n(n

(n 4-

1) (n 4- 2) -

4- 1) (n 4-

2)/3,

and

(c)

\342\200\242
2 \342\200\242
3 4-

(n

(2

\342\200\242
\342\200\242
\342\200\242
3 \342\200\242
4- \342\200\242
4-

3. Derive the column


summationidentity
4.

Use identity
(a)
C(n 4+

C(n

(n)

4)

n(n

4-

1)

(n 4- 3)/4.

4- 2)

identity

(11)

4- m,r)

= C(n

summation

the diagonal

from

(8).

that
(11) to verify
\342\200\242
\342\200\242
4- C(n
l,r) 4- \342\200\242
1, r + 1).

+ m + l,r + 1) -

(b) In particular,
n-l

X!

C(fe

4- 2,2)

- C(n

4-

2,3)

or

n-l

X! C(k 4(c) Use (b)to obtain

2-3 + 3.4+..\342\200\242

1.2 +

5.

We

such

a proof

2,2)

= C(n

4- 2,3).

that

+n(n

+ l)=-(n)(n

+ l)(n

+ 2).

triples (xfyfz) from the integers{l,2,..., (n + 1)}


is larger than eitherx ory.
that if z is fe + 1, then the number of such triplesisk2.
can be classified into 3 types:
triples

to make

wish

that z

(a)

Prove

(b)

These

(l)*-y,
(2)

x <

y, and

(3)*>y.

Show that there are C(n + 1,2) of


C(n + 1,3) of eachof the other2 types.
6. Solve for the unknowns in the following:
=
(a) C(10,4)+ C(10,3)
C(n,r);
(b)
C(50,20)
C(49,19)- C(n,r);

the

first

type

and

200

Chapter

Combinatorics

2: Elementary

(c) P(n,2) = 90;

- C(10,3)

C(5,3)

C(10,5)

(d)

C(n,r);

(e) C(5,0)2+ C(5,l)2+ C(5,2)2

C(rv);
C(5,5)

(f)

C(n,0)

(g)

+ C(6,5)

+ C(7,5)

+ C(n,l)

+ C(8,5) + C(9,5)= C(n,r);


= 128.

\342\200\242
\342\200\242
\342\200\242
+

C(n,n)

7. Use the binomialidentitiesto evaluate


1

8.

\342\200\242
2 \342\200\242
3 +

r,t
+
C(r

(n

(n - 1) n.

n,r)

\\

m + n)l

(r +

+ n,m)

C(m

;\342\200\224\342\200\224\342\200\224

rlmlnl

that

Show

(b)

sum

the

- 2)

\342\200\242
\342\200\242
\342\200\242
3 \342\200\242
4 + \342\200\242
+

that

Show

(a)

+ C(5,5)2 -

+ C(5,4)2

C(5,3)2

\"

5 (r!)2in

- r)!2

'

C(2^>

a combinatorialargumentto explainwhy

9. Give

- P(n,n
- 2P(n,n

(a)

P(n,n)

(b)

P(n,n)

(c)

(3n)

(e)

[(n!)2]!/[(n!)!]n!+1

is an

(n!)3

!/3!

- 1),
- 2),

integer,

areintegers,
(d) (3n)!/3!nand (3n)!/3fl

(f) (*!)!/{[(*by a

Show

10.

C(2n,2)

(a)

is an

is
l)!]!}n

an

(c)

r)

men

and

- l,r).

= nC(n

C(n,r)
=

+ 3

3C(n,3)

C(3n,3)

integer.

combinatorial argument that:


= 2C(n,2)
+ n2. (Hint: Considera set of n

women.)

(b) (n

integer, and

(d) C(3ra,3) = C(2n,S)+

\342\200\242

+ C(n,l)3.
C(n,2)

C(n,l)

2C(n,2)

C(n,3)

C(2n,l)

+ C(2n,2)

C(n,l).

(e) C(4n,4)= C(n,l)4

C(4,l)

C(3,2) C(n,l)2

C(n,2)

C(n,2f + C(4,l)C(3,l)C(n,l)

C(ra,3)

11. Show by

C(4,l)

+ C(4,2)

C(n,4).

a factorial argument that

(n -r)C(n + r-

l,r)

C(n,r)

= nC(n

r-

l,2r) C(2r,r)

Selected Answers for Section2.6

1.
7.

Since

(A

(fc
\302\243

9. (a)

C(n + 1,2) + 6C(n +


- 2) (fc - 1) fc - 3! C(k,S)

k3 =

22_i

(b)

- 2) (fe

1,3)+ 6C(n+ 1,4).

- l)fc = 6 \302\243C(fc,3)

Designateoneofthen distinct
are P(n,n - 1)ways to

6C(\302\253

as a

objects

arrange

the

1,4)

by (11).

There
- 1 objectsinto n

special object.

Section

The

2.7

and

Binomial

Theorems

Multinomial

201

each of these,thereis only one way to place the


special object.
(b) Placen - 2 of the objects. Then thereare2ways to arrange the
remaining 2 objects in the 2 vacant
places.
the number of unordered 3-partpartitions
of 3rc objects
(c) Count
where each part containsn elements.
positions. For

(e)

2.7

THE

of two

sum

The binomial
few

cases

elements.

n!

AND MULTINOMIAL THEOREMS

BINOMIAL
Any

n!-part partitions of (rc!)2

of unordered

number

the

Count

elementswhereeachpart has

unlike

symbols, such

as x +

the

powers

theoremis a formula

for

theorem should

of this

first cases of the

correspondence

Pascal's

with

be familiar
in

theorem

binomial

triangular

triangle:

x + y
x2 + 2xy +
+ 3x2y

x3

x4 +

4x3y

the

x and

The

: .

y3

4- y4

y)1

(* +

y)3

(x 4-

y)4

triangle again. That

Pascal's

we find

...

\342\200\242
\342\200\242
\342\200\242
+

(J)

/*

coefficients C(n,r)

appearance in the expansionof powers


First
Proof:
Write (x
\342\200\242
\342\200\242
(x + y) \342\200\242
(x + y). Then

4- C(n,2)

xn~ly

. + C(n,n)yn

binomial

(x +

says.

4- C(n,l)

+ (5)x-y
xn~ryr

y)\302\260

be

a positive

y,

- C(n,0)xn

4- C(nfr)xn-ryr

(?)

(* +

(The BinomialTheorem).Let

Theorem
2.7.1.
integer. Then for all
(x 4- y)n

y2

+ 4ry3

alone

theorem

binomial

- (* + y)2

+ 3xy2
6x2y2

If we focuson the coefficients

is just what

binomial. The first


We list these
reader.
form to suggest the

of a
the

to

a binomial.

called

is

y,

(j)

xn~2y*

xn 4-

4-

\342\200\242
\342\200\242
\342\200\242

(j) xn~ly

C(n,r)x-y.
\302\243
r-0

I'M

of

receive

their

name

from their

a binomial.

4- y)n as a product of n factors


(x 4- y)
expand this product until no parentheses

202

Chapter

Combinatorics

2: Elementary

One way is to select an x or a y from


We can dothis in many
ways.
and arrange these into a term of the form
for
multiply
xn~ryr
r = 0,1,...,
n. The collection
ofall terms with the same exponents on x
the coefficients in the expansion of (x + y)n.
and y will determine
Thus
for any given r we need only
determine
the number
of terms of the form
as described.
But such a term is obtainedby selecting
obtained
xn~ryr
y
n - r factors.The
the
from r of the factors and then x from
remaining
number
of such
terms is therefore the numberof ways
of choosing
r of the
n factors from
which
to choose
the y. Since this can be done
in C(n,r)
ways the coefficient of xn~r yr is C(n,r) as stated in the theorem. \342\226\241

remain.

each

factor,

2.7.1.

Example

(X +

y)\302\253

+ C(8,2)*Y

+ C(8,l)*7y

C(8,0)x8

+ C(8,3)*Y4-

+ C(8,5)*Y

C(8,4)*V

+ C(8,7)xy74- C(8,8)y8
(2.7.1)
= x8 4- 8x7y 4- 28*Y +
56xV + 70*y
4- 56*V
4- 28*y 4- 8xy7 4- ys;
C(6,0)(2a)6 4- C(6,l)(2a)5(56) + C(6,2)(2a)4(56)2
4- C(6,3)(2a)3(56)3
+ C(6,4)(2a)2(56)4
(2.7.2)
4- C(6,5)(2a)(56)5 + C(6,6)(56)6.
4- C(8,6)*Y

(2a 4-

56)6

Letx - 2a

and

(2a

- 26a6

4-

5b)6

= 56

4- 6

4- 15

2.7.1. Then

in Theorem
-

25

+ 15

. 5a56

\342\200\242
22 \342\200\242
54a264

1,the

becomes

formula

and
(x

4-

prove

y)n+1

becomes
(x+y)

\\t

that

(x

(x 4-

4- 20

52a462

55a65 +

4-6-2.

Second Proof. Thisproofis by

clearly true. We

. 24 .

. 53a363

5666.
on n.

induction

mathematical

4- C(l,l)y -x + y,

y)1 = C(l90)x

now assume the formula

. 23

and

If n

this

is

positive integer n
n
4- 1. We write
it is true when n is replaced by
4- y) (x 4- y)n and by the inductive hypothesis this

= *
C(n,r)*-y)

is

true

(^ C(n,r)*-yj

= C(n,0)jcri+14-

r-l

4- \302\243C(n,r)xn-y+1
r-0

for a

(E

C(n,r)x\"-y)

C(n,r)x,1-r+y
4- C(n9n)yn+l.

Section2.7
If we set r = k -

k runs from

the

in

1 to

(X

y)\302\273+i

x^1

as r runs from

C(n,r)xn~ryr+1 becomes 2JU C(n,k-

variable is immaterialsonow

third term becomes


2JLX

and the

above, then

term

third

rc, 2?:J
of the dummy

letter

the

Now

C(n,r

0 to

- 1,

l)xn+l~kyk.

k by

replace

l)xn+1~ryr and

- l)]xn+1-ryr+ yB+1.

+ C(n,r

\302\243[C(n,r)

203

Theorems

and Multinomial

Binomial

The

r-l

But

identity, we then have

Pascal's

using

(X

= x^1

+ y)^1

+f

C(n

l,r)jcn+1-ryr

yn+1

r-l

or
n+1

y)n+l =

(x +

X]C(n

l,r)xn+1-y.

r-0

the

formula is

mathematical

induction.

Thus

for

the theorem

1 and

is

by

proved

\342\226\241

can be

theorem

binomial

The

true

written in several other equivalent

forms:

(x

+ y)n

C(n,n
\302\243

r-0

r)jcn\"V

C(n,r)*yi-r
\302\243

r-0

C(n,n
\302\243

r-0

The first of these follows


C{nyr)

C(nyn

interchanging x
The

case y =

with

1 occurs

Replacing

l)n

x by

(1

n.

the symmetry
two

other

The

frequently enoughto warrant

Corollary 2.7.1. Letn


+

2.7.1 and

r - 0, 1, ...,

property

follow

by

y.

special case.

(x

Theorem

from

r) for

r)xry\"-r

C(n,r)xn-r
\302\243
r-0
\342\200\224
x we

be

a positive

r-0

- 21 C(n,r)xr.
r-0

C(*,r)(-*)r

C(*,r)(-l)r*'.
\302\243

r-0

it as

Then for all x,

- r>*n\"r

c(*>*
\302\243
r-0

have

-*)\302\273-\302\243]

integer.

recording

204

Chapter2:Elementary
Some

Combinatorics

Identities

More

\342\200\242
\342\200\242
- 2n has already
The identity C(n,0) + C(n,l) + \342\200\242
4- C(n,n)
been
but it also follows
(9)
proved by a combinatorial argument in identity
x = y = 1.
from the binomialtheoremby setting
\342\200\224
=
1 in the binomial
If we set x *= 1 and y
theorem, then we seethat

(13)

C(n,0)

+ C(n,2)

C(n,l)

This says that the alternating

\342\200\242
\342\200\242
\342\200\242
+

triangleis zero.
also

can

We

this as

write

C(n,0) + C(n,2)+
S be

Let

\342\200\242
\342\200\242
\342\200\242
-

(9),

identity

+ C(n,3)

C(n,l)

C(n,4)

total of these two


this is 2n. Thus

the common

the left.By

= 0.

of any row of Pascal's

members

of the

sum

C(n9n)

(-l)n

the right-hand

Add

sums.

2S = 2n

....

S = 2n~\\

or

side to
we

Therefore,

have

(14) C(n,0)+ C(n,2)


has the

This

identity

with

n elements,

then

elements is 2n_1 and


of elements.
number

\342\200\242
\342\200\242
\342\200\242
=

C(n,4)

\342\200\242
\342\200\242
\342\200\242
= T~\\

+ C(n,3)

C(n,l)

If S is a set
combinatorial
interpretation.
an even
the number of subsetsof S with
number
of
this equals
the number of subsets of S with
an odd
following

(15) lC(n,l) + 2C(n,2)+

3C(n,3)

- n2n~l

\342\200\242
\342\200\242
\342\200\242

nC(n,n)

for eadi

positiveintegern.

Tosee

this

rC(n,r)
(3a),
nC (n,n)
(n

n[C

we

use

Newton's

- nC(n

nC(n -

1,0) +

- identity
1),

- l,r

1,0)+

\342\200\242
\342\200\242
. +

C(n

we can apply identities(3b)

- l,n
and

give

proof as an

a proof

using the

exercise.

identity (9).by
+

lC(n,l)

1,1) +

- 1)]-

(9) to

(3) and

nC(n

n2n~l

obtain

l,l)/2

by

\342\200\242
\342\200\242
\342\200\242
-f

- 1) =

(9). Likewise

identity

the identity:

+ C(n

C(n,r) C(m,0) for

identity

2) +
- l,n

2C(n,

\342\200\242
\342\200\242
\342\200\242
+

Identity. C(n +
. +

r=>0.
We

nC(n

+
C(n
(15a) C(n - 1,0)/1
l)ln (2n
l)/n.
C(n
l,n

(16) Vandermonde's
l) + . .
C(n,l) C(m,r \342\200\224

so

m,r)

- l,2)/3 +
=

integers

binomial theorem; we

leave

C(n,0)
n > r

...

C(m,r)

> 0 and m >

a combinatorial

Section

and

The Binomial

2.7

Multinomial

205

Theorems

the coefficient of xr in (1 + x)n+m.


the
binomial
By
that coefficient is C(n + m,r).But(1+ x)n+m can also be written
as (1 + x)n (1 + x)m, and each of these factors can be expandedby the
\342\200\242
\342\200\242
binomial
theorem:
and
4- \342\200\242
4- C(n,n)xn
(1 4- x)n = C(n,0) 4- C(n9l)x
\342\200\242
\342\200\242
Now in the product
4- C(m9m)xm.
(1 4- x)m - C(m,0) 4- C(mfl)x 4- \342\200\242
of xr is obtained
the coefficient
the
r,
by summing over k = 0, 1,
of
a
of
from
a
term
the
factor
and
term
first
degreek, C(n,k)xkt
products
of degreer - k, C(m9r - k)xr~k, from the secondfactor, so the coefficient
of xr in the product is
consider

First,

theorem

...,

- k) -

C(m,r

C(n,k)

51

But,

as

have

we

4-

m,r),

so

follows.

In summary

ways

C(n,r) C(m,0).

this coefficient is alsoC(n

observed,

already

-1)+...+

C(m,r

C(n,l)

the identity

C(m,r)

C(nfi)

obtained

have

we

identities in a

combinatorial

variety

of

of

the use

including

1. combinatorial
reasoning;
2.

of binomial

representation

3. Pascal's

for

identity

The

coefficients;

induction; and

4. mathematical

5. the

coefficients by factorials;

binomial

theorem.

binomial

Theorem

Multinomial

4- x2 is a binomial, the sum of three


and, more generally,the sum of t unlike
\342\200\242
\342\200\242
4- xt, is a multinomial.
things, Xi 4- x2 4- \342\200\242
for (xx 4- x2)n when n is a
The binomial theoremprovides
a formula
to give a formula
for
can
be extended
positive integer.This formula
of
of trinomials
4- x2 + *3)* or more generally for
{xx
powers
powers
\342\200\242
\342\200\242
In this theorem the role of the
multinomials
4- xt)n.
(xx 4- x2 4- \342\200\242
is replaced
binomial
coefficients
by the numbers

unlike things xx

The sum of two

unlike

things

is a

trinomial,

n\\

=
\342\200\242
\342\200\242
> Qt)
<?2, \342\200\242
\342\200\224j\342\200\224j
-7

P\\n\\qu

where

n. It
and

qu

q2,...,

are

qt

nonnegative

ordered

partitions

of

a set

with

integers

is legitimateto name thesenumbers


to denote them by (qu .?., qt).

of n elements

qx

multinomial

\342\200\242
\342\200\242
4- q2 4- \342\200\242
4- qt

coefficients

that they enumerate the


of type (qu q2,..., qt).

Recall

206

Chapter

Combinatorics

2: Elementary

Before stating the general theoremlet us first


cases. If we multiply out (xx 4- x2 4- x3)3, we get
oXx

4*
X3 4- 0X1X2 4* 3xxX3
The coefficient of x 2X3,

proof

2.7.1

Theorem

of

remaining

C(2,2) = 3 ways.

x\\ +

0X2X3 4- 0X1X2X3.
for

and x3

the

from

in C(3,l)

this

choose

could

we

words

special
4-

3X? x2

x\\

as we did in the

can be discovered
x2 from one factor

example,

by choosing

In other

2 factors.

some

consider
x\\

more instructive. Supposethat we


x\\ x\\ x\\ in (xx 4- x2 4- x3 4- x4)18.(Note the
will occur in the multinomial
add
to
18.)
Thi&product
exponents up
4 of the 18factors,x2 from 5
can
from
as
often
as
be
chosen
xx
expansion
6 of the remaining 9 factors, and x4
of the remaining 14 factors, x3 from
from the last 3 factors.We see that the coefficient of x\\ x\\ x% x\\
then
taken
another

Perhaps

to find

wish

will be

example

the coefficient of x\\

must be

C(18,4) C(14,5)C(9,6)C(3,3)
This is not surprisingfor
are

We

letters:

of

such

we

can

number

the

calculating

-^^

the problem in

formulate

of ways of
Moreover,

{4-x1,5-x2,6-x3,3-x4}.

another way.

18
arranging the following
we know that the number

is

arrangements

P(18:4W)

4!^3!-

the sum of all


More generally,we can say that (x!4-x24-x34-x4)18is
where
and
over all
terms of the form P(l8;qifq2yqSyq4)
qu q2f 93,
q4 range
= 18.
of
such
that
sets
<714-<724-<734-<74
nonnegative integers
possible
it as follows:
Further generalization is apparent and we state

2.7.2

Theorem

integer. Then

for

(The Multinomial
all

qt) x?1 x%

2P(n;<7i,...,

...,

x2,

xu

\342\200\242
\342\200\242
\342\200\242
where

xf

have

(xx

the summation

a positive

n be

Let

Theorem).

xt we

4-

4- x2

\342\200\242
\342\200\242
\342\200\242

xt)n

extends over all sets

of nonnegative integersqifq2f ..., qt where qx 4- q2 4There are C(n 4- t - l,rc) terms in the expansionof (xx

\342\200\242
\342\200\242
\342\200\242
4

qt

4-

4- x2

= n.

\342\200\242
\342\200\242
\342\200\242
4-

xt)\\

Proof.

The coefficient

arranging the n letters {qx

of

x\\x

xq22

\342\200\242

xu

q2

\342\200\242
\342\200\242
\342\200\242
xQtf is
\342\200\242

x2,

...,

the

qt

number
\342\200\242

xt}y

P(n\\quq2y. ..,qt).

The number of

xf

xf

\342\200\242
\342\200\242
\342\200\242
is

xf

terms

types. Hence there are C(n

as follows: each
of n objects with repetitions
4- t - l,rc) ways to do this.

is determined

a selection

of ways

therefore,

of

it is

term of the form


from
\342\226\241

t distinct

Section

The Binomial and

2.7

X\302\247
X4

(a) In

2.7.2.

Example
Xj

(xx

x2

4-

4- x5)10the

+ x4

x3

207

Theorems

Multinomial

of

coefficient

X5 IS

= 12,600.

P(10;2,0,l,3,4)

There are C(10+ 5

(*! +
(b) In

X5)10.

X3 +

X2

(2x

coefficient

X4

4-

3y

of

x\\

-f

*?>

- C(14,10)

1,10)

we let

5z)8,

- 1,001termsin

expansion

= (23) (-3)3 (52)(560).

P(3;3,0,0)x3+

x3

P(3;l,2,0)

z3 + 3x2z -

8y3 +

(-2y)z2

4- P(3;0,l,2)

(-2y)2z

P(3;0,2,l)

P(3;l,l,l) x {-2y)z
-\\2xyz.
12y2z -

+ P(3;0,0,3)z3
x (-2y)2

(-2)V

P(3;0,3,0)

P(3;2,l,0)x2(-2y)

+
+

the

=
2x, x2 = -3y, x3 = 62, and thenthe
- 560. Thus, the coefficient
of x3y3 z2 is

xx

x\\ is P(8;3,3,2)

23(-3)3(5)2P(8;3,3,2)
- 2y,+ zf =
(c)
(x

P(3;2,0,l)x2z
P(3;l,0,2)xz2

=\342\200\224^

4-

6x2y

12ry2

4 3xz2

+
+

+
4

6yz2

For any positive integer t9 we have tn = 2 P{n\\qu


summation
extends over all sets of nonnegative
\342\200\242
\342\200\242
+ qt = rc.
qt where qx + g2 4- \342\200\242

2.7.2.

Corollary
\342\200\242
\342\200\242
\342\200\242
> <7t)

Q2>

the

where

quq2,...,

integers

Just let 1 = xt = x2

Proof.

x, in

are tn

Theorem

\302\243-part

ordered

2.7.2.
partitions

\342\226\241

of a

set

n elements.

Example

2.7.3.

Find the

n distinct

elements.

a set

\342\200\242
- \342\200\242
=

that there

states

2.7.2

Corollary

S with

with

S is

of

partitions

number of 3-partunorderedpartitions
of
We know the number of 3-partordered

3n.

denote the number

of a set
unordered
partitions
in
this
Pn(3)
example.
of which
One 3-part unordered partition of
there are 3
{S,0,</>}
- 1
and
each
of
the
From
(</>,S,0),
(0,</>,S).
Pn(3)
orderings: (S,0,</>),
=
3
unordered
there are
1) 4Thus,
3n,
3!(Pn(3)
Let Pn(t)

We are

n elements.

with

of

asked to

t-part

find

S is

other

3!orderings.

partitions

= (3nl

andPn(3)

Exercises

+ l)/2.

for Section 2.7

1.
2.

What

Using

3. (a)

is the

Figure

coefficient

of x3y7 in (x 4- y)10? in

2-8 complete

the 21st row

Use the binomialtheoremto prove

of
that

(2x -

Pascal's
3n =

9y)10?

triangle.

2?_o C(n,r)

2\\

208

Chapter

Combinatorics

2: Elementary

(b) Generalizeto find

sum

the

2?_0 C(nfr)

for

tr

number

real

any

(c) Likewiseprove that T - 2?_0 (-l)r C(n,r) 3n~r.


4. Use the multinomialtheoremto expand(xx + x2 4- xs + x4)4.
of x\\ x\\ x\\ x\\ in (xx + x2 4- x3 4- x4
5. (a) Determinethe coefficient
x5)10.

(b)

the numberoftermsin

the

ly

4-

expansion

(d) Determine the coefficientofx5in (a + bx + ex2)10.


What is the sum of all numbersofthe form
l2\\/qx\\q2\\q$\\
q2i q3 range over all sets of nonnegative integerssuch
q2 4-g3 = 12?

7. (a) UsePascal'sidentity
4- 1)

C(2n,n

4-

to

- ly

4-

the equation

for

combinatorial
argument

C(2n 4- 2,n
1).
C(2n,n
= 2[C(2n,n) 4- C(2n,n -

men and 2 women

of 2n

a set

Consider

4- 1)

2,n

8. Obtain relationsby

and

4-

4-

ql9
qx

4-

1)

1)].

give

in (a).
of xk in the

coefficients

the

equating

where
that

that

prove
4-

2C(2n,n)

C(2n
(b) Therefore
(c)

- w)25.

3z

of (x

- u;)25.

3*

6.

in (x -

the coefficient of xVVu;6

Determine

(c) Determine

4-

following:

(a)

(1 4- x)n

(b) (1

4-

- (1
=

x)n+2

(1 4-

C(n,n)xn);
(c)

(1

= (1

4- x)n+z

4- x)

(C(n,0) + C(n,l)x 42x 4- x2) (C(n,0) 4-

4- 3x 4-

3x2

4- xz)

...

4- C(n,n)xn);
.

C(n,l)*

. +

(2;_o C(n9r)xr).

9. Prove that:
- C(2n,0)

\342\200\242\342\200\242\342\200\242'
+

4- C(n,l)

[C(n,0)

C(n,n)]2

C(2n,2n).

4-

10.

(a) Show

that

>

for

2, C(n,l)

= 0.

(-l)n-1nC(n,n)

(b) Concludethat C(n,l)


4C(n,4)

(c)

n2n~2;

(e)
11.

(a)

4- 3C(n,l)

4- 5C(n,2) + .

C(n9n)

- (n 4- 1) 2\".

Verify

that

C(n,2)

C(n,n) - 1 4-

(1 4-

Consider

4-

...

(b) Verify
-(-1)\302\273.

(n

4-

2nC(n,n)

C(n,0) -

4- 2C(n,3)

- 2)

. .

. . . =* 2C(n,2)
term is nC(n,n)].

- 2C(n,l) 4-

that

3C(n,3)

of C(nfl)

Verify

C(n,0)

4-

4- 5C(n,5)

3C(n,3)

+ l)CM?

(-ir(n
(d)

value

the

is

What

4-

- 2C(n,2)

[here the last

\342\200\242
\342\200\242
\342\200\242
=

4- C(2n,l)

\342\200\242\342\200\242\342\200\242
4-

4- 3C(n,4)

4-

. +

. .

3C(n,2)

..+

(2n

\342\200\242
\342\200\242
\342\200\242
4-

(n

1)

1)

2n\"x.

2x)n to prove C(nfi) 4-

4- 22C(n,2)

2C(n,l)

= 3\".

2C(n,l)

4-

22C(n,2)

4-

\342\200\242
\342\200\242
\342\200\242
4-

(-l)n2nC(n#)

Section

The Binomial

2.7

(c) Verify

for

formula

for

and

3nC(n,n)

209

Theorems

Multinomial

and

+ 3C(n,l)
+ 32C(n,2) + . .
- 3C(n,l) + 32C(n,2)+ . .

C(n,0)

C(n,0)

+
+

(-l)nSnC(n,n).

proof of (a) Pascal'sidentity

a factorial

Give

12.

identity.

sum 1 + 2 C(n,l) +
+ l) C(n9r)
by
breaking

13. (a) Evaluate the


+ -**+(n

eachof

is an

which

(b) Evaluate the sum

14.

(a)

*>w

1) C(n,r)

(r

sum into

2 sums,

section,
+ C(n,2)

+ 2C(n,l)

C(n,0)

this

+ 2C(n,3)

that

Observe

(1 +

in this

identity

...

Newton's

(b)

and,

(l-*>w_

C(n>0)

+ C(n,2)x2

\342\200\242
\342\200\242
\342\200\242
+

C(n,q)x*,

where

( n if n is

(7

= J

(b) Then verify


C(nfl)

+ C(n,2)

for q -

the

16.

Show

n if

a combinatorial

Sbe

set

union

the

that

n is

odd.

that

15. Give

even

\342\200\224
1 if

n is

[ 2\"\"1 for n > 0


1 for n - 0

\342\200\242
\342\200\242
\342\200\242
+

C(n,g)

even
.
is odd.

1 if n

identity. (Hint: Let

proof of Vandermonde's
of m men and n women.)

of k consecutive integers is divisible


the number of ways of selectingk objectsfrom

product

(Hint: consider
k objects.)

- C(r^g2)17. ShowthatP(n;gx,(72) = C(m,(7i)


tn = 2) P(n;quq2f
18. Give a combinatorial argumentthat
where the summationis takenover all sets of nonnegative
\342\200\242
\342\200\242
\342\200\242
n - qx + q2 + \342\200\242
\342\200\242
+ qt.
\342\200\242,
<7i,<72,
Qt where

(a) Among 2rc objects, n of them are indistinguishable.


number
of ways to select n of these 2rc objects.
n distinguishable
select r objects from
the
objects;

19.

n-

r objects

from

(b) Among
The

number

Stirling

number

elements

of

indistinguishable

3n + 1 objects,n

the number of ways

20.

the

t-part

to

where each

them

n of

select

of the

unordered

of

qt)

...,

integers
Find

(Hint:

the

first

then select

objects.)
are indistinguishable.

Find

+ 1 objects.
kind, S(n,t), denotesthe

these 3n

second
partitions

cell is nonempty

k\\.

by

of a
(that

set

with

is, each

distinct

<?, > 0).

Show

210

Chapter

Combinatorics

2: Elementary

argument similarto the verification

by an

Pascal's

of

(5)

identity

\342\200\224 Observe
the boundary
that S(n,t) = S(n \342\200\224
1,\302\243 1) + tS(n
l,t).
=
=
of
the
conditions S(n,l)
S(n,n) 1. Then following
pattern
for n = 1,2,3,4,5.
of S(n,t)
Pascal's triangle list the values
21. Let T(nyt)
denote
the number
of ordered t-part partitions of a set
of n distinct
elements
where
each cell is nonempty. Show that
- l9t)]. List the values
of T(n,t)
+ T(n
1)
T(n,t) = t[T(n = T(n,t).
for n = 1,2,3,4,5. Note that t\\ S(n,t)

l),t -

P(n) denote the number

22. Let

of t where

values

of unordered
of a set with
partitions
number of cellsis not specified,
that

number of t-part

is the

P(n)

where the

elements

distinct

unorderedpartitions

and

21

to

possible

= 2^x

P(n)

Let Q(n) denote the number


of
values of t where 1 < t < n. Then,

resultsof Problem20

all

for

1 < t < n. Thus,

n
is

ordered
Q(n)

compute

S(n,t).
partitions for all
t-part
- SJ.x T(n,t). Use the
P(n) and Q(n) for n =

1,2,3,4,5.

23. In

how many ways can 7 distinguishableballs be placed


boxes if the first box contains2 balls (and
balls in a boxis immaterial)?

24.

the

that

Verify

= C(n,r
+ 2,r) - 2C(n + l,r) + C(n,r)
+
+
+
+
(b) C(n 3,r) 3C(rc
3C(n
2,r)
l,r) -

(a)

C(n

and

(c)

in

distinguishable
of the
order

(-D;

2?_0

C(n + q

C(gj)

- 2);
= C(n,r

C(n,r)

- j,r) = C(n,r -

q)

where

- 3);
a

g is

positive integer.

25. (a)

combinatorial

Give

identity

qiA2 ~

(b)

27.

Stirling
S(n,2)

the

1;

for P(n\\quq2,..., <?,).


row square summation by computing

the

1).

l,q2,qz)

P(n

for

(1 4- x)2n.

induction the
numbers of the secondkind:
= 2\"-1 - 1 for n > 1.

by mathematical

Prove

(a)

xn in

proof for

formula

(10)
of

an algebraic

- l;qx -

P(n;quq2,q3)

26. Derive identity


coefficient

and

l^a) + P(n;quq2,q3-

a similar

State

proof

= P(n

two

following

formulas

- 1) = C(n,2)
for n > 1.
28. (a) Provethat if p is a prime integer and k is an integersuch
0 < k < p, then p divides
C(p,k).
2P - 2.
(b) Use (a) to conclude that the primep divides

for

(b) S(n,n

Selected

that

Answers for Section 2.7

3.
7.

(a)

Consider

(c)

Choose

the

binomial

a committee

expansion of
of n + 1 from

(1 + 2)n.
the

2n

2 people by

2.7

choosing n + 1men,orn

- 1men

or n

1 woman,

and

men

211

Theorems

and Multinomial

Binomial

The

and

women.

C(n + l,k) -

8. (a)

(b)

C(ra

2,k)

+ 3,k) -

(c) C(n

C(n,k

1) +

C(m.A:)

C(h,k).

+ 2C(n,&-

- C(n,&)

1)+

3C(n,k

C(n,k

+ 3C(n,&-

- 1)

2).
+

2)

C(n,k

3).

9. RecaUthat (1 + x)2n - C(2ra, 0) + C(2n, 1) x + ...


- [(1 + x)nf = [C(n, 0) + C(n,l)x+ \342\200\242
\342\200\242
\342\200\242
+ C(m,
x
1.
this expression let

10.

1)

C(n,

(a)

- 2C(n,

n [C(n

- 1,

(-1)\"\"1

C(n

0)

2) + 3C(n,3) +
C(n - 1, 1) +

- 1, n

- 1)]

n)xnf.

2n)

n) =

(-D'^nCin,

1, 2) +
identity (13).

C(n

0 by

x2n

Then in

\342\200\242
\342\200\242
\342\200\242
+

\342\200\242
0 =

+ C(2n,

\342\200\242
\342\200\242
\342\200\242
+

\342\200\242
\342\200\242
+ l)C(n,n)
1) + 3C(n, 2) \342\200\242
(-l)\"(i\302\273
\342\200\242
. \342\200\242
(-1)\"-1
n)
C(\302\253,0)
C(n,2)
C(n,
C(n,l)
[C(n,l)
= 0 by identity (13)and 10 (a).
\342\200\242
\342\200\242
n C(n,n)]
(-1)\"
2C(n,2)\342\200\242

(c) C(n, 0)

2C(n,

14.

(1 + x)n
(1

- C(n,0)+ C(n,l)x+

- x)n - C(n,0)-

(1 +

x)n + (1 -

x)n

C(n,l)x+

C(n,n)xn

\342\200\242
\342\200\242
\342\200\242
+

+ C(ra,2)x2

n
Let x = 1 in

the

above

and we

2nl

1 for
24. See

is even
n is odd

C(ra,2)

\\

\342\200\242
\342\200\242
\342\200\242

\342\200\224
1 if

expression

C(nfi)

where

4- C(n,q)xQ

( n if n

C{n,n)xn

(-1)\"

= C(n,0)

\342\200\242
\342\200\242
\342\200\242
+

get

\342\200\242
\342\200\242
C(n,q)
\342\200\242/+

for

n >

= 0.

exercise 8.

THE PRINCIPLEOF INCLUSION-EXCLUSION


In

Section

2.1

the sum

we discussed

number of elementsin the union

not disjointwe
commonly
sometimes

called

must

called

the

the

sieve

refine

of disjoint

the

principle

method).

rule by
sets.

which

we

However,

of the sum
statement
of inclusion-exclusion

count the
if the sets are

can

rule to a rule
(it is

212

Chapter2: Elementary

Combinatorics

B are subsetsof

If A and

Statement:

First

set

universe

some

t/,

then

Thisis
in

of

elements

the

diagram illustrated in Figure 2-9 since


of B we have
the elements
counted
the

a Venn

from

clear

fairly

counting

of A P) B twice.
But it is also clearthat

and

(2.8.1)

+ |B|-|AnB|.

|AUB|-|A\"|

elements

n B

B9 A

Pi

B is

and

|AUS| = |Ans|
since

two

Pi

that by the

B, so

sum rule,

(2.8.2)

+ |AnB|4-|Ans|
A

and

nB| + |AnB|and|\302\243|

\302\243

B) U (A
+ A H B|.

(A O

|AnB|

see

we
\302\243),

that

The sum of these

is

equations

|A|

The

O B) -

U (A

Pi B)

(A

|A| = |A

of the 3 disjointsets

the union

+ |B|

= |An :B| + | AH
of

combination

B|

+|

(2.8.2)

Equations

and

(2.8.3)

+ AHBI.

TOBI

(2.8.3) gives

the desired

result:

|AUB|
Of course, if
Since
this

sets

equation

The
equals

D B

|A|

+ |B|-|An\302\243|.

then this is just the sum

= 0,

are frequently defined in terms


into the following statement:

number

the

of

elements

number

with

either

of elements with

Figure 2-9

rule.

of properties,we

of the

properties A

property

plus

translate

or

the

Section2.8

The

elements with
both
elementsthat satisfy
number of

will suffice

example

simple

Example 2.8.1.
French and 50can speak

properties

to illustrate

while

Russian,

and Russian.How

members

faculty

many

Russian?
If F is

the

of faculty

set

who speak

who speak Russian,then we know


20. We are asked to compute| F

20-

that

number of

this statement.
can speak

members
faculty
can
only 20
speak

200

that

Suppose

minus
the
A and B.

property

can speak

French and R
| F | = 200, | R
which

213

of Inclusion-Exclusion

Principle

by the

both French
either French or

the
- 50

is
|

set of faculty
and | F O R | -

formula

is 200 +

50 -

230.

The
solving

Example 2.8.2. Froma group


committeeof5 membersbeformed
Professor

offers an alternative
described below.

of inclusion-exclusion
principle
combinatorial
some
problems

of 10
so

that

method of

professors how many ways can a


at least one of ProfessorA and

included?

B will be

solutions; one using the sum rule, one by counting


one
and
the
of inclusion-exclusion.
indirectly,
using
principle
The number of committeesincludingboth Professor
A and Professor B
is C(8,3) = 56. The number
of committees
Professor A but
including
=
B
Professor
is
Professor
A
fills
one position
C(8,4) 70,(since
excluding
there are only 4 more positionsto fill and since Professor
B is excluded
there are only 8 people from which to choose). LikewiseC(8,4)is the
of committees
number
Professor B and excludingProfessorA.
including
sum
rule
total number of ways of selecting
the
the
a
by
Consequently
of 5 including ProfessorA or Professor
B is C(8,3) +
committee
70 = 196. By counting indirectly we obtain a second
2C(8,4)= 56 + 2 \342\200\242
we
need
the observation that the total number of
solution;
just
A and B is C(8,5) = 56 and
both
committeesexcluding
Professor
the
total
of committees is C(10,5).Thus,we see that C(10,5) - C(8,5) number
252\342\200\224
56 = 196 is the number of committeesincludingat leastoneofthe
We will give 3

professors.
A

252

third

solution

committees

uses the principle of


of 5 members, let Ax and

includeProfessor and
A

126 -1A21 and | Ax


- 56 = 196.
126

A2

Professor

inclusion-exclusion.Among
the
of
be
the
set
committeesthat
A2

JB, respectively.

| = C (8,3) -

56,it

follows

Since | Ax
that

C(9,4)

| Ax U A2 |

- 126 +

214

Chapter

Combinatorics

2: Elementary

If

for

jb

3 subsets of
the

examining

the universal set U, we

Venn

can

illustrated in Figure

diagram

find

2-10.

that

see

(A O

B O C)

(A

b n

c) u

B O

C) U

(\"J n

C = (A

3 sets.
C are any

C | by

B U

We

A =

B,

A,

|A U

obtain a statementof the principleof inclusion-

we can

Likewise
exclusion

(A

(A

Pi B

\"C)

b n

c> u

B O

C) U

O B

(A

(J n' b
(A

we

U (ADBDC),

no u

B O

since these are disjointunions

Therefore

O C)

C) U

use

can

jb n

o,

B O

C).

(A

(A

rule to

the sum

compute:

|A|
\\b\\-\\a

|AnBnc|

b n

c\\

\\a

nb

+ |AnBnc|,

+ |AnBnc|

AnBnc|

n c\\ +

\\Xnb n

(2.8.4)

c\\

\\a

n b

n c\\,

(2.8.5)

\\c\\-\\a n En

c\\

\\a

n5n

c\\

\\a

b n

c\\

\\a

nb

n c\\,

(2.8.6)

Figure

2-10

Section

The Principle of Inclusion-Exclusion

2.8

\\A\\ +

\\B\\

+ |AnBnc|

first 7 of these
the next 2 give

The

c\\ + \\a n

b\\

\\a

_But

like

would

we

B H C| +

ci

+ |AnBnc|

+ |AnBnc|

+ iAOBnci

lAnsnci

+ |AnBnc|

sets make up A

Pi C/Thus,

A
c\\

have

|AUBU C|

and

B,

|A|

C, the

C\\

how

many

Let F be
who speak
know

from

eithef

speak

the

set

of faculty

members

following

who speak

and Spanish,
French, Russian,

French,
faculty
|R |-

be

the

that speak

50,| S | -

that

speak

20 that

Spanish,

or Russian or Spanish?

Russian, and S be the set of


2.8.1. that | F \\ = 200,
example

that

note

C|

IAHBH

French
speak
10 speak
only

French

|C|

\\B\\

n C|

|C|-|AnB|-|A

2.8.3. If there are 200faculty


Example
50 that speak Russian,100that
speak

Russianand Spanish,while

|A|

finite sets, then

French,

French and Russian,\302\2470


that

next 2 make up A H
+ |C| = |A UBU

\\B\\

complements.We
H C| so that we have the

C are

CI

|An\302\243nc|.

free of

|B| +

-|BH

U B

|A

an expression
B n C| = |B

2.8.1. If A,

n c\\.

n b

\\a

we

J5 U

wehave|A|

theorem.

Theorem

+ \\An5nc\\

+ |AnBnc|

By rearrangingterm^
|AnB|-|Anc|-|AnBnc|.
|A n

have:

+ \\AnBnc\\

\\c\\-\\An5nc\\

+ |a nen

J5, and

and (2.8.6),we

(2.8.4), (2.8.5),

Equations

Adding

215

speak

35 that speak
and Spanish,

set of

faculty

Spanish.

100,
|

FC)

R \\ -

We

20

|FnS|-60f|finS|-35and|FnflnS|-10.Thus,|FU/iUS|200 + 50+ 100 20 -60 -35 + 10 - 245.


to count indirectlyand thereisa form
it has been beneficial
Frequently
that encompassescounting
of
inclusion-exclusion
of the
principle
Let
us
laws.
and
explain this versionfor 2 sets and
complements
DeMorgan's
we will give the generalversionlater.
_ __
A O B = A U B by
If A and B are subsets of a universal set U, then

216

Chapter 2: Elementary

Combinatorics

then by Equation

laws, and

DeMorgan's

(2.8.1),we
UB|

nB|-|TU\"B|-|l/|-|A

= |[/|-{|A|

1,000

|Anfl|.

If in Example 2.8.1thereare
2.8.4.
are 1,000 -\\F\\-\\R\\ + \\F C) R\\ = 1,000 R | = 1,000 - 230 = 770people
who
speak

1,000

Example
there

(2.8.8)

+ |B|-|AnB|}

-|tf|-|A|-|fl|
then
altogether,

have

\\F

faculty

200 - 50+ 20=


neither

French

nor Russian.

Likewise, if
laws and

A,

subsets of

C are

and

B,

\\A

HBH

UBU

C\\-\\A

C\\

C\\

+ \\C\\-\\AClB\\

(2.8.9)

c\\ + \\a nsncil

-\\a nc\\-\\BD
=

DeMorgan's

apply

UBU

\\U\\-\\A

+ \\B\\

-\\U\\~{\\A\\

|[/|-|A|-|B|-|C|4-|AnS|

50

can

we

Uf

Equation (2.8.7)to get

\\a

Thus in Example2.8.2there
- 100 + 20 + 60 + 35-10

c\\ +
are

\\b

- 245

1,000

do

who

faculty

nb

c\\-\\a

n c\\.

= 755 = 1,000not speak

200-

either of the

languages.

Example2.8.5. In

the
course, 208
computer
following

were

taking

were

course,

mathematicscourses
kindsof courses, 150
Let

and

and

M =

C(a) How many


(b)

How

many

course

but

(c) Howmany
mathematics

mathematics
76 were

and computer

statistics

taking

Florida State University


were taking a statistics
course, 160 were taking a
taking statistics and

of students
at
260
obtained:.

survey

was

programming

48
mathematics,

information

programming,

computer

were

{students

taking

taking

programming,62were taking

none of

30 were

taking all 3

the 3 courses.

statistics},

{students taking mathematics},


{students

taking

programming}.

computer

students weresurveyed?
students were taking a statistics and a mathematics
a computer

not
were

taking

course?

course?
and a computercoursebut

programming

a statistics

not

Section 2.8

The

(d) How many


How
in

a computer programming and a


statistics course?
a statistics course but not taking a course
taking
or in computer
programming?
a mathematics
course but not taking a
taking

were

taking

not a

but

mathematics
course

(e)

were

many
mathematics

(f) How many

were

statisticscourseor

course?

programming

computer

(g) How many were taking a computerprogramming


taking a course in mathematicsor in statistics?

The

Venn

217

of Inclusion-Exclusion

Principle

2-11

in Figure

illustrated

diagram

be helpful

also

will

but

course

not

in our

analysis.

= 76,|SnC| =
WeknowthatlSl = 260,|Mh208,|Chl60,|SnMl
=
=
C
sowe can
|- 150;
C|
62,|SnM.n
C| 30,and|SUMU
48,|MO
in
2
of the
of
8
the
students
number
of
insert the
regions
immediately
Venn diagram, the regions S D M O C and S U M U C.
(a)

The

of students

number

total

|[/| = |SUMUC|

-\\s\\ +
=
(b)

We are

\\s n m n

|MO

+ |SUMUC|
n c\\-\\m

n m\\-\\s

\\c\\-\\s

n c\\

+ is n m n c\\ + isTJmTJci
260 + 208 + 160- 76 - 48 - 62 + 30+ 150=

622.

asked to find:
c\\

CO

m-

s n mn

\\s

76

- 30 = 46.

(c) |sn cnM|


(d)

\\m\\

surveyed:

|sn

c|-|sn

S| = |MH C|-|Mn

c\\

cnM|

\\s

\\s n

mn

= 48-30 = i8.

CO S|

Figure 2-11

m\\

62-30

= 32.

c\\

218

Chapter

Combinatorics

2: Elementary

Is

( 46\\

Figure

\\

150

2-12

we can insert some more numbersin the appropriate


regions of the
Venn diagram (see Figure2-12).
the
of the number of students taking coursesin
Only
computation
one
of
the
3
exactly
subjects remains, and that is preciselythe contentof

Thus,

parts(e),

(f),

and

HM

(e)\\S
\\S

(g).

C\\

|Mnsnc_|

|cnsnM|
we can fill
in Fig

in

\\SnCDM\\-

166.

\\m\\

ioo

iMnsnci

\\Mncns\\

\\cnsnM\\ -

_
- \\cnsr)M\\
-

- |c|

ig)\\cnsnM\\

illustrated

- 46

260

(f)IAfnsnci

Thus,

- ISHMHCI - 18 - 30-

- |S|

nU\\

O MO

80

for all

numbers

the

8 regions in the Venn

diagram

2-13.

formulation of the principleof


that elements of a
PlfP2f
-,Pn
properties
U may or may not satisfy,then for each
universal
set
i, let A, be the set of
\342\200\242
\342\200\242
thoseelements
ofU that satisfy the property Pz. Then Ax U A2 U \342\200\242
U
all
is
the
set
of
elementsof
U
the
that
at
least
one
of
An
satisfy
properties
\342\200\242while
that
9Pn>
satisfy both the
P1,P2,* \342\200\242
Ai Pi Aj is the set of elements
3
properties P, and P;,At D Aj P) Ak is the set of elementsthat satisfy.the
\342\200\242
\342\200\242
\342\200\242
H
is
and
of
The
set
/the
set
O A2
Pi9 Pj9
Pk.
Ax
flA\342\200\236
properties
\342\200\242
\342\200\242The
set of
elements that satisfy all of thepropertiesP^ P2, \342\200\242
^.
\342\200\242
\342\200\242
\342\200\242
D
D
H
is
elements that donot satisfy
and
the
set of
is
An
Ax
A2
A,
P,
Let us now

proceed

to

If
inclusion-exclusion.

elementsthat satisfy
Let us list a few

a general

\342\200\242
\342\200\242

none
facts

give

of the

that

are

properties.

will be

useful. Suppose A,

B,

Ai are

subsets

of

U.

1. |A| = |[/|-|A|(countingindirectly).

2. |Brelative

A\\

|J3 n

complements).

A| =

|S- (AOB)|

|B|

- |A

H B| (counting

Section

The Principle of inclusion-Exclusion

2.8

2-13

Figure

3. I^H
U

\\Ai

A2H

...

A2 U

\342\200\242
\342\200\242
\342\200\242
U

- IAx

DAn\\

219

U A2U

\342\200\242
\342\200\242
\342\200\242

| U\\-

UAj-

An|(countingbyDeMorgan'slaw).

2.8.1.
(General statement of the principleof inclusionare finite subsets of a universal set U, then

Theorem

If Ai

exclusion).

...

|axua2u

UAj

EK-l-ZK-nA;.|

*-l

ij

+ DA-HA;-nAJ

(2.8.10)

\342\200\242
\342\200\242
\342\200\242
+
\342\226\240
\342\226\240

(-l)n-1\\A1DA2.

the second

where

{1,2,...,

integers

tions

{i,j,k} of

states

\\AX

U A2U

summation is taken over all2-combinations


{ij}ofthe
all 3-combinan), the third summation is taken over

{1,2,... ,n\\ and so on.


are 4 + C(4,2) + C(4,3)+

For = 4 there
the theorem
n

DAn\\,

A3U

24

1 =

15 terms and

that

A4\\

\\Ai\\ +

\\A2\\

\\A3\\ +

\\Ai\\

-lA.nAjl-lA.riAal-lAxn^l

-|A2nA3|-|A2nA4|-|A3nA4|
+ \\Ai n a2 n a3\\ + \\At n a2 n
a3 + n a4| + \\a2
n
-\\At
A2n a3d a4\\.
+

In

general

there

are

|Ai

(j) +

right-hand sideof Equation

\342\200\242
\342\200\242
+
(jj)
(g) + (3) + \342\200\242

(2.8.10).

a3 n

a4\\

2\"

a4|

1 terms

on the

220

Chapter

2:

Combinatorics

Elementary

on the number n of
=
n
subsetsAt. The theorem is obviously true for
1,and we have indicated
holds
for
why the theorem holds for n = 2 and n = 3. Assumethe theorem
of U. Suppose, then, that we have n + 1 sets Al9A2f ...,
any n subsets
holds
with n replaced by n+1. We will
use
An,An+1. We show the formula
for 2 sets repeatedly in the proof.
the result
ConsiderAx U A2 U ... U An U An+1 as the union of the sets Ax U
A2 U

theorem

The

Proof.

by induction

proved

An+1. Then

An and

\342\200\242
\342\200\242
\342\200\242
U

I^UAjU.

be

will

\342\200\242

\342\200\242
\342\200\242

-UAJUAJ

U^UiO-KAiU.

= |AtUA2U.

.UAj

-|(AXUA2U.
Use

that intersection

the fact

+ |An+1|

\342\200\242

(2.8.11)

\342\200\242

.UAn)PiAn+1|

distributes overunionsto getthat

\342\200\242
\342\200\242
\342\200\242

|(AXUA2U

UAn)DAn+l\\

-|

(A! H An+l)

U (A, O

O An+1)|.

\342\200\242
\342\200\242
\342\200\242
U

An+1)

(An

Thus, 2.8.11 becomes

|AXUA2U . .
- | (Ax
We can
(2.8.12),

. UAj
U

An+1)

|An+1|

O An+1)

(A2

\342\200\242
. . U

(An H

An+1)

|.

hypothesis to 2 of the 3 setsin

apply the inductive

(2.8.12)
equation

namely,
\342\200\242
\342\200\242
\342\200\242

|AXUA2U

EI^HAJ

UAJ-JlA,-!-

+ JLlAiHAjHA^

+ ..

(2.8.13)

. + (-l)-1

\\AlnA2n..

\342\200\242
ha\342\200\236|

and

I (a,

| a;
\302\243
\342\226\240-i

An+1 |

-\302\243

u
a\342\200\236+1)

n An+1

a,-

(An n

\342\200\242..
u

n <a,

|
a\342\200\236+1)

An+ly\\

>j

\302\243 |

...

(a2 n

u
a\342\200\236+1)

(A,

n An+1)

(-d-^kax

D(AnnAn+1)|.

(A,-

n
a\342\200\236+1)

An+1) n

(A2

(a*
n

n An+1) |

n
a\342\200\236+1)

...

(2-ai4)

Section

of Inclusion-Exclusion

The Principle

2.8

C\\

Aj

like

|AXUA2U

O An+l)

(At

t-l

\342\200\242
\342\200\242
\342\200\242

UAnUAn+1|

i,j,k<n

ij^n

...

+ (-Dn-1\\A1nA2n

...

(-lriA.nA.n
that

observe

sum is takenover

/,

nAn\\

...

+ T.\\Air)AjnAn+1\\+

Now

...

+ X] lA-nAynAj+

Zl^nA,|

EKI-

and (2.8.14) into (2.8.12)and making


- A, O
D (Aj H An+1) D (Ak n An+l)

we have

D An+l,

Ak

(2.8.13)

Equations

Substituting
simplifications

221

\\An+l\\-it\\Ai

(2.8.15)

r\\An+1\\

1-1

nAnnAn+1|.

(2lVssn|A,- Pi A,| 4the 2-combinations

2?.x |At-

Pi

{ij} of

the first

where

An+1|),

{1,2,.. .,n},and the second

2-combinations of the form {i,n +1} where i e


to 2 At- D Aj where this sum is taken over
all
2-combinations
of {l,2,.. .,n,n 4- 1} since / U J is the
set
of all 2combinations of {1,2,...,n,n 4- l}. Likewise the two sums

sum

J, the

over

taken

is

{1,2,.. .,n}, can

be simplified

X]1 a,, n
where

a,.n aj4- Yi\\Ain^yn^+il,

first sum is taken over all 3-combinationsof


is taken over all 3-combinationsof
form

the

the

second

{1,2,...,rc}

the

and

{i,

j,

can
to 2)tJ>* | A, D Aj H Ak | where
be simplified
{1,2,...,n,n 4-1},
over all 3-combinationsof {1,2,...,rc,n4- l}. Other similar
can
simplifications
also be made. Thus, Equation (2.8.15)becomes

n 4-

1} of

this

sum

is taken

|A,UA2U
*

EI
+

where

...

second

the

\342\200\242
\342\200\242
\342\200\242

UAnUA\342\200\236+1|

I*
\302\243

n.A,-1

+ EI

a,

n a

(2.8.16)

h\\

nAn+1|,

+(-iriA1nA2...
sum is

Ai

taken over all 2-combinationsof {1,2,... ,rc

4- l},

of {1,2, ,n 4- l},
the third sum is taken over all 3-combinations
is
so on. In other
(2.8.16)
just Equation (2.8.10)
Equation

and

\342\200\242
\342\200\242
\342\200\242

words,

replaced

by n

4- 1.

The theorem,then,
Let

us give

is proved

an alternate

induction.

by mathematical

proof of the theorem

that every elementof Ax


once in the right-handsideofEquation
that an element x G Ax
Suppose

must show

with

for

A2 U

additional

\342\226\241

We

clarity.

An is counted

\342\200\242
\342\200\242
\342\200\242
U

exactly

(2.8.10).
U

A2 U

An is

\342\200\242
\342\200\242
\342\200\242
U

in exactly

of

222

Chapter

2:

Combinatorics

Elementary

the

for definiteness, say x G Au x


x will be counted in
$ An. Then

sets,

Am+1,...,

2,..., m, in other

are C(m,2)pairsofsetsAhAj
x is

Likewise,

are

in both

counted C(m,3) times in

3-combinations

C(m,3)

x is

where

At, A;,

| A,
and

At

A* where x G

- C(m,2)+ C(m,3)

Now we must show


by

C(m,2)+
and

expression

yields 0 - (1 -

(-l)mC(m,m).

since there

(2.8.17)

is 1. Expanding (1 -

l)m

the fact

Use

\342\200\242
\342\200\242
\342\200\242
4-

C(m,0)

l)m

- C(m,l) +

that C(m,0) -

1,

and

other terms to the left-hand sideofthe lastequation,


is equalto 1. \342\226\241
to
see that Equation (2.8.17)
signs

all

transpose

last

A, |.

since there

times.

(-l)m-1C(m9m)

this

that

theorem

binomial

the

1,

A;, and xEAk


in like
Continuing

\342\200\242
\342\200\242
\342\200\242
+

P) A J

2-Li

(\302\243

x G
A\342\200\236

.,Am).
(namely 3-combinationsof the sets AUA2,..
x is counted
side,
manner, we seethat on the right

C(m,l)

A;.

Pi A;

2|At

| for

the

Pi A;|

x
i =

and

Am,

y?J times in

C(m,2) timesin

be counted

x will

Furthermore,

x G

A2,...,

be counted

will

words,

each of the terms| A,

change

the

2.8.1

Corollary

... nAj^if/i-iAxU a2u

|AxnA2n

|\302\243/|-El^l

... uaj

El^nA;-|

(2.8.18)
\342\200\242
\342\200\242
\342\200\242

-H\\AinAJnAk\\+
i,j,k

DAtn.-.nAt

+ (-i)n\\A,

In general,the principleof inclusion-exclusion


equation

count the
+ x24-*\302\253-+xn = r
to

2.4.2

Theorem

with

x1

bounded above and below

xl + x2
4<x2<7

+ x3 = 20
J

and

know

We

that

U\\

C(20

each

6, and ct. Let

-2<x3<9.
(xl9

-2-4

- {(xux2,x3)

used

together

i, the

us give

solution

x{ are

an

example.

to

(2.8.19)

2 < jc, < 5,

where

(2.8.19)

\342\200\236

x2y x3)

+ 2+

where 2

< xu 4

3-1,3-1)-

Let

Ax

be

number of integralsolutions

Let U bethe setofsolutions


=

where for

integers

Count the

2.8.6.

Example

by

can

number of integral solutionsof an

G (7|x!>6}

< x2,

~ 2

< xz.

C(18,2).

Section2.8

The

A2
A3

We wish to
(Ax

A2 U

By the
|AX U

A2

{(xux2,xs)

{(xx ,x2

count the

,x3)

E t/|x2

> 8}

\302\243
U

> 10}.

of

number

| xz

elements

Ax D

in

A2

Now Ax

is

A3

A3).

U A2 U A3)| = |
principle of inclusion-exclusion
|(AX
=
U A3|
H A2| - |AX
| V\\
{| Ax| + |A2| + |A3|
|AX

-|A2nA3|
\342\200\224
2 <

223

of Inclusion-Exclusion

Principle

+ |AxnA2nA3|}.
the set of solutions of Equation (2.8.19)
where

6 <

U\\

xu 4

A3|

< jc2,

x3.

set

is the

A2

Similarly,

-6-4

C(20

Thus,|Ax|=

+ 2 + 3-1,3-1) = C(14,2).
of solutions of Equation (2.8.19)where

8<x2,-2<x3.

Therefore,!

A21

C(20

= C(20

A31

Likewise,|

2 <

xu

= C(14,2).

2-8 + 2 + 3-1,3-1)
- 2 - 4 - 10 + 3 - 1,3-

1)-

C(6,2).

set of solutionswhere
8 < x2, \342\200\224
2 < x3.
+ 2 + 3-1,3-1) = C(10,2).
Thus| Ax H A2| = C(20 -6-8
6 4 - 10 + 3 - 1,3- 1)= C(2,2),and
C(20
Likewisel
Ax Pi A3|=
=
H
C(20 2 8 10+ 3 - 1,3 - 1) - C(2,2).
|A2
A3|
= 0 since 20doesnot exceed
6 + 8 + 10.
Moreover,
| Ax Pi A2 Pi A31
=
+ C(10,2)
Therefore,| (Ax U A2 U A3) | C(18,2) 2C(14,2)C(6,2)
Now

Ax D A2

is the

6 < xx,

+ 2C(2,2).

be

\342\200\242\342\200\242
In how many ways can the letters {5 \342\200\242
c]
6,3
a, 4
that all the lettersof the samekind
are
not in a single

2.8.7.

Example

so

arranged

block?
letters.
Let Ax be
of these
Let U bethe setof12!/[5!4!3!]
permutations
of the letters wherethe5 a's are in a single block, A2 the
arrangements
and
where the 4 b's are in a singleblock,
A3 the
arrangements
the 3 c's are in one block.Then,
arrangements where
the

,A|_A4!3!'' lAl-iL
Ul-M
11
5!3!
\"

5!4!'

|A1nA2|-||,|A1nAa|-||,|A8n>4,|-^,
I

A,

O A2D

Aal-3!.

Thus,
|AinA2nA3l

12!
5!4l3l-te

/8!

9!

10!\\ 5! 6!
+

5!3l 5!4l)

3!

i!

7!

5!-3!-

224

Chapter

2: Elementary

Combinatorics

Example
mysteries of

2.8.8.
(The sieve of Eratosthenes).One of the great
mathematics is the distribution
of prime
integers
among the

by only one integer


positive integers. Sometimesprimesare separated
like 17 and 19, 29 and 31, but at other times they are separatedby
mathematician
arbitrarily
large
gaps. A method developed by the Greek
who
lived in Alexandria in the third century
B.C. gives
Eratosthenes
a way
1
all
n.
between
and
His
of listing
is the following:
primes
procedure
all multiples
of 2 other than 2. Keepthe first
Remove
remaining
integer
all
of 3 except 3
2, namely, the prime 3. Remove
exceeding
multiples
itself. Keepthe first remaining
3, namely, the prime 5.
integer
exceeding
all the multiples
of 5 except 5, and so on.The retained
numbers
Remove
This
is
of
Eratosthenes.\"
the
method
called
the
\"the
sieve
are
primes.

We now

compute how

1 and

between

integers

many

1,000 are not

remain
after the first 4
divisibleby 2,3,5, or 7, that is, how many integers
The
of
Eratosthenes'
s
ieve
method.
is
solved
problem
using the
steps

principleofinclusion-exclusion.

Let

be the
Ax

be

the

set of

1 < x < 1,000.


Let

integers x such that

set of elementsof U divisible

by

2, 3,

5, and 7,

<1,000that are divisible

those positive integers


A2 denotes
those
divisible
A3
by 10, A2D A3 = {all integers^
and
so
on. We wish to
divisible
by 15}
I Ax

Pi

Ax n

x is

compute

We know

that

|Al|_L\342\204\242

(where

Au

LxJ

means the

500,

lA,!-11\"000
'\"\"

'

greatest integer < x),

|A3|

1,000=
^-

200,

|A4| =
[\302\261^j=142,

,000

1^0^1

|A2nA3|

= 166

[^j=66,

100,

A2, A3,

A4

respectively. Thus,
by

6,

11 ^ x < J.,000and
D A2 H A3 D A41.

Section2.8

The

225

of Inclusion-Exclusion

Principle

M.n*|-[!g!j-47.

= 23,

lA.nA.n^i-^J-g,

Then,
I

Ax

U A2

A3

A41 =

500 +

333 + 200+

- 100 -

+ 33 +

71-

66

+ 14

23

142

47

+ 9

166

- 28
4

= 772.

Thus,

| A,

Example2.8.9.

to be relatively
prime
positive integer,<t>(n)

A2

A3 O

1,000

- 772 = 228.

Two

0-function).

(Euler's

if 1

A4\\

positive

only commonpositive

is the

integers

are said
is a

If n

divisor.

such that 1 < x < n and


For
example,0(30) = 8 because 1,
relatively prime.
29
less than 30 and
and
arethe
23,
7,11,13,17,19,
only
positive
integers
=
to
30.
Let
U
and
.,n},
{1,2,..
suppose Pu...9Pk are the
relatively prime
of
of n. Let At denote the subset of U consisting
distinctprimedivisors
n
in
to
are
U
those
The
divisible
relatively
prime
by P;.
integers
integers

such

that

those in none
O

An | = |

U\\

is the

of integers x

number

x are

n and

of

the

| Ax U

subsets
A2

AUA2,

... , Ak,

\342\200\242
\342\200\242
\342\200\242

multiples of d in U.Hence

UAJ.

If d

so

</>(n) = | Ax

divides

rc, then

A2

there

\\At\\-^,\\AinAj\\-^,...,\\AlnAan...nAh\\-

\342\200\242
\342\200\242
\342\200\242

are n/d

^.

226

Chapter 2: Elementary

Combinatorics

principle of inclusion-exclusion,

by the

Thus,

0(n)-*-\302\243\302\243+

TTp

This last expressioncanbeseen

Thus, in this

(1/3)][1-

to

equal

= 2

30

since

formula

+ '

\342\200\242
\342\200\242
+

p-

(-\302\273*P pU

the product

\342\200\242
3 \342\200\242

5,

0(30)

- (1/2)] [1 -

= 30[1

(2/3) (4/5) - 8.
principle of inclusion-exclusion there is a
applicatipns
the
so that all the sets A, have
the
same
about
symmetry
properties
number of elements, the intersectionof any pair of sets have the same
number of elements,and so on. That is,

In

(1/5)]

30(1/2)

of the

many

04-041-

14

\342\200\242
\342\200\242
\342\200\242

there are C(n,l) =


2-combinations, etc., we see that
.

of

1-combinations

\342\200\242
\342\200\242

41,

As |

the

sets,

C(n,2)

4|

U4|-n|4|-C(n,2)|A,0

O A2

+ C(ra,3)14

4-04I-.-

-I40

UA2U

|4-i

-I4H4I.

Then since

14

I4J,

141

I4I-|A2|

14 0 41-14 0 41'

\342\200\242
. \342\200\242

(2.8.20)

\342\200\242
\342\200\242
\342\200\242

(-D\"-Il4n4n

oaj,

and

I4040
+ C(n,2) 14
+

there

in

# 1, i2
.,n\\.

2,...,

C(n,3)

14

O 41

+ ..

(2.8.21)

OAJ.

(Derangements).
natural

and

in

Among the

permutations of

in which none of the n


derangements,
is a derangement
place. Thus, (ii,i2\302\273-\342\200\242
-dn)
n. Let Dn be the number of derangements
of

called

some,
its

O A2

\342\200\242
\342\200\242
\342\200\242

2.8.10.

Example

{1,2,..

4|-|t/|-\302\273|4l

O 41

(-l)\302\273|A1OA,0

are
{1,2,...,n}
integersappears

if i!

\342\200\242
\342\200\242\342\200\242
0

Section

The Principle of

2.8

that

we note

illustrations

As

derangement,

and

(2,1);

namely

227

Inclusion-Exclusion

=
0, D2 = 1 because there is one
=
2 because (2,3,1)and (3,1,2)arethe
D3
Dx

derangements.

only

for
to derive a formula
can be achieved by

want

We

This

n.

integer

that is valid for each positive


use of the principleof inclusion-

Dn

exclusion.

U be

Let
the

the set of n\\

of {1,2,^..,n]such

of derangements is preciselythe set Ax

Dn =

HAJ.

A2D

\\AlC\\

The

\342\200\242
\342\200\242
\342\200\242

,,n}. For

of {1,2,..

permutations

(bub2f:. .,bn)

permutations

A2

be

the set

i/Then

An. Therefore
all of the form

\342\200\242
\342\200\242
\342\200\242
H

in

permutations

each i, let At

b, =

that

are

Ax

of {2,3,.. .,n}. Thus | Ax | =


is a permutation
(l,b2f.. .,6n)where (b2f...,&\342\200\236)
(n \342\200\224
1)!;
|At| = (rc - 1)!. Likewise,Ax P) A2 is the set of
similarly

permutations of the form


similar
1 < fc

way we
<

n, the

see that | At

in

(1,2,.. .,k9bk+u...,6n)where
Thus,

|AX

Ax

nAj=(n-

OA2n
conditions

the

is a

permutation

An\\ =

\\U\\-\\AXUA2U
4-

\342\200\242
\342\200\242
\342\200\242
U

- 2)!

C(n,2)(n

(n

a ^-combination

in (2.8.20),

2)!.

k where

of {k 4-

form

1,..

.,n}.

generally,
|Atl D
of {1,2,.. .,n}.

more

and

\342\200\224In

of the

Ak are

k)\\y

prevailing

\\

integer

\342\200\242
\342\200\242
\342\200\242
D

1^2,.. .,ifc}
Thus, we have

A2

A2

.,6n)

(6/5+1,..

P)

- 2)!. For any

= (n
Aj\\

permutations

so that | Ax

.fbn)

(1,2,63,..

so that

1)!

n\\-C(n,l)(n-

+ (-l)nC(n,n)

\"ra!\"l!

n\\

n\\

n\\

2!-3!+'

(-\302\273<

Thus,

(2.8.22)

In particular,

D, =

5!

1!+ 2!

Example 2.8.11. Letn

on. In how

can the

ways

many

5!.

4!

be distributed

books

that the books are returnedand

+
3!

distributed

to

44.

to n students. Suppose
students again later

the

books be distributed sothat

student

no

will

get the same book twice?

Answer: The
second

first

time Dn ways.

time

are distributed

Hence, the total numberof


1

n\\Dn

books

the

(\302\253!)2

l!

2!

ways

n\\

is given

+ {-IT-.
n\\,

ways,

by

the

228

Chapter

2: Elementary

Combinatorics

Example 2.8.12.
from 1to 10inclusive,

the

the

satisfying

of

number

of the

derangements

that the

condition

integers

set of elementsin

is:

5 places

first

Findthe

some order,

(a) 1,2,3,4,5, in

(b) 6,7,8,9,10,some
in

order.

Answer,
(a) The integers 1,2, 3,4, and 5 can be placed into the first
5 places in D5 ways; the last 5 integers 6, 7, 8, 9,and 10 can be placed in
the last 5 places in D5 ways. Hence, the answer is D5 . D5 = 1936. (b) Any
so
arrangement of 6, 7, 8,9,and 10 in the first 5 places is a derangement
there
are 5! possibilities;
the same is true for the integers
and 5 in
1,2,3,4,
the last 5 places.Hence,
are
there
(5!)2 = 14,400 such derangements.

Exercises for Section2.8

1.

certain

these2

center

can
in

program

2.

employs 100 computer programmers.Of


in
FORTRAN, 35 in Pascal and 23 can
program
How many can program in neitherof
both
languages.

computer
47

these

languages?

that, in addition to the information


there are 20 employeesthat canprogram
Suppose

and FORTRAN, 11 in Pascaland


Pascal, and COBOL.How many

given
in

and

COBOL

can

program

in Exercise

1,

COBOL
5 in FORTRAN,
in none of these 3

COBOL,

12 in

languages?

3.

insurance

An

company

claimed

to have

900 new policy holdersof

which

796

bought

auto

insurance,

402 bought life insurance,

667

fire

347 bought

auto and life insurance,

bought

580

bought

auto

insurance,
and

fire insurance,

and
291 bought life and fire insurance,
263 bought auto, life, and fire insurance.
of
why the state insurance commissionorderedan audit
Explain
the company's records.
4. An advertising
has 1,000 clients. Suppose that T is the set
agency
ofclients that use television advertising, R is the set of clients that
who
use newspaper
use radio advertising, and N is the setofclients
advertising.
Suppose that \\T\\ = 415, |A| - 350, \\N\\ - 280, 100

Section 2.8

The

Principle

clients use all 3 types of advertising, 175use television


180 use radio and newspapers,and | T D N | = 165.

(a)Find|Tnfl (1

229

of Inclusion-Exclusion

and

radio,

N\\.

How

(b)

not

use radio

many clients
television?

but

use televisionbut do not use newspaper

(c) How many

use radio

not

advertising
and^do

and newspaper advertising

advertising?

(d) Pind|rn/?nN|.

5. In a

800

of

survey

were

was found:

the following information


260 were from
high-income

voters,

educated,

college

families,

300

325

Democrats, 184were collegeeducatedand from


155 were college educated and registered
families,

were registered
high-income

165
Democrats,

from

were

registered

college

educated,

Let
families,and were registeredDemocrats.

E =

{voters who were

/=

{voters

were

from

D = {voters

who

were

registered

different

Venn

1<

7.

of the

regions

6. How many
<

Xi

How

8. How

< 6,

3 < x2

<

Democrats}.

<

+
<

x2 4- x3
9?

106 inclusive are


fourth powers?
perfect
1

from

to

squares,perfect
the numberof integers
nor

cubes,

9. Find

divisibleby

of

integers

10.

none

of 5,6,

divisible

by

x34-x4 = 20if

<

solutions
are there of xx
7, 5 < x3 < 8, and 2
x4

many integers

of elements in the 8

the number

are there ofx14-x2 +


8, and 1 < x4 < 9?

< xz

< 7,1

integral

many

2 < xx

< x2

families}

high-income

diagram.

solutions

integral

6,1

list

and

diagram

from high-income

college educated}

who

Draw a

and were

families

high-income

were

94

Democrats,

4- x4 =

20 if

neither perfect

1 and
between
1,000 inclusive that are
and 8. Note that the intersection
ofthe set
6 with the set of integersdivisible
by 8 is the

set of integers divisible


by 24.
\342\200\242
Find the number of permutations of the integers1to 10inclusive
such that exactly 4 of the integersarein their
natural
(a)
positions
(that is, exactly 6 of the integersarederanged),
such that 6 or more of the integersarederanged.
(b)
nor 4 in the fourth place,
do not have 1 in the first
that
(c)
place,

nor 7 in the seventh

(d)

such

that no

place.

odd integer will

(e) that do not beginwith

a 1

and

be

in the

natural

do not

end with

position.
10.

230

Chapter

2: Elementary

Combinatorics

that S is the setof integers1to n inclusive


Suppose
and that
subset of r of theseintegers.
Show
that
the number of

11.

which the

S in

permutationsof

deranged is
A

is made

code

simple

with

letter

every

13.

Prove

that

14.

Eight

people

Dn

nDn_x

(- l)n

on

How

floor.

for n >

many

2.

at the first floor.

elevator

an

enter

the letters of the alphabet


a distinct letter. How many

made in this way?

dischargespassengers

the fifth

...

by permuting
replaced by

being

can be

codes

different

floor

successive

each

different

The elevator

until it empties

\342\200\242\342\200\242
\342\200\242
how
c] be arranged
b, 2
ways can the letters {4 a, 3
many
that all the lettersofthe samekind are not in a single block?

bookbinder

In how

cloth.

used

one book?

10 men check their hats. In how


a theater
hats be returned so that
(a) no man receives his own hat?

17.

so

brown
is to bind 10 different booksin red,blue,and
many ways can hedothis if each color of cloth is to be

least

at

for

on

ways can this happen?

15.In
16. A

elements of A are the only elements that are


- 1)! + C(r,2)(n - 2)!+

C(r,l)(n

- r)L

(-IYC(r,r)(n

12.

n\\

A is

At

many

ways

can their

hat?
his
own
(b) at least 1ofthemenreceives
men
own
hats?
2
of
the
their
at
least
receive
(c)

18. Howmany ways are there to select a 5-cardhand from


cards such that the hand containsat leastone card in
19. How many

13-card

(a) onecardin
(b)

one void

bridge
suit?

each

How

21. (a)

How

the

rooms
many

ofthe

22.

there
at

with

integers
1, 2,

digits

(b) Howmany

card

are

ways

many

different

of 52

suit?

least

suit?

(c) oneof eachhonor


and jacks)?

20.

have at

hands

a deck

each

of

digits

Three Americans,
a row. How many

least

cards

(honor

are aces,

to assign 20 different
in each room?

kings, queens,
people

to

1 person

between

1 and

106inclusive includeall of

3, and 4?
the

numbers

between

1 and 106inclusiveconsist

alone?
1, 2, 3\342\200\2364

3 Mexicans, and 3 Canadiansareto beseated

ways can they

be

seated

so that,

in

Section 2.8

The

(a) no 3 countrymen

231

of Inclusion-Exclusion

Principle

sit together?
may sit

together?
take
a quiz. Then for the purposeof grading,
23. Thirty
students
the
asks the students to exchange papers so that
teacher
no
one is
can this be done?
grading his own paper. Howmany
ways
24. In how many ways can each of 10 people selecta left glove and a
so that
no person
right glove out of a total of 10 pairs of gloves
selects a matchingpair of gloves?
(b)

25.

2 countrymen

no

of a chessboard
are painted 8 different
colors.
The
of each row are paintedall 8 colors
and
no 2 consecutive
In how many
squares in one column can be paintedthe samecolor.
ways can this be done?
The

squares

squares

26. How
mean

27.

How

before

M's,

How

integers

both

many

How

between 1 and

30. Suppose

letters the
a person

that

friends

to dinner

bedoneso

prime

integer

to

prime

iff

of MISSISSIPPI

1 is

50?

the only

with

no

pair

same?
10 friends

with

every

of the word
or both A's

\302\243?

50 are relatively

to the

are there

arrangements

many

of consecutive

the

M's before

or both

/
we

just immediatelybefore.)

are there of the letters


T's before both A%
both

(The integer a is relatively


common positive divisor.)

*29.

c, or c

before

before, not

arrangements
with

many

MATHEMATICS

28.

before b, or b

anywhere

of the letters a, 6,c,d,e, and


before d? (By \"before,\"

are there

arrangements

many

either a

with

night

for

invites a different

10 days.

subset

of 3

How many ways can this

at least once?
of
3
a's, 3 b% and 3 c's
many
arrangements
the
without
3
consecutive
same?
letters
(a)
no adjacent
letters the same?
(b) having
32. Same problemas 31for 3 a's, 3 b% 3 c's, and 3 d's.
in a
n letters and their correspondingenvelopes;
33. A secretary
types
at
the
she then puts the lettersinto
fit of temper,
envelopes
so that
the letters
random. How many ways could she have
placed
that

31.

34.

all

friends

are included

are there

How

no letter is in its correctenvelope?


2rc letters of the alphabet, 2 of eachof n types,
Given
of consecutive
no
are there with
pair
arrangements

how

many

letters the

same?

35. Use

the

primes

principle

between

of inclusion
exclusion
41 and 100 inclusive.

to count

the number of

232

Chapter

Combinatorics

2: Elementary

36. How many derangements of the integers1to20inclusive


in which the even integers must be deranged(odd
integers

there

are

or

may

may not occupy their natural position)?


of the 26 letters of the alphabetarethere
37. How many arrangements
of the patterns LEFT, TURN, SIGN, or
which
contain
none
CAR?

of thirty

Each

38.

students is taking an

examination

another
examine

a student in a subject.
examinations be scheduled without

In
a

how

different

subject
5 minutes

and
to

can

the

ways

many

student

appear beforeboth examinersat the sametime?


How many 6-digit decimal numbers contain exactly

39.

two

in

One teacher examines the students in one


in the other subject, and eachteachertakes

subjects.

to

required

being

different

three

digits?

40. How many


digits?

41. How

can

numbers

4-digit

many

number

rc-digit decimal numberscontain


be composed

k different

of the digits in the

123,143?

many 5-digit numbers


number 12,334,233?
How

42.

exactly

43. How many


number

numbers

6-digit

if the

1,223,145,345

can be composed
of the

in

digits

the

can be composed of the digits in the


same digit must not appear twicein a

row?

How

44.

5-digit numbers can be composedof the digits


12,123,334 if the digit 3 must not appearthreetimes

many

number
row?

45. (a)

In how

11,223,344
if

46.

(b)

Solve

Use

the

part
sieve

of

47

2. 100-

35 +

47

35

1. 100

4. (a)

- 41.
- 20 + 23 + 12+ 1123

= 39.

75.

T| = 80
(c) |rn^nfl|-i75.
I

T n

R n

N\\

the number 12,234,455.


to compute all prime integers<
Eratosthenes

(b) \\RHNn
(d)

the
in

number

we arrange the digits in the


digit must not appear twicein a row?

2.8

Section

for

Answers

same

the

(a) for

200.

Selected

can

ways

many

of

| T

U R

N\\

1,000

- 625 = 375.

Section

of Inclusion-Exclusion

The Principle

2.8

233

5.

325

55

90 \\

\\

4.5

9\"4

71 V/

nL61
99

Figure 2-14

\302\253\342\226\240

PS)

PS)

= 217.

9. 1,000
10.

(a)

(c) 10!-

(d) 10! -

Z>26.

48

15.

+ (>,
+

(3)9!

(>.

\302\2518!

\302\2517!

(!)

25+ 41) - 8 -

(!)

2l

310

(3)210 +

17. (a) Ac
(b)

- (!)

600.

+ Qz,,.

0.
\302\2516!

\302\2515!.

(fj3e + g)28 g)l8 40,824.


Let A, be the arrangements where the 4 a's are one block,
arrangements with the 3 b 's in a single block, and A3 the
arrangements with
the 2 c's in a block. Then,
9!
/ 6!
7!
8! \\
+
+
\\AtnA2nA3\\
=

I 3!2!

4!3!2!

10!

(c) 10! -

'Ml)

\342\231\246

+ 8!.

4! 5! 6!

16.

(!)

- 7!.

(3)8!

(f)9!+

- (2)9!

10!

(e)

14.

\302\251

+ (33 +

+ 125)

166

C(10,6)D6.

,b,0.

12.

(200

C3 - PS

(1)

3!

3 ways.

D10.
D10

<(1) +

10D9.

\302\253PD-\302\253P3-

o1

4!-3!

4!2!

871.

4!3!/

A2 the

234

Chapter

2: Elementary

Combinatorics

*\302\253(S)-G)\302\256*G)(S)-G)-

20. 320

21. (a)

(b)

\342\200\242
220 +

106+

. 86 43 + 44 + 45

42 +

22. There

9!

are

3.
+ 6

. 96

. 76 + 66.

of

permutations

- 4)/3.
the 9 people. If Au

46 =

(47

A2,

A3 is the
3 Mexicans

and

3 Americans
set of permutations with
together,
and
3
Canadians
together,
together,respectively^henJA,

\\At H

Aj\\

Ax H A2 H A3| = (3!)4.
- (3!)4.
+
3(3!)25!
\342\200\242
2!8!
+ 27(2!)27! + 3 . 3!7!
. 3!(2!)25! - 9
27
+
3!3!5!,|

9! - 3 . 3!7!
(b) 9! - 9

A*.

24.

(10!)D10.

25. The first row can be painted8!ways.

paintedDs

Hence

ways.

REVIEW FOR

A2

| =_3!7!,
D A3| -

the

row

Each

number

(3!)4.

of ways

after

the first

can be

is 8!(D8)7.

CHAPTER

1.

C\\

- 27(2!)36!
- 18. 3!2!6!

+
(3!)22!4!

3(3!)25!
23.

Thus,|Ax

license plates are there (with


if
allowed)
repetitions
is a letter followed
3
followed
3
letters
by
digits
by
or a digit?
followed
by a letter
(b) there are1,2,or 3 digits followed by 1, 2, or 3 letters followed
or a di^it?
by a letter
(c) there are 1,2,or 3 digits and 1, 2, or 3 letters and the letters

How many

(a) there

must

2. How

occur

together?

many ways

are there to

the

arrange

letters

of the

word

MATHEMATICS?

3. There are 21consonants

Consider
(a)

How many

(b)

How

many

(c)

How

many

Give

words

5 vowels

with

in the English alphabet.


4 different vowels and 6

consonants.

different

4.

and

10-letter

only

such words can be formed?


contain the letter a?
with b and end with
begin

a combinatorial

c?

argument to explain why

(5n)\\/5lnn\\

is an

integer.

5. In a classof 10girls

and

6 boys,

how many

be selected?
(a) ways can a committeeof5 students
be chosen?
(b) ways can a committeeof 5 girls and 3 boys
contain
(c) ways can a committee be selectedthat
students?

3,

5 or

Section2.8

The

Principle

235

of Inclusion-Exclusion

(d) committees will contain 3 or moregirls?


of 2 or more can bechosenthat
committees
have
twice as many
(e)
as
girls
boys?
(f) ways can the students be divided into teams where 2 teams
5 members
have
each and 2 teams have
3 each?
can
the
divided
be
into
teams
with 2 members
girls
(g) ways

each?

(h)

each have

second team

and the

3 each

have

be divided

students

the

can

ways

4 students,

fifth

has

team

where the first

team

the third and


2 members?

and

the

fourth teams

with
3 of each sex but
(i) committees of 6 students canbeformed
G
B
and
on
cannot
both
be
the
committee?
boy
girl

6.

is a multiple choicetestwith
but only 1 correctanswer
to each

20 questions

with

test

each question

many ways are thereto have


6 correct answers?
(a)
exactly

for

5 answers

question.

How

(b) at least 6 correctanswers?


7.

How

many

integral

many

ways

where 2 < xu 3 < x2i

8.

How

solutions are there


0 < x3, 5 < x4?

can 20

indistinguishable

of xx

- 20

books be arrangedon

shelves?

different

5-card hands from a deck of 52 have


(a) 5 cards in 1 suit?
3 aces and no other pair?
(b)
exactly

9. How many

(c)

10. (a)
(b)

1 pair?

exactly

State Pascal's identity.


Use

(o) -(\")
(c)

theorem to

the binomial

Use the

(*)

prove

O-o.
-\302\251\342\200\242\342\200\242\342\200\242\342\231\246<-\302\273\342\226\240

binomial theoremto prove

[(S)+ft)+---+fc)r-g(^).
(d)

Give

a combinatorial

proof that

236

Chapter

Combinatorics

2: Elementary

that

(e) Prove

C(n + 4,r) -

C(n,r)

+ 6C(n,r C(n,r - 4).

- 1)

4C(n,r

4C(n,r-3)

of inclusion-exclusion
11. Use principle
400.
of primeintegersless

2)

to determine

the

the number

than

12.

of 7-card hands that

the number

Find

have

at

one

least

card in

each suit.

13. Find the number

14. Use

notation

the

(a)

of

of the

permutations

do not

letters

same

the

that

letters of

appear together.
\"
for (n * + r)

to stand

TOMTOM so

. Then

prove

(;)-(\302\253_-1) (V)

15.

different

How

many

word

CONNECTICUT

(a)

With

no two

that

words

have

of the lettersof the

C's adjacent?

(b) If thereareonly
(c) If there is exactly

16. Suppose

are there

arrangements

four
one

letters

in each

consonant

arrangement?
each pair of vowels?
6-letter
alphabet. How many
between

a 15-letter
we
have
exactly 3 consecutive letters the same?

Recurrence

Relations

3.1

OF

FUNCTIONS

GENERATING

SEQUENCES

The objects of interest in this chapteraresequences


of real
numbers
is
that
functions
whose
domain
set
of
the
.),
is,
(a0falfa2f.. *faTf..
nonnegaand whose
tive
use
integers
range is the set of realnumbers.We shall
=
A
to
such
like
denote
{ar}~_0
sequences.
expressions

3.1.1. The

Example
(1,2,4,8,16,..

br =

b9 = 2,

bi0

3,

b0

if5<r<9

3
4

ifll<r

= bx =

br = 4

and

{2r}\"_0

is

the

sequence

where

if0<r<4

(0

is the sequence
where

sequence

sequenceB = {6r};_0

.,2r,...); the

ifr=10

b2 = b3
for

all

b4

0, b5 =

r >

subscripts

b6 =

b7

11 thus,

b8 =

B =
r + 1

C {Cr}^0> where Cr =
The sequence
(0,0,0,0,0,2,2,2,2,2,3,4,4,...).
D
value
the
each
of r, is the sequence (1,2,3,4,5,...),
sequence
=
r2
is
each
the
r, dr
{dr)r-owhere,
sequence(0,1,4,9,16,25,...).
=

for

and

for

The

we

letter

another

will

sequence

denoted

be interested

use

for

the subscript

has no particular significance,

the

just as easily; in other words, there is no differencein


we will
Normally
by {at}r-o and that denoted by {ar}\"_0in sequences A = {ar}\"-0 where ar is the number of ways to

do

237

238

Chapter

Relations

3: Recurrence

objects in some procedure.Forexample,


nonnegative integral solutionsto the equation
select r

4- x2

*i

where n is a fixed

ar be

the number

xn =r

\342\200\242
\342\200\242
\342\200\242
4-

positive integer and

constraints. Of

let

each

of

(3.1.1)
xt

to certain

is subject

2.4 that ar is also


course,
you
as the number of ways of distributing r similar balls into n
described
numberedboxes,where the occupancy
numbers
for the different boxes
will

recall

from Section

are subjectto certainconstraints.

the constraints
are only that each x, > 0,then
we know
instance,
=
=
1
In
other
+
C(n
r,r).
C(n
ar
words,
1,0) 1, ax =
a0
=
=
a
nd
In
so
on.
this
will
+
there
be infinitely
C(rc,l)
n, a2 C(n
1,2),
case,
of
nonzero
the
A.
terms
many
sequence
However,if each xt is restricted so that 0 < x, < 1,then in particular
distribute
more than n balls into n
+ l becausewe cannot
ar = 0ifr>n
boxesif each box can contain at most 1 ball.Hence,in this case,

If,

for

that

if0<r<n

\\C(n,r)
ar =

Likewise if
for

ar

0 <

previous chapter

exclusion

will

a0

be

+ 1

< r.

2, then ar = 0 if r > 2n + 1, but a generalexpression


not immediate using the techniques
we have
that

this
thus far. By comparing

developed

case n =

if

xt <

< 2rc is

if r

you

required.

might

realize

In fact,

with

problem

that

the

the reader

may

Example

2.8.6 in the

principle of inclusionwant

to verify

that, in

3,

=
=

1, ax
C(7,5)

= 3, a2 - C(4,2),a3 = C(5,3)
- 3C(4,2), a6 = C(8,6)

- 3,

a4 - C(6,4)-

- 3C(5,3)
+ 3.

9,

a5

we could place all sorts of complicatedrestrictionson the


for giving
an
and you might well imaginethat the difficulty
We don't deny that
become
insurmountable.
expression for each ar could
this would
be
the case using the methods developedup to this point.
a method in this sectionthat
it is our intention
to introduce
Nevertheless,
will
handle
like the last case fairly
easily.
problems
is found in something quite
the clue to the new method
Oddly
enough,
Of

values

course,

for xt

Since
old and familiar:multiplication of polynomials.
polynomials
only
caninvolve
involve finitely many nonzero terms and sequences
infinitely
nonzero
terms, we introduce the conceptof generating
many
for
that
a generalization
of the concept of polynomial,to allow
function,
will
be the most abstract
The use of generating functions
eventuality.

Section3.1
technique used in this textto solve

method is masteredit

spectrumofproblems.

To

the

... +

- 2\".o ar^r-

...

degree i,

term

the

and

are

coefficients

really

a0
what are

the

A(X)

A =

sequence

The

words

could

use,

that

term of
term. The

X1

symbol

is simply

reason, the formal


an (ordinary) generating function

power
for

usfed because, in some sense,


is used to denote
\"ordinary\"

are

function\"

word

The

coefficients.

are used; other kinds of generatingfunctions


other functions like Xr/rl,sin (rX), or cos (rX) in

of X

powers

by contrast,

place of Xr. Forthemostpart we


usage. We use the word \"formal\"

symbol A

is the

a,X'

the constant

the

a0 + ax X
a formal

for this

aif and

this

broad

{ar}^0-

\"generating

A(X) generatesits
the fact

of interest;

is called

arXr
2\302\243_0

term

the

a0 is called

=
X\302\260

device for locatingthe coefficient


series

to apply to a

assign the symbolA (X) =


The expressionA(X)
is called

series, a, is the coefficientofX\\

power

but once

problems,

method

easiest

A = {ar}\"_0, we

sequence

anXn

combinatorial

the

be

will

239

of Sequences

Functions

Generating

will

the word \"ordinary\"


the
between
distinguish

suppress
to

in

our

abstract

students
ar Xr and the concept of powerseriessome
2\"_0
in calculus courses. We emphasize
in our concept X
that
a numerical value if there
are infinitely
many
assigned

(X)

may

have

seen

will

never

be

we
nonzero coefficients in the sequencegenerated
A(X).
Therefore,
by
of
avoid having to discuss such topicsas convergence
and
divergence
in
often
discussed
calculus
courses.
power series, topics
If all of the coefficients
are
zero
from some point on, A(X) is just a
=
> k + 1, then A (X)
If
0
and
for
0
i
is a polynomial
a,
polynomial. ak ^
of degree k.

Example 3.1.2.
A(X)

The

= X>X',

r-0

B(X) = 2X5

2X6

\302\243>(X)

Y.(r

r-0

+ 2X8 +

+ 2X7

+ 4X12+

+ 4XU
C(X)

functions

generating

2X9

3X10

\342\200\242
\342\200\242
\342\200\242

+ l)Xr,

f>2)X'

r-0

generate the

sequencesA,

Definition 3.1.1.
formal

power

series.

Let

D of

C, and

B,

A(X)

We then

2T.0

define the

Example 3.1.1.
Xr,
\302\253r

following

B(X)

= 2S% bs

concepts.

Xs be 2

240

Chapter

3: Recurrence Relations

Equality:

= B

(X)

Multiplication
Sum:

productsa;
the

product

= ^^na}bk.

a; bk means

of

B(X) is obtainedby

it

coefficient

in B(X)y

by the
ax of X

coefficient
in A (X) and

Xn

of

bn

multiply

on, using the coefficients

and so

A(X) and the coefficients

of

formal

sum of all possible

j and k is n. Sincethese

taking

see

the term Pn

that

the

of all

sum

products of one terma; Xj from A(X) and one term


such that the sum of exponents
j + k = n.
Of course, this can be accomplished
very
systematically
the
constant
term
with the exponent 0 and thus with
multiply

of 2

product

take the

sum of the subscripts


to the exponents on X, we

A (X)

= 2;.o (Car)Xr.

X\\

discuss the definition

2;+/?.n

0.

C: CA(X)

number

the

where

correspond

subscripts
in

bk

each n >

- ^PBr,wherePn

time to

some

power series. The sum

= bn for

an

scalar

A(X)B(X)

take

us

Let

iff

= 2S-o(\302\253\302\273
+ 6n)

+ B(X)

A(X)

Product:

by

(X)

possible

from

Xk

bk

Xn

by

B(X)
starting

A(X) and
in B(X);
then proceed to the
it by the coefficient bn_x of Xn_1
of

corresponding

increasing

decreasing

a0 of

of X in
X in
of
powers
powers

B(X) as follows:
n

Pn = Go&n

axbn_x

a2bn_2

\342\200\242
\342\200\242
\342\200\242
+

+ anb0

an_xbx

5Ia\302\273bn-r
\302\243-0

Thus,

A(X)

= a060

B(X)

(a0&i

\342\200\242
\342\200\242
\342\200\242
+

(a0bn

\302\253i^o)^

+ axb^;

(\302\253o^2+

+ a26n_2+

aA

+ a2b0)X2

\342\200\242
\342\200\242
\342\200\242
4-

anb0)Xn

\342\200\242
\342\200\242
\342\200\242

+ a8X8andB(X) =
moment
we are not assigning
64
b0 +
mean
that the coefficients are zero
any values to the coefficients\342\200\224we
just
for
the
of Xr in A (X) B (X) is
missing
powers of X), then the coefficient
found
the powers {X\302\260,
X3, X4, X8} from the first factor and
by considering
the powers
factor such that their sum is r.
{X\302\260,X4,X5,X8} in the second
X\302\260
Forinstance*
in the first
the
of X8 can be obtained by using
coefficient
factor and X8 in the second;X3 in the first and X5 in the second; X4in the
X4 in the second; or X8 in the first
in the
X\302\260
first
and
and
second factor.
is such that P8 of X8 in the product A (X)
B(X)
Thus, the coefficient
and (8,0) are the only
4- a3 65 4- a4 64 4- a8 b0f because
(0,8),(3,5),(4,4)
po b6
whose sum is 8.
and
B(X)
pairs of exponentsofA(X)
Example

If A(X) = a0 4- a3X3
X4 + b5 X5 4- 68 ^8 (wherefor the
3.1.3.

+ a4X4

Section3.1

241

of Sequences

Functions

Generating

of X5 in the product is a0 b5 because


Likewise the coefficient
there is
A
o
f
of
and
one
whose
sumis
B(X),
only
pair exponents (X)
namely (0,5),

5.

if a0

Thus,

= 2,

3, then P8 =
b8
(2) (8) = 16. Of

a3 -

-5,

(2)(3)

= 7,

a4

(-5)(8)

4-

course, we can
coefficients to seethat with these

A(X)B(X) = 6 -

+ 30X7 -

+ 16X5

9X4

15X3

and a8 = 3, b0 = 3, b4 = -6, b5 = 8, and


4- (7)(-6)
+ (3)(3) = -67, and P5 =
all
the computations
of
complete
values
of a/s and 6/s, then

- 15X11 +

4- 56X9

67X8

3X12+

24X13

9X16.

of A(X)
and
the case where all the nonzerocoefficients
However,
interest.
Note that in this case, P8 = a0 b6 4B(X) are 1 is of special
the
case,
a3 65 + a4 64 4- a8 b0 = 4, and P5 = 1. In particular,in this
of pairs
of exponents
coefficient of X8 in the product is just the number
of X8 in the product (1 + X3 4whose sum is 8, that
coefficient
is, the
X4 4- X8) (1 4- X4 4- X5 4- X8) is just the number of integral solutionsto
= 8, where ex and e2 represent
the equation
the exponents of A (X)
ex 4- e2
and B(X),
Hence ex can only be 0,3,4,or8 and e2 = 0,4,5, or
respectively.

8. Likewise there is only one


on ex and e2 so the coefficient
X5 4- X8) is 1.
have

We

(1

X3

4-

stumbled
4- X4

solution
of

(1

restrictions
(1

4- X4

4- X5

X4

4-

4- e2 = 5 with these
4- X3 4- X4 4- X8)

here: the coefficient


of Xr in the product
4- X8) is the number of integral

a clue

upon

4- X8)

to ex
X5 in (1

= 0,3,4,8
to the equation ex 4- e2 = r subjecttothe constraints
ex
=
of the factors in the product
and e2 0,4,5,8.Note that the exponents
reflect the constraints in the equation.Note alsothat we can view this
clue in two ways. We can compute
the coefficient of Xr by algebra and
the
of integral solutions to the equation ex 4- e2 = r
then discover
number
all solutions of the equation
subject to the constraints;or we can compute
and
then
discover
the coefficient of Xr.
subjectto the constraints
solutions

Generating FunctionModels
if we
wanted
to
Thus,
solutions
to an equation ex
we would expect that we

count the
4- e2

need

product of generating functions


A(X) reflectthe constraints

only

A(X)
on

number

= r with

ex and

of

integral

nonnegative

certain constraints on ex

find

the

B(X),

coefficient
where the

the exponents

and

e2,

of Xr in the

exponents of
of B(X) reflectthe

= 1
let A(X)
be 0,1, or 9,
<
<
1 4- X2 X4
B (X)
X X9. If e2 can only be even and 0 e2 8,
X6 4- X8. On the other
if ex can be any nonnegative integer
on

constraints

if ex

e2. Thus,

can only

then

then

4-

4-

number

we

let A(X)

= 1

of Jerms].

Likewise,

4-

value,

hand,

then

4-

4- X2...
[in this case, A(X)
if e2 can only take on the integral

has an infinite
values,

say,

242

Chapter 3: RecurrenceRelations
of 5, then we let B (X) that
are multiples
are
endless.
you seethat the possibilities
we can extend what we have
Moreover,
the
definition
than two variables e, because

1+

ax)

No doubt

X10 +

to

said

with more
of formal power

equations

of product

seriesextendsto morethan two factors.


Let us illustrate for 3 factors. Let

B(X) -

X5

J2bjX\\

\302\243>***.

Then

A(X)B(X)C(X)

f^PrXr

r-0

where

i+j+k~r

that

the product is obtainedby taking any one term


(X),
any
6; Xj from B (X), and any one term ck Xk
such
sum
that
the
of
C(X)
exponentsi + j + k = r. Of course, the
can extend this idea to productsofseveralfactors.
here
is
Thus,
term Pr Xr in

is, the

a, X1 from A
from

one term

reader
our rule:

Assume each

nonzero coefficient

Ai(X) is 1. Then

the

\342\200\242
\342\200\242
\342\200\242

A2(X)

can

An(X)

power series
the product AX(X)
as the number of
interpreted
\342\200\242
\342\200\242
to an equation
+
ex + e2 + \342\200\242

be

nonnegativeintegralsolutions

r where constraints on each


of the ith factor A,(X).

en =

formal

each

of

of Xr in

coefficient

e, are

determined

by

the

exponents

Of
this line of reasoning
course,
count the number of nonnegative
\342\200\242
\342\200\242
constraints
+
en = r with
^2 \342\200\242

generating
to
the

function

the

answer

0,3,8

are

only

those

(X)

integral solutionsto

A2(X)

ei9 then

each

on

whose

\342\200\242
\342\200\242
\342\200\242

An

(X)

an

a problem

ex +

equation

we can

coefficient

to

build a
of Xr is

problem,

3.1.4.

Example

because
the

Ax

can be reversed.Given

The

solutions
solutions

coefficient

of ex +
3
where

of

e2

4-

X9 in

is C(10,3)
(1 + X3 + X8)10
each e, 9
where
e10

\342\200\242
\342\200\242
\342\200\242
4-

values are

equal to three, and

the

Section

3.1

Generating

243

of Sequences

Functions

values are 0. Likewise the coefficient


will
because each solutionto the equation
involve
remaining

is 10!/3!2!5!
3's, two 8's, and

X25

of

three

0's.

five

the number of
nonnegative integral solutionsof ex + e2 4- e3 4- e4 4- e5 = r where0 <
< 3, 0 <
e2 < 3, 2 < e3 < 6, 2 < eA < 6, e5 is odd, and 1 < e5 < 9. Let
ex
=
AX(X)
A2(X) = 1 + X + X2 + X3, A3(X) = A4(X) = X2 + X3 + X4 +
= X + X3 + X5 + X7
X5 + X6, and A5(X)
the generating
+ X9. Thus,
function we want is
3.1.5.

Example

A2(X)

AX(X)

A3(X)

Find a

generating

= (1

A5(X)

A4(X)

ar =

for

function

+X

+ X4 +

(X2 + X3
(X + X3

+ X3)2

X2

-t- X5

X5

X6)2

4- X7 +

X9).

for ar = the number of


Example 3.1.6. Find a generatingfunction
\342\200\242
\342\200\242
\342\200\242
4- en = r where 0 < ev < 1.
nonnegative integralsolutionsto et 4- e2 4=
=
1 4- X for each i 1,2,..., n. Thus,the generating
function
Let Ai(X)
= (1 + X)n. The binomial theorem
we want is AX(X) A2(X) . . . An(X)
and thus we know the numberofsolutionsto the
all the coefficients
gives
above

equation

Example

is C(n,r).

3.1.7.

Find a generating function

nonnegative integral solutionsto ex


each

ar

- the

en = r

number of

where 0 < et

for

i.

Here
AX(X)

4- e2 4-

for

\342\200\242
\342\200\242
\342\200\242
4-

since there
A2(X)

is no upper bound
=

\342\200\242
\342\200\242
\342\200\242

An(X)

(1 4-

...

4-

Theorem 2.4.2, we know that 2)^L0 C(n - 1 + r,r)Xr


for this same generating function, that is,
expression

= irC(n-l
(t^XkY
r-0
U-0
/

r,r)Xr.

In particular,
\302\273
2

Y.X\")

*-0

(oo

\302\260\302\260

=H(r

+ l)X',

r-0

and

r-0

(r 4- 2)(r

4-

the

on

constraint

X 4- X2

1)

4-

Xk

e/s,

we let

.. .)*.

Using

must be another

244

Chapter

Relations

3: Recurrence

= 2, C(n -

since for n

(r +

r,r)

= r

+ 1 and

for

= 3,

C(n

- 1 + r,r) =

+ l)/2.

(r

2)

Find a generating function

3.1.8.

Example

ways of distributing r similarballs

ar =

for

boxes

n numbered

into

the number of
where each box

is nonempty.

we

namely,

e2 4-

en =

\342\200\242
\342\200\242
\342\200\242
4-

(2r.x

each et

r, where

>

1.

the generatingfunction
equal
Xr)n, which by Theorem 2.4.3must
in turn,

Then,

reader

(The

this problem as an integral-solution-of-an-equation


solutions
to ex +
are to count the number of integral

model

we

First

problem;

coefficients

we build

(X

C(r

2?_n

a combinatorial explanation
of Xr are all zero if 0 < r < rc - 1).
should

give

Find a generating function


3.1.9.
Example
when:
ways the sum r canbeobtained

ar =

for

X2 +

- l,n

as to

\342\200\242
\342\200\242
\342\200\242

)n

- l)Xr.
the

why

of

the number

2 distinguishable
dice are tossed.
2
and
the first shows an even
(b) distinguishablediceare tossed
number and the secondshows an odd number.
6 specified
dice show an
(c) 10 distinguishable dice are tossedand
even numberand the remaining
4 show
an odd number.
(a)

In (a) we are to count the number of integral solutionsto ex + e2 = r


where 1 < e, < 6. Then
coefficient of Xr in the generating
ar is the
function
+ X2 + X3 + X4 + X5 + X6)2.
(X
In (b) we are looking for the coefficient
of Xr in (X2 + X4 + X6)(X +
X3
1 < ex < 6 and ex is even while 1 < e2 < 6 and e2is odd.
+ X5) since
the
function
X4 +
called for in (c) is (X2
+
Likewise,
generating
X\302\253)6(X

+ X5)4.

X3

function
to count
Example 3.1.10. Find a generating
integral solutionsto el + e24- e3 = 10 if for each i, 0 < et.

Here

we

coefficient

a model for

can

take

of X10 in
the

two

(1 +

distribution

approaches.

X + X2

4- X3

of 10

Of course we
+

\342\200\242
\342\200\242
\342\200\242
But

)3.

of

the number

are looking for

since

similar balls into 3

the

the equation

boxeswe see that

is

in each box. Thus we


10 balls
et < 10 for we cannot placemorethan
could also interpretthe problem
we are to find
as one where
the
\342\200\242
\342\200\242
coefficient
of X10 in (1 + X + X2 + \342\200\242
4- X10)3.
each

Section

3.1

Exercises

Generating

3.1

for Section

1.

function
to the equation ex
< 3 for each L
et\342\200\242
< 5 for each i.
et

Build

(a) 0 <

(b) 2 <
(c) 0 < exforeachi.
0 < ex < 6 and ex
(d)

is even;

a generating function
(a) the numberof ways

2. Write

number of ways

(b) the

of

supply

can

second
(d) the

of

dice.

3. In(l +

dimes and

unlimited

quarters.

formed

number of integersbetween
X5

from an

upon tossing50

want in (d) if

we

total of 100

50 dice?]

the

tossing

r coins

selecting

the number of ways of obtaining a

to know

upon

2 <

of obtaining
a total of r
do we
coefficient
[Which

ways

distinguishable

want

integral

from n letters where the


an even number of times up to 12,the
an odd number of times lip to 7, the
appear
can occur an unlimited number of times.

letters

number

of

if:

appear
can

letter

remaining

of

pennies,
of r-combinations

letter

first

= the number

= r
e3

e2 < 7 and e2is odd;5 < e3 < 7.


for ar when
ar is
r
balls
from 3 red balls,5 blue
selecting

nickels,

(c) the number

isr.

of

+ e2 4-

balls.

7 white

balls,

(e) the

for ar

generating

solutions

(a)

245

of Sequences

Functions

999 whose

0 and

sum of digits

X9)10find

the coefficient

(b) the coefficient

of X23.
of

X32.

coefficient of X16in (1 + X4 + X8)10.


for
of ways to
the number
a generating function
into 5 numbered boxes where eachboxcontains
distribute 30 balls
3 balls and at most 7 balls,
at least
X15 from
Factor
the above functions, and interpret this
out
(b)

4. Find the
5. (a) Find

revisedgeneratingfunction

6.

Find

a generating

function

distributing r similar

balls

second,third, fourth,
7*

(a)

Find

a generating

nonconsecutive

8.

(b)

Which

coefficient

(c)

Which

coefficient

Build

(b)

ar

into

the

numbered

number
of ways of
boxes where the

fifth boxes are nonempty.


function for the number of ways to
integers from 1,2,..., n.
n = 20?
in case
do we want to find
do we want for general n?
and

function

for ar

- the

number

r similar balls into 5 numberedboxeswith


at most 3 balls in each box.
3,6,or 8 balls in each box.

distribute
(a)

generating

combinatorially.
for

of

select

ways

to

Chapter3: Recurrence

Relations

(c)

(d)

(e)

1 ball in eachof the


eachofthe last2boxes.
at least

box 1, at most 7 balls in the last 4 boxes.


of 5 balls in box 1, a multiple
of 10 balls in box 2, a
box
of25ballsin
a
of
50 balls in box 4, and
3,
multiple
multiple
5 balls in

most

at

a multiple

a multiple of 100ballsin

9. Find

3 balls in

at least

and

3 boxes

first

a generating

5.

box

of r-combinations

number

the

for

function

of

{3.a,5.6,2.c}

10.

for determining the number of ways


function
for a dollarbill in pennies,nickels,
dimes,
quarters,
pieces. Which coefficient do we want?

a generating

Build

making change
and half-dollar
11.

Find

function

a generating

ar

Selected

1. (a)

(1 + X +

X2

(c)

(X

(d)

(1 + X2

+ X2+

if0<r<2

if3<r<5

ifr>6

X5)3.

\342\200\242
\342\200\242

-)3.

(1 +X

where

{ar}\"_0

X3)3.

(b)

(X2 + X3 + X4 +

2. (a)

A =

sequence

3.1

Section

for

Answers

the

for

of

X*
X2

X'XX3

X3)(l

+ X5
+ X

+ X7)(X5 +

X6

X7).

\342\200\242
\342\200\242
\342\200\242
+

+ X

+ X5 +

X7)(l +

X5)(l

\342\200\242
\342\200\242
\342\200\242
+

X7).
\342\200\242
\342\200\242
\342\200\242
+X\"+

(b)

(1+

(c)

(1 + X2
\\n-2

(d) (X
(e)

3. (a)

+ .\". .

(1 +

X +

32 can

X9)3.

with

e10

one

with

5,

10!/l!2!7!.

be otained only
of

four

- 23 where et = 0,5,9. This can be


two 9's and seven O's. Hence the

\342\200\242
\342\200\242
\342\200\242
4-

X32 is

4. The only solutionsto ex

those

\342\200\242
\342\200\242
\342\200\242
+ X\"

+X6)50;a10o.

is

coefficient

+ X3

\342\200\242
\342\200\242
\342\200\242
+

done only
(b)

-)4.

X12)(X

Solve ex + e2 4coefficient

\342\200\242
\342\200\242

\342\200\242
\342\200\242
\342\200\242
+

4's,

or two 4's, one8,and

with

three

9's, one

5, and 6 0's. Thusthe

10!/3!l!6!.
+

no S's,
seven

e2 4-

and six 0's; two


0's.

16 where et = 0,4,8are
S's, no 4's, and eight O's;

e10 =

\342\200\242
\342\200\242
\342\200\242
+

Thus

the coefficient

is

Section3.2
6. (1 + X7.

+ X2.

\342\200\242

-)3(X

(a) (1 + X . . -)2 (X
as dividers for 7 boxes

5 boxes

other

-)4.

+ X2

of

(c)

Coefficient

of X\"-6.

X14.

X3)(l
of

(1 + X
(1 + X5

X2

-)5.

the first and

are nonempty.

the

Coefficient

+X

6 integers chosen
last box can be empty

of the

\342\200\242
\342\200\242
Think

where

(b)

11. 1

247

\342\200\242

and

9. (1 + X + X2 +
10. Findthe coefficient

Functions

of Generating

Coefficients

Calculating

+ X

Xm

in the

X2

\342\226\240
\342\200\242
\342\200\242
+

X5)(l

product of
Xm)

+ X10 + . .

X10 +

(1 +

X25

(1 +

X50

+ X100).

\342\200\242
+

X100)

\342\200\242
\342\200\242
\342\200\242
+

X20

X50

+ X75

+ 3X4

+ X2).

\342\226\240
\342\226\240
\342\200\242
+

(1 +

+ 3X3

+ X

X100)

+ X100)

+ 3X5.

3.2 CALCULATING
COEFFICIENTS
OF

FUNCTIONS

GENERATING

in building
to this point we have
been
interested
Up
primarily
to combinatorial
generating functions to determinesolutions
problems.
of
We now develop algebraictechniquesfor calculating
the coefficients
functions.
generating
we introduce
The most important
is that of division of
concept
formal powerseries.First let us discuss the meaning of 1/A(X).

Definition 3.2.1. If (X) =


a multiplicative
A(X) is said to
A

have

series

B(X)

In particular,
if

a0

= 1,
b0

a0 # 0, then

so that
we

Xk such

2\302\243_0
bk

A(X)

has

X\" is
2\342\204\242_0
o\342\200\236

inverse

a formal
if there

that A(X)B(X)

= 1.

a multiplicative

inverse, then we

a0 must benonzero.The converse

can

determine

power series, then


is a formal
power

the coefficients

is also

true.

see that

In fact, if

ofB(X) by writing down

from the
X in A(X)B(X)
of
the coefficientsof successivepowers
these to the
definition of product of 2 power series,and then equating
we
1. Therefore,
series
coefficients of like powers of X in the power
have:

248

Chapter

Relations

3: Recurrence

a0b0 =

= 0

4- axb0

a0bx

a0b2 4- axbx
a063 4- axb2 4-

a0bn 4-

= 0

a2b0

= 0

4- a3b0

a26i

. . . +

axbn_x

we can

solve for b0

anb0 =

0,

and soon.

From

first

the

equation,

l/a0;

from

we

the second,

find

-axb0

61

third equation, we

in the

-ax

n\342\200\224 ~^~;

a0

a0
get

\342\200\224 \342\200\224

axbx

62 =

\342\200\224
\302\2602ao

ai

^2^0

a\\

a0

from the

we

fourth,

find

for

b3

this manner,we

Thus,

reader

power series A (X) = 2\302\243_0an


constant
term a0 is different from

the

iff

familiar

is doubtless

A(X) divides C(X) if


= A(X)D(X),

C(X)

Of
not

such

course,
be

the

that a0

is a

there

and we

for arbitrary
case that A (X)

# 0, then A(X)

of

of that

Definition 3.2.2. If A(X) and

division

with

coefficients

extension

an

a formal

fact, the discovery of the

nothing morethan

a3b0

a0

that

inverse

a multiplicative
The

involving
can
solve

established

we

a2bx

this expression for b0, bx, and b2 to obtain an


only the coefficients of A(X). Continuingin
for each coefficient of B(X).

into

substitute

can

We

expression

-axb2

b3

B(X)

of polynomials
= 1/A(X)
as

Xn

has

zero.

and, in

above is

idea.

C(X)

formal

are

power

series, we

power series

say that

D(X) such that

write D(X) = C(X)/A(X).

formal
divides
has

power series, A(X)

and C(X), it need

is
C(X). However, if A (X) - 2\302\243_0
a>n Xn
a multiplicative
inverse B(X)
1/A(X)

Section

Coefficients

Calculating

3.2

A(X) divides anyC(X)\342\200\224just

and then

l/A(X)).
If A(X) - 2\302\243_0\302\253n
Xnf
zero, then let ak be the

of Generating

Functions

- C(X)B(X)

letD(X)

249

= (C(X)

of A(X)
is not
0, but some coefficient
nonzero coefficient of A(X), and A(X) term of AX(X),is nonzero.Then
where
in
a*, the constant
X*AX(X),
Xk is also a factor of
order
for A(X) to divide C(X) it must be'truethat
If
series.
C(X), that is, C(X) - X* CX(X) where CX(X) is a formal
power
X
this is the case,then cancel
the
common
of
A
from
both
and
(X)
powers
= CX(X)/AX(X)
and then we can find
C(X)
C(X)/A(X)
by using the

a0 =

and

first

multiplicative inverseof AX(X).


Geometric

Series

what we have
learned
to
= 1 - ,X. Let B(X) for 60,61,...,as above,we see

us use

Let

inverse

for

successively

A(X)

the multiplicative

determine
=

1/A(X)

S^o^X\".

Solving

that

&0-l-lf

a0

(-D(l)

-axbo

^-\"^r\342\200\224iir\"1'
,

-a^-a^o

b2

b3

a0

-alb2 -

and so on. We see that


geometric series:

a2bi

bt =

each

replace in the

If we

see

we

azb0

]T

have

we

an

called

expression

Xr.

above expressionX by

for the

(3.2.1)

aX

where

a is

a real number,

that:

(3.2.2,

j-^-M

the so

1,

1,

1 so that

1-X
then

- (0)(1)
=

-(-!)(!)

geometric

series

(with

common

ratio a).

250

Chapter

Relations

3: Recurrence

1; then we

let a

In particular,

so called

- X

- 1

\342\200\224^\342\200\224
=
\302\243(-DrXr
A
+
r_0

the

get

- X3

X2

... ,

(3.2.3)

series. Likewise,

geometric

alternating

4-

\342\200\224^\342\200\224=

(3.2.4)

J(-ira^

\342\200\242
Suppose that n is a positive integer.If Bl(X),B2(X),.,andBn(X)
\342\200\242
\342\200\242
inverses
of
and
multiplicative
AX(X),A2(X),. ,
An(X),
\342\200\242
\342\200\242
\342\200\242
is the multiplicative
inverse of
respectively, then
Bi(X)
B2(X)
Bn(X)
\342\200\242
\342\200\242
\342\200\242
.
.
.
Al(X)A2(X)
An(X)\342\200\224just multiply
A1(X)A2(X)
An(X) by
\342\200\242
\342\200\242
\342\200\242
= I for each
and use the facts that A( (X)Bi(X)
Bl(X)B2(X)
Bn(X)
is the multiplicative
inverse of A(X), then
, i. In particular,if B(X)
is the
of
inverse
this
(B(X))n
(A(X))n. Let us apply
multiplicative
observation
to A (X) = 1 - X.
n a positive integer,
For

are the

-i\342\200\224

The

first

the second

2?_0C(n -

could
C(n

4-

r,r) X'.

(3.2.5)

and the fact that


already
1/(1

observed
X)n =

proved by mathematical induction


\342\200\242
\342\200\242
+
4- C(rc,l) 4- C(n 4- 1,2) 4- \342\200\242

also be
- 1,0)

l,r) = C(n 4- r,r).


X by -X in
By replacing
For n a positive integer,
r

1 +

equality in Example3.1.7.The equality


r,r)Xr

4-

C(n
\302\243

the above comments


inverse of 1 - X; we have

multiplicative

and use of the identity


C(n

from

follows

equality

is the

Xk
2\302\243_0

X*)n

(J

(1

\342\200\2241\342\200\224=
\\i

Following this

obtain

J C(n
r_0

a;

4-

- 1 4-

pattern, replaceX
*

YVt

*
n

the above we get the

Yv.

by

E C(n
-

C(r\302\273
\302\243

aX

4-

in

identity:

(3.2.6)

r,r)(-l)'X'.

- 1
1 +

following

(3.2.5)

r,r)arXr,

r,r)( -a)'X'.

and (3.2.6) to

(3.2.7)

(3.2.8)

Section

Likewise,

replace X by

in

Xk

of Generating

Coefficients

Calculating

3.2

Y.Xkr
\342\200\224^\342\200\224k
\342\200\224
A
r\342\200\2360

= 1

for k a positiveinteger,

to get

(3.2.1)

Xk

251

Functions

X2k

\342\200\242
\342\200\242
\342\200\242

(3.2.9)

and

=
\342\200\224^

If a

(3.2.10)

E(-DrX*r.

is a nonzerorealnumber,
1

1/

a \\1-

- X

\\

,oo,,x

l^Xr

a 73

A/a/

and

is a

is a

ra

(1 +
(1 +
(1
(1

4-

X)n = 1 + (J) X
-

1 +

(J)

Xk

- X)n = 1 -

(l)

1-

(1)

- X*)\" =

The formulas
theorem.

r_0

use frequently are:

X2

\342\200\242
\342\200\242
\342\200\242
+ Xn

\342\226\240

1~Xy

(3.2.13)

integer,

positive

X*)\302\273

\342\200\224
X

integer,

positive

1+

If

that we will

identities

Other

If

\342\200\224
a

X*

(j)

g)

(j)

g)

X2 +

\342\200\242
\342\200\242
\342\200\242
+

(J)

X2* +
X2 +

\342\200\242
\342\200\242
\342\200\242
+

(J)

X\"

X\"*

\342\200\242
\342\200\242
\342\200\242
+

X2* +

(3.2.14)

(-1)\"

(J)

(3.2.15)

X\"

(3.2.16)

X\"*

\342\200\242
\342\200\242
\342\200\242
+

(-1)\"(|J)

are all specialcases


(3.2.14)-(3.2.17)r

of

the

(3.2.17)

binomial

Chapter3: Recurrence

252
Use

of Partial

Relations

Fraction

Decomposition

If A(X) and C(X) arepolynomials,

compute C(X)/

how to

show

we

fractions.The readerwill
A(X) by using
=
that
is
from
a
of
recall
algebra
product linearfactors,A(X)
\342\200\242
\342\200\242
\342\200\242
if
and
is
of
(X
C(X) any polynomial
a2Y2
akYk,
an (X \342\200\224,ai)Tl(X
can be written as
C(X)/A(X)
degree less than the degree of A(X), then
the sum of elementaryfractionsas follows:
the

C(X)

An

A(X)

(X-a,)\"

and partial

identities
if A (X)

above

Al2

+ 7T7
rm
(X-a,)\"\"1
^21

(X

(X

+...+
numbers
)r'

the

find

equation

ax

(X

by

An,...

(X -

T(X -

a,)
.+ ...+
+

+
+

we

Akn

- a*)\"\"'

(X

(X-a*)'\302\273
To

A^

a2p~l

A>1\342\200\224

Alri

(X-\302\253x)

A22

,
T

- a2r

\342\200\242
\342\200\242
\342\200\242
+

both

multiply

\342\200\242
\342\200\242
\342\200\242
(X
a2 V2

and then we equate coefficientsof the


from
required coefficients can be solved

to clear
ak )r\302\273

same

powers

the

resulting

Akr>

(X -

a,)

sides of the last


of denominators
of X.
Then
the
of
system

equations.

A few

Calculate

3.2.1.

Example

Since

X2

the method and refreshyour

will illustrate

examples

5X

6- (X -

- ^.0 br

B(X)

3)

(X

A(X

see that 1/(X2- 5X + 6) =


B(X - 3) = l.LetX = 2and
A

1/(X2 - 5 X +
and (3.2.12) to see

1. Thus

(3.2.11)

we

3)

- 5 X + 6).

2), we

+ B/(X - 2).Thus,
A/(X
2) +
=
=
B
-1.
3
we find
Let
and we see that
- 1/(X
- 2). Then
use
6) = 1/(X -

- 3)

- 1/(X2

Xr

memory.

that

X2-5X

+6

Therefore, for each r, br

3-X2-X

3(1-

- l/3r+1

2(1

X/3)

- X/2)

+ l/2r+1.

Thus,

X2-5X T6

+
^^\\~\302\245ri

\302\245^xr~^0(~\302\245ri

\302\245^)xr

Section

3.2

Coefficients of Generating

Calculating
if we

and

make the

substitution fc

= r

+ 5we

X5

X2this

what

and

5X

T6-g(-F*

1
5 and

= 0

1
3

k >

3N*-\302\243***

= d3 = d4

= d2

di

(1*.=
5

if

see that

says is that

final equality
do

so on.

Example 3.2.2. Computethe coefficients

'
r.o

Z.

X4

Since

(X + 2) we

5X

- 5

of

X +3

~X4-5_X2
+

4-

- 4) = (X -

1) (X2

1)

(X

X2-5X

+ 3

X4-5X2

+ 4

by

X4

X-1X

- 5X2

+ 2'

+ 1X-2X

+ 4 gives

= A(X + 1)(X - 2)(X + 2)


+ C(X - 1)(X + 1)(X + 2)

+ B(X
+

D(X

- D(X
- 1)(X

Thus,

2)(X

2)

+ 1)(X -

involve
X = 1, then all terms of the right-handsidethat
= i/G.
X
1 vanish, and we have -1<= -6:\\orA
Similarly putting X - -1, X = 2, and X - -2, we find B
= -17/12.
-1/4, and \302\243>
Let

- 2)

1) (X

write

can

+ 3

X2

Vr

- 5 X2 + 4 = (X2

Multiplication

X2

253

Functions

the

2).

factor

= 3/2,

C =

254

Chapter 3: Recurrence
- 5X

X2

X4

Relations

+3

5X2 +

17

6(X - 1)

2(X

- X)\342\226\240+
1+ X^

3(1

12(X+

- X/2)

12(1 +

4(X

1)

2 I

- 2)

2)

17

4(1

X/2)J

Therefore,
<*r

-|

3(-1)r+2^5-Y(-1)r2^5.

to

be simplified

can

which

:r

12
After

in the

we see

examples

[1

(X/o,)]
-

[1

that it is desirableto

write

ri-l

(X/a,)]

5\302\253

\"T

[1-

Bk2

A(X) =

where
for

(X/a*)]\"

5*r,

[1 - (X/a,)]r\302\273-l

- (X/aA)]
axr (X - a2)r>

[1
an(X

constants
Bllf ..., Blri, ..., Bkl,
in this
form
This is desirablebecause

...

the

algebraic techniques.

apply the formulas

ifriS\302\260dd-

Bt
-

B lr,

and then solve

2^)

form,

By
(X/ai)]r<

2^(1+T)H(-5

these

doing

C(X)/A(X)

[1 -

R-3

is even

(3.2.1)

intermediate
stepof

applying

through
(3.2.11)

(3.2.8)
and

without
(3.2.12).

(X
...,

we can

having to

- a,)'*
B^

by

readily

resort to the

Section 3.2

3.2.3. Find the coefficientof

Example

255

Functions

of Generating

Coefficients

Calculating

in

X20

(X3

X\"

\342\200\242

X5.

-)5.

x4 +

(x3 +

X3 from

by extracting

the expression

Simplify

x5.. .)b

Thus,

.. -)]5=
x15(x;xr)5

+ x+

[x3a

factor.

each

(1 the

of X5in 2\"_0

C(4

the coefficient
is
coefficient

we seek
C(4 + 5,5) = C(9,5).

+ r,r)Xr

Example 3.2.4.

(X2 + X3 +

(1 +

the

Calculate

X4

X15 in

of

coefficient

(X + X2 +
X5)
\342\200\242
\342\200\242
\342\200\242
that we can
+ X1B) Note

r,r)Xr.

fr0

becomes the coefficient


original
expression
(cancel X15 from the above
Thus,
expression).
is when r = 5 in the last powerseries,that is, the

of X20 in

coefficient

The

l +

X15]TC(5-

X)5

A(X)

X3 + X4 + X5 + X6 + X7)
A (X)
rewrite the expression
for

as

X2(l

+ X

+ X2

X +

(1 +

X3)

(1 +

(X)

\342\200\242
\342\200\242
\342\200\242
+

\342\200\242
\342\200\242
X + \342\200\242
+ X6)
- X7) (1 - X16)
v3 (1 X4) (1

15. = X

X15)

1-X

1-X

(1-X)

(1 - X7) (1 -

- X4)

(1

(1

The coefficient of X15in A(X)


(1

X4)

(1

- X7)

(1 -

(1

the

of X12 in

coefficient

- X16)

X)3

Since

is the sameas

X16)

- X)3

(1

- X4)

(1 -

X7)

(1

- X16)

\\y C(r

2,r)X').

of X12 in a product of severalfactorscan be obtained


from each factor so that the sum
of their
exponents
equals 12, we see that the termX16 in the third factor and all terms of
degreegreaterthan 12 in the last factor need not be considered.Hencewe
look
for the coefficient of X12in
the

by

taking

coefficient

one

term

+ 2,r)X'

(l_X4)(l-X7)f;C(r
r-0

(1

- X4 -

X7

X11)

f;

C(r +

2,r)Xp.

256

Chapter

Relations

3: Recurrence

factors
and
the corresponding
Using the successive terms of the first
terms of the secondfactorsothat the sum of their exponents is 12,we see
- C(10,8) - C(7,5)+ C(3,1)
isthe coefficient
we seek.
thatC(14,12)
of Xr
Note that A (X) is a generating function such that the coefficient
3 numbered
counts the number of ways of distributing r similarballsinto
of balls between 2 and 5
number
boxes where the first box can have
any
between 1 and 7
inclusive, the secondbox can contain
any number
box
can
contain
inclusive, and the third
any number up to 15 balls.
FactoringX2 out of the first factor and X out of the secondfactor
amounted
to the combinatorial
strategy of placing2 balls in the first box
of X12 in
coefficient
the
and 1 in the second to begin with. Then finding
12
of distributing
of ways
A(X)/X3 amounted to counting the number
balls into 3 boxes where the first box could contain up to 3 balls, the
secondbox could contain up to 6 balls, and the lastup to 15 balls. Had we
2 we would have used the principleof
done this problemin Chapter
form of the answer suggests that that is
and
the
inclusion-exclusion,
preciselywhat is going on behind the scenes in all the algebraic
the
is the
manipulation.This
major reason for using generatingfunctions:
do the combinatorial reasoningfor
techniques
algebraic
automatically

us.

To

this

illustrate

2
Chapter
techniques.

solve one problem with techniques


those techniqueswith generating

let us

point

and compare

from
function

3.2.5.
Find the numberof ways of placing 20 similar balls
Example
into 6 numbered boxesso that the first box contains any number of balls
between 1 and 5 inclusive and the other 5 boxesmust contain2 or more
balls
each.
The integer-solution-of-an-equation-model
is: count the
to ex + e2 4- e3 + e4 + e5 + e6 = 20 where 1 < ex <
number of integral
solutions
~\"
5 and 2 < e2,e3,e4fe5,e6.
2 < et for i = 2,3,4,5,6.
we will count the solutions where 1 < ex and
First,
in
do this
1
2balls
We
ball
boxnumber
eachin the other 5
one,
by placing
and
then
number
of
the
to
distribute
the remaining
boxes,
ways
counting
9 balls into 6 boxeswith unlimited
are
There
C(14,9) ways to
repetition.

do this.
But

then

and 2 <

et

number

of

we wish

to discard

the number of

solutions

for

which

i =

C(9,4).

Now let us solvethis problemwith


function
generating

6 < ex

2,3,4,5,6. There are C(9,4) of these. Hencethe


is
solutions
C(14,9)
subject to the stated constraints

for

we consider

is:

generating

functions.

The

total

Section 3.2

(X +

X2

desire

We

+ X5) (X2 +

\342\200\242
\342\200\242
\342\200\242

X3

)5

\342\200\242
\342\200\242
X2 + X3 + X4) [X2 (1 + X + X2 \342\200\242
)]5
\342\200\242
. )5
X2 + X3 + X4) (X10) (1 + X + X2 \342\200\242
X(l
\342\200\242
Xn(l + X + X2 + X3 + X4) (1 + X + X2 . \342\200\242
)5.

+ X +
+ X +

= X(l
=

+ X4

X3

the coefficient of X20

to compute

this

in

last product,

need only compute


the
coefficient
of X9 in (1 + X + X2
\342\200\242
can be rewritten as:
(1 + X + X2- \342\200\242
)5, which

Thus, the coefficient


again

that

257

Functions

of Generating

Coefficients

Calculating

X9

of

in this

last product

is C(14,9)-

combinatorialreasoningfor

did the

the algebra

X3

but we
+ X4)

C(9,4).
Note

us.

Linearity

functions possess an important transformation


namely
Linearity implies that, if any two sequences
linearity.
property,
of numbers \\ar }\"_0 and \\br }\"_0 and scalars D and E are given,thensequence
the generating
has
formed
by the linear combination cr = Dar + Ebr
{crYr-o
Ordinary

generating

function

C(X) =

= DA(X)

+ Ebr)Xr

&ar
\302\243
r-0

+ EB(X),

where

A(X)

and

X>rXr

B(X) = \302\243>rXr
r-0

r-0

are the

generating functions

Example

Since 1/(1

3.26.

- 2X

2)(r +

(1

1)\342\226\240
J
o
i

7
/

{Mr\302\260-o>respectively.

- 2X) generates
{2r}r.0

generates

and

{ar}\"_0

(r +

and 71 - 1_g v\\3


(i
5xy
1

for

- 5X)3

generates

r-0

the sequence

3<2f_7(r

+ 2)(r +
l);
r-0

258

Chapter

Exercises

Relations

3: Recurrence

for Section 3.2

1.

the

Using

1(b)

3.2.1, find the coefficients


functions B(X):

Definition

generating

following

+ X2'

3X

1 +

1+

2X
X2'

3X

2. Write
(a)

the

for

11X+ 28X2'

(c)

of

equations

b0fbi,b2,b3,b4,b5

the formal

(d)

T^x>

for
powerseriesexpression

(g)

3^x'

(1 -

the

following:

5X)3'

(b)lT5x'

(e)arW'
(f)

(C)3TX'

(a)

(b)

(c)

4.

(3 +

xr

3. Use

(h)

(1 - X)8'

(\302\260(3

X)<

partial fractions to compute:

1 --

1
IX

12X2'

1 --

IX +

(X -

10X2'
(e)

X + 21

(1

3X

7X2

(d)

2)(X

+ 2
+

l)2'

1 - 7X + 3X2
3X)(1 - 2X)(1 + X)

(X-5)(2X + 3)'

Write

the

(a)

ar-(-l)r,

(b)

ar

function

generating

for the

(-m\\

(c) a,

= 5',

(e)

ar

= 6(r

(g)

a,

= (r

(h)

ar

(d) ar = r + 1,
+ 1),

(f) ar = C(r + 3,r),


+ 3)(r

+ 2)(r + 1),

(-l)'(r+2)(r + l)
2!

(i)

ar = 5r

(k)

ar

+ (-l)r3r + 8C(r + 3,r),

(j) ar=(r +1)3',


= (r

+ 2)(r

+ 1) 3r.

sequence

{ar)7-o

defined

by

Write an

expressionfor

following

generating

(a)

15
1 ^

(b)

7
3
~
77\342\200\224^7^
- X)2 (1 - 2X)3

(3 +

<b,

(1

(c)

13

3(X + 1) 12(X-

- 1

Find the
(a) (1 +
'

+ X)

(5

2X)2

-14~

2X'

3 +

8
(c)

8
+

yr\342\200\224^

(1

the coefficient of Xr in the

(1 - X)5'

2X

1 +

259

r^ +

ar is
A(X):

where

ar

functions

Functions

of Generating

Coefficients

Calculating

of

coefficient

X + X2

4(2

2)

+ X).

X10 in

\342\200\242
\342\200\242
\342\200\242

)2,

-X)3'

1
(1

-X)6'

1
(d)(TTxF

(e)
(f)

X4

\342\200\242
\342\200\242
\342\200\242

+ X

X4(l
+

Find

(X3

)\\

+ X2 + X3)(l +

+ X4)(l

+X +

X2

of X12in
-

X4

(1

Findthe

of

coefficient

(a) (1 + X +
(b) (1 + X +
(c) (X2 + X3

(X +
Find

X2 +

X14 in

X3)10,
+ X3 +

X2

+ X4

X2 +

X3

\342\200\242
\342\200\242
X4 + \342\200\242
+ X8)10,
+ X6 + X7)4.

X5

of

X20 in

X4

the coefficient
\342\200\242
\342\200\242
\342\200\242
+

Find the

X7 + X\"

- X)5

X2

Find the coefficient

(b)

+ X3

x12).

the coefficient

1-

(a)

+X2

\342\200\242
\342\200\242
+

X^XX20

+ X5)(X2

of X50

+ X21

coefficient of X25
(X2

+ X3

in

+ X4

+ X3 +

(X10

+ X11

\342\200\242
\342\200\242
\342\200\242
+

X45).

in

+ X6

X4

X6)7.

\342\200\242
\342\200\242
\342\200\242

f.

\342\200\242
\342\200\242
. +

X*)(X

260

Chapter 3: RecurrenceRelations
11.

of X12in

the coefficient

Find
(a)

(1

(f) (1 (g) (1 -

X2
- X)10'

(1 (1 -

(c)

(d) (1

X)10'

X2
(\302\273)

X)20,

(1

+ X)20,

(e) (1 +

4X)15,

(1 + X3)-4,
- 3X,

(h)

X5

(b)

4X)\"5,

(1

(j)

- X)4
- 2X)19.

-20

X)

be the number of ways the


50 distinguishabledice. Write

12. Let ar

sequence
of

13. Let

(a) Finda10

(b)

a10in the

< 4 for
2 < Xx <

< X,

if 0

Find a50 where

14. Find

generating

be obtained by tossing
for the
function

obtain the sum

of ways to

the number

of nonnegative

number

= r.

X2 + X3

is, find al00.


the

be

ar

find

Then

{ar}~_0-

that

100,

r can

sum

each

integral solutionsto

Xx

i.

< 50, 5 < X3

50, 0 < X2

exercisenumbers listedbelow

<

25.

3.1:

Section

from

(a) 5(a)

(b) 6

(c) 7(a)
(d)

8(a)

(e)

8(c)

(f)

8(d)

(g) 8(e)

15. Use
balls

a large

from

selection

(a)

the

(b)

the

selection

(c)

the

selection

16.

How

many

sundaes

How

with

there

are

ways

if there

one type are allowed?


17.

to find the number of ways


of
red, white, and blueballsif
pile
has at least 2 ballsof eachcolor,
has at most 2 red balls,and
has an even numberof blueballs.

functions

generating

many ways are


5 colors if there

Write

the
obtaining

19. How

n when

each

chocolate

4 sundaes

most

enough

blue,

for an, the

pink,

and green

are there for

X, must

have one

the

of

hotel

paint to

number of ways of

tossing 9 distinguishabledice.Then

many solutions

X4 = 12if

at

12

for

there to paint 20 identicalroomsin

is only

function

a generating

sum

order

are 5 types of sundaes,and

paint 3 rooms?

18.

to place an

to select 10

equation

find

Xx + X2

of values 1, 2, 3,or

4?

a25.

4- X3 +

Section

Calculating Coefficientsof Generating

3.2
20.

Write a

generating

r letters
least onea,
from

{5

a,

c}

6,

one

least

at

number of ways of selecting


selection must include at

ar, the

for

function

\342\200\242
6 \342\200\242
if
8 \342\200\242

each

at least

6, and

Find

c's.

two

a8.

number of ways to
where unlimited
select r objectsfrom n distinguishable
objects,
repetition is allowedand eachkind of object must appear an even
a single
for A(X) and
number of times.Derive
series expression

21. Find

the generatingfunction

261

Functions

an

find

each

case

for determining

function

generating

must appear

object

times.
Find

ar, the

for a12.

expression

22. Solve exercise21 in

23.

for

A(X)

r-combinationsof the letters


can appear
number
of times

in

M>A,T,RJ9X

once.

Find

24.

Let ar

number of ways
each

that is at least3.

form

(c) Finda20.
A set
of r balls is

to

I, and X appearat most

selected

partition

has an

pile

function

a generating

Determine

(b) Determinea closed


25.

ar, the number of


M, A, and T

which

a10.

denote the

into 4 distinct pilessothat


(a)

but R,

any

a multiple of 3

for ar.
for

expression

an

from

r identical marbles
odd number of marbles

ar.

infinite

of red,

supply

white,

must
the condition that
blue, and gold balls.A selection
satisfy
of red
either the number
balls is even and the number of white
balls
is odd, or the number of blue balls is evenand the number
of

is odd.

balls

gold

Let

ar

denote

the

number

function
(a) Determinethe generating
(b) Determine an expressionfor ar.

(c)

for

of such

selections.

ar.

Finda13.

In how many ways can 3r balls be selected from 2r garnet balls,


2r gold balls, and 2r blueballs?
How
(b)
many
ways can 4r balls be chosen?
27. Letar denote the number of ways to select r ballsfrom 20 garnet
30
blue
balls with the
balls, 20 gold balls, 30 green balls, and
constraints that the number of garnetballsis not equal to 2, the
number of goldballsisnot 3,the number
of green
balls is not 4, and
the number
of
blue
balls
is not 5. Determine the generating
26. (a)

for

function

Selected

Answers

ar.

for Section 3.2

3+

+
3(1

X\\

ir)

3 U

3 to

\\

3/

262

Chapter3: Recurrence

Relations

(DffT\302\273'-?(,+fr-ss(-iw<r+iw6)'jr

*3- /(a)
^

1 - nv

7X

<CTV1

12X2

t*
(1

^JFTT^ - 3X)(1

3 21

-3

\342\200\224
= \"

OO

^
- 3X

4X)

- 4X

CO

4 Y. 4rXr

3rXr +

r-0

L (4r+1-

3r+1)Xr

r-0

(c)

A(X)

X + 21

(X

X - 5

+ 3)

5)(2X

2X

-\302\243[(-lH-f)1-

--(-i)ar-(-ir\342\200\224

(d)
/a\\

^v^

A(X)

7X2 +

3X + 2

= \342\200\224\342\200\224rr7^

- 2)(X

(X

+ l)2

1+
-

=
~

\342\200\224
X

(1

X'

(-1)'
\302\243

r-0

+ X)2

'

\342\200\224\342\200\224\342\200\224

(X +

2
X

l)2

X - 2

2__
X\\

- 2 t. (r +

D(-Dr

Xr

21.

r-0

r-0

- 2(r + l)(-l)r

LJ3(-l)r

2^)']X';

simplify,

5.

(e)

C-9/4)(3\")
o\342\200\236

(b)

ar

(d)

1-

= 3C(r
(4/3)

+ l,r)
(-1)\"

+ (7/3)(2n)

+ (11/12) (-1)\"

- 7 (2)' C(r + 2,r)


-

13/24 (1/2)\" +

8/3

(-l)r

9/8 (-1/2)\"

(2/3)'

(l\\xr
w

Section

3.2

6.

(a;

of

coefficient

(b)

jr-^

11.

X10 is

+ 2,r>

Or
\302\261

263

Functions

= 'jr(r + l)Xr;

= Y.C(r+l,r)X'

1Y.2

of Generating

Coefficients

Calculating

- t

X-

(r

+ 1>

2>'r

*i

coefficient of X10is (12)(ll)/2.

(c) C(14,10)
(d)

= C(14,10)

(-1)10C(14,10)

+ X +

(e) [X3(l
X10 is

X2

the coefficient

coefficient = 5

(f)

C(8,6)

\342\200\242
\342\200\242
\342\200\242
=

)]2

of X4 in 1/(1 -

+ 9,r)

C(r
\302\243

X4)10

C(r

S;.0

of

+ l,r) Xr;

- C(3,l)

C(4,2)

(iirrxi
-

X)2

r-0

- [1 -

C(10,l)

X;C(r

+ 9,r)X<;

X4

\342\200\224
v4\\io

= (1

- X)2];coefficient

Xs [1/(1

y4\\10

=a-xr

Xr

C(10,2)

Xs

- C(10,3)X12

\342\200\242
\342\200\242
\342\200\242
+

X40]

r-0
coefficient of X14is C(23,9)- C(10,l)
C(19,10)
+ C(10,2)
C(10,3)C(ll,2)
C(15,6)
(b)

9. C(14,9) 10.

(a)
(b)

11.

C(23,14)

C(9,4)

- C(6,4)-

C(21,19)

- 7C(12,6)

C(17,H)

(a)

C(19,10)

(b)

C(16,7)

10C(14,5)

C(5,3)

+ C(7,2)C(7,l)

(c) C(20,12)

(d) C(20,12)

(e) C(31,12)
(g)

412C(15,12)

(j)

(-2)12C(19,12)

12. (X

+ X2 +

coefficient

X3

of

X100

+ X6)50is C(99,50) - C(44

X4

+ 38,38)C(50,2)-

+ Xs

C(49

32,32)

X50

C(50,3)

(1

X6)80 1/(1

49,44)

\342\200\242
.

C(50,l)

X)80;

+ C(49

264

Chapter

3: Recurrence Relations

13. (a) C(12,10)- 3C(7,5)


+
(b) C(45,43)
C(24,22)

15.

(a)

C(6,4)

(b)

C(12,10)

16. C(16,12)
17. The

- C(9,7)
of

coefficient

+ C(5,2)

C(ll,7)

C(5,l)

X20 in

(1 +

- 3C(20,16)
+ 3C(16,12)

X +

C(6,2)
X2

(2r% Xr)2

X3)3

is C(24,20)

C(12,8)

18.

+ X2 +

- (X

A(X)

Find the

X5)9

The expressions
for
in

Chapter

for

inadequate

An

face.

relations

(1

- X6)9(1 -

9C(18,1(\302\273

(1

X +

\342\200\242
\342\200\242
\342\200\242

X)\"9;

C(9,2)

C(12,4)

permutations,

2 are

combinations,

the most fundamental

and partitions

tools for

counting

the

sets. Nevertheless, these expressions


often
prove
combinatorial
that
the
many
problems
computerscientist
alternate
important
approach uses recurrence
called
difference
to define the termsof
equations)
desire
to demonstrate
how many combinatorial problems

of finite

elements
must

X16 in

- C(24,16)

+ X6)9 = X9

RELATIONS

RECURRENCE

developed

of

coefficient

a25

3.3

X3
+ X4 + X5
= X9(1-X6)9(1-X)-9.

(sometimes

a sequence.
can be modeled
We

recurrence
and then we will
discuss
relations,
several common types of recurrencerelations.
of recurrence
relation beyond that of Section 1.10
discussion
A formal
within
difficult
is somewhat
the scope of this book but the concept
of
relations
is straightforward.
recurrence
combinatorial
Many
problems
can be solved by reducing
them
to analogous
problems involving a
smallernumberof objects,
and
the
salient
feature
of recurrence relations
of one
term
of a collection of numbersas a function
of
is the specification
of
a
we
terms
the
recurrencerelation
can
collection.
Using
preceding
n - 1 objects, then
a problem involving n objects to one involving
reduce
n
2 objects, and so on.By successive
of the
reductions
to one involving
a problem
number of objectsinvolved,
to eventually end up with
we hope
will be instructive.
that can be solved easily.Perhapsan example
with

methods

of solving

Science Application

A Computer

Suppose

that

number

of

valid

a given
expressions

in

programming
using only

language we wish to countthe


the ten digits 0,1,... ,9,and the

Section

265

Recurrence Relations

3.3

four arithmetic operationsymbols


that
each
this languagerequires

+,\342\200\224,-=-,

x.

the syntax

that

Assume

of

Therefore,valid

expression
digit, and that 2
can be combined
4
the
arithmetic
by using
operations.
is a sequence of oneor moredigits
or of the
expression

form

A and

valid

expressions
a

of the

\302\251
B where
4

arithmetic

B are

end in a

valid

valid

Thus,

operations.

and

expressions

the operator

for instance,

1 4-

is

o is

one

a valid

expression as is 3 x 45,and then 1 + 2 - 3 x 45 is alsoa valid expression,


but 1 + 4- 2 is not.The problem
then
is: how many
such valid expressions

of length n are therein this language?


First of all, we note that the answer
is not
because we do not
(14n-1)10
allow expressionslike 14-4-2, that is, 2 successive arithmetic symbols
1 entries
cannot
be filled arbitrarily.
are not allowed so the first n \342\200\224
to
be
a
our
needs
bit
more
to
Thus,
analysis
sophisticated.We attempt
use the idea of recurrencerelations.
Let an be the number of valid expressions of length n, and let us
on the
consider
a particular
valid expression of length n. Focusattention
\342\200\224
n
in
in
1.
which
case
This
be
a
the
first
entry
symbol may
position
digit,
n - 1 symbols
form
a valid expression
of length n - 1. Or this symbol
in which case the preceedingn may be one of the 4 arithmetic
symbols,

symbols

a valid

form

expression.

in the first class is 10an_x


since
The number of valid
there
expressions
are 10 digits that can be appended
to a valid expression of length n - 1.
in the second class since each one
Likewise,there are40an_2 expressions
of4 arithmetic
be
followed
may
symbols
by any one of 10 digits and then
of
n - 2. Thus, we can
both appended to a valid
expression
length
the
from
and
to
relation an = 10an_x
determine
an
an_x
an_2 according
for n > 2, but clearly a0 = 0 and
4- 40an_2. This recurrence relation is valid
1 is just the
of length
ax = 10 since the number of valid
expressions

number of digits.Thus,
a2 a3

we

can

determine

10ax4-

40a0

= 10(10)

10a2 4-

40ax

- 10(100)4-

40a2

- 10(1400)

that

4- 40(0)

= 100,

40(10)

= 1400,

a4 = 10a3 4-

4- 40(100)

= 18,000,and

so

on.

of a recurrence
Chapter 2) is anotherexample
l,r) 4- C(n - l,r - 1). Herea termin the n-th
in a preceding row. But
row of Pascal's triangle is determinedby 2 terms
this exampleis an example
of a r'ecurrence
relation involving the 2 integer
variables n and r. By and large we shall restrict our attention to
recurrencerelationsthat involve only one integer variable, so let us adopt
Pascal's

relation:

the

following

identity (see
= C(n -

C(nfr)

working

definition

of recurrence

relation.

266

Chapter

Relations

3: Recurrence

3.3.1.

Definition
for

n >

integer

any

A recurrence
is a formula that relates
relation
=
n-th
termof
a
A
the
1,
sequence
{ar}\"_0 to one or

more of the termsa0,au ...,

an_x.

If sn denotes
relations.
of recurrence
the sum of the
Examples
first n positive integers,then (1) sn = n + sn_x. Similarly if d is a real
with common
number, then the nth term of an arithmetic
progression
difference d satisfiestherelation(2) an = an_x + d. Likewise if pn denotes
common
with
ratio
the nth term of a geometricprogression
r, then (3)
Pn = rPn-i- We list other examples as:

(4) an

3an_x

(5) an -

(6) an
(7)

an -

(8)

an

(9)
(10)

3an_x

(n

2a\342\200\236_2

2an_2

- 1) an_x
+

9an_x

- 0.

- n2 +
-

- 24an_3

26an_2

3(an_x)2

1.
- 1) an_2

(n
=

2a\342\200\236_2 n.

+ axan_2
an = aQan_x
a2 + (an_1)2=-l.

\342\200\242
\342\200\242
\342\200\242
4-

an_xaQ.

Definition 3.3.2. Supposen


of

ck(n)

for
/(m)
of n is said

n >

an_k

functions

are not

degreek. If
is

coefficients.

If f(n)

is

. . +

c0

linear recurrence relation with


constant
relationissaidto be
identically zero, then the recurrence
is inhomogeneous.

it

Thus, all the examplesabove


(9), and (10);the relation(8),

squared term.The

are
for

2; (7)

degree

linear
instance,

recurrence
is not

relations except (8),


linear because of the

(5), and (7) are linear with


and (3) have degree
1; (4), (5),
has degree 3. Relations (3), (4), and (6) are
in

relations

(3),

(4),

(1), (2),

Relations

coefficients.
have

+ .

c1(n)an_1

as a

otherwise,

and (6)

c0(rc), cx(m), ..., ^(n), and f(n) are


recurrencerelation.If (n) and c* (n)
is said to be a linear recurrence
relationof
ck(n) are constants, then the recurrence

it

homogeneous;

constant

integers.

nonnegative

where

fe,

...,

Ci(n),

c0(n),

known

are

c0(n) an

to be a linear

identicallyzero,then

relation

and

form

the

relation

recurrence

= 0.

= 5n.

homogeneous.

There are no general techniquesthat


recurrencerelations.Thereare, nevertheless,
us to solvelinearrecurrence
with
relations
Solutions

elementary

defined

one

enable

to solve all
enable

that will
techniques
constant
coefficients.

Relations

of Recurrence

In

will

algebra

to mean

solving

that we

find

an equation
all

substituted into the quadratic equation,

those

- IX + 10

like X2
values
made

of X
the

0 was

which, when

equation

a trye

Section3.3

267

Relations

Recurrence

we determine
formula,
By factoring or by use of the quadratic
= 2 and X = 5 arethe only 2 values that solve the equation.
Supposenow that we are given the recurrence relation an - ban_x = 0
is meant
for n > 1 and are asked to solve it. We first ask: what
by a
this by recalling that a
solution of this recurrencerelation?We answer
into the
integers
sequenceA = {a J~_0 is a function from the nonnegative
the
recurrence
relation
does is describe a relation
real numbers. What
between the values
of this
function
at n and at n - 1. We ask then: is
domain
the set of nonnegative integers,
there a function, defined with
which makesthis equationtrue for every value of n? The answer is yes, as
is shown
by the function A = {aj~_0 where an = 5n for n > 0. For this
= 5n - 5(5n_1) = 0 for
n > 1, so that this
function
we have
an - 5an_x
function
satisfies
the
recurrence
relation. However, it is one of many
as a matter
of fact, if c is any constant the function {aj^0
solutions;
where an = c5n for n > 0 also satisfies the samerecurrence
relation
= c5n - 5c5n_1 = 0 for
>
n
1.
because
an
5an_x
Just as in algebra, recurrencerelationsmay have no solution. Equation
(10) above is an exampleofthis since there are no reaZ-valued functions /
- l))2 = -1 since the squares of real numbers
suchthat (f(n))2
+ (f(n
are always nonnegative.

statement.

that X

Definition 3.3.3.
a sequence
integers.
S if the values
relation

subset of the nonnegative


is
a
solution to a recurrence
Then
{an}^-0
A
of
the
recurrence
relation a true
make
over
an
A
n
in
of
S.
If
the
for
value
statement
sequence = {an}^0 is a
every
is
said
it
to satisfy the relation.
of
a
recurrence
t
hen
solution
relation,

Example 3.3.1.

(a)

is a

A =

= {an}^0

that

Suppose

where an =

2n

the

satisfies

recurrence

n > 1. In fact for any


the set S of integers
constant
relation.
c, the sequence
{c2n}^_0satisfies the samerecurrence
if a and c are any real numbers,
More
then an = can satisfiesthe
generally,
= aan_x for n > 1. (b) If cx and
recurrence
relation:
an
c2 are arbitrary

an = 2an_x over

relation

constants, then
7an_x

an

10an_2

this expressionfor
an

- 7

an_x

= 0

= 2n\"2 d

2n\"2

the recurrence

into

= (cx 2n

+ 10 (cx
2n

the

satisfies

over the set S of integers

an

10 an_2

=d

+ c2 5n

cx 2n

2n\"2

7 d

c2 5n)

+ c2

2\"\"1

relation, we have

- 7 (cx

2n~l

+ c2

2n~2 +

c25n

5n\"2

bn~l)

5n\"2)
10 d

[22 - 7 (2) + 10]+ 5n~2


(0) 4-

relation: an \342\200\224
recurrence
>
n
2. For by substituting

c2

(0) = 0.

c2 [52

7 c2 5\"-1 + 10 c2
- 7 (5) + 10]

5n~2

268

Chapter3: Recurrence

Relations

c2, an = cx 5n + c2 nbn satisfies


+ 25an_2 = 0. (d) Likewise for
constants
cx, c2, and c3, an = cx 2n + c2 5n + c3 rc5n satisfies the
arbitrary
= 0. We leave this
recurrence relation an - 12an_x + 45an_2 - 50an_3

constants

for arbitrary

(c) Similarly

the recurrence relation an

cx

and

10an_x

verification as an exercise.

Note

each

in

that

different

solutions,

we are

askedto find

a0 = 10
requirements

and ax =

41. Theseso-called
boundary

are

conditions

to that of satisfying the

in addition

satisfied

be

must

that

of the above examples there are infinitely


many
of the
one for each specificvalue
constants.
Suppose
a solution
of the recurrence relation in (b) for which

recurrence

relation.

listed
whether there is such a solution amongthosealready
10 = a0 =
form an = cx 2n + c2 5n. If we set n = 0 and n = 1, then
=
+ c2 5\302\260
cx 2\302\260
cx + c2 and 41 = ax = cx 21 + c2 51 = 2 cx + 5 c2. Thus, the
constants cx and c2 satisfy the equations
Let

us see

of the

10 = cx

41 =

and

c2

2 cx

5 c2.

Solving these two equations for cx and c2, respectively, we find that cx = 3
and c2 = 7. Thus, an = (3) 2n + (7) 5n is a solution of the recurrence
the boundary
relation
that
satisfies
conditions.
If we are given
a recurrence
the nth term of a
relation
describing
=
A
a
of
terms
as
function
the
sequence
{ar}~_0
a0, ax,..., an_x, what we
of n alone as in (b)
desire is a closed-form expression for an in terms
above. But even if we do not have such a closed-formexpressionthe
is
still
recurrencerelation
For we can
very useful in computation.

compute

an

O'n-iy

in

\342\200\242
\342\200\242
\302\253\\
ao;

points is given
neecl

so

ax, a0; then computean+l

of an_x,...,

terms
and

provided the

so on,

the computation

that

of the

value

can be

sequence

the

for
if

coefficients,

will not

there

or more
we

conditions.

the boundary

boundary conditions
solution. In general,
and
constant
then

of an,

terms

initiated. That is why

relation
The above exampleis a linearrecurrence

in

at one

linear

if there

of

of a0 and ax gave
recurrence
relation

value

degree
rise

than k boundary

are fewer

be a unique solution.But even

if

the 2
unique

2 and
to a

of degree

k has

conditions,

k values

of the

sequence are stipulatedthesemay not, as a rule, guarantee a unique


solution exceptin the case that the k values are consecutive.In other

words, if there is
anoAio+i>-

\342\200\242
are
\342\200\242>o^)+At_1

conditions.

the

some

given,

there

linear recurrencerelationof degreek


Usually

values

for a0,au..

^ak_x

that

such

n0

integer

then

will

be

a unique
these

satisfying
are

appropriate to calltheseinitialconditions.

given

and

the

values for
of the

solution
boundary

then it would

be

Section

269

Relations

Recurrence

3.3

Relation

The Fibonacci

In a book

1202

in

published

a problem

posed

Fibonacci,

a.d.

also known

of Pisa,

Leonardo

of determininghow

pairs

many

as

of rabbits

are

is the
born of one pair in one year. The problemposedby Fibonacci
that
there
is
one
of
rabbits, male
only
following. Initially, suppose
pair
and female,just born,and suppose,
month
each pair
that
further,
every
of
of rabbits that are over one month old produce a new pair of offspring
n
sexes.
Find
the
number
of
rabbits
12
and
after
after
months
opposite

months.

We start with one


have only one pair

reproduce.
has

pair

of newly

pair

we have

2 months

After

are

cannot

reproducedagain.

reproduce

4 months

After

we have

we still

month

one

After

not

2 pairs of

After 3 months we

now reproduced.

thoseborn just lastmonth


first pair

born rabbits.

of rabbits sincethey

yet mature

enough to

rabbits becausethe first

have

5 pairs

is continuingto reproduce,the second


pair

of rabbits

3 pairs

yet, but the


of

original pair has

rabbits
has

since

because
produced

the
a new

n > 0, let Fn
the third pair is still maturing.Foreach integer
the number
of pairs of rabbits alive
denote
at the
end of the nth month.
Here we mean that F0 = 1, the originalnumber of pairs of rabbits.Then
what
we have said is that F0 = 1 = Fu F2 = 2, F3 = 3, and F4 = 5.
Note that Fn is formed by starting with Fn_x pairs of rabbits alive last
month and adding the babiesthat can only come from the Fn_2 pairs alive
2 months ago. Thus, Fn = Fn_x + Fn_2 is the recurrencerelationand F0 =
Fx = 1 are the initial conditions.

pair, and

this

Using

the values

and

relation

for F2, F3, F4

already

computed

we

see that

^6 = F4

^6 = F5
Fn

F6

F8

F7

F9

_ F8

F10

Fn

=
=

F12 Thus,

12

after

continue

this

months

process

approach,even for
practicalespecially

if an

more

F9
Fw
^u

= 8,
+ F4 = 8 + 5 - 13,
+ F6 - 13 + 8 - 21,
+ F6 - 21'+ 13 = 34,
+ F7 = 34 + 21 = 55,
+ F8 = 55 + 34 = 89,
+ Fg = 89 + 55 = 144,
+ ^io - 144 + 89 - 233.
+

there

F3

+ 3

are 233

to compute
complicated

electronic

= 5

F36,

pairs of rabbits alive. We

and
so on. Indeed
relations
recurrence

computer is used.

could

this numerical
is quite

270

Chapter

Relations

3: Recurrence

solution of this
an explicit
=
is
called
the
+
Fn
Fn_x
Fn_2
and the numbers Fn generated
Fibonacci
relation
the
Fibonacci
relation
by
=
=
1
conditions
are
called
with
the
initial
the
Fibonacci
Fx
F0
and the
numbers
numbers
is the
{Fn}^o
Fibonacci
numbers
Fibonacci
arise
sequence.
quite naturally in many
we will show

Shortly

recurrencerelation.

obtain

to

hovy

relation

The

sequenceof Fibonacci

combinatorial
Quarterly,

a scientific journal, Fibonacci


involving the Fibonaccirelation

relation comes up again in the following

Fibonacci

The

is even
to research

primarily
numbers.

Fibonacci

and

There

settings.
devoted

stair-climbing

example.
can a person climb up a flight
(a) In how many
ways
can
one
at
most
person
stepat a time?
skip
climb n steps for a > 1.
can
the
Let an = the number of ways
person
Noteax = 1, and a2 = 2 (sinceonecan proceed one step at a time or take 2
steps in one stride).- Let us solve for an in terms of a fewer number of
steps. Supposethe persontakesonly 1 step on the first stride, there then
areleft n - 1 steps to climbfor which there are an_x ways to climbthem.
If, on the other hand, the person took 2 steps in the first stride, there are
n - 2 steps left for which
there
are an_2 ways to climb. Sincethereare
2
and
events are mutually
exclusive
we
these
these
only
possibilities
=
sum
rule
to
the
+
an_2.
apply
get an an_x
the
of
above
(b) Suppose we change the conditions
example and
assume that the personmay take either 1,2, or 3 steps in each stride.Find
of ways the person can climbn
a recurrence
for
the
number
relation

3.3.2.

Example

of

n steps

if the

steps.

= the

let an

Again

clear

that

an

number of ways to climb n steps. Then it should be


is determined by
where
each summand
+ an_2 4- a\342\200\236_3
or
3
stride
takes
1, 2,
steps.

= an_x

whether the first

Some Properties ofFibonacci

Numbers

Let
relation.
Fx

us
First

some immediate consequences of


for
to find a compact formula
attempt

examine
we

following table

Fn. The

\342\200\242
\342\200\242
\342\200\242
4-

shows that S0 -

the

the

Fibonacci

sum Sn = F0 4- 1; S1 = 2 -

F2

F8-l;S2-4-F4-l:
n

Fn

13

21

Sn

12

20

33

54

Section3.3

Recurrence

This

leads us

(1) The
that

to conjecturethat:
+ 1 Fibonaccinumbersis onelessthan
- 1.
. . . +
Fn - Fn+2

first n

the

of

sum

is,

271

Relations

F0 + Fl

+ F2

Fn+2y

is straightforward; it couldbe certifiedby mathematical


the following observation makes the proof immediate.
in an array as follows:
numbers

The proof

but

induction,
the

Write

^2

\342\200\224

Fx =

F3

\342\200\224

F2 =

F4

^o

F\\

F2

F3

= F5

Fn

= Fn+2

F3
FA

\342\200\224

Fn+i

add all of these equations,the


side causes all but -Fx and Fn+2
right-hand
- F, butF1 \342\200\242
\342\200\242
\342\200\242
44Fn - Fn+2
F2
If

we

telescopic

1.

we

Likewise

4- F2 +

(3) FI

+ FUFI+

Fx

F4

F2n = F2n+U

\342\200\242
\342\200\242
\342\200\242
4-

and

\342\200\242
\342\200\242
\342\200\242
+

F2R-FHFn+l.

If Fn
(General Solutionof the Fibonacci
Relation).
=
Fn
Fn_x 4- Fn_2 for n > 2, then thereare

3.3.1.

the Fibonacci relation


Cx and
C2 such that

satisfies
constants

,._Cl(l\302\261*)are completely

constants

the

where

Thus, F0 +

have:

(2) F0

Theorem

the

of

property

to vanish.

Proof. Let

F(X)

note

Then
{Fn}\342\200\236_0.

sequence

F(X)
XF(X)

X'FiX)

F0

- F0X
= F0X2

F,

2-_0

<.(i^)-.

determined by the initial

FnX\"

be the

generating

conditions.

function

for

that

X +

F2X* +

F3X3 +

\342\200\242
\342\200\242
\342\226\240
+

FnXn

\342\200\242
\342\226\240
\342\200\242

\342\200\242
\342\226\240
\342\226\240\342\226\240\342\226\2
\342\200\242
+ F,X2 + F2XZ
+ \342\200\242
+Fn_lXn+
\342\200\242
\342\200\242
\342\226\240
\342\226\240
\342\200\242
\342\200\242
+
+ Fn_2Xn
+ F1X3 +

272

Chapter

3: Recurrence Relations

Subtracting the

last 2 equationsfrom

- XF(X)

F(X)

X2

F(X)

+ (Fl -

- F0

first

the

gives:
+

F0)X

- F2
- Fn_x

- FJX3 +

(F3

(Fn

F0

(Fx

(F, - F0)X.

- F0

- F,

(F2

Fn_2)

- F0)X

F0)X2

\342\200\242
\342\200\242
\342\200\242

X\"+...

+ OX2+

OX3

\342\200\242
\342\200\242
\342\200\242

Thus,

fractions

the

and b - (1 -

F0+(Fl-F0)X

\"(1_(ui)X][1_(i^X]
on F0 and

conditions

initial

whatever

Fu the methodof partial

to give

applies

FiX)

Using

~ FQ)X

(Fl

i-x-x>

for

Thus,

+
F\302\260

F(.Y)

1-

(1 +

V5)X/2

for geometric

identities

- (1

- V5)X/2'

series we see that

1-

- aX

6X

\302\2433

for

each

= (1

+ V5)/2

\302\2433

\302\243(C1a\302\273+

In other

if

then,

V5)/2

C2b\X\302\273")

X;FnX'1

n-0

words,

n >

0.

Of courseif
can find

c,

we

D
are

TshH

given

the initial

1 =
conditions thatF0 \302\253

and

c\302\253-^h-

Fl9 then

we

Section3.3

One

case, the nth Fibonaccinumber

in this

so that,

is

of the
last observation is the relative
size
large n. Sinceb = (1 - V5)/2 is approximately

of this

consequence

numbers for

Fibonacci

273

Relations

Recurrence

-0.618,\"bn+1
gets

for

small

very

n so

large

that

is

Fn

by

approximated

for large n.

(1/V5)an+1

The Fibonacci

occur

numbers

in combinatorial

frequently

and in fact, there isan interestingproperty


on the
that the sum of the elements
lying
the left are Fibonaccinumbers.We illustrate

of Pascal's

upward from

running

diagonal

problems,
that states

triangle

as follows:

this

F0
F2

F,
FA

F5

F6

Figure 3-1

In particular,

C(n - 2,2)+
in

for n > 0 and


If we
4-

C(n

identity

- k,k)

=;

this we defineqn
k =

4-

C(n,0)

- 1,1)

C(n

where k = Ln/2J = the greatestinteger

C(n,0)

C(n,0)

4-

1,1) 4By Theorem

C(n

\342\200\242
\342\200\242
\342\200\242
4-

C(0,m).

qn-2

- C(n
4-

- 1,0)4-

C(n

+ C(n

- 1,1) 4-

\342\200\242
\342\200\242
\342\200\242
4-

C(n

3.3.1, we need only


1 = qx. But q0 =

Pascal's

identity,

- 2,1) 4-

\342\200\224
4-

...

C(0,n

4-

we can write
C(n - k - 1,^4-1)

m, then

r >

- k,k) 4-

C(n

C(n

- 3,1) 4-

C(m,r) = 0 if

\342\200\242
\342\200\242
\342\200\242
4-

show

qn satisfies

C(0,0) = 1 and

C(n

C(m,0)

4-

C(n

1,0) 4- 2,2)
4-

C(n

- 2)

C(n - 1,1)
- 1)
- \342\200\242
+ C(l,n
4- \342\200\242
- 1,1) 4- C(n - 2,2)

+ C(0,n) = 9\342\200\236.

the
qx

we see that for n > 2,


n - 1) 4- C(n - 2,0)
C(0,

= C(n - 1,0)4- [C(n - 2,1) 4- C(n - 2,0)] 4\342\200\242


.
+ C(n - 3,2)]+ \342\200\242
- 1) + C(0,n- 2)]
4- [C(0,n

- k,k)

J .

n/2

adopt the convention that

Fibonacci relation and that q0


C(1,0) 4- C(0,1) = 1. Then,using
Qn-i

Fn

rc/2.

To prove

qn

the

have

we

\342\200\242
\342\200\242
\342\200\242
4-

4-

[C(n

\342\200\242
\342\200\242
\342\200\242
4-

C(l,n

3,1)

- 1)

274

Chapter 3: RecurrenceRelations
Other

Models

Relation

Recurrence

in
Compound interest problemscanbe described

of recurrence

terms

relations.

3.3.3. Let P representthe principal


borrowed
from a
the
equal the interestrate per period, and let an represent
= (1 + r) an_t.
r an_l
due after n periods. Then an = an_1 \342\226\240+In
a0 = P, ax = (1 + r) P, a2 - (1 + r) ax = (1 + r)2 P, and soon,so

Example
bank, let r
amount
particular,
=

thatan

(1 +

r)nP.

a recurrence
Example 3.3.4. The numberof derangements
satisfy
relation. Recall that a derangement of {1,2,.. .,rc} is a permutation
(ii,i2,.. -yin) where ix ^ 1, i2 ^ 2, ..., and in / n. Let Dn = the number of
derangementsof {1,2,.. .,rc}. (We derived a formula for Dn in Section

2.8.)

These derangements can be partitionedinto two classes. Consider an


1 is in the iith position
either
arbitrary derangement (i'i,i2,...,in).Then
In
(that is, 1 and ix have changed places) or 1 is not in the i\\th position.
of those
form
a derangement
the first case, the remainingn - 2 numbers
numbers and sinceix can be chosen in (n - 1)ways, there are (n - l)Dn_2
of this kind. Now let us countthe derangements
where
1 is
derangements
in
n
1
Now
First
choose
not in the i^th position.
take
ix
ways.
any
of {2,3,.. .,rc}. We can form
a derangement
of {1,2,.. .,rc}as
derangement
follows:first replace ix in this derangement by 1 and thenput i\\ in front of
its natural
this derangement. Since originally ii did not occupy
position
This
will
now 1 is not in the i\\th position.
process
produce all
second kind. Thus, there are (n - 1)Dn_x
of these
derangements of the
= (n - 1)
and
hence
both
numbers
we
+
derangements,
by adding
Dn_x
get Dn
>
n
for
3.
1)
(n
Dn_2,

Example 3.3.5.

Find

recurrence

relation

for

an

the

number

of

ways to distribute eithera $1bill,a $2 bill, a $5 bill, or a $10


until a total of n dollars has been
dollarbill on successive
days
different

distributed.

We
on

the same

use

the

first

kind of analysis as in the stair-climbing


If,
example.

day, we distribute

dollarson the succeedingdays

a $1 bill, then we
and

there

are an_x

n - 1
distribute
to
that.
do
If, on
ways
there
remains
the
bill,

are

to

hand, the first days distribution was a $2


of
can be done
this
problem distributing n - 2 dollars;
on. Thus, we seethat an = an_x + an_2 4- an_5 + an_l0.

the

other

Let us

follow this

analysisin onemoreexample.

an_2

ways

and

so

Section

3.3.6. Supposethat

Example

prize away

each

further

Suppose

day.

school

to give a

decides

principal

that the

275

Relations

Recurrence

3.3

principal has 3 different

worth $1 each and 5 different


kinds
of prizes
kinds
of prizes
worth $4
each. Find a recurrencerelationfor an = the number of different ways to

distribute prizesworth

n dollars.

day, a $1prizeisgiven,

the first

the
could have been chosen
prize
of $1 prizes,and then there are n - 1
dollarsworth of
away later. Thusthereare 3 an_x ways
to do this. If, on the otherhand,
the
prize
given on the first day was a $4
are
5
choose
there
different
to
the prizeand an_A ways to
then
ways
prize
distribute the remaining prizes.Thus,an = 3 an_x + 5 an_4.

If, on

3 different kinds
to be given
prizes

of the

one

from

management,
Many problemsin the biological,

lead

sciences

social

and

to sequences which satisfy recurrencerelations.In some


cases
the
relation
for
lead, as in the examplesabove, to one recurrence
problems
which
the sequence
is a solution. In other casesthe principles
which
two
or more
economic forces or the interactionbetween
describe
as a system of linear recurrencerelations.
populations can
be formulated
For
of one population may affect
the growth
the growth
of another
example,
or unfavorably
because
they may compete
population either favorably
for
one may prey on the other, or eachpopulation
food,
may
prey on the
other, and so on.
An
will illustrate
the nature of this kind of problem.
example

Example3.3.7.

Lancaster

(The

engagein combat.Eacharmy

the endof each


the

denote
Thus

an_1

the

during

armies,respectively,beforecombat

number

the

represents

an

on the

battle

two

nth

day.

Abn_i

and

bn_x

effectivenessof the weapons


rewrite thesesothat we have
a =
a

system

unknowns.

very

an_x

we have

Thus

day.

an =

much

Abn_x

bn

=
of

Likewise

constants

reminiscent

bn

bn_x
on

These
Ban_v
the different

and

end of the nth day.


lost by the first army

of soldiers

Suppose it is known that the decreasein the


of soldiers
army is proportionalto the number

beginningof each

let

at the

armies

lost by the secondarmy

first
and
bn
an

in the

men
and

begins,

the

of men in

number

of soldiers

number

of men

the number of

b0 denote

a0 and

Let

day.

and second

Two armies
still in combatat

of Combat).

Equations
the number

counts

the

nth

number

in the
A

and

bn

day.
of soldiers in each
other army at the
B such

constants
armies. Of

-Ban_x

the

represents

that

an_x

measure the
course, we can

bn_u

of two-linear equationsin

two

276

Chapter

Exercises

3: Recurrence Relations

for Section 3.3

1. In

of

each

the

In each

given.

a recurrence relation and a function


are
following
is a solution
of the given
case, show that the function

recurrencerelation.
- an_x

= 0; an
- 1; an

C.

(a)

an

(b)

C.
an_x
=
= 2n + C.
2;
an
an
an_x
=
0; an = Cx + C22n.
an
3an_x + 2a\342\200\236_2
=
+
1; an = Cx + C22n - n.
2an_2
an
3an_x
=
+
7an_!
12an_2 0; an = CxSn + C24n.
an
- Q311 4- C24\" +
+
an
7an_x
12an_2 an

an

n +

(c)
(d)
(e)

(f)

1;

(g)

2. For eachof the


satifying

Of the

the initial

(a)

a0

= 5.

(b)

a0

- 6.

(c)

a0

- 6.

(d)
(e)

a0
a0

(f)

00

(g)

a0

ax

4,^

solutions given, find

the

1, we will

give

solution

unique

conditions.

5, ax

= 4,
=

in Exercise

relations

recurrence

conditions.

initial

1/6.

19/6,

= 6.

- 6.
= 6.
ax =

31/6.

3. (a) Considera 1x

n chessboard.
we can color each square
Suppose
= the
ofthe chessboard
red
or white.
Let
number
of
no 2 red squares are
ways of coloringthe chessboard which
that
an satisfies,
adjacent. Finda recurrence
either
red, white,
Suppose now that eachsquarecanbe
or blue. Let
be the number
of ways of coloringthe squares
no two adjacent squares are coloredred.
so that
a
either

an

in

relation

(b)

colored

bn

Find

recurrence

satisfied

relation

by

bn.

relation for the number of ways to arrange


flags
n
feet
tall using 4 types of flags: red flags 2 feet high,
flagpole
or white, blue,and yellow flags each 1 foot high.
5. Find a recurrence
relation
for
the
number
of ways to arrange
vehiclesin a row with n spaces if we are to park Volkswagens,
Hondas,
Buicks, Cadillacs, Continentals, Mack
Fiestas,
Toyotas,
buses.
Each of the Volkswagens, Hondas,
trucks,and Greyhound
one parking space; the Buicks,
Fiestas
and
requires
Toyotas,
2 spaces each, and the Mack
and
Continentals
Cadillacs,
require
buses require 4 spaceseach.
trucks
and Greyhound
4.

Find

a recurrence

on a

6.

Find
n

a recurrence

chips

two gold

using

relation
garnet,

for the

number of ways to makea pileof

gold, red, white,

chips are together.

and blue chipssuch

that

no

Section

7. Let

Pn

the

be

of permutations

number

of m letters taken n

letters

time with repetitions but no 3 consecutive


Derive a recurrence relation connectingPn, Pn_l9

recurrence relationfor

Find a

8. (a)

sequences with

no

(b) Repeat for rc-digit ternary


only 0,1, or 2 as digits).

9.

a recurrence

Find

(a)

that

sequences

for

Repeat

(b)

the

and

of n-digit

0,1,

binary

Fs.
(Ternary

sequences.

quaternary
sequences.
2, 3 for digits.

n-digit

Pn_2.

sequences use

relation for the number of rc-digit


have an even number of 0's.

sequencesuseonly

at

same.

the

being

number

of consecutive

triple

277

Relations

Recurrence

3.3

ternary

Quaternary

disk is divided into n sectors, like one


with the boundaries of all sectors meetingat a
in the
center of the disk. Suppose,further, that we have
10
point
which
we are required
different
to paint the
colored paints with
sectorson this disk in such a way that no adjacent sectorshave the
of ways to paint
color paint on them. Let an be the number
same
of the disk with
10 different
the n sectors
the
paints. Find a

10. Supposethat
cut

would

circular

a pie,

recurrencerelationsatisfiedby

11.

Ruin)

(Gambler's

Suppose we

an.

repeatedly bet $1on

the

toss

of a

coin; heads you win, tails I win. Each of us has a probability of 1/2
on each
of winning
flip of the coin. Suppose,further, that you have
that
$100 and I have $200 to begin with. Let Pn be th6 probability
you win all $300 when you have n dollars. Find a recurrence

relation

Pn.

involving

12.

(a)

Suppose

a coin

is flipped

until

2 heads

appear

for
a recurrence
relation
experimentstops.
experimentsthat end the nth flip or sooner.
(b) Repeat assuming the experiment
stops
Find

and then the


the number of

on

only

after

3 heads

appear.

stopsafter 4 heads appear.


assumingthe experiment
fund
is
investedin
a
market
16% a year,
$1,000
money
earning
how much money is in the accountafter n years?
A bacteriologist
wants the numberof bacteriain a certain solution
of the solution
one
tenth
The
S0.
bacteriologist proceedsas follows:
one
and
form
a
new
is
taken
diluted
to
solution
Sx; tenth of Sx is
S0
a new
taken and diluted to form
solution
S2; and so on. Let an
denote
the number
of bacteria in Sn. Supposeit is determinedthat
(c) Repeat,

13. If
14.

a4

15.

= 10.

Find a0.

and
starts
a chain letter by writing to 4 of his friends
denote
4
so
and
that
each
write
to
others
of
them
an
asking
chain
letter.
of letters written at the nth
the number
Find
and solve a recurrence relation involving
an. (Note:
a0 = 4.)
A

student

on.Let
stageofthe

278

Chapter

Relations

3: Recurrence

Theorem 3.3.1 find

16. From

(a)
(b)

F0

Fo

= 0,Fx

17. Let F0

FnFn+2/+(-ir.

relation

Fn

...

+(-irFn.
holds for all integers n > 2,explain
be translated
to the relation Fn+2 ='

+ Fn_2

Fn_x

can

relation

that

Fn+i 4- Fn for
(a) Combine

it.

prove

F2n_x.

+ F2 +

(c)

and

then

and

\342\200\242
\342\200\242
- +

F0-Fx

how

sequence).

= l.

(b)

all integers n. Also observe


these to give an expression

Fn+3 =
for Fn+3 in

that

Fn+2

Fn+1.

terms of Fn+l

Fn.

Express

Fn+4

(c) ExpressFn+3
19. (a) Find r, given

in

terms

in

terms

of Fn+l and
of Fn_x and

(a) Prove that

rc >

for

Fn_2

2.

5F317 +

3F316.
is, Ln =

That

sequence.

Ln_x

Ln_2

for

ways

of

\342\200\242
\342\200\242
+ L2 + \342\200\242
+ Ln = Ln+2 - 1.
\342\200\242
\342\200\242
for Lx + L3 + L5 + \342\200\242
4- L2n+l.

4- Lx

L0

a formula

Derive

Fn.

Fr = 2Fm 4- Fm.
Fs = 3F200 4- 2F199.

that

(b) Finds, given that


=
(c) Find t, given thatFe
20. Let L0,LU...bethe Lucas
n > 2 and L0 = 2, Lx = 1..

(b)

Fn

FlfF2y... be the Fibonacci sequence.By evaluating


following expressions for small values of rc, conjecture a

generalformula
(a) Fi + F3

(b)

C2 so that

1 =

of the

each

18: The

Cx and

constants

the

initial conditions.
following
- 2, Fx = 1 (the Lucas
the

satisfies

21.

Conjecture and prove formulas for the


\342\200\242
\342\200\242
4- L3n.
(a) L0 4- L3 4- L6 4- L9 4- \342\200\242
\342\200\242
\342\200\242
(b) Lx 4- L4 4- L7 4- \342\200\2424- L3n+1.
\342\200\242
\342\200\242
4- L3n+2.
(c) L2 4- L5 4- L8 4- \342\200\242

22.

Find

a recurrence
a selection

making

Lucas

sequence:

relation that countsthe


numbers

the

from

pair of consecutivenumbers

the

(counting

of

number

.,n without taking


set as a
empty

1,2,3,..

selection).

23.

integers1,2,3,..

-,n

no integer

that

such

in

its position

from

removed

the number of permutationsofthe


is more than one .place
the natural order.

relation for

a recurrence

Find

24. Find a recurrencerelationfor


sequences
0 (there

first

at

with

may

least

one

be no

0's).

the

1 and

25. Find a recurrencerelation for


sequences that

example,
the

in

the

thirteenth

the

pattern

of n-digit

quarternary

the

number

010 occurring

of

n-digit

at the nth

binary

digit. For

occurs at the fourth and the ninth


digits
1010000100011, but not at the eighthand
After
the pattern
occurs, scanning starts all over

pattern

sequence
digits.

have

number

the first 1 occurringbeforethe

010

Section

Recurrence

3.3

Relations

279

again to search for the second occurrence so that in 110101010101


the pattern occursat the fifth and ninth digits but not at the
seventhand eleventhdigits.
relation
26. Find a recurrence
for the number of n-digit ternary
have the pattern 012 occurring:
that
sequences
(a) for the first time at the end of the sequence.
for the second
time at the end of the sequence.
(b)
27. Find a recurrence
relation
for the number of n-digit binary
with an even number of 0's and an evennumber of l's.
sequences
a system of recurrence relationsfor the number
28. Find
of n-digit
binary sequences which:

(a) do

not

2 consecutive

contain

0's.

0's.
exactlyonepair of consecutive
Find a system of recurrence relationsfor the number
binary sequences that contain the pattern 010for the

(b) contain

29.

of n-digit
time at

first

the end.

30. Find a recurrence


relation
people

Selected Answers for

3.
4.

5.

an

(b)

bn =

the

number

of ways

to pair off

2n

Section3.3

- an_x

(a)

for

matches.

for tennis

an_2

2bn_x +

2bn_2

on the
Let an = the number of ways to arrange the flags
flagpole
n-feet tall. If the first flag is 1 foot high, then there are an_x ways to
the flags on the othern - 1 feet of the pole.Sincethereare
arrange
3 colors
for the first flag, in this case, there are
to
3an_x
ways
arrange the pole. In casethe first flag is red, and hence, 2 feet high,
2 feet
there are an_2 ways to arrange the flags on the other n \342\200\224
of
the pole. Thus, an = 3an_! + an_2.
an

4an_i

6. If the first

+ 3an_2

4- 2an_4.

there are 4 colors for the second


chip and
chip
2 chips.
There are,
then an_2 ways
a pile of the other n \342\200\224
on the other hand, 4 colors for the first chip to be otherthan a gold
a pile of the other n - 1 chips.
to make
one, and then an_x ways
Thus an = 4an_! + 4an_2.
7. The first 2 letters may be the same or different; if the same, the
n 2 letters must be a permutationof the specified
remaining
Hence
where
the
third
letter cannot be like the first 2 letters.
type
two
we may append to a \"good\"(n - 2)-permutation
repeated
different from the first letter of the (n - 2)-permutation.
fetters
from
can
be chosen
letter
Similarly for the other case,the second
m - 1otherlettersand the other n - 1 letterscan be arranged
Pn_x
is gold
to make

280

Chapter 3: Recurrence

Relations

relation is

the recurrence

Hence

ways.

Pn

(m

1)

[Pn_x

Pn-2].

If the first

9. (a)

digit is not 0,then


If the

sequences.

ternary

first digit

- 1)-digitternary
number of 0's. Sincethereare
of (n

number

are

there

is 0, thenwe
total

must

that

sequences
3n-1

- l)-digit such

2an_x (n

(n

an odd

- l)-digit ternary

an_x with an even number of 0's, thereare


an odd number of 0's. Hence there are 3n_1 an even
numbers
of 0's and that
n-digit sequences with
- an_x + 3n_1.
with
0. Thus,
+ 3n_1 - an_x
an = 2an_x
and

sequences

the

count

have

an_x with

3n_1

an_x

start

(b) Herean = 2an_1 + 4n-1.


Number the n sectors. Then eithersectors1 and 3*have
the same
color or not. In the first case we could remove sector number 2 and
imaginesectors1and 3 coalesced to leave a disk with n - 2 sectors
in
this
case, the sector
painted according to the rules.Thus,
number 2 could be painted 9 different
so that
the total
colors,
in this way is 9an_2.In the
number of ways to paint the n sectors
if we remove
othercasesince sectors 1 and 3 are colored differently
n - 1 sectors of a kind we are
sector 2 we are left with
considering.
Since sector 2 can have
8 different
colors for it, the total
only
number of ways to color disks of this type is 8an_x. Hence the

10.

is an

relation

recurrence

8an_x

+ 9an_2-

ii. pn =

12.
17.

y2pnTl4-i/2pn+1.
= an_x + (n - 1).
=
(b)
an
an_x + C(n - 1,2).
(c) an = an_x + C(n - 1,3).
(a)

an

(a)

F2n

(b)

(-!)\302\273*;_!+

(c)

Fn_xFn+3

1.
1.

+ 3.

19. (a) r = 103.


t =

(c)

20. (b)
3.4

SOLVING

321.

L2n+2

2.

RELATIONS BY SUBSTITUTION AND

RECURRENCE
FUNCTIONS

GENERATING

We shall

and the
1.

consider four

next two

substitution

methods of Solving

sections:

(also called

2. generatingfunctions,
3.

characteristic

4. undetermined

roots,

iteration),

and

coefficients.

recurrence

relations

in this

Section

3.4

281

Relations

Recurrence

Solving

In the substitution methodthe recurrence


relation
for
an is used
in
for
a
for
to
solve
terms
of
n.
We desire
an
repeatedly
general
expression
no other
that this expressioninvolve
terms of the sequence except those
conditions.

boundary

by

given

of this methodarebestdescribed

The mechanics

We used

this methodin

Example

in the nextthreeexamples.
1 by

of examples.

terms

in

the method

also illustrate

recurrence relation an

Solve the

3.4.1.

Example

n>

Let us

3.3.4.

an_x

+ f(n)

for

substitution.

<*i
a2

- a0
-

+ /(l)

ax +

a3 = a2

<*n

/(2)

/(3)

= (a0

- a0

+ /(I)

= a0

+ H

+ /(2)

4- /(I))

(a0

+ /(I)

+ /(2)

+ /(2)) 4-

/(3)

\342\200\242
\342\200\242
\342\200\242
+

4-

/(n)

Thus,

the sum

is just
a\342\200\236

More
ra

>

/(ft).

of the

/ (k)'splus

a0.

if c is a constant then we
same
the
way:

generally,

1 in

ax

a2 -

=
a3 =

ca0

+ /(l)

cch

+
+

c2a0

ca2

- c(ca0

/(2)

= c(c2a0

c3a0

+ c2/(D

ca^

+ f(n)

a\342\200\236

+
=

/(\302\273

cno0

solve

/ (n)

+
a\342\200\236
ca\342\200\236_!

+ /(D) + /(2)

+ /(2)

c/(l)
/(3)

can

+ c/(l)

+ c/(2)

+ /(2)) + /(3)

+ /(3)

- c^\"-1^ + c\"-2/(D

1)) +

+ cn-V(l)

\342\200\242
\342\200\242
\342\200\242
+ c/(\302\273-

2)

/(\302\273)

+ c\"-2/(2) +

\342\200\242
\342\200\242
\342\200\242
+

or

a\342\200\236-c\"ao

iy-*/(\302\253.

c/(n

- I)

/(\302\273).

for

282

Chapter 3: RecurrenceRelations
3.4.2.

Example

Towers of Hanoi Problem). Thereare3 pegs


increasing diameter on one peg,with the largest

(The

disks of

n circular

and

on the bottom. These disks areto betransferred


at a time onto
one
that at no time is one allowed
another peg with the provision
to put
a
smaller
diameter.
The problem is to determine
larger disk on one with
disk

the

of

number

transfer.

for the

moves

=
Let an be the number of moves required to transfer n disks.Clearly
a0
=
=
3. Let us find a recurrence relation that an satifies.
To
1, and a2
0, ax
n disks to another pegwe must
first transfer
the top n - 1disks
transfer
disk to the vacant peg, and then transfer
the
to a peg,transfer
the
largest
n - 1 disks to the peg which
now
contains
the largest peg. Thus an =
2 an_i + 1 for n > 1.
k in the formula of Example
Now
we use c = 2 and / (k) = 1 for
each
\342\200\242
\342\200\242
3.4.1.Then an = 2n a0 + 2n_1 4-( \342\200\242
since a0 = 0, we
4- 2* + 2 -t- 1. But
\342\200\242
\342\200\242
\342\200\242
2n~1 4for the sum of
have
4- 22 4- 2 4- 1, and using the formula
an
we
find
that
terms in a geometricprogression,

Example3.4.3.
A sequence

l-2n

\342\200\224\342\200\224
=

(Analysis

of

2n

is the

\342\200\242
Then
\342\200\242\342\200\242<&\342\200\236.
bx

way

to merge

sorted

is

order,

to

mean

of

the

heads

sorted list.

into one

them

combine

lists, LIST 1 and

two sorted

if the numbers are


is, if bx < b2 < b3 <
tail. By
and
bn is the

that

the sequence

head of

one
procedure: Since the smaller

smallestof

Algorithm).

Mergesort

ndndecreasing

merging two sorted lists we


One

the

of numbers (blfb2,...,bn)

arranged accordingto the

n > 0.

- 1 for

an =

2, is the

LIST

following

lists must bethe

of the two

lists, we can removethis number


in the merged list. We
number
shall label this new list as LIST. Now we can comparethe two heads of
and
the smaller one of the
the two lists of the remainingnumbers
place
as the second
of
two
number in LIST. This processis repeateduntil
one
list is
the lists is empty, at which time the remainder
of the nonempty
to the tail of
appended (concatenated is the usual computerterminology)
LIST.
from

tjie

list

all

the

it is in

in the two

numbers

and place it

as the first

Since each comparisonof an element


results in an element beingremoved

of LIST

LIST 2

added to LIST, therecan


1 afrd

LIST

LIST 2 have

no comparisoncan be made

be,

in

fact,

at most

m + k

no

be
m

and
when

\342\200\224
I

more

than

k numbers
either

comparisons.

with

an

element

of these

one

m +

k comparisonswhere

Moreover, since
lists is empty, therecan
if n is the total number

respectively.
of the
Thus,

of

lists and

from

Section

3.4

of numbersin the two

are at

most n -

283

Relations

to

comparisons

sorted lists.

the two

merge

Recurrence

there

then

lists,

Solving

Mergesortis a sortingalgorithm

an unsorted input list into


and then mergesthe resulting
lists into a single sorted list. This final
sorted
sorted
list is the output of
of Mergesort is given
in
this algorithm.(A more formal description
two

sorts

\"halves\",

that

splits

half recursively,

each

4.)

Chapter

and
of the subdivisions
is shown
the input list {5,4,0,9,3,2,8,6,23,21}

An illustration

diagram exhibitsthe subdivision

the

lists

of

merging

of

successively

the

merges necessary in sorting


Fig. 3-2. The top half of the

the
in

the bottom

lists;

half illustrates

above.

as described

can be
sorting an input list by Mergesort
maximum
number
of
t
hat
the
comparisons are
by counting
us
the
To
do
this
let
make
the
that
assumption
simplifying
necessary.
of 2. Then
an upper bound an on
number n of items to be sortedisa power
the
number
of comparisons required to sort n items is given
the
by
of the

estimate

An

cost of

obtained

| 2,8,6,23,21

5,4,0,9,3

5, 4,0 | 9, 3

/
5

2 | 8

\\
4

\\/

\\
0,3,4,

23

2,8

23

\\/
21,23

\\/

2,6,8,

5,9

0, 2,3,4,5,6,8,9,
Figure

21

21

2,6,8

3,9

4,5

\\

\\/

\\/

\\/
0

21

4,5

\\

\\/

23

\\

/.\\

\\
4

\\

2, 8 | 6

9 | 3

| 0

6 | 23,21

\\

/
4

5,

2, 8,

3-2

21, 23

21,23

284

Chapter 3: RecurrenceRelations
relation:

recurrence

an =
The

first of

these

2 an/2
two

\342\200\224
for

4- (n

1)

equations

requiredtosort
comparisons

of

number
number

second

comparisons,

to

required

that the

halves.
The
(n - 1), requiredto mergethe
comparisons,
a
not
fact
that
element
does
the
equation expresses
sorting single

any

We can
repeatedly

comparisons.

solve this recurrencerelation for


the basic relation to get:
using

=
=

22an/4

22an/4 + n
22[2an/8

that

we

have

2an/2 = n

2an/2

22an/4
-

22an/4

sides

and

an

that

= kn- (1 +
- kn - (2k -

\342\200\242=
kn

(n

(n)

nlog2

by

- 2

n-22,

- n

2kan/2>

- 2
-

22

- n

2k~\\

+ n-24-n-22+-\302\253-+n-

n-l

sequence of equations,cancelling
appropriate
=
at = 0, we have
an/2*

of this

noting

k >

- 1

23an/8 = n

2*~1a\342\200\236/2*-1

both

2k where

sequence of equations:

the following

an

+ n/4-l]

= 23an/8+

etc.,so

2an/2

summands,

number of
sum of the
the
most,
sort both halves and the

the fact
expresses
must
list
be, at
large

2an/2f

= 0

of

require

Summjng

2, where ax

n >

2...

2*-1)

1)

- 1)
-

(n

- 1).

2k~1

Section

3.4

Relations

Divide-and-Conquer

The

relation.

an

and usually

so-called\"divide-

arise in the analysis

of

take the form:

(n) where c and d are constants

+ /

can/d

special case of a

these relations

Frequently

algorithms

computer

is a

relation

recurrence

above

and-conquer\"

recursive

285

Relations

Recurrence

Solving

/ (n)

and

is some function

n.

of

can be solved
by substituting
method of solution for

Usually these relations


will discuss another
We
in Section 3.6.
relations

how
to solve
that approach

showed

We

and

divide-and-conquer

the Fibonacci relation


works for arbitrary
linear

this method in detailwe

To describe

n.

with

generating

recurrence

coefficients.

constant

with

relations

of d for

Functions

Solutions By Generating
functions

a power

the following

to understand

need

basic property.

The shifting propertiesof generating

If

functions.

2\302\243_0
an

the

Xn

then XA(X)
generates
(0,0,a0,ai,a2,...),and, in
where there are k zeros

the sequence (a0faua2f...),


X2 A(X) generates

generates

(0,a0,a!,a2,...);

sequence

general

.,0,a0,a!,a2,...)

(0,0,..

generates

XkA(X)

A(X)

beforea0.

function for the sequence(a0falf...),


amounts to shifting the sequenceoneplace
Xk
and
a zero in front. Multiplying A(X)
by
right
inserting
to shifting the sequencek positions
to the right and inserting k

Thus,
then

if

A(X)

multiplying

to

the

amounts

is the

generating

A(X)

by X

zerosin front.

This processis

formal

power

described

series

Xk

by

- X*

A(X)

an
\302\243

Xn

last expressionreplacen

expression
%7-k
bx

ar-k
. .

Xr
. =

bk = a0,

bk_lf

the nth term in


replacinganby

the new

bk+l

we

know

that is, the

sequence

that

r, and

then n = r - k and the


form the expression

In this

Xr.

sequence{br}\"_0

al9 and in general br


from
is obtained

and by 0 if n

an_k \\in>k

Forinstance,

(1,1,1,...),

k by

2^0 anXn+k becomes 2)\"_fe ar_k


that it generates the
signifies

Xn+k.

an
\302\243

n-0

n-0

In the

variable in the

in the dummy

a change

as follows:

expressions

1/(1

{aJn-o

where

\\ir>k.

the old

generates
an

where

ar_k

< k.

- X) = 2\302\243_0
Xn

sequence

= 1

b0 =
Thus,

0 =

sequenceby
the sequence

for each n

> 0.

286

Chapter

Relations

3: Recurrence

Thus,

and

generates (0,1,1,1,...),

C(n
\302\243

77\342\200\224^

the sequence

generates

n-0

-AJ

r-2

Similarly,

(0,0,1,1,1,...).

generates

\342\200\224

4- l,n)

X\"

+ l)Xrt

(n
\302\243

so that
\342\200\242)
(1,2,3,4,-\342\200\242

I1

1 to

oo,

r-1

n-0

Note that the expression


(0,1,2,3,4...).
the coefficient of X\302\260
is 0 because
the sum is taken
the form of the coefficients would give
the
same

that

rXr
describes
2\"\342\200\236,
r

A)

the sequence

generates
from

\342\200\224

but

{r}~m0

is allowed to equal zero;hence


as SPLi rlt' and as 2\342\204\242ta0
and
X/(l - X)2 two ways:
rXr,
is zero.
mean that the coefficientof X\302\260
Likewise,
even

conclusion

if r

- L

*L,

(n

1) *n+?

(r
\302\243

we

both

can

write

expressions

1) Xr

the sequence (0,0,1,2,3,4,...),that


the
is,
sequence
{br}~_0i
- 1 if r > 2, but 0 = b0 = bt. Since the expression br = r - 1
- 1) Xr also
(r
equals zero when r = 1, it happens that X2/(l - X)2 = \302\243~_2
can be written
as 1%^ (r
1) Xr.
generates
where br

= r

Followingthis lineofthought
(1 ~

generates

X)

we see

further,

\342\200\236_0

that

\342\200\236_0

the sequence

\\{n

2) (n

+ 1)

/l
\\

2-3

\342\200\242
2

'

'

\\
3-4
2 \"'T

Section3.4
2/(1 -

and, therefore,

- (1

4- l)Lo

2,2

2X

n(1

equals

4,...).

in +

when r = 0, we

1)X\"+1

X)3

that

see

\"
=

write

l)(r)X'

(r
\302\243
\302\243l

2*7(1 - X)3 generates{(r+

(r)

Now since br

4,...).

we can

+ 1)

(r
\302\243
\302\2437

\342\200\242

-3,3

2,2

(n

2)

\302\243(r

Xp

- (r

l)(r)

1)X'

l)(r)X',

Likewise

l)r};_0.

2X

= \302\243>

2)(i\302\273+

tn=0

(1-X)3

DXn+2

\302\243(r)(r

1)X'

r-2

(r)(r
\302\243
r\302\253G

\342\200\242
\342\226\240
and the last sum
(0,0,1 \342\200\242
2,2
4,...),
3,3
sequence
- 1) is 0 when r =
oo
0 to
because the coefficient
r(r
combine
these
results to discover generating functions

the

generates
from
can

We

other

2) (n +
\342\200\242

(0,1

sequence

2X

taken

l)Xn generates{(n4-

then

But

\302\243J

(1 so that

(n +

+ 2)

(n
2\302\243_0

3,3

yT5
- A)

the

generates

X)3

\342\200\242
\342\200\242
\342\200\242

287

Relations

Recurrence

Solving

X
X(l + X)
(1 X)2 (1 - X)3

2X
- X)3

(1

the

No doubt

2)(n +

{(r 4- l)(r)

sequence

the readercanverify

3)(n

4-

6X

V~

- X)4

to

2)(r

Yi (n

6/(J

n\\/
.
3)(\302\273+

- X)4generates{(n
'
,
n\\/

2)(\302\273+

(r
\302\243

+ 2)(r

+ l)(r)X'

(r
\302\243

+ 2)(r

+ l)(r)X'

r-0

generates {(r+

4- l)(r)t.0;

= (0,1,4,9,...).

*\342\200\242

DlLo;

(1

{r2fc.o

Ho

4- l)/6}~_0;

2)(n

- tln *3)<\":2><n+\"
o

na0

{(n +

r}~_0

that

t cc+w

- A)
-i^.
{I
generates

for

For instance,

sequences.

generates

can be

0,1.

and

iwn+1
1)X\"

4- 3)(n

288

Chapter3: Recurrence

Relations

6X2

(1 -

]T (n
n-0

X)4

(r
\302\243
r-2

{(r +

generates

Since(r
2)(r + 1) -

3)(r

l)(r)(r

l)Xn+2

- l)Xr = f] (r + l)(r)(r r-0

- l)t_0.
+ 2)(r + 1) - r3 + 6r2 + llr + 6 then r3
llr - 6 so that {r3}^0
is generated
by
X

X)

manner we
so on.

a similar

{r4)7-o>

6r2

+ 2)(n +

1)X'

l)(r)(r

6(X)(1 +
(1-X)3

6
(1-X)4
In

+ 3)(n

(1-X)2
can find

generating

(r +

6
XQ. + 4X + X2)
(1-X)~
(1-X)4
functions

for the

3)(r +

\"

sequences

and

{r5)7-o>

Now there

A(X) = 2\302\243_0an

are other shifting


Xn

properties

of

generating

.)>then A(X)

functions.
=

If

2\302\243_x
an Xn

a0
(a0,ai,a2,..
generates
\342\200\224 \342\200\224 X
= 2\342\200\236_2
Xn
^(X)
(0 ,a1,a2v \342\200\242
\342\200\242)>
^n
(Xi
clq
generates
\342\200\242
\342\200\242
\342\200\242
in
X
and,
ax
(0,0,a2,a3,...);
ak_x Xk~l =
general, A(X) a0
where there are k zerosbefore
(0,0,.. .,0,ak,ak+l...),
2\302\243_fc
anXn
generates

generates

ak.

to the left. For


by powers of X shifts the sequence
=
Xn~l
the sequence
(A(X)
instance,
a0)/X
S^ an
generates
(aua2,a3y...); (A(X)
a0
axX)/X2
(a2,a3,a4,...); and, in
generates
...
k
>i
for
1, (A(X)
a0
axX
ak_iXk~1)/Xk
general,
generates
But

then

dividing

this shifting
in the
property can be describedby a change
in
variable
the
If
n
1 by r,
series
we
dummy
power
expressions.
replace
=
Xn~l
then
becomes
which
(A(X)
a0)/X 2~=1 an
2\"_0 Gr+i Xr,
signifies
that the coefficient
an in the original
sequence is replacedby an+u that is,
to the left.
the sequence has been shifted
one
place
Likewise replace n - k by r, and the expression (A(X) - a0 - 2\302\243_fc
becomes
anXn~*
axX - ... - ak_1Xk~1)/Xk
2;.0 \302\253r+^r which
In
the
the
other
term
words,
sequence (ak,ak+uak+2,...).
an in
generates
the original sequenceis replacedby an+k for each n, indicating that the
=
A(X)
sequencehas been shifted k places to the left. Thus,for instance,
so
that
+
1/(1
X)2 generates(1,2,3,.
..)-{* lfe.0
X)2 1]/X
[1/(1
- {n + 2fe=0, and [1/(1 - X)2
1 - 2X]/X2
(2,3,4,...)
generates
generates (3,4,5,...)= {n + 3}~=0 similarly 2/(1 - X)3 generates{(n + 2)
(n + l))LoSothat
[2/(1 - X)3 - 2]/X generates [(n + 3)(n + 2)fc.0.
Let us combine
results
on the shifting property of generating
these
with
functions
the
different
identities for geometricseriesand
together
series
to obtain generating functions for a few familiar
other
sequences
(see Table 3-1).
Again

Section

Solving Recurrence Relations

3.4

Table3-1. Table

of Generating

Sequence

Functions

Generating

Function

MX)

(1)

C(k,n)

(2)

(1 +

*)*

.1

1-

(3)

a\"

(4)

(-1)\"

(5)

(-l)V-

(6)

kis a

(7)

C{k

(8)

C(k

- 1+

1 - aX
1

1
1

(-a)\"

C(k - 1 +

1 + a*

n, n)

fixed

positive

1 +

int\302\253

1
(1 -xf

n,

n))an

(1

n,ri)(-af

(1

1
+

aXf
1

(9)

(1 -

*)2

(10)

(\302\2531)

(n +

(12)

(\302\273+1)(\302\273)

(1-xf
2
+
2)(\302\253

1)

(1- Xf
2X
(1Xf

X(

(13)

+ X)

n*

(14)

(n+

(15)

(n

2)(/J+

3)(n+
+

(16)

/\302\2733

(17)

(n

2)(a

1)(#\302\273)

1)

(1

- xf

(1

-xf

(1

X(1 +

ex

-x)4
AX

X2)

(1 -xf
1
1)a\"

(1 -

aX)2

aX

(18)

na\"

(19)

ifa\"

(20)

ifa\"

(1 -

aX)2
1 + aX)

(1 -aXf
(aX)(\\ + 4aX +
(1

-\302\253*7

a2X2)

289

290

Chapter

3: Recurrence Relations

In solving recurrence relationsby


these shifting properties so frequently

expressions for

IfA(X)

we

that

some

list

equivalent

reference.

ready

of Equivalent

Table

we encounter

functions

generating

Expressions

for

Functions

Generating

\302\243a\342\200\236Xn,then

n-0

= A(X)

X\"
a\342\200\236
\302\243
n-k

an_x
\302\243
n-k

= X(A(X)

Xn

Xn
a\342\200\236_2
\302\243
n-fc

an_3X\"
\302\243
n-fe

oo

Ok.xX*\"1,

OxX

ak_2X\"-\\

-a0-axX

- X2(A(X)

= X3(A(X)

oo

a0

a,_3X*-3),

o,X

a, X

- a*_4X*\"4),

\342\200\242
, .

\\

= X*(A(X)).

X>n_*Xn

n-k
to
solve
linear
recurrence
Now we are prepared to describehow
coefficients
the
use
of
relations with
constant
by
generating functions.

The processisbest

illustrated

Solve the

3.4.4.

Example

an

the

number

We

by

steps

7 an_x

of the

recurrencerelation

+ 10 an_2

Next

multiply

from 2 to

0 for

n >

2.

each term in

the recurrencerelationby

Xn

and

sum

oo:

anX\"
\302\243

n-2

3. Replace

procedure.

1. LetA(X) = 2Z_0anXn.
2.

examples.

- 7

f] c.xX\"
n-2

each infinite

sum

equivalentexpressions:

by

+ 10Y. <*n-2Xn

0-

n-2

an

expression

from

the

table of

Section

3.4

Solving

a,X] -

[A(X) -a0-

1X[A(X)

Relations

Recurrence

10X2[A(X)] =

a0] +

291

0.

4. Thensimplify:
+ 10X2) -

- IX

A(X)(1

a0

- 7a0X

axX

or
{
5.

i _

A(X)

Decompose

Cx and

where

>

6. Express

A(X)

7X +

as a

10X2

\"

(1 - 2X)(1-

5X)*

sum of partial fractions:

C2 are constants, as yet undetermined.


as a sum of familiar series:

as the
7. Expressa\342\200\236

of Xn in A(X)

coefficient

otherseries:

an

Cx2n

the
the only possiblesolutionsto
(Thus, we seethat

+ C25n.

in Example

solutions

suggested

this

and in the sum of the

recurrence

3.3.1(b) were

relation).

the constants Cx and C2 are uniquely determined once values


and ax are given. For example,if a0 = 10 and ax = 41, we may
the form of the general solution an = Cx2n + C25n, and let n = 0

8. Now
for

use

a0

and n = 1to obtain

0x4-02

the

= 10

two

equations

and

2CX

5C2

- 41,

= 3 and C2 = 7. Thus,in this


which determine the values
case the
Cx
= (3) 2n + (7) 5n.
solution
of
the
recurrence
relationis
an
unique

292

Chapter

Relations

3: Recurrence

Solve the recurrencerelationan

3.4.5.

Example
=
24a\342\200\236_3 0

for

As above let A(X)


to

oo

since

n > 3.

anXn

Then

o,nXn.
2~\342\200\2360

9 f]

by Xn and

multiply

+ 26 f]

an^Xn

the infinite

an_2X\302\273

24

sum from

sums by

a,X -

expressions:

equivalent

a2X2)

- 0.

an_3X\"
\302\243

n-3

n-3

n-3

- o0 -

(A(X)

+ 26an_2

9an_x

Thus,

n-3

Replace

n > 3.

- o0 - a,X)

9X(A(X)
+

- a0)

26X2(A(X)

- 24X3A(X)= 0.

Simplify:

- 9X

A(X)(1

+ 26X2

24X3)

a0 +

GlX +

a2X2

- 9aoX -

9aiX2

26aoX2

or

A(y.
AK*}-

Now

- 9X

are constants

+
_ a0

(ai -

9a0)X

- 9a t

(a2

1 - 9X + 26X2 -

26a0)X2

24X3

+ 26X2 - 24X3 = (1 - 2X)(1 - 3X)(1such that


CUC2,C3
*

A(X)

L/i

=
1

- ^2X

- C, \302\2432nX\"

L/o

+ C2

(ci2n
\302\243

f]

that

there

3\"X\"

- 4X
+

n-0

+ c23n

so

v^a

1-

r\342\200\224^7
3X

n\302\2730

4X)

C3

4nX\"

\302\243

n-0

+ C34n)Xn.

Thus, an = Cx2n + C23\" 4- C34nand Cu C2, and C3 can be determined once


the initial conditionsfor a0, alf and a2 are specified.
are a0 =\302\273
For illustrationlet us assume that the initialconditions
0, ax =
=
1, and a2 10.Then

Section

293

Solving Recurrence Relations

3.4

X + X2

MX) = (1 -

2X)(1

- 3X)(1 -

and C^l

4X)

3X)

Example 3.4.6.
Here we
JT

n-3

Solve

1/2,1/3,1/4,

case, an
- 8an_t

an

if A(X)

that

see

(1 -

C2(l

- X + X2.LetX =
in this
-4, and C3- 5/2.Thus,
-

(1

n-3

- 3/2 (2\")

axX

(3\") +

-4
-

5/2 (4n).
for n

21a\342\200\236_2 18a\342\200\236_3 0

> 3.

= 2^_0a\342\200\236Xn,
then
-

18 f]

- 0,

an_3Xn

n-3

n=3

- a0

(A(X)

- 4X) + C3(l - 2X)


find that C, - 3/2,C2

and

- 4X)

(1

3X)

2X)(1

- 8 Y. an-iXn+ 21\302\243an_2X\"

anXn

C3

C2

C\\

- 2X)

(1

- 4X)

3X)(1

- 8X(A(X)
+ 21X2(A(X) -

a2X2)

a0

a0)

axX)
18X3A(X)

- 0,

or
,,\342\200\236.
\"
^

a0

since

But

are

- 8X

constants

C3/(l -

or an =
We

linear

Then

Cx2n

(ai

+ 21X2 -

CuC2fC3
3X)2.

C23n

- 8a0)X + (a2 - 8ax + 21a0)X2


1 - 8X + 21X2 - 18X3

18X3- (1-

2X)(1

= Cx/(1 A(X)
2^0 [Cx2n + C23n
+ C3(n + l)3n.
such

that

A(X)

see that there


- 3X) +
C2/(l

3X)2 we
+

2X)

+ l,M)]Xn

C33nC(n

about this methodof solving


For onething, in each

to discover some things


beginning
relations
recurrence
by generating functions.

are

of the Examples 3.4.4-3.4.6 A(X) can be written


coefficients of the denominator Q(X)has a definite

where

P(X)/Q(X)

the

with the
relationship
of
coefficients of the recurrencerelation.Moreover
note
the relationship
in the recurrence relation.
the powers of X in Q(X)with the subscripts
For instance,in Examples
the relations
+
3.4.4-3.4.6,
an - lan_x
=
=
0
and
+
+
21an_2
0, an
an
8an_x
10an_2
9an_x
26an_2
24an_3
= 0
the
denominator
Q(X)
18an_3
gave rise to A(X) = P(X)/Q(X),where
1 - 8X +
was equal to 1 - 7X + 10X2, 1 - 9X + 26X2 - 24X3,
and

21X2 - 18X3,respectively.
Let

us note

the form

(ax - 7a0)X,a0

4-

(ax

of P(X) in eachof theseexamples;


+ (a2 - 9ax + 26a0)X2,

- 9a0)X

they

and

are

a0 +

a0 + (ax

294

Chapter

Relations

3: Recurrence

8a0)X

-\\-

+ 21a0)X2, respectively.Here,too,the
relation and the values
etc., determine
a09au

- 8ax

(a2

the recurrence

Solvean

3.4.7.

Example

12an_2 -

Qan_x +

P(X).

8an_3

of

coefficients

0 by

functions.
generating

expressed above, we expect that

the ideas

Following

P(X)

MX)-La'X'-Q(X)
-

+ (a2

6a0)X

+ (\302\253i
\302\253o

- 6X

+' 7:

- 2X

;\342\200\224^

(1

= C, \302\2432\"X\"

+ C2

+ C2(n

C,2\"

n-0

- ^2X)2

(1

f]

(\"

+
X)

+ 1)2\" +

12a0)X2

'

- 8X3

12X2

But since 1 - 6X + 12X2 - 8X3 = (1 conclude that there are constants


Cl9C2,C3
A(X)

- 6at +
we

2X)3

use

that

+ C3

]T (ra

to

fractions

partial

such

2X)3
2\"X\"

+ 1]

(\"

2)j\"

C3

2)

2nX\"

2\"| Xn,

so that

\302\253.

Cl2\"

+ C2(n

+ 1)2\" +

(\"

+ 1}

2)i\"

C3

T.

Functions
Outline of the MethodofGenerating

1.

the

in these examples holds in


of generating functions as follows.

discovered

have

we

What

outline

method

relation

recurrence

A linear

given, which^without
form:

an

constants,

.
+
+ b !<*\342\200\236_!

ck #

2. LetA(X)

0, and n >

with

coefficients

constant

of generality,

loss

ckan_k

we assume
= 0,

general.Let
of degree

us

k is

has the following

where cuc2,.. ,fck

are

k.

each term of the recurrence


relation
infinite
sums
all
Xn,
by
by equivalent
replace
is transformed
relation
into an
expressions.Thereby,the recurrence
=
=
where
+
P(X)
a0
(ax +
/algebraic equation: A(X) P(X)/Q(X),
=

sum

anX
2\302\243_0

from

n, multiply

k to

oo, and

Section3.4
cxaQ)X +

295

Relations

Recurrence

Solving

\342\200\242
\342\200\242
\342\200\242
\342\200\242
4- \342\200\242
4- (ak_x
+ exak_2 4- \342\200\242
4=
.
.
.
1
4+
+
+
ck_xaQ)Xk~l
Q(X)
cxX
c2X2
c*X\\
to get the
back
Then,
A(X)
knowing P(X) and Q(X), transform
coefficients an (call this performing
the inverse transformation).
This canbeaccomplished
in one of several ways. We shall describe

(a2 4-

+ c2a0)X2

cxax

and

3.

two.

use partial

say Q(X) = (1 fractions and the different

functions to

get A(X) as a sumof familiar

If the factorization

of

\342\200\224
\342\200\242
\342\200\242
\342\200\242

(1

then

<7*X),

familiar

is known,

Q(X)

<7iX)(l

q2X)
for

identities

and

series,
generating
that an is the sum of the coefficients
of known
series.
However, even when we cannot factor Q(X) if we are given initial
conditions we can solve for as many coefficients
of A(X) as we desire by
division
of
inverse
into
the
P(X) [or by finding
long
Q(X)
multiplicative
of Q(X) since the constanttermofQ(X)
is nonzero].
this
the process we have
and we affirm
described
is reversible
Actually

hence

following theorem.

in the

of numbers which satisfy the


sequence
\342\200\242
\342\200\242
+
constant
coefficients
4- \342\200\242
an 4- cxan_x
function
n
the
then
A(X) 0, and
generating

Theorem 3.4.1. If {anfe.0

linearrecurrence

relation

= 0> where

Ck&h-k

is a

with

ck #

> k,

S^oOhX'1equalsP(X)/Q(X),whereP(X)
+ cxak_2

(a*-i

4-

4- (ax 4- cxaQ)X
Q(X) - 1 + cxX

- a0

and

\342\200\242
\342\200\242
\342\200\242
4-

ck_xaQ)Xk-x

\342\200\242
\342\200\242
\342\200\242
+

4+

ckXk.

Conversely,

given such

polynomialsP(X) and

degree less than k, and Q(X) has


whosegeneratingfunction
is A(X)
Moreover, the sequence {aJ~_0
recurrence

relation

coefficients

of

is a

has

P(X)

sequence |oj;.0

= P(X)/Q(X).
a linear
satisfies

homogeneous
coefficients of degree k, where the
relation are the coefficients of Q(X).
\342\200\242
\342\200\242
where b0 * 0 and bk
4- bkXk
4- bxX
4- \342\200\242

constant

with

recurrence
if Q(X) - b0

the

In fact,

k> there

degree

where

Q(X),

0,

then

Q(X)

60

= 60

where

c,

6j/60

for

i >

A(X)

(1

(1 +

the

coefficients

cxX 4-

...

4-

b*/M*)

\342\200\242
\342\200\242
\342\200\242
4-

ckXk)

1. Then

\302\243p<xi

\342\204\242

Q(X)
and

4-

+ bJboX

of A(X)

1 4-

\342\200\242
\342\200\242
+ ckX
cxX 4- \342\200\242

are discoveredby

using

>
\342\226\240k

partial

fractions

and

296

Chapter3: Recurrence

Relations

of 1

factors

the

satisfiedby

+ cxX +

Much of the

theory

relations

with

recurrence

extensive

that

than

ckan_k

= 0.

relations,

table of generatingfunctions.

in the

summarized

Cxa^

\342\200\242
\342\200\242
\342\200\242
+

in particular linear
can
be developedusing such
coefficients,
But of course, this requires a much more
of sequences and their generating
functions

techniques.
of pairs

knowledge

is an +

recurrence

of

constant

function

generating

ckXk.

relation

the recurrence

Then

\342\200\242
\342\200\242
\342\200\242
+

of A(X)

coefficients

the

Exercises for Section3.4

1.

the

Solve

(a)

an

relations

recurrence
4- n

following
an_

wherea0

an = an_ 4- n

(b)

4- n
(c) an
an_
=
4n(n
(d) an
an_

(e)

an

an = an_

(f)

(g)

an

(i)

an

a general

Write

- 1)

l/n(n

4-

4- 3m2

an-

an_

wherea0

1)

wherea0

4- 3m

4-3n

wherea0

4- n3n

where

for A(X)

expression

1.

1.

a0 = 1.

where

4-

7.

a0 = 1.

where

4- 1

4- 2n

an = an_

(h)

2.

an_

4-

a0 = 5.

where

by substitution.
where a0 = 2.

1.

a0 = 1.

= P(X)/Q(X)

the

specifying

Q(X) where A(X) generates the


and an satisfies the following recurrencerelations:
{a J^_0
sequence
- 0 for n > 2, a0 = 1, ax - 2;
(a)
an 4- 5an_x 4- 3an_2
(b) an 4- 7an_! 4- 8an_2 - 0 for n > 2, a0 - 1, ax - -2;
for

coefficients

(c)
(d)

an

an

5an_x 4-

a0 = 1,ax
a0

8an_2 -

0,

2an_3 4- an_6
1, ax = a2

3. Solvethe

and

P(X)

4an_3

= 3, a3
recurrence

following

forVi >

= 0

a2 = 1; and
- 0 for n >

3,

6,

a4 =

a5 =

2.

relations

using

generating

functions.

(a)

an

> 1 and a0 = 1.
= 0 for n > 2 and a0 v = -3, c^
10.
4- ^uan_2
9an_x
x -t20an_2
- 5an_x
=
0 for n > 2, and a0 = 1, ax = -2
4- 6an_2
=
> 2 and a0 = 0, ax = 1.
4a\342\200\236_20 for n
= 0 for rc
3 and a0 = 0, ax = 1,
4- 9an_3
an_l
9an_2
-

6a

(b) an (c)

an

(d)

an

(e)

an

a2

(f) an (g)

= 0

for n

- 2.
3an_2

4- 2an_3

4- an_6
a\342\200\236
2a\342\200\236_3

a4 = a6.

= 0 for n > 3 and a0


- 0 for n > 6 and a0

1, ax
1, ax

0, a2
0 =

= 0.

a2 =

a3

Section

297

Solving Recurrence Relations

3.4

(h)

an

(i)

a\342\200\236

an_l

a2 =

-1.

- 16an_2 4- 20an_3-

33an_2 -

10an_x 4
=
-23.
a2

(a) an

5.

7an_l

an

(c)

an

(d)'

a\342\200\236

(e)

an

(f)

an

\302\253
0 for

(a)

&\342\200\236-/(*

(b)

6n =

(c)

6n

/(n4
/ (n

of

n\342\200\224like/

= 0, ax
=

1, ax

1,

==

1,

functions.

generating

using

and a0

> 3 and a0

n >

2.

0 for

n >

3.
for n >
0 for n >

3.
3.

= 0
=

the sequence

generates

anXrt
2^\342\200\2360

is somefunction

- 0

an

> 3

for n > 2.
for n > 2.

3an_x + 3a\342\200\236_2
an_3 +
9an_x
27an_2 27an_3
- 12an_3
lan_x + 16an_2

A(X)

= 0

12an_2

- 4an_x - 12an_2
5an_x + 6an_2

(b)

If

for n

= 0

36an_3

4. Find a generalexpression
for

0 for

{an}^_0>

(n) = n2 4 3rc 4

1, what

and

an =

/ (n)

generates

+1)?

2)?

- 2) for

n >

2 and

60 =

&i

- 0?

of the basiccombinatorial
in
science
is
procedures
computer
a
list
of
and
oneofthe
bestknown sorting algorithms
items,
sorting
is called bubble sort, so namedbecause
move
small
items
up the
in a liquid. The bubble sort
list the same way
bubbles
rise
as follows:
that an n-tuple A of
procedureis described
Suppose
of A. The
are given, where A(i) denotes the i-th entry
numbers
n-entries of A are to be sorted into nondecreasing order;thus, the
smallestentry is to be placed in A(l) and the largestisto be placed
in
The
sort procedure makes n - 1 passes
over
the
bubble
A{n).
where
a
starts
at
and
A,
A(n)
n-tuple
pass always
proceeds through
the unsortedportion
of A. Each
pass consists of a sequence of

6. One

each

steps,

of which

compares A(i)

with

A(i

1) and

interchanges

their values if they are in wrong relative order. Thus, if A(i) >
first pass starts
The
A(i 4- 1), then the entriesare interchanged.
1 and
i = n \342\200\224
with
until i = 1. At the end of the first pass,
continues
the smallest entry
into
the position
of A has been \"bubbled up\"
In
and
not
further.
second
need
be
considered
the
A(l)
pass, the
the
smallest
value of i ranges from n - 1 to 2, this pass \"bubbles\"
of A(2),.. .,A(n) into the secondposition.
Now
and
then
A(l)
A(2)
the
are in correct relative order. Finally,
the (n \342\200\224
after
l)th
pass,
the
values A(1),A(2),.. .,A(n - 1)areall in place, and consequently
n-+h
A
of
has
to
been
moved
the
position.
largest entry

Find a recurrencerelationfor
rc-1passesand solve this
7. Solvethe following
divide-and-conquer
in the

(a) an = 7an/3
where

4- 5

n = 3* and

ax

1.

the

number

relation

of comparisons

made

by substitution.
relations

by substitution:

298

Chapter 3: RecurrenceRelations
(b)

an =

2an/4 4- n

where n =
(c) an = an/2 +

1.

- 1

2n

where n = 2k

ax =

and

4k

ax =

and

1.

8. Verify by mathematicalinductionthat

is a

an

= Axn

a>n

= ^

A2

to

solution

an/d +

where

9. Show that

1) is

4-

(n)

C(logd

relation:

a*

where n

10. Show

=*

an

e (C

nlog'c

- 1)/(C

an = C an/d 4n = d*, C #
ax

11. Show by substitution


of the relation

(b)an

(0

the

generating

an =

- 1) is

the

solution

to

the

3\302\273

(i)n

-.-(-!)'

e for

and

= e.

that C(2n -

an = (4n ax = 1.

(a)

+ C

an/d

relation

recurrence

12. Give

the recurrence

and

dk

that

the solution to

6)an_x

function

for

2,n - l)(nrc >

for the

1)!
is

2 where

sequence {aj~_0if

the

solution

Section

3.4

Recurrence

Solving

(d)

= 3\"

an

+ 5\"

(e)a\342\200\236

299

Relations

3(^3)

5(i)\"-7(5)\302\273
+

2)5\"

(f)a\342\200\236=(ra

(g)

an =

(h) an

(i)

Selected

3)(ra

+ 2)(ra+l)

l)(ra)(ra

- 1)

7(ra

(ra

= ra23n
a\342\200\236

\"

a,

(b)

ra(ra
a\342\200\236

,(c) .

ra2(ra
=
a\342\200\236

D2

ra

(g)

(ra
a\342\200\236

3. (b)
<c>

A(X)

ra

nn+1

l)2

1 + 7X

1+

3X2

5X

- 5

11

\342\200\242
5\"

2
a\342\200\236
*\302\273

+ l)3
3\"+1 - 1

\342\204\242 =
o\342\200\236

(a)

---4----

(f)

(h)

- (ra +
a\342\200\236
=

1223

2ra +
ra

+ 7

+ 5

1111

1+--t

+ 1)

l)(2ra
-

1) +

+
(\302\273

(a)

2.

3.4

for Section

Answers

\342\200\242
4\"

-1

if

(d)

0
o\342\200\236

(e)

1/12
a\342\200\236

(f)

8/9
a\342\200\236

(h)

A(X)

-\302\253\"\302\253\342\226\240
ra

f- 2\"
a\342\200\236

is even,

{-3

+ 4

- 6/9

ra

\342\200\242
3\"

1/9

+ X=

-2/49
a\342\200\236

if

ra

r^x;

- 5(2\">

\"\342\226\240

4<3\">

is odd

(-3)\"}

(-2)\"

X
-i

r^ix

16X2 +
(2\") +

= -2/49 + 7/49
20X3 1 - 2X (1- 2X)2
7/49

(ra

1)2\"

- 5/49

\"

(-5)\"

5/49
1 +

5X'

300

Chapter

Relations

3: Recurrence

(i)
lU

1 ~

\"

A(X\\

9X

3X

an

(1

36X3

20

15

1-

- 3X)2

(1

15(3\")

1 \342\200\224
9X

\"

1 - 10X + 33X2 -

+
6(\302\253

- 4X)

- 3X)2(1

- 4X'
- 20(4\

l)(3n)

11. Let

(4 n

- 6ra\342\200\236_!
- 6)(4 n - 6)(4 n -

(4 n

- 6)(4 n

(4 n

a\342\200\236

(4 n

- (4 n since

a,
-

an

10)a\342\200\236_2

- 6)(4
(4 \302\273

10)(4

14)a\342\200\236_3

10)(4 n

= 1.

We rewrite

2\"\"1

(3)

(5)..

(2

4) (2

\342\200\224
and

2)

(2 n

5) (2)

.(2 n - 7)(2 n

2\"'1 (2 n

2\"-1(l)(2)... -

(2n- 2)!
(n

(2

1)!

THE METHODOF
This

learned

from

+
CiO\342\200\236-i

the

is nothing

method

\342\200\242
\342\200\242
\342\200\242
+

ckan_k

ra

5)(2

(2)

(1)

- 3)]
(4)

(2)

(6)..

.(2 n

- 6)

2)!

4)(2

- 2)

2)!

- 2)(n -

1)

(n - 1)!
1)!

1)!

ROOTS

CHARACTERISTIC

new method

- 7).. .(2)(3)

(n - 1)!(\302\273

C(2n-2,n-l)(n-

3.5

6)a\342\200\236_3

- 2)!

3)(n

{n

(2ra - 6)(2 n

(2)(4)...

we have

2\"-1(2 ra

o\342\200\236

2)

- 14).. .(6)(2)

and denominatorby

Multiply numerator
\342\200\224

- 10)(4(n -

this as:

- 3) (2)(2 n

[(1)

6)a\342\200\236_2

.(6) (2)^

14)..

6)(4

2(2 n

- 10)(4 -

1)-

- 6)(4 (n -

(4 n

more than a synthesis

of generating
= 0 where

P(X)/Q(X) where Q(X)is a polynomial


Q(X) completelydeterminethe form

of all that
we have
functions. If we want to solvean +
we can find A(X) =
0, then
ck =\302\243
k. Then the factors of
of degree
of

coefficients

of A(X).

Section 3.5

301

Roots

of Characteristic

Method

The

In Example
3.4.4 the denominator
But let us makeone observation:
Q(X) - 1 - IX + 10X2 and the general solution for an was an - C^\" +
because

C25rt

- 2X)(1 -

as (1

factors

Q(X)

Q(X) were 1/2 and 1/5 while

reciprocals. To avoid
another

this

are

direct

in

C(t) = t2
- 5). Now

roots

and multiply

[1 - 7(1/0

by

4-

t2 to

10(lA2)]

polynomial, 2 and 5,

of this

of the solution for

the form

with

relationship

= t2

the

of their

powers
let us consider

X in Q(X) by lit
Q(l/t)

of

roots

the

that

Note

involve

relationship,

reciprocal

we replace

where

polynomial

obtain the polynomial


t2 - It + 10 = (t - 2)(t

5X).

solutions

the

an

= Cx2n

4-

4-

C2b\\

In Example 3.4.5
A(X)

\"

P(X)

Q(X)

- 2X)(1 -

(1
form

of the

again

that

the

- 9X
WO

and

P(X)

\"

solution

3X)(1-

24X3

4X)

was an

recurrence

that

for

+ 26X2

= Ci2

C20

C34\302\273.

Note

C(t) = t*

and these

of Q(X) are 1/2,1/3,and


- 9t2 4- 26t - 24 = (t - 2)(t -

the roots
= t3

Q{l/t)

roots are in directrelationship

to

1/4,

are

4)

of the

form

the

of

the roots

but

3)(t-

2, 3,4,

solution

for

On-

called the characteristic polynomialofthe


that if the recurrence relation is an 4for
n > k, whereck # 0, then the characteristic
cian-i
\342\200\242
\342\200\242
for
this
recurrence
relation
is C(t) = tk 4- cltk~1 4- \342\200\242
4- ck,
polynomial
=
\342\200\242
\342\200\242
\342\200\242
X
and this, in turn, equals tk Q(l/t),
1
where
444Q(X)
cx
ckXk.
- a8)rt then in the expression
\342\200\242
\342\200\242
\342\200\242
Then if C(t) factors as (t - ax)ri
(t
=
the denominator
A(X)
P(X)/Q(X),
Q(X) factors as (1 - axX)r'
The

polynomial

recurrence

C(t) is

Note
\342\200\242
\342\200\242
= 0
4- \342\200\242
4- ckan_k
relation.

\342\200\242
\342\200\242

.(l-a,X)\\

Distinct

Roots

If the
Clot\"

4-

characteristic polynomal
of the solutions for
Ckotk where

\342\200\242
\342\200\242
\342\200\242
4-

to satisfy

distinct

has

form

general

the

roots

au..

homogeneous

CuC2i.. .Ck are

constants which

.9ak9

equation
may

then

the

is an

be chosen

any initial conditions.

Example 3.5.1. To
characteristic

solve

an

equation is C(t) =

generalsolution IS

dn

= Ci

lan^x 4- 12an_2= 0 for n > 2, the


It 4- 12 = (t - 3) (t - 4). Thus, the

t2

6 4- L/2

302

Chapter

3: Recurrence Relations

If the initial conditionsare a0

= 5,

2, ax

then we must solve the

equations

to find

Cx =

that

= 2

4- C2

Cx

and

C2 = -1,

3 and

the

and

- 5

4- 4C2

3CX

required

solution

4-

= 0

is an =

(3)3n -

4n.

ax

Solve

3.5.2.

Example
= 5.

an

5an_x

6an_2

where a0

= 2 and

the characteristic polynomial is t2 - 5t 4- 6 = (t - 3)(t


2),
=
=
2 and ax
5, we have
a0
an = Cx2n 4- C23n. From the initial conditions
of equations
the
system

Since

Cx 4- C2=

Solving these

equations,we

n >

all integers

= 5.

4- 3C2

2CX

Cx =

find

2
C2= 1.Thus,

1 and

an

= 2n

4-

3n

for

0.

Multiple Roots

In Example
3.4.7
to an
general

discovered

we

solution

form

= Cx

an

2n 4-

6an_x

C2 (n

4-

1)

= 0

8an_3

[(n 4-

4- C3

functions that the


> 3 wasof the

generating

by using
12 an_2 -

4-

for n

2) (n

4-

1)

because

2n]/2

12X2- 8X3 - (1 - 2X)3.But then this corresponds


Q(X) = 1-6X+
- 6t2 4- 12\302\243
= \302\2433
the fact that the characteristic
C(t)
polynomial
2
as
a
root
3.
has
with
2)3
(t
repeated
multiplicity
Let us make an observationhere.If we rewrite
an =

Cx2n 4- C2(n

4-

1)2*

Cx2n

and

recombine,

l/2C3n22n.
D2y Dz

such that an

= Dx 2n

Example 3.5.3.
an

(b) an
(c)

an

46a\342\200\236_x
3an_x

9an_2

4- 3an_2

9an_2 4-

(ri

4- C22n

in another

21an_2 -

4- C3

2- as

4-

C3

(y)

2* 4- C32\"

example.
form

general

= 0,

4- (C2 4- 3/2 C3)n2n


4C2 4- C3)2n
after simplificationthere are constants
Du
4- D2n2n
4- D3n22n. This type of result holds

the

Write

2)

= (Cx 4-

this

exhibit

(\" +

4- 0,^12*

we have an
In other words,

in general.Letus

(a)

4- C3

to
8 =

an_3
27an_3

= 0,

and

= 0.

of the

solutions to

Section

The Method

3.5

idea sincethe characteristic


polynomial

Following the above

- 6t + 9 = (t - 3)2 the general


Likewise the characteristicpolynomial
t2
l)3

so

Dx

D2n

form an
is t3 - 3t2

is the

solution

solution in (b)

the general
4- D3n2.

that

303

Roots

of Characteristic

for

(b)

is an

in

Dx3\"

is

= (t -

+ D3n2ln

4- D2nln

Dxln

- 1

4- St

(a)

+ D2n3n.

- 9t2 + 271 - 27 =
the characteristicpolynomial
is \302\2433
(t - 3)3 so
=
solution
for
is
+
+
(c) an
Dx3n
D2n3n
general
Dsn23n. We
this
to
cases
to
where
the
characteristic
expect
generalize

In (c)
the

that
would
polynomial

several

has

If the characteristic polynomial

3.5.4.

Example

roots.

multiple

recurrence relation is
homogeneous
solution
for
an is an = D,2n + D2n2n

2)2

(t

of

- 3)3 then
+ D4n3n +

linear

the general

D5n23n.(Of
- 3)3 - tb - 13t4 + 6713 - 171t2+ 216*- 108 we
- 13an_x 4- 67an_2
the recurrence relation must have
been
an
=
>
n
for
+ 216an_4
5.)
0,
108an_5

coursesince(t
that

see

(t

\342\200\224

171an_3

In generalwe

D33n

2)2 (t

the

have

3.5.1.

Theorem

of the

roots

distinct

the

Let

theorem.

following

characteristic

linear homogeneous
+
C(t)
polynomial,
\342\200\242
\342\200\242
\342\200\242
=
recurrence relation,an 4- cxan_x 44- ckan_k
0, where n > k and
<
#
fc.
Then
is
a
there
0, be alf a2y.. .,aswheres
ck
general solution for an
\342\200\242
\342\200\242
which
is of the form, Ux(n) + t/2(rc)
where Ui(n) =
4- \342\200\242
4- Us(n)
=

tk + cx tk~1

(A. + A, n
m, is

where

and

ck of the

\342\200\242
\342\200\242
\342\200\242
4-

4- A,

\342\200\242
\342\200\242
\342\200\242
4-

\"2 +

A^

the multiplicity of the roota,.

Example3.5.5.
solution

general

(D6 4- D7n
Example
=
12a\342\200\236_3 0

4-

3.5.6.
for rc >

an

may

conditionsgive

D2rc

(t
+

polynomial
- 2)3 (t - 3)2(t - 4)3.
D3n2) 2n 4- (A 4- Dbn)

Then

3n +

D8n2)4n.

recurrence relation an initial


conditions
a0 = 1, ax

Solve the

3 with

the

The characteristicpolynomial
Thus,

is

is an = (Dx 4-

for a

characteristic

the

that

Suppose

linear homogenous
recurrence
relation
the

m\"1'-1) \302\253?

be written
the

system

- 7t2 4- I6t

is f

as

Cx2n

4- C33n.

C2rc2n

of equations

2CX
4CX

Cx 4- C3
+ 2C2 4- 3C3
4- 8C2 4- 9C3

- 12

= 4
= 8.

7an_x 4- 16an_2 = 4, and


a2 = 8.
=

(t

- 2)2

But then

(t

- 3).

the initial

304

Chapter 3: RecurrenceRelations
This

of the

solution

unique

the solution Cx = 5, C2
recurrence relation

has

system

an

+ (3)(n2n)

(5)(2n)

Remark. The

C3 =

3, and

-4. Hence, the

is
- (4)(3n).

will work whether or not


are real numbers.However
if the
not be real and in our discussionand
roots are complex then an need
we
have
real-valued sequences. Hence we
definitions
always discussed
in the examples to linear recurrence
our attention
restricted
have
have had only real roots. We
relationswhose characteristic
polynomials
to do the same in the exercises.
intend
or

have

we

methods

the rootsof Q(X),

roots

the

described

of C(t),

Exercises for Section3.5

1.

the

factor

and

Find

in

4 in

for

for

4an_3 = 0 for

n >

Section

relation

recurrence

of

a solution

3 of
(a)-(e)of Exercise

Section

5.

3.4.
an

4-

ban_x

to the

recurrence relations in

the characteristic polynomial for the homogeneous


relations whose general solutionhas the form
an =

(b)

an

(c)
(d)
(e)
(f)

Bx + nB29
nB2 + n2Bz,
=
an
Bx 2n + B2 3n,
=
an
Bx 2n + B2 n2n,
=
an
Bx 2n + B2n2n + B3 n2
an
B, 2n + B2 n2n + B3 3n
=

recurrence

Bx +

6. Find Cl9C2,C3
C3 an-'s = 0 for
(a)

3.4.

Find
(a)

8an_2

3.

the general form

4. Find

for the recurrence

characteristic
polynomial
of Section 3.4.

3
relations Exercise
2. Do the same Exercise
3. Do the same
the

aB-B13B

if

the

n >

2n,
4- B4

S5 6n.
an + Cx an_x

n3n +

recurrence
relation
3 has a general solutionof

+ B26n,

the

C2an_2

form

(b) an = Bx 3n + B2 ^3n,
(c) an = 5x3\" + B2 n3n + B3 2n.
7. Solve the following
relations
recurrence
using the characteristic
roots
(a) an - Zan_x - 4an_2 = 0 for n > 2 and, aQ = ax = 1;
(b) an - 4a\342\200\236_1
12an_2 = 0 for n > 2 and, a0 = 4, ax = 16/3;
(c) an
4an_! + 4an_2 = 0 for n > 2 and, a0 = 5/2, aj = 8;
= 0 and,
(d) an + 7an_x 4- 8a\342\200\236_2
7;
a0 = 2, ^
(e) an 4- 5an_x 4- 5an_2 = 0 and, a0 = 0, ax = 2 V5;

Section

Roots

The Method of Characteristic

3.5

(f)

an

a3

(g)

(h)

(i)
(j)
(k)
(1)

+ 10a\342\200\236_4
7a\342\200\236_2

- 16 V2

25

- 7, ax

0, a0

8 V2

+ 5

a\342\200\236
o\342\200\236_!6o\342\200\236_20

5on_! +

6a\342\200\236_20

a\342\200\236

(m)

+ a\342\200\236_i5a\342\200\236_2
+ 3a\342\200\236_3
a\342\200\236

(n)

6o\342\200\236

19an_!

15a\342\200\236_2 0

and

o0 =

where

0 and ox

Selected Answers for Section3.5

2.

(d)

(f)

= t3

C(t)

- t3

- 1 = (t
16* - 12 -

3t

3t2

7t2

(a)

= t3-5t2 + 8t-4
= (t - l)2
at)

(b)

C(t)

3. C(t)

5.

C(t)

(t

6.

at)

(f)

C(t)

(a)

Cj

(b)

= (t
=

(t

- 2)2 (t

\\4n
0

an

(c)

-2n
a\342\200\236

(t

2)2

- 3)

- 1)

- 3)2{t - 6)

C2

C2

+
^6\"
o

(b)

2)2 (t

(t-

C2 = 18

-9

d - -6

an

l)3

(t -

3)

- 2)3

(c) Cj- -8

7. (a)

- l)3

(c) at) = (t-2)(t= (t - 2)2


(d)
C(t)
(e)

C3

= 0

C3 = 0
C3 =

21

-18

\\(-\\)n
u

J(-2)n
o
3

+ -n2n

(e)0\342\200\236.2(z^r-2(zi_^)-

(f) C(t) = (t
an =

(t

V2)

3(V2)\302\273

= 41,

5(-

-1;

- -7;
c^- 0;
at= 1;
1;
a0 = 7 and 0!= 1;
0 where a0 - 0,at = 1,

where

a2

VB;

for n > 2 and, a0 - 12, ax


=
0 and, a0
+ 6an_2
+ 5a\342\200\236_!
4, at
a\342\200\236
= 0 where
+ 8o\342\200\236_2
a\342\200\236
6a\342\200\236_i
o0 = 1 and
= 0 where
+ 3a\342\200\236_2
7o\342\200\236_i
2a\342\200\236
a0 = 1 and
=
+ 9a\342\200\236_20 where
6a\342\200\236_!
an
o0 = 1 andax=
-

V5,

305

V2) (t V2)B + 7

V5)
(V5)B

(t

+
+

V5)
2(-

V5)B

-.

a2-

2;

Chapter 3: RecurrenceRelations

RECURRENCE

LINEAR

INHOMOGENEOUS

OF

SOLUTIONS

RELATIONS

Let us turn our attention


recurrencerelation(IHR):

an

the inhomogeneous

how to solve
+ . . . + ckan_k

learn

to

now

cxan_x

f (n)

for n > k,

of n. Call f(n) the


where ck =5* 0, and where / (n) is somespecifiedfunction
of
(IHR).
forcing function
to find a solution using generating functions.We
We
follow
attempt
in
the
same
as
recurrencerelations
procedure
solving homogeneous
A (X) - 2\".0anXn, multiply each term in the IHR
Let
(HR).
by Xn, sum
from k to oo, and replace the infinite sums by expressions from the table of
for
some
expressions for A(X). Let us present
examples
equivalent

illustration.

Example 3.6.1. Find a solutionto an


a0 = 2.

an_x =

- 1)where

3(n

n >1

and where

Let
Xn

by

A(X)

2^.o

sum

and

E anXn
n-1

Replace each
But

then

A(X)

3X7(1

A(X) = 2 S^o Xn

1)

for

n >

by an

(n
\302\243

l)Xn.

n-1

expression from the table,so

equivalent

XA(X) = 3X7(14- 3X7(1


(1 - X) Using Table 3-1, the
a0

X)3.
the inverse

functions,

recurrence relation

of the

we have

Then

- f] an.t Xn
n-1

sum

infinite

- oo -

A(X)

that

oo.

term

each

a\342\200\236Xn.
Multiply

from 1 to

X)\\

A{X) - a0/(l -

- X)2or

of

property

shifting

transformation, and the fact that


3/2 (2-.0 n(n - l)Xn) so that
an

- 2,

a0

2 +

X)

generating

we have

3/2 (n) (n -

0.

3.6.2.

Example

recurrence relation

an

Find a general expressionfor


ban_x + 6an_2 = n{n - 1)for

= S^o aaXn. Then multiply

Let A(X)

by

and

Xn

solution

n >

to

the

2.

sum from

2 to

oo

to

get

anXn
\302\243
n-2

Replacing
a0
thp

2-.2

axX)
shifting

(n) (n

- 5

an-i
\302\243

^n

a^jX11
\302\243

n-2

sums by
- 5X(A(X) - a0)

the infinite
properties

+ 6

n-2

equivalent
4- 6X2

of generating

- l)Xn = 2X7(1-

X)3.

f]

n-2

expressions,

(n) (n-1)
we have

X\".
(A (X)

= 2^2 (n) (n -,l)Xn. Using


A(X)
functions and Table 3-1,we see that
- 5X + 6X2) = a0 4A(X)(1
Thus,

Section

Solutions of Inhomogeneous Linear RecurrenceRelations

3.6

(a,

+ (2X7(1 -

- 5a0)X

and

X)3)

(1 - 5X +

If

are

we

coefficients of A(X). Suppose,for


A(X) =

1-

- 3X

then

for constants

do +

3X) + E(l and

1/3

that B

(1

X)3

Now

this

so forth,

3X)

-10

by

the

1) +

and

C(l

process

E =

inverse

- X)2

A(l

- 2X)

1 - 3X +

2X) =

5X2

(1

\" 10<2\"> +

21/4, we find
transformation

D(l

X3. Let

that

get the
3D +

we

and then

= 39/12,

process, we have
+

(|)

For
for the IHR above.
IHR by Xn, sum from

of the

if we

cxX

c2X2

c*X*) =

+....+

Y.f{n)Xn +

P(X),

n-fe

where

P(X;

= a0

+ (a! +

cxaQ)X

4-

\342\200\242
\342\200\242
\342\200\242
4-

(a*_!

4-

c^.2

\342\200\242
\342\200\242
\342\200\242
4-

let

k to oo,

we obtain

A(X)(1 +

(1 -

- 1,1/2,and

and get 6A
A

3X)

- X)3

3*

(t)

term

- 2X) (1 -

3X)

of X4

coefficient

works in general
each

6X2)\"

21/4. Let X = 0 and

(1 -

5X

<^L\302\261i)_(10)2.

A(X) = ?Tn\342\200\236QanXnymultiply
and

2X2

7\"2; + (1 - X)3(l + 6X2)

(|(\342\200\236

3\302\273
+

5, then

6X2)

5a0)X

- 1, D = -10, and
- 19/4. Solve for the

= 3/2.Then

\"f +

find the

aY

3X)

C, D, and E. Thus,

equation
2E = 0, but sinceD A

5X

2X) (1 -

find

(<*i

(1 - t^

A, B,

(1 -

- X)

B(l

1 and

fractions,

by partial

a(x)-,v'

a0 =

can

we

then

ax

that

(1
- X3

2X)(1-

- X)3(l -

(1
But

5X2

for a0 and
example,

2X2
- X)3(l - 5X

6X2

5X

- 5X + 6X2) '

- X)3(l

(1

6X2)

conditions

initial

given

2X2

+ (a1-5a0)X

\342\200\236/V, a0

307

ck_xa0)Xk~\\

308

Chapter 3: RecurrenceRelations
for

Then,

= 1

Q(X)

+ cxX +

. +

ckX\\

Hf(n)X\302\273>

that

Note

= 0

ckan_k

Perhaps a few

more

examples

an

Let

(X)

- 2;_o

<*nXn-

^/^

does

what

Find

Q(X)

solution of the HR:an

is a

k. But

Example 3.6.3.
recurrencerelation

1 tUL.

Q(X)

P(X)/Q(X)

for n >

A(X)

us a clue.

general

expression

+ 6an_2

=--

clan_l

solution to the

for a
n >

4n for

\342\200\242
\342\200\242
\342\200\242
+

represent?

f(n)Xn)/Q(X)

(2;_*

will give

5an_l

2.

Then

Y]4nXn

1-

jzj

6X2

5X

go

- 5a0)X

(Qi

- 5X

6X2

Now

4\302\273X\"=
\302\243
ra-2

by a

which

42X2

X] 4n-2Xn\"2,
n-2

becomes

change of dummy variable

= 42\342\200\224\302\245\342\200\224.

42X2X>X\302\273

tTo

- 4X

Therefore,
(,
W

4^
(1 - 4X)(1 -

- 5X +
homogeneous solutions
since

But

partial

6X2
have

+
+

5X

=
the

6X2)

- 2X) (1

(1

form

42X2

that

where

(fll

- 5a0)X

1-5X

+ 6X2

we

3X)

+ C23n.

see

\"

that

the

But likewise by

fractions

(1 - 4X)(1 - 2X)(1 so

Cx2n

a0

42X2/(1
bn = C4n

3X)

- 4X) (1 - 2X)
+ D2n + ESn for

(1
some

- 4X

+ Z - ^7 + 1 2X 1

3X

3X) generates a sequence {&J-_0


constants
C, D, and E. Note that

Section

D2n 4-

0, so the only
this

we compare

When

solve the

would

also

E3n

5an_i 4- 6an_2 =

Linear Recurrence Relations

of Inhomogeneous

Solutions

3.6

homogeneous recurrencerelationsan information


is the part CAn.
gained
=
function
that
4\", it seems
original
/ (n)

new

the

with

has almost reproduceditself.Thus,


at
has
a
(n)Xn)/Q(X)
generated
sequencebn -

this function
(2\302\243.a/

h(n) isa

least

in this

Cf (n)

example,
+ h{n) where

HR.

the

of

solution

309

Let us subsitute bn = C4n +


But this is not the whole
picture
yet.
D2n 4- ESn for an in the recurrence
relation an - ban _j + 6an_ 2 = 4n. After
a moments reflection, we realize part of this is unnecessarysinceD2n +
relationso that substituting
E3n is a solution of the homogeneous
bn is
the same as substituting C4n.
-1
2
But
we have4n - C4n - 5C4n
then
+ 6C4n\"2 - C4n (42 - 5 - 4 + 6)
in this example
or C = 8. Therefore,we have
concluded
that,
a
has
solutionof
form
the
4 h(n),
(8)4n
(2\302\243-*/ (n)Xn)/Q(X)
generated
where (8)4n is a particular solutionof the inhomogeneous
recurrence
= 4n, and h(n) is a solution of the
relation
4an - 5an_t
6an_2
= 0.
relation
4- 6an_2
an
homogeneous
ban_x

of/ (n).
Let us considerotherexamples
where we are to solvean \342\200\224
5ah
l 4

3.6.4.

Example

the case

us consider

example, let

Then, in this

case,we

2 = 2n.

obtain

P(X)

^2\"Xn

(1

For

6an

- 3X)(1 -

(1

2X)

- 3X)(1

-_2X)

Now

2nXn
JT
\302\2433

22X2

2^r

f^

2X

\342\200\224

f=o

(1

2X)2

- 3X)(1

2X)

Thus,
22X2

,,v,

Therefore,

using

P(X)

(1 - 3X)(1 fraction

a partial

decomposition

ABC

22X2

(1 - 3X)(1
Thus?

A3\"

- 3X)

22X2/(1

+ B2\"

(1

2X)2

(1 -

2X)2

Cin + 1)2\"=

AS\"

3X

generates
+

(B

- 2X)

we have

- 2X + (1 -

a sequence

+ C)2n

{6J

2X)2

^,0 where bn

+ Cn2n. Again

note

that

310

Chapter 3: RecurrenceRelations

is a solutionto the homogeneous


but Cn2n is a
relation,
solutionof
the
relation
for
a
inhomogeneous
particular
specific choice of
Cn2n
into
the
we obtain
recurrence
relation
In
fact
C.
substituting
by
or
C2n~2
10
+
l)2nl
2)2n\"2
6C(n
2\",
(Cn2n 5C(n
[An
=
=
\342\200\224
2n.
C
Thus
and
is
a
1) + 6(n
{-2)n2n
-2,
(n
2)]
particular
4- C)2n

+ (B

ASn

the

of

solution

relation

inhomogeneous

an

5an_l

Example 3.6.3,a particularsolution

Note that in

= 2n.

6an_2

of

was

form

the

had
the form C nf (n).
Cf (n), but in Example 3.6.4a particularsolution
is the
difference?
the
What
Upon reviewing
analysis of eachof these
=
4n
us
we
that
the
observe
factor (1 - 4X) in the
cases,
/ (n)
gave
of the expression
for A(X), and in this case4 was not a root
denominator
so no higher
of the characteristicpolynomial
power of (1 - 4X) occurred
in
of A(X). However, when / (n) = 2n, then
denominator
the
(1 - 2X)2
occurs in the denominatorof A(X) because 2 was a root of the
characteristic
polynomial.

(1)

Any

(2)

the

IHR

the

solution

and a solution of

discuss clue

Theorem 3.6.1.
an

+ c2an-2
+ c2an_2

cian-i

+
\302\253n

cian-i

relation.

Then

(2) If {a\342\200\236l}
~_0 is

+ a\"}
HR, then {a\342\200\236

^2>

Lo>

{a\"1}

{C^1 +

C2a\"2

is affected by

the

the rootsof the

IHR with constant coefficients is


= / fa). Suppose, further, that HR
= 0 is the associated
+\342\200\242\342\200\242\342\200\242-}ckan_k
homogeneous
the

that

Suppose

\342\200\242
\342\200\242
\342\200\242
+

ckan-k

\"

of IHR, then
=0 are two solutions
of HR.
of
particular solution of IHR and {a\342\200\236}
*_0 *s a solution
n-o is a solution of IHR.
\\apn2)

a solution

a\342\200\2362}
~=0 is
{a\342\200\236l

(3) If

to

related

directly

1.

if {c#} ~=0 and

(1)

IHR

C(t).

polynomial

us first

of the

solution

a particular

solution

a particular

of

form

characteristic
Let

sum of

particular solution is

/ (rc);and

(3) the

is the

of the

both

HR;

of the

form

function

seem to be consistentin

clues here that

There
are three
above examples:

{a\"2}

n-o*

\342\200\242
\342\200\242
\342\200\242
9 iann}

\342\200\242
\342\200\242
\342\200\242

Cma\"m}

different solutions to HR, then


of HR for any constants Cu

n-o are

is a solution
~\342\200\2360

\342\200\242
\342\200\242
\342\200\242
9 ^m*

Proof.
a>n +

Ci<d

We only prove (2); the proofs


\342\200\242
\342\200\242
= / (n) and
+ \342\200\242
+ cka*_k

we can add thesetwo


4- ck (a\342\200\236
+ a\")

= /

equations

to get

the

for
a%

others

+
+ cl{a^_l

cxa^_x

+ a\")
(a\342\200\236

conclusion.
(rc), which is the desired

are similar.

Since

\342\200\242
\342\200\242
\342\200\242
+

cka%_k

+ a\")

- 0,
\342\200\242
\342\200\242
\342\200\242

Section

of Inhomogeneous Linear RecurrenceRelations

Solutions

3.6

The

of Theorem

import

for the

solution

IHR

falls

3.6.1 is that the task of


two

into

the

finding

complete

solve the HR in full

first,

parts:

311

and
discover
second,
generality, listing all possiblesolutions,
any
solution at all of the IHR itself.The sum of these two parts
particular
provides a general solution to the IHR and if appropriateinitial
are given,
the arbitrary constants in the solutionmay
conditions
be
Let us apply this conclusionto anotherexample.
determined.

Example3.6.5.

Find
the
solution
to the IHR: an complete
=
>
2.
7an_! + 10an_2 4n for n
We know that the solutionsto the HR:an - lan_x + 10an_2 = 0 are of
- 5) is the
the
form a? - Cx2n
+ C25n since C(t) - t2 - It + 10 - (t - 2)(t
characteristic polynomial.

The

is to determine a particular solution.We could


as we did in Example3.6.3and 3.6.4, but let us
in that example. As is so often
the
case
gained
attempt to use the insights
with mathematical
or at
problems, a goodmethod is to guessthe answer,
least the general form of the
and subsequently
to verify it,
answer,
use

main

now

problem

functions

generating

identifying the coefficients in the generalexpression.


In this case, we suggest that a particular solution will have the form
= C4n.
if so, what
Let us determine if this is, in fact, the case,and,
a\342\200\236
value of C will give a particular
solution.
relation an - 7an_l
Substitute C4n for an into the inhomogeneous
+
- 4\\ Then we have
C4n
7C4\"1 + 10C4n\"2- 4\", or C4n \"2 (42 10an_2
4 + 10) - 4\". Thus, C = -8, apn = (-8)4\"
7 \342\200\242
is a particular solution, and
= (-8)4n
+ Cx2n + C25\"is the completesolution.
an
we are given the initial conditionsa0 = 8 and a{ = 36,
If, in addition,

then substituting n = 0 and n = 1 into


8 =

have

(-8)

Cx

36 =

C2 and

solving, we find C1 = 4 and C2 =


in two unknowns. Thus, an =
of an

solution

and aY
The

Method

\342\200\224

lan_1

+ 10an_2

the

above

-32 +

2C\\

expression
+

12as the solutions


(-8)4n

4n

satisfying

to

(4)2n +
the

for

any

we

and
Simplying
these
two equations

5C2.

(12)5n is the

initial

conditions

unique

a0 = 8

36..

of Undetermined Coefficients

form of a particular solutionto an


Themethod guessing
the general
the values of
and
then
recurrence
determining
inhomogeneous
is
the
method
of
the coefficients in the generalexpression
of

relation

called

undetermined

coefficients.

a little insight and


we
In order for this method to be successful
require
to gain that experience
functions
more experience.We use generating
and to verify what forms are good guesses for solutions. Oncewe have
done
this for several types of situations, we will not have to resort to

312

Chapter

Relations

3: Recurrence

rather

functions anymore,
based on our experience.

generating

Inhomogeneousrecurrence

consider two cases:


of n and the other

/ (n)

where

other

generating

types

of functions

trial

solution

theIHR

/ (n)

where

others,

is a

-=

of known

reason for

and the

polynomial in

Of

rc.

can

we

increases

functions

types

guesses

are known. Basically,


Dan
is an exponential

(n)}~_0

/ (n)

one where

only

vocabulary of

than
{/

certain

with

relations

to solve
functions / (n) areeasier
that the generating functions for

educated

make

will

we

course,

solve the

that

function
as our

IHR

for exponentials.
= Dan, where D and a
-

Suppose that we are to solve

areconstants.Let

\302\243>nX\".

n-0

we know

that

+ P(X)

D^anXn
-

A(X)

-\302\243=*

Q(X)

where

P(X)

= a0 +

(ax

c^X

+ .

. .
4-

(afc_!

+ cxak_2

+ .

and

Q(X)

- l

+ ClX +

\342\200\242
\342\200\242
\342\200\242
+

ckXk.

Now

D ]T

so that

by change

for

/ (n).

A(X)

Then

is

we shall

anXn

= DakXk

ak~kXn~\\
\302\243

of dummy variable,lettingr
J2 or kxn

=--

~ k,

. . +

ck_1a0)Xk

Section

of Inhomogeneous Linear RecurrenceRelations

Solutions

3.6

313

becomes

Thus,

D >
then

and

a\"X\"

this into the expressionfor

by substituting

(1 -

DXkak +
A(X)

Note that the degreeofthe denominator


numerator
is at most k. Thus, we

is
can

1 and the degree of the


the method
of partial

whether or not a is a rootofthe characteristic

as to

question

k +

apply

fractionsto this quotientof polynomials.


the

aX)P(X)

- aX)Q(X)

(1

But

we have

A (X),

polynomial

= tk

C(t)

where

au a2,...,

ocs

- a,r (t

= (t

C(t)

distinct

the

are

Q(X) - (1 -

axX)ri

(1

1 ~

aX

ck

roots of

C(t). Thus,

- a2X)r>

... (1-

if a

+ 73
(1

\342\200\242
\342\200\242
+

\342\200\242\342\200\242\342\200\242(*asr

a2Y<

is not a root of C(t),so that


fraction
decompositionof A(X)
partial
The

us write

itself. Let

presents

immediately

+ cxtk-1 +

asX)r.

i
form

\302\253
\302\245\342\226\240
1,
a{ for

has

the

. , ,s, then

2,..

the

777 +\342\200\242\342\200\242\342\200\242\342\226\240+\342\226\240
7777 + 71
777 -(-\342\200\242\342\200\242\342\200\242
- axX)
(1 - a,Xr (1- a2X)
+

(1 -

+ .

^
a2X)r2

. .

\302\243*!

4-

(1

- anX)

. .

^
(1 - cv,X)r

above except the


all terms
constants
C, Cu, C12,... , C,v Note that
relation.
of
recurrence
the
first give rise to homogeneoussolutions
characteristic
case
in
a
a
root
the
is
not
C(\\),
Therefore,
polynomial
of
for

'

314

Chapter

3: Recurrence

we have

Relations

the value

7-3nforn>2.
- It

10

Substituting
- 7
10C3n~2

in

C3n\"2 (32
\342\200\242
32 or C -

we

C(t)
to

C(t)

solutions have
we take a trial
determined.

be

C3n -

7C3\"\"1

- 7 . 3 + 10)
in turn, implies
is ap -63/2. Thus, a particularsolution

that C(-2) - 7
(-63/2) 3n. Of course,the generalsolution
-

an

and

+ 10an_2 =

7an_l

relation gives
- 7 . 3\". This,

recurrence

the

\342\200\242
or

3n,

homogeneous

is not a root of
C is yet

the

C3n for an

Can,
a\342\200\236

form

characteristicpolynomial

from Example
3.4.5 that the
=
4(t
2) (t 5) and that the
a\" = Cx2n + C25n. Since 3
form
solution for ap = C3n where the constant
know

We

t2

the

of

C.

of

Find a particular solutionto an

3.6.6.

Example

IHR

of the

solution

a particular

must determine

3\"

(~)

to

0,2\"

is

relation

this

+ C25\".

\342\200\242
\342\200\242
=
4- ckan_k
4- \342\200\242
Now if {a*1}^is a particularsolutionto an + c^.x
\342\200\242
\342\200\242
\342\200\242
4- c*an_fc
4\\a^)^Q is a particular solutionto an 4- c^.!
fx{n)andif
\342\200\242
\342\200\242
= f2(n)> then {a\302\243
-f
4- \342\200\242
a particular
solution to an 4- c^.i
4- a^Y^^is
=
fM) 4- /2(rc).
ckan-k

Example 3.6.7. Find a particularsolution


7

\342\200\242
3n 4-

to

an

- 7an_l

10an_2

4n.

this, we use the above

to resolve
the problem into
\342\200\242
=
3n and
47an_l
an 10a\342\200\236_2 7
particular
finding
=
=
from
4n.
We
know
3n is
3.6.6
+
(-63/2)
10an_2
Example
thatc#
lan_x
=
We know from example 3.6.5 that a\342\200\2362
a solution of the first relation.
=
is a particular solution of the secondrelation.
(-8)4n
Therefore,
apn
is a particular solution to an - lan_x + 10an_2 =
4(-63/2)3*
(-8)4n
(7)3n 4- 4n.

To solve

solutions

Now,
C(t)9

and

modification.
Let

comments

to an

on the other hand, if a is a root


if / (n) = Dan, then
above

the

us suppose

root of C{t) is m.Then

a = at
when

4/v,

of the

characteristic polynomial
some

needs

argument

for somei and that the multiplicity

a as

of

we express

DakXk +d

as a sum of partial
there
fractions,
aX)m+1. Hence a particular solution

-aX)P(X)

will be
for

one term
the

IHR

of

the

form

C/(l

has the form

ap =

Section

CC(n + m,n)an.

But

~,
C(n

and

multiplicity

\342\200\242
\342\200\242
\342\200\242

4-

make

a better

where

Enman,

is a

if a is not a root of
2. ap = Cnman
is

the

choice for a particular


E is some constant.

4-

Cxan_x

= CC(rc

solution

of

C(t)

of

of the HR.
of the IHR,

of IHR
- Dan

Ckan_k

C(t).

polynomial

of IHR

solution

if

is a

root of

C(t)

of

m.

multiplicity

Example
2n. Since

=
a particular solution of an - 4an_l 4 4a\342\200\236_2
=
=
=
4t
4
t2
is
4
(t
2)2,2
polynomial C(t)
=
ap
Cn22n.
solution
is
thus
a
trial
2,
Substituting
relation, we obtain

3.6.8.
Find
the characteristic

is a rootofmultiplicity
the recurrence
-

Cn22n

4C(n

- l)2 2n~l

C2\"-2 [4m2 -

or

C[8]

- 22,

solution,and

- 2)2 2n\"2

4C(n

8(n - l)2 4

2)2] =

4(n

orC = 1/2. Therefore,


apn

n22n/2

2\",

2\\

is a

an-

\342\200\224

2n

+ Cl2n

+ C2n2n

is the generalsolution.

Trial solutionsfor products


of

exponentials.

degree m.
4 m,n)an

rules:

\342\200\242
\342\200\242
\342\200\242
4-

characteristic

a particular

n of

in
a\302\243

a is a root
is a solution

Prn_inm~l)an

solution

particular
+

1)
,

\342\200\242
\342\200\242
\342\200\242
4

the following

have

we

summary,

Thus,

(n 4

1)...

because

But

Pmnm)an.

an

into

m!

4- PiM 4

1. ap = Caa

m,n)

namely,let apn

In

m)(n +

m,rc)

m, (P0
can

we

Thus,

(n 4

4-

this product will yield a polynomial


\342\200\242
\342\200\242
= P0 + P^
and
4- \342\200\242
4 Pmnm

expanding

Thus, CC(n 4= (P0 4- Pxn

315

Linear Recurrence Relations

of Inhomogeneous

Solutions

3.6

Now

let

us suppose

/(*)-(P0

polynomials

that

+ Pi*+

\342\200\242
\342\200\242
\342\200\242

+Psns)an9

and

particular

316

Chapter

3: Recurrence

Relations

whereP, areconstants.

case.

to

Again

for

solution.

a particular

Let us

the form of a particular solutionin this


generating functions to discovera candidate

desire

We

we use

do this,

do a simple exampleto illustratewhat

Example 3.6.9. Findthe form

+ 6an_2 =

n24n

for

n >

can

we

solution

a particular

of

do in

general.

to

an

han_x

2. Let

n-0

Then

Y. n24nXn

- 5X

(a,

a0+

- 5a0)X

+ ex2

Now

- 42X2

nHnXn

\302\243;

n24\"-2Xn-2,
\302\243

n-2

n-2

and we

let r = rc

we have

2, then

]T n24nXn

n2X2

(r
\302\243

n-2

Let
so

us write

(r +

\\2 2)2

r-0

\342\200\2362
r2 + 4r

+ 4

as 2C(r

+ 2)2

4rXr.

+ 2,r) + C(r + l,r) + C(r,r)

that

42X2

(r
\302\243

+ 2)2

r-0

4rXr

- 42X2 2 ]T C(r +

2,r)4rXr

r-0

l,r) 4rXr +

+ J2C(r+
r-0

= 42X2

(1 -

+ (1

42X2[2

(1

4X)3

4rX'

\302\243

r-0

- 4X)2

- 4X) + (1 -

(1

4X)2]

- 4X)3

Thus,

A(X)~

42X2 [2

+ (1 + 4X)

(1-

+
4X)3

(1
(1

- 4X)2]
- 5X +

+ (1 6X2)

4XyP(X)

4X\\

Section3.6

where P(X) = a0

- 5a0)X.

(ax

F(X)

is a

Aiir\\
MX)

(1 --

Thus,

F(X)

A(X)-where

(1-4X)3(1-2X)(1-

polynomial of 4 or less. By
B

+
-\342\200\2243

4X)3

+
TTTTo
- 4X)2
(1 -

JZ

(1

317

Linear Recurrence Relations

of Inhomogeneous

Solutions

3X)

C
4X)

(1
Now

\342\200\224

D/(l

(1

3X)

recurrence

series

The

relation.

(1 -

- 2X)

- 3X) satisfies the homogeneous

+ E/(\\

2X)

that

we see

fractions,

partial

- 4X)3 + (1 -

B
+

- 4X

4X)2

= ]T [AC(n +

4- BC(n

2,m)

l,n)

4-

4-

C]

4nX\"

a particular solutionhas the form


4- 2,n) 4- BC(n 4- l,n) 4[AC(n
But
after
the
binomial
we
see
that
the
coefficients,
C]
expanding
= n24n
4n.
above solution takes the form
44(n)
Thus,
Pin
P2n2)
(P0
/
a particular solution of the form
a polynomial
of degree 2
determines
so that
4n.

times 4n.
this

With

imitating

in mind, let us return


we did in the above example,we

example

what

to the generalcase.By
can

obtain

the following

conclusions:

3.

apn

(A0 4- Axn

4-

\342\200\242
\342\200\242
\342\200\242
4-

A8ns)an

is a

ofthelHR:
+

an

Cxan_x

4-

\342\200\242
\342\200\242
\342\200\242
4-

Ckan_k

not a root of the


\342\200\242
\342\200\242
44- Ck.
C^*\"1 \342\200\242

if

a is

4.

nm (A0
is a root

a\302\243

IHR

if

- (P0

particular solution

C{t)

4-

tk

\342\200\242
\342\200\242
is a particular solution of the
4- A8ns)an
4- Axn 4- \342\200\242
of C(t) of multiplicitym.

4- P8n8 is just
polynomial

case

a specialcaseofthe above

1. Then we need be concerned


only

characteristic

Psn5)an

polynomial

The

Pxn 4-

\342\200\242
\342\200\242
\342\200\242
4-

characteristic

Trial solutionsfor polynomials.


...

4-

Pxn

C(t).

with

whether

where
discussion

or not

f(n)

- P0
where

a =

1 is a root of the

318

Chapter

3: Recurrence Relations

Finda particular
of an - 2an_l +
= t2 - 2t 4- 1 rootof
(t - l)2of

Example 3.6.10.

solution

5 4- 3m. Since 1 is a
we use apn = An2 + Bn3
Upon
[A(n

C(t)

we have
substitution,
2)2 + B(rc - 2)3] =

6Bn = 5

have 2A

In particular,

3rc.

4-

- 5 and for

6B

and hence -B = J/2. Thus,


general solution is an

constants

[An2

this simplifiesto (2A


this holds for all n, hence for n =
- 1,2A - 6B + 6B - 5 4- 3 or 2A solution is apn = 4n2
4- CY 4- mC2, where

a particular
= 4n2
4- ^n3.

we have

noted

function

/ (n)

the

generally

l)3]

4-

6B)

0 we must
8 or A - 4

V2M3, and

4-

B.

and

the

Cx and C2 are

conditions.

by initial

Table 3-2 summarizesall we have


particular solutionsto the IHR.If/ (n)

- l)2 + B(n -

- 2[A(n

Bra3]

for

and solve

a solution

3n, and

5 +

be determined

can

that

multiplicity

as a candidate for

an_2

forms of

the
concerning
sum of different

said
is the

functions,

treated separately.If the


includes a function that is a solution to the HR,
then
form of the particular solution will include
the product
of

powers of n with

should be

function

each

that

/ (n).

Table 3-2.
Polynomial

C(a) * 0
a is a root
C(a) * 0
a is a root
C(1) * 0
1is a root

Da\"

Da\"

Dnsan

Dnsan
Dn8

Dns

Solution

C(t)

apn

Aan
of C(t)

of multiplicity

of C(t)

of multiplicity

of C

In each

Remark:

particular

of Particular

Form

Characteristic

f(n)

(t) of multiplicity

of the last four


same

solution

is the

us apply

what we have

Arfan

if Dns

(A0 +

AAn

nT(A0

\342\200\242
\342\200\242
\342\200\242
+

+ .
+ .

ff(A0 + -

\342\200\242
\342\200\242
*

is replaced by

A9n9)an

. .

(A0 + AAn

of Table

types

^/i

+ A/i^a\"

\342\200\242
.

Ajff)

Ajfi\

3-2, the form


4- Pxn

[P0

4-

of the
\342\200\242
\342\200\242
\342\200\242
4-

Psn\302\260l

let

Now

9 wherea0

10 and

to several

examples.

relation
Solvethe recurrence

3.6.11.

Example

learned

ax =

an

- 6an_i

C(t)

= t2

4- 8an_2 =

25.

First, we note that the characteristic


polynomial

Qt

4- 8

of the homogeneous
the
solution
(t - 2) (t - 4). Therefore,
general
relationHR is:a% = Cx4n 4- C22n. Since the forcing function
has
the form
= A(l)n
= A as a trial particular
we use a\342\200\236
D(l)n and 1 is not a rootof C(t),

solution.

But

Thus,

an

then

Cx4n

after
4- C22n

substituting

4- 3.

a?n

= A

into the

Now using the initial

IHR, we find

conditions

a0 = 10

= 3.

and

Section3.6
=

ax

4- 3

25, we have the system of equations Cx


= 25. But these equationssimplify
to Cx

which in turn have the solutionsCx

319

Linear Recurrence Relations

of Inhomogeneous

Solutions

= 4

3 = 10 and 4CX + 2C2


= 7 and 4C\\ 4- 2C2 = 22,

4- C2 4-

4- C2

C2 =

and

3. Thus, an

(4)(4n)

4-

+ 3.

(3)(2n)

Solve an

3.6.12.

Example

+ 8an_2

6an_x

where

3n

a0

- 3

and

= 7.

ax

we try a particular solutionof the form


and we discover A =
A3n,
after substitution into the recurrence
relation.Thus, an = (-9)(3n) 4Cx4*+ C22n, and then the initial conditions give Cx = 5 and C2 = 7. Hence,
= (-9)(3n)
+ (5)(4n) + WW).
an
Here

-9

Example 3.6.13.
ax

Solve

an

6an_x 4- 8an_2 =

where

n4n

a0

- 8

and

= 22.

Here the particular solution takes the form


n(A0
root of characteristicpolynomial
of
multiplicity
expression into the recurrencerelationgives

- 6(n -

4- AlHn

n(A0

1)

4- Ax

(A0

- 24(n -

4- Axn)

16n(A0

term

the common

by canceling

1)

(A0

- 2)(A0
we

4n\"2,

Al(n-1))

4- 8(n
is an

this

Now

n = 0 we
obtain

and

the

4- 3AX

A0

Ax

that holds

expression

obtain

= 2.

1. Hence,

These equations
apn

n(-l

A0

(n

4- Ax

2)(A0

- 2))4n-2

n4n

the

4- rc)4n =

(n

- 2)) = 16n

particular for
and then for n = 1 we
solution
A0 = -1
unique
of n, in

values

4- Ax

have

4- Ax

is a
this

have

all

for

equation

simplified

since 4

1. Substituting

- 1)) 4W-X

(n

4- 8(n

But

4- Axn)4n

= 0,

n(n -

l)4n

is

a particular

solution.

But then
- l)4n

n(n

relation

- l)4n

4- Cx4n
conditions

4- (3)(4n) 4-

with

Solving

n(n

the initial

and

relation,

an

the

given

(5)(2n)

initial

Systems of Recurrence
Let

us

illustrate

the following

how we

example.

4give

C22n is the general


= 3 and C2 =
Cx

is the unique
conditions.

solution

of

the

5. Hence,an =
solution to the recurrence

Relations
might solve a systemof

recurrence

relations

by

320

Chapter

3: Recurrence

Relations

Example

3.6.14.

Suppose that

For each integer n


we introduce

First,

matrix

2x2

is the

an expression for An using


1, find
give the numericalentriesofA100.
the following notation. Let

>

In particular,

relations.

recurrence

0>n
An

and observethat

n >

for

this equality

2. (In fact,

for

holds

n >

1, since we could adopt the

convention

=
A\302\260

Thus,
=

An

an-i

bn-i

Cn-l

dn-i.

\"3-

ll

2J

'3a\342\200\236_x26\342\200\236_i

3C\342\200\236_!
2d\342\200\236
-i

From the

equality of matrices,we
(1)

Where

ax

- 3,

an

(3)

cn

-1,

bx

The recurrence

(2)

3an.!,

- 3c,,.!,

bn

(4)

cx = (0, and

dx

Cn^l

four

obtain

dn

a\342\200\236_ij

recurrence

2bn_x

2dn_x

relations:.

an_l9

- cn.u

2.

relations (1) and (3)with

their

initial

conditions

that
an

3n for

n >

and cn

= 0

for n

> 1.

imply

Section3.6

321

Linear Recurrence Relations

of Inhomogeneous

Solutions

Thus, (2) and (4) become

But

(6)

dn

- 2dn.l = 0.
= 2n

dn

> 1, and we

for n

solve.

relation (5) to
A

6n-26n_1=-(3'l-1)and

(6)

solution

the unique

has

(5)

of (5) has the form


-1. Then, bn = A2n = 2n 1. Therefore,
bn

solution
B =

particular

into (5), we find


&! = -1 gives

and

B3n,
3n

the

and
is

3n

are

the

with only

left

after substituting
initial condition

unique

solution

of

(5).

Therefore,
3\"

2n

3n

An

2n

and

oioo 9100_

3100\"

A100 =
2100

Solving

Recurrence

Nonlinear

Relations

relations
Sometimesnonlinearrecurrence
recurrenceby a substitution.

1 wherea0

be

made

Solve the recurrencerelationa2n

3.6.15.

Example

n >

can

into a

2a2n_x

linear

1 for

2.

=
= 1
substitution
6n
a% This
changes the relation aj^~- 2a^_x
=
=
linear recurrence 6\342\200\236
1, and since a0
2bn
2, we see that b0 =
= 4.
By the technique of undetermined coefficients,we find that bn =
a\302\251
But in fact, since a0 = 2, an
an = \302\261
(5)(2n) - 1, and hencethat
V6^.

Let

to a

cannot

be

so

y[Fnt

an =

yj(5)(2n)

Likewise,

- 1.

takes the
determined

form

an

relations

recurrence

divide-and-conquer

appropriate substitutions.Generally,
Can/d

+ /(n)

can be

divide-and-conquer

where usually

the

values

solved using
relation
n are

of

a
an is really
by nonnegative integral powers of d. Now
of k.
function of n, but sincen = dk9 an can also be viewed as a function
When we change our perspectiveto viewing
of k, we say
an as a function
that We make a \"change of variables.\" Generally, what we do is this: let
=
> 0. Then therelationan = Can/d + f(n) is transformed
bk \342\200\224Onadk for k

322

Chapter

Relations

3: Recurrence

into the
and any

linear relation bk =
initial condition, ax

Of course, after

expression bk,
Let illustrate

7bk_x

a solution b% =
solution of the

a particular
b% =

form

the

characteristic

the

has

relation

homogeneous

reveals A

A3*. Substitution

an =

k > 1 and

- 2(3*) for

The linearrelationhas

relation

divide-and-conquer
= 5/2.
ax

> 1 and

the changeofvariablesbk

bk

Moreover,

the

Solve

n = 3* for k

We employ

- 0,

= 5/2

1,

- logdn.

an

7an/3

the transformed

a3*. Then

ax

=
d\302\260

a general

the
transformed
relation for
then solve for an using the fact that k
in the following example.
technique

Example 3.6.16.
relationis

solve

we

this

us

2m where

1.But for

we can

for

for k >
b0 = A.

Cbk_x + f(dk)
= A becomes

- b0.

polynomial
B7* for some

- 7 so that the

constant

JB.

inhomogeneousrelationtakes
=

so that

-3/2

&*=-~(3*)+B7\\

but then the initial

b0 =

condition

us to determine B = 4.

5/2 enables

Thus,

+ (4)(7*)'

6*^(3*)

Now let
the

facts

us give

a solution

that n = 3* and

for an in

terms of n

k = log3n.We

6*-all-(-|)(n)
from

Moreover,

properties

_
7iogs\302\273

Exercises

for

of logarithms,

niog37 so

that

1. Find a particularsolution
relations

(a)

an

(b)

an

then

use

that

(4)(7k\302\253l).

we know that

|L

(4)(niog37)

3.6

Section

recurrence

an

rather than k. Herewe

observe

3an_x
3an_x

using

to

the

the method

- 3n.
= n + 2.

following

inhomogeneous

of undetermined

coefficients.

Section3.6
c)

an

- 2n.

+ an_2

2anix

323

Linear Recurrence Relations

of Inhomogeneous

Solutions

- 4.

d) an- 2an_x
an_2
- 3\".
e) an- 3an^ + 2a\342\200\236_2
+

f) an - 3an_x
3an_!
g) <*\302\273
h) a\342\200\236
3an_j

2a\342\200\236_2

i)

an

3an_!

j)

an

3a\342\200\236_x 10a\342\200\236_2

k) an + 3an_! - 10an_2
1) aB - 10a,,.!+ 25an_2
(m) an + 6an_! + 12an_2

2.

the

Write

a) an
b)

g)

2an_

a\342\200\236

- 3n.

8an_3

h) an - lan.

- n.
\342\200\224
2n.

- 3\".
- 4n.

12a\342\200\236_2

+ 12an_2

the

the

general

in

relations

n4n.

solution
(the general homogeneous
plus
particular solution)of the recurrence

general solution
form of a

List

2.

Exercise

that the recurrencerelationofdegree

4. Suppose

<*n

Cxa^i

+ C2an_2

..

(a) Find
(b)

Find

.,Ck

Cl9C29..

CX,C2,..

.,C, if C(t)

(c) List the general


(t
(d)

List

(t -

(e) List

2)(t

- 4)(t

the
2)(t
the

general
4)2(t
general

(g)

C(t)
Same

as

3)(t

- 5).

C(t) -

case when

of a\"

for

the

case

when

C(t)

of

for the

case

when

C(t)

form

a^

5)3.
of

recurrence

the

a\"

- 5)3.
form

solution

3)(t- 5).
-

2)2(t

associated

the

for

of

- 5).

of

a particular
denotes
the

homogeneous

- 2)(t -

- (t -

form

(t - 2)5(t - 4)2(t
(f) List the general form

- (t

- (t

if C(t)

- f(n),

Ckan_k

associated

the

of

polynomial

relation.

k is

\342\200\242
+

for n > k, and that a\" denotesa solution


recurrence relation, apn denotes
homogeneous
to the inhomogeneousrelation.Moreover,
C(t)
characteristic

not

2n.

+ 12an_2
lan\342\200\236

- 7an_

an

(2n.

-3.

2an_

an

1.

n +

form of a particular solution a* (you


need
relations.
recurrence
constants) to the following

c) a\342\200\236
2an_ -n2n.
+ 12an_2
d) a\342\200\236
7an_
e) an - lan_ + 12an_ _2

f)

*2
n2

general

for the

solve

3.

3.

- 2\\
+ 2a\342\200\236_2
- 5n + 3.
+ 2a\342\200\236_2
- 10an_2 - n + 1.

apn when

- 2)5(*- 4)2a(f) where / (n) * 4n.

5)3.

f (n)

- 3n2 + 5n +

and

324

Chapter

3: Recurrence Relations

5.

(h) Same as (f)

where

/ (n)

= 5\".

(i) Sameas (f)

where

/ (n)

2\".

the

Solve

relations using generating

recurrence

following

functions.

an

(a)

(b)

6.

=- n

- 2(n

an_i

an_!
2an_x
2an_x

a\342\200\236

(c)
(d)

n >

for

an

the

an

- 10an_!

25an_2

the result of Exercise1 (1).


the

with

2.
1.

(homogeneous
plus particular
- 2n where a0 - 2/3and
- 3. Use
ax

solution

complete

to

Find

a0 -

- 10.

an

solutions)

7.

- 0.
1 and

= 4n_1 for n > 1and a0 - 1, ax - 3.


- 2n~2 for n > 2 wherea0 - 2 and ax =
+ a\342\200\236_2
\342\200\224
> 2 and a0 - 1, ax = 5.
+
ban_x
6a\342\200\236_2 4\"~2 for n
3*-2
for
n > 2 and a0 - 1,^
+
10an_x
21an_2

an

Find

> 1 and a0

- 1)

an

(e)
(f)

for n

\342\200\224

a0

to an +

solution

complete

2a\342\200\236_1

n +

3 for n

> 1 and

- 3.

8. Suppose that
24a\342\200\236_3 5n

- 1, ax

\342\200\224
+
9a\342\200\236_1
an \342\200\224
26an_2
=
45.
Write
the
a2
generating

relation

the

satisfies
a\342\200\236

where a0

18,

function

A(X)-f>\342\200\236X\"

quotient of 2 polynomialsP(X)/Q(X).
the
recurrence
relations for a particular solution.
following
- 5an_! +
- n.
an
8a\342\200\236_2 4an_3
=
an
ban_x + 8an_2
4a\342\200\236_3 2n.

as a

9.

Solve
(a)

(b)

an
(d) an

- 5an_! +
- 50^.! +

(e)

(cj

an

10. Show

5an_x

that the
an

finding

n2n.

divide-and-conquerrelation
=

+ (n

2an/2

bfc

= 0

4an_3

- 3n.

8a\342\200\236_2 4a\342\200\236_3 1.

solved for n
solving the relation

then

4a\342\200\236_3

8a\342\200\236_2

can be

and b0

8an_2

by using

2*

by

2b*_i

\342\200\224
for

1)

2; and

the change

using

n >

ax

= 0

of variables

the method of undeterminedcoefficients,

a2* from bk.

an = 2an/4

+ n for n

a^,

lforife^l

2*-

11. Choosean appropriatesubstitution

bk

to

= 4*

translate
>

4 and

c^ =

and

Section3.6

12.

13.

325

Linear Recurrence Relations

of Inhomogeneous

Solutions

this
relation
into a first order relation.Solve
by undetermined
coefficients and then find a4*.
recurrence relationsin Exercises7,
Solve the divide-and-conquer
10
of
Section
3.4
the
and
8,9,
by
changeof variables
technique.
Solve the recurrence relation an = b(an_x)2
for n > 1 and a0 - 1.
Here make the substitution bn = log2(an),
solve the linear
recurrence
for
then
find an.
relation
and
bni
inhomogeneous

14. Solve the recurrence


relation
where k > 0, and where ax
bk =

substitution

15. Show that

wherec and

an

- n for n
3.
Hint:
make
a2

5an/2 4- 6an/4

1 and

Ax

CXogdin)

is a

A2(n)

solution to an

and n is a powerofd if

constants

e are

C is

and conquer recurrence for


in
a
tennis
tournamentwith n players,
played
a divide

solve

matches

2\\
the

02*.

d.

16. Find and

an

Can/d not equal

en,

number

of

the

where

to

n is a

powerof 2.

17.In

local

five

every

five salespeople report to a local manager,


managers
report to a district manager,and so forth
every

vice-presidents to the firm's president.If the firm


where n is a powerof 5,find and solve the divide

finally five

until
has

firm,

large

n salespeople,

and conquer

recurrencerelationsfor:

(a)

(b)

the

the

the

in

firm.
by making an appropriate
into linear recurrences with

relations

recurrence

following

substitutionto transform

the

relations

coefficients.

constant

(a)

(local managers up through the

of managers

number

president)

18. Solve

managerial levels in the firm.

of different

number

the

4aTn

(b)

nan

(c)

a\\

(d)

an

(e)

an

- 2Va^ -

Ja~i

where

00

1.

0!-

2n where a0 = 10.
4- nan_x
an_x
= 0 where
a0 = 8. Hint: let bn
2a\342\200\236_!
- nan_i = n! for n > 1 wherea0 = 2.

wherea0

1 and

ax

log2an.

- 2.

Gn-2

(f)

5nan_! +

an +
=

(a\302\273-i)2 (a\302\273-2>3where

(g)

<*n

(h)

na\342\200\236

(i)

nan

(n (n 4-

2)a\342\200\236_!

relations.

= 0

l)an_2

a0

= 4

2n where

> 0, solve

(Assume

=
F\302\260

where

and ax -

a0

l)an_! = 2n where a0

. For n

19. LetF=

recurrence

6n(n -

for

a0

- 6 and ax

17.

4.

- 5.
=

1.

entries

the

of'F\" using

326

Chapter

3: Recurrence Relations

3 2
20. Let

n >

For

0 solve

for the entriesofA

using

recurrence

relations.

21. Solve

exercise 20 for

A =

matrix

the

6l

[4

[l

22. Solve exercise20 for

A = [2

matrix

the

5J

[l

\302\2601

3J

defined on N
23. Ackerman's function
is a function
the set of nonnegative integers,as follows:

x N, where

is

1
if m = 0
A(m - 1,1) ifn =0
- 1)) otherwise.
A(m
l,A(m,n
n +

A(m,n)

Then,

for

A(0,A(1,0))

A (1,1)

example,

A(0,A(0,1))

A(0,2) = 3.
(a)

= A(2,n -

then

function to showthat A(2,n)


n > 1 where A(2,0) = 3. But
integers
this recurrence relation, observethat

definition

the

Use

1)+ 2

by solving

of Ackerman's

for

all

A(2,n) = 2m
(b)

As

in

(a),

show

n >

0.

that

A(3,n) =

24. Solvethe

3 for

divide-and-conquer

2n+3

3 for n

relations

> 0.

using

a change

of

variables.

(a)

(b)
(c)
(d)

(e)
25. (a)

an =

5an/2 4- 4 whereax =
= 4 where ax =
2an/z

0 and

n =

2k

for

k >

0.

5 and n = 3* for k > 0.


an
\342\200\224 = 2m where
=
1 and n = 8k for fe > 0.
an
ax
3a\342\200\236/8
=
=
n
where ax 5/2 and n = 3fe for k > 0.
an
5an/3
\342\200\224 = n where
an
ax = 7 and n = 5* for fe > 0.
5an/5
at 13.9%
interest.
$40,000
Suppose that a person borrows
is
which
includes
the
that
$530,
monthly
payment
Suppose
on the balance owed. At
payment on the principaland interest
a new loan
the
end of seven years, the borrowermust negotiate
\342\200\224

Section

Solutions of Inhomogeneous Linear RecurrenceRelations

3.6

owed. How much of the principalwill

the balance

for

after

seven years?

(b) If P is the original


r is

and

balance

26.

Review

4log*n
27log\"1

for Sections

1.
2.

be

owed

p is the payment for each period,


rate of interest, derivea formula
for Bn, the

principal,

the period

owed after n

periods.

k where

Find

(a)
(b)

327

= nk

nk.

2.8-3.6

all n -digit
decimal numbers, how many
0,1,8,9?
digits 2 and 5 but not the digits
At a theater 20 men check theirhats.In how
hats be returned so that
(a) no man receives his own hat?
Among

of them

many

contain

ways

the

can their

his
hat?
own
(b) at least oneofthe menreceives
least
at
of
the
men
receive
their
own
two
hats?
(c)
3. Find a recurrence relation for an, the number
of ways a sequenceof
l's and 3's can sum to n. For example, a4 - 3 since 4 can be
obtainedwith the following sequences: 1111 or 13 or 31.
4. Find a recurrence
for the number of n -digit quinary
relation
use
that
have an even number of 0's. (Quinary
sequences
sequences
only the digits 0,1,2,3, and 4.)
as the
5. Write a general expression for the generating function
A(X)
the
Q{X)
by specifying
quotient of two polynomialsP(X) and
coefficients of P(X) and Q(X) where
the
A(X)
generates
sequence an for n > 0 where a0 = 1, ax = 0, a2 = 1, and for n > 3, an
- 0.
satisfies the recurrencerelationan - ban_x + 8an_2 - 4an_3
6. Write the generalform
of the solutions
of the following:
=
0.
(a) an
9an_x + 14an_2

(b)

7.

&n

the

Write

(a)

an

(b)

an

(c)

an

6an_x

+ 9an_2

general

- 9an_x +
9an_x +
9an_x +

form

- 0.

of a

particular solutionto the following:

14an_2= 5(3n).
14an_2= 7n.
=

14a\342\200\236_2

3n2.

and conquerrelationan = San/5


and n is a powerof 5.
9. Find a simple expression for the power series
8. Solve

the divide

(n
\302\243

n-l

4- 2)(n

4- l)(n)X\\

+ 3

where ax -

328

Chapter

Relations

3: Recurrence

10. Find

a simple expressionfor

the

by

generated

sequence

5
X2
+ rz
+
^
(1-X)3\" (1-3X)3*

(1-2X)

SelectedAnswers for Section3.6

1.

(a)

Try

ap

(b)

Let

ap

- An3\". Substitute

\342\200\242
2\" =

Try ap -

B, get

2A

to find
-

B - -7/4. Hence

- -1/2,

(c) a* - 4
(d)

An

a characteristic

1 is

(f) Since1isa characteristic


-3.Thus,a\302\243 =

(j) Since C(t) = (t

Solve

for

2.

- A2\";

apn

(m)

a\302\243 (27/125)3\".

(a) a*

5)(t

and

find

- (7/4).

let

aj

root.
= An.

Solving get A

and 1is not a characteristic


+ C. Substitutingand equating

- 6B -

1,-37

17B

root,

- 6C

= 1.

= A.

(b)

ap

= An2\"

(d)

ap

= An

(f)

ap

(h)

Leta\302\243

since 2 is a characteristic
root.

+ B.
since

An3\"

12 = (t - 3)(t = n(Ara

root of C(\302\243)=

a characteristic

3 is

4).

t2

- 7t

A(X)

a\342\200\236X\"
\302\243

^-^L-

X
(1

(b) A(X) =

- Xf

1-

+ B)4\".

that
d - -12, C2
(b) C(t) = t* - I2tz + 51t2 - 92t + 60implies
60.
51, C3
-92, C4
(c) a^ = C12n+ C24n + C35\".
+ C3n22n
+ C4n32\" + C5ra42\"
+ C64n
(e) a* - C,2n + C2n2\"
+ C9n5n + C10ra25\".
C7\302\2534n + C85n

(a)

2n+2/9.

(g) ap -An24\".

5.

nZn.

solving,

- 2)

- 4/9; a* -

(1)

(e) ap = A2n.

4.

A,

2,

-3ra.

- -1/6,34A
B, and C.

get

coefficients,

root,

+ Bn

a\302\243 An2

try

1,3A
a* - (-n/2)

so ap

2n+2.
since

Ara2

= 1

- 2B -

x)3

(1

rj. Thus,

(n + l)(n)

a\342\200\236

2X2

+
+
X

(1

an
\342\200\224j;
- X)3

= 2

2
+

(n)(\302\273

1).

Linear
Solutions of Inhomogeneous

Section 3.6

(c) A(X)-z

1/2

- 4X)

2X)(1

:;
1 - 4X'

that A(X)

Observe

2X

!/2
(d)

1 - ^ + (1
1 - 2X

1 M
\342\200\236\342\200\236
= -2\"
a\342\200\236
\"

(f)

+ 1) +

2\"

(1-

3\"

-- 7X)

3X)(1

- 3X/
48 (r J_)_J__
an'

- In +

2\".

X2

-35

-35
48

- X)2

2XH1

(1-X)2 1-2X'
-

\342\226\240

A(X)

X2
_

- 7X + 7X2
- 2X)(1 - X)2
3
2

~(1-X)
Thus,

\342\200\224
3X

2
(1

- 2(n

+ -4n.

+
^ _ x^ (i

= 3
a\342\200\236

12

(ra +

(1

12(1-

1)3\"+

.-7X)

3X)2(1

+
3X)2

29

16 (1 -

29

\342\200\236\342\200\236
\342\200\224

7\".

16

<

2n+2

6.

a,
a.-\302\247F

~9~'

11

n
\342\200\236sn

16,

\302\273.
aia

\\nbn

_ (1

+ 9X

- 91X2)(1
-

(l _ 5X)(l

329

Relations

Recurrence

5X)

_ 9X + 26X2 _

X353
\342\200\242
24X3)

1
7X)

and

Relations

Digraphs

GRAPHS

DIRECTED

AND

RELATIONS

In Chapter 1 the conceptof relation was


introduced
and
used to
illustrate how the languageofsettheory
can
be used to build a framework
of precise
for more complex structures. The usefulness
of
definitions
relations
however.
relations
are
After
the
sets,
probably
goes beyond this,

most basic and extensively

used

relations.
The connectives
Mathematical
induction, on

tools

which
based on orderingrelations.Applications
science

throughout
computer

and

inputs

in

attributes

outputs
databases,

languages.

This

will

then
begin

chapter

of mathematics.

All

G, C, and = of set theory


all

virtually

of

relations.

rests, is

of mathematics

relations

are

functions
are

are found

and engineering,
including relations between
of computer
programs, relations betweendata
and relations
between symbols in computer

the

to a more detailedtreatmentofrelations.
We
relations and special propertiesof binary
relations,

is devoted

review

binary
look at some
by introducing

applications of binary
a useful way

of viewing

and

rc-ary

binary

relations.
relations

We

will

as directed

graphs.

Consider the diagram in Figure 4-1.This is a directed


graph
eleven
the kinship relation \"is parent of\" between
people.
representing
Each person is represented by a point,
each
and an arrow is drawn from
three
children
to
each
of
T
hus
Terah
has
the
children.
parent
respective

331

332

Chapter

and Digraphs

4: Relations

\342\200\242

Nahor

Esau

\342\200\242Jacob

\342\200\242

The relation

4-1.

Figure

\342\200\242
Abram

shown:Nahor, Hanan,and

\"is

of\" on

parent

The

Abram.

Isaac),
(Milcah,
(Hanan,Sarai),
(Sarai, Isaac), (Bethuel,Rebecca),

Milcah),

Jacob),

(Isaac,

Esau),

(Isaac,

Jacob)}

(Rebecca,

when
viewed
purposes, relations appeareasierto understand
graphs than when viewed as sets of orderedpairs.It
easier
to see, for example, that Isaac and Bethuelare cousins
than it is from the orderedpairs.
diagram

For many

as directed
probably

from

the

Definition4.1.1.*

if E

(digraph)

V. The

pair

*Unlike

other

between

this

book and

edge
an

such as

the

called

the

subject.

vertices

and the

to be from
tail at x

and the

and

geometry

notation

author to author. The


should be prepared
reader

other bookson

is

(V9E) is a directedgraph
are

is said
(x,y)
with the
arrow

the

standard,

from

much
but

of

elements

of mathematics,

areas

become fairly

G =

sets

of

elements of E are callededges.An


and is represented in a diagram by

terminology has
graph theory vary
widely accepted,

by

Bethuel),

(Nahor,

Bethuel),

(Abram,

Esau),
(Rebecca,

represented

Abram), (Hanan,

(Terah,

Nahor),

(Terah,

Hanan),

relation

binary

this directed graph is the setofpairs:


{(Terah,

a set of people.

and
terminology

algebra,

x to

where
used

definitions

used

y,

here

to encounter differences

in

is

Section

Relations

4.1

and

Directed

Graphs

333

head at y. Such an edgeis saidto be incidentfrom


to y,
x> incident
and incident on both x and y. If there is an edge in E from x to y we say x
is adjacent to y. The number of edges incident from a vertex is calledthe
of the vertex and the numberof edgesincident
to a vertex
is
out-degree
called the in-degree. An edge from a vertex to itself is calleda loop,and
A digraph
will
with no loops is called loop-free
be permitted.
ordinarily
to require all digraphs to be
some
authors
or simple. (Though
prefer
in
will
useful
we
find
expressing certain binary relations.)
loop-free,
loops
all directed
Unlessspecified
to the contrary,
graphs are presumed to be
set.
V
is
to
be
a
finite
assumed
that
is,
finite;

4-1,the edge(Terah,

4.1.1.
For the graph shown in Figure
Terah to Abram. There are two edges
incident
on Abram.
is incident
to Abram and (Abram, Isaac) is
(Terah, Abram)

Example

is from

Abram)

The edge

incident

for Terah,

Note

for

that

any

which has

digraph

relation R C

any binary

vertex

No

Abram.

from

except

two,

or out-degreegreaterthan
out-degreethree.

has in-degree

(V9E)9 E is a binary relationon V. Likewise,


may also be viewed as a digraph G - (A U
of
of binary
relation
on a set and the notion

x B

B,R). In this sensethe notion


are equivalent.

digraph

In the remainder of this book, the terminology


for
and the
digraphs
A relation
terminology for binary relationswill be used interchangeably.
will
as a digraph when concepts that are traditionally
be treated
graphsuch as path properties, are involved.
On
the other
theoretic,
hand, a

digraph will be treatedas a relationwhen properties


in terms
of relations are involved,
such

traditionally
phrased

that

are

as irreflexivity

and

transitivity.

Digraphs are a specialcaseof a


directed multigraph.When
more
one

from

graph

general

one

type

edge is

of graph called a
permitted incident

multito another vertex, then the resultis a directed


x to a vertex
two or more edges incidentfrom
a vertex

vertex

and

more

than

then

are calledmultipleedges.

In

to

addition

nondirected

graphs

digraphs
and

and
nondirected

directed

multigraphs,

multigraphs

there are also


direction of

where the

considered. Since the term graph applies


to all of these, we
careful when we use it that we are clear about the kind of graph
we
mean.
there
are a few contexts where, due to the
Fortunately,
of these
different
kinds of graphs, it is not necessaryto make
similarity
suchdistinctions.Forexample,
form
of graph may be viewed as a
every
of
a set of edges, so that the definition
and
pair (V,E)ofa setofvertices
is
That
all
kinds
of
below
is
for
why
subgraph
graphs.
adequate
given
edges

is not

must be

334

Chapter

4: Relations

and

Digraphs

Sarai

\342\200\242

Abram

\342\200\242

Isaac

A proper

4-2.

Figure

of the

subgraph

digraph

in

Figure

4-1.

and
in definitions
the term graph is used insteadof digraph.
By contrast,
the statements of theoremsthat do not apply to all kinds of graphs we
we intend.
will
to specify which kind of graph
be careful
4.1.2.

Definition
G =

(V,E) if

G1

graph

VandE1

n
\302\243

- (V\\El) is a subgraph of a graph


(V1 x V1). G1is a proper subgraph

G.

ofGifG1

V1

4.1.2.
The digraph shown
Example
vertices {Sarai,Isaac,Abram}
and
the
of the digraph
Isaac)}is a propersubgraph

Frequently it happensthat
graphs that have only to do
this

For

sets.
introduced.

means

Definition 4.1.3.
isomorphic if there

Two

E2.

graphs

and

G1

w in

\302\253

and

(VlfEx)

G2 =

onto function f: V!

adjacency,we
V^, (v,w)

mean

is in Ex iff

for
(/

(V2,E2) are
\342\200\224\342\226\272
that

V2

that
digraphs
(v), / (w)) is in

this is

of stating

way

wishes

a one-to-one

is

for every pair of verticesv


Another

one

with the

By preserving

adjacency.

preserves

4-2, comprised of the


{(Sarai, Isaac), (Abram,
shown in Figure 4-1.
Figure

to ignore differences between


namings of vertices in the vertex
the concept of graph isomorphism is
\"having the same form.\"

purpose,

Isomorphic

in

edges

E2-{(f(v),f(w))\\(v9w)EEl}.

In this casewe

= g{G2)

g(Gt)

thaX

call

Some

(directed

graph)

isomorphism

of

number

from Gx

isa
(under isomorphism)
g on
whenever Gx and G2are isomorphic.

of

examples

the

fa

of graphs

invariant

function

graphs

G2. An

such

of digraphs are the number of vertices,


the \"degree spectrum,\" which is the collection

invariants

and

edges,

to

of
in-degree of a vertex and j isthe out-degree
Note
that
of
the
for
vertex
each
graph.
pair
same
values of invariants, but that
the
graphs that are isomorphic have
that can guarantee that two graphs are
set of invariants
there isno known

of
the

where i is the
with one
vertex,

(ij),

pairs

same

isomorphic.
Example 4.1.3.
both

have

five

(2,1),(2,1),

(0,4).

vertices,
A

The

digraphs

eight
digraph

in

4-3 are isomorphic. They


degree spectrum (2,1),(2,1),
isomorphic to either of the

Figure

edges, and
that
is not

Section

Relations

4.1

Directed

and

335

Graphs

\302\273\302\273$
e

(a)

(b)

Figure

4-3. Isomorphic digraphs.

digraphs in Figure4-3 is shown

too,

has

five

in

edges,

eight

vertices,

(2,1),(2,1),(0,4).

4-4.

Figure

that this graph,


spectrum (2,1),(2,1),

Note

and degree

ExercisesforSection
4.1
1.

Draw

(a)

the

The

digraph

relation

of each of the following


\"divides,\" defined by \"a

positive integer c such that

{1,2,3,4,5,6,7,8}.
(b) TherelationC on all
(c)

2.

Specify

3.

(a)

The

# on

relation
the

in-degree

in Figure4-1.

the

the set
and

relations.
divides

\342\200\242
c =

subsets

nonempty

b\"

b iff there

exists a

on the

integers

of the

set {0,1,2}.

{0,1,2}.

out-degree

of each vertex in

the edge sets for the digraphs (a) and


Give
(b) shown
4-3 as sets of ordered
pairs.
(a) to (b), described
(b) Give a specific isomorphismfrom
in (b)].
in (a), vertex
orderedpairs [vertex
are
there
between (a) and
(c) Howmany
isomorphisms

4. Provethat

the

eitherof

the

shown in Figure
digraph
in Figure 4-3.
shown

ones

Figure 4-4.

the digraph
in Figure

as a set of

(b)?

4-4 cannotbe isomorphic


to

336

Chapter

4: Relations

and Digraphs

Figure 4-5.

5. (a)

the subgraphs
with four vertices and two edges
of the
in Figure 4-5, up to isomorphism.
That is,donot repeat
that are isomorphic.
graphs
Do the samefor all subgraphs
with four vertices and three
all

Draw

digraph

(b)

edges.
(c) Do the same

for

all

vertices and

four

with

subgraphs

four

edges.

(d)

Do

same for all

the

subgraphs with

five

and

vertices

four

edges.

6. Prove that each of

the

invariants

cited

in this

section is truly

an

invariant:^

(a)

of vertices;

the number

(b) the number


(c)

of

the degree

edges;

spectrum.

y SupposeG is an arbitrary
digraph with
of
number
isomorphisms
largest possible
(Choose G to maximize this number.)

8.

Suppose

is

an

may

have?

maximize

Selected

(Treat

this

digraph

arbitrary

largest possiblenumber of

distinct

isomorphic

number.)

Answers for Section 4.1

with

subgraphs

subgraphs

What
G and

vertices.
between

What

vertices.

with

k vertices

as distinct.

is the
itself?
is the

that G

Choose G

to

Section

Relations

4.1

and Directed

337

Graphs

(b)

(c)

fc

\342\231\246

^I-f

2.

JD. -degree

vertex

Nahor

Hanan

Bethuel

2
1
1
1
1

Isaac

2
1

2
2

0
0

Abram
Milcah

Sarai

Rebecca
Esau

Jacob
3.

(a)

\"

\"*

out-degree

Terah

*.^

A ^\342\200\224\342\200\224\342\200\224

{(a,6),(6,^),(e,d),(d,a),(c,a),(c,d),(c,6),(c,e)}

[(a,b)Aa,c),(a,d),(a,e),(b,c),(c,d),(d,e),(e,b)}

(b,c) There are four

Vertex

isomorphisms.

possible

correspondto vertexa in (b),sincethese

with

other

out-degree

vertices

four

in (a)

and

the

c in (a) must
only vertices

zero. Once

in-degree

is paired with

are

one of

are
(b), the rest of the correspondences
fully
the definition of isomorphism.The isomorphisms

{(c,a),(6,6),(e,c),(d,d),(a,e)}

[(c,a)9(b,c)9(e,d),(d,e),(a,b)}

{(c,a),(6,d),(e,e),(d,6),(a,c)}

{(c,a),(6,e),(t?,6),(d,c),(a,d)}

these

vertex

a corresponding

determined
are

thus:

in
by

338

Chapter

4: Relations

and Digraphs

There are,

of

many

course,

contradiction.Hereis one:

proofs.

They

generally proceed by

a sequence of edges (a,d),(d,a)


that
d, and back to a again.Suppose/ is an
from
this digraph to digraph (a) in Figure4-3.Then
isomorphism
(a),
(d)),(
f (d),f (a)) must also be a sequence of edges leading
(/
/
from
to
there
is no such
/ (d) and then backto / (a).Since
/ (a)
in
of
such
no
sequence
edges
digraph (a),
isomorphism
/ can
The

digraph

of Figure

4-4 has

goes from vertex a to

possibly exist.

5. (a)

\342\200\242
-\342\226\272\342\200\242

-\302\253\342\200\242

-*\342\226\272\342\200\242

-\342\226\272\342\200\242-*-

(d)

Try

taking

away one

edge in as many

ways

as possible:

Gx to G2.
Suppose that / is an isomorphismfrom
of one-to-one
onto
the
definition
(a) It follows from
between the
a one-to-one
correspondence
gives

and

G2.

is a one-to-onecorrespondence
between
of Gx and
edges
= (/ (x), / (y)).
by: f((x,y))
given
in
.,vn is a list of the verticesof Gl9 ordered
vu..
Suppose
order of in-degree, and within
vertices
of equal
decreasing
in-degree, by increasing out-degree. For any vh f (i;,) has the
same in-degreein G2 as u, has in Gl9 and likewisefor out-degree.
is because every edge {vi,Vj)
in Gx corresponds
This
uniquely to
an edge (f(Vi),f(Vj))in G2, and for every edge in G2 there is

(b) There

edges of G2

(c)

function that /
vertices of Gx

Section

4.2

. .(in-degree(i;n),out-

(in-degreed),out-degree^)),.

identical to the degreespectrum


(in(i;x)),out-degree(
/ (i^))),. . .(in-degree(/ (i;J),outmust be

degree(O)
/

degree(

/ (vn))).

degree(

7. There

are n! isomorphismsbetween

the

The

There are

possible edges,
these

and

For each set of k

There

edges.

subsets

distinct

2*2

the

are thus

that

itself.

k that

\342\200\242
(\302\243) 2k* possible

be

may

are k2

there

vertices

may be

of

number

largest

of size

subsets

distinct,
(\302\243)

the n vertices.

from

formed

vertices gives

digraph on n

complete

subgraphs.

with

digraph

complete

and
.,n}x{l,...,n}),
loops on n vertices,({l,.. .,n},{l,..

8.

339

Relations

edge in Gx. Thus the degreespectrum

a corresponding

such

of Binary

Properties

Special

formed

from

with k

subgraphs

vertices.

4.2

SPECIAL PROPERTIES OF BINARY


The

following

RELATIONS

special properties,

relation, occur often

enough

which may

be

possessed

1. Transitivity

Vx,y,2,

if x R y and y R

2.

Reflexivity

Vx,

xR

3.

Irreflexivity

Vx,

xftx;

if x

5. Antisymmetry

V*,y

if x

6. Asymmetry

Vx,y

if

It

is

digraph
whenever

to restate these
if
is transitive

interesting

(relation)
there is

z, then x

Ryf theny R x;
R y and y R x, then x

xRyy

any

theny

three

y\\

Jftx.

properties in terms of
for

binary

x;

Vx,y

4. Symmetry

by a

have names:

that they

in mathematics

vertices

digraphs.

x,

y>

and

z,

y to z there is also
y and an edge from
illustrates a transitive relationon the set
need not
z in the definition of transitivity
Note
{u,v,w,x9y,z}.
4-7 is not a transitive
in Figure
be distinct. For example, the digraph

an edge from

x to

an edgefrom

x to

z. Figure 4-6
that
xf yy and

\342\200\242

\342\200\242

s^~

Figure

JC

\342\200\242

\342\200\242

4-6.

A transitive relation.

V
9f

\342\200\242

z
\302\273
\342\200\242

340

Chapter4: Relations

and

Digraphs

Figure

4-7.

is not

that

relation

transitive.

A relexive

4-8.

Figure

relation.

Figure 4-9.

relation.

irrefldxive

An

Figure 4-10.
relation.

[The edges
are

definition,

(xfx), (yfy),
if

itself (sometimescalleda

vertices

have

and

{x,y9z}

and

which

(z,z),

it

It

self-loop).

4-9 illustrates

Figure

vertex

every

4-8

Figure

self-loops.

(Note also

relation.

symmetric

would be

required by the

missing.]

is reflexive

A digraph

is

illustrates

a relation on
that a graph

possible
as Figure 4-11 illustrates.)
if for every
is symmetric
digraph
is also an edge in the
there
that

from the vertex to


if none of the
a reflexive relation on

has an edge
is irreflexive

{x,y,z}that is irreflexive.
be neither reflexive
nor

irreflexive,
A

points

edge in one directionbetween

oppositedirection

two points.

Figure 4-10 showsa symmetric

relation

antisymmetric
points
them in both directions.Figure4-11illustrates
if

An

relation.

even

the

self-loop

permitted.

Properties(l)-(6)
of binary
special
kinds

equivalence

that
relation.

have an
an

is

edge going between


antisymmetric

the asymmetryproperty.

at x violates

used

are

relation

distinct

two

same

A digraph

are
is still further restricted. Self-loops
digraph
since
The digraph in Figure 4-11 is not asymmetric,

asymmetric

not

no

the

between

on {x,;y,z}.

relations

is transitive,
A

binary

in various

that are

as axioms to define
useful in mathematics.A binary

combinations

an
is called
reflexive, and symmetric
that is transitive, reflexive, and
relation

Section

Special Properties of Binary

4.2

341

Relations

4-11.

Figure

An antisymmetric

relation.

antisymmetric is called a partial ordering relation.


properties were introduced in Chapter 1 and will be

once. In the next section,we shall


(l)-(6) to a relationthat is neither

relation.

of these

Several

seen again

more than

of properties
ordering nor an equivalence

an application

consider

a partial

Exercises for Section4.2

1.

an

Give

satisfies

of a

example

each of

the

nonempty set

following

and a relationon

combinations

digraph of the relation.


(a)

symmetric

and

transitive,

(b)

symmetric

and

reflexive,

(d)

transitive

but not
but not

the

of properties;

set

that

draw a

reflexive.

transitive.

(c) transitive and reflexive,but not symmetric.


and

reflexive,

but not

antisymmetric.

but
not reflexive.
(e) transitive and antisymmetric,
(f) antisymmetric and reflexive, but not transitive.
2. For each of the following digraphs, state which of the special

properties(1-6)

satisified

are

by

the digraph's

(a)

(b)

(c)

(d)

relation.

342

Chapter

and Digraphs

4: Relations

3. Prove or disproveeachofthe following:


(a)

implies

Asymmetry

antisymmetry.

(b) Symmetry and transitivity


(c) Antisymmetry implies

(d)
4.

and

Asymmetry

the

of

Which

digraph if
5.

it

six

Draw

changes

imply transitivity.

together

symmetry

(1-6) must apply


properties
to the whole graph?
applies
each

digraphs,

to the

reflexivity.

imply

together

asymmetry.

by making

digraph shownbelow

the

to every subgraph of a

to make

required

of

number

minimum

it satisfy

one

of the properties(1-6).

Ot6.

^\302\273-\342\200\242

fc
\342\226\272
\342\200\242-

that R is a symmetricand transitive relationdefined


on a
Consider the following
If
G
R
then
(afb)
argument.
that
then
that
(6,a) G R. However, transitivity
symmetry
implies
implies
Find the fallacy in this argument.
{a,a) G R. Thus, R is reflexive.
Considerthe relation R defined on the set of positive integersby
G R if x divides y. Which
of the 6 properties
does R satisfy?
(x9y)
Provethat if R is a transitive and irreflexive
relation
on a set A,
then R is antisymmetricand asymmetric.
Suppose

set A.

7.
8.

9. Let

relations

be

and

on a

set

A.

Prove

following:

(a) If

are

and

asymmetric,

then R U

or

the

disprove

S and

are

are

asymmetric.

(b) If

are

and

antisymmetric,

then R U

S and

antisymmetric.

10. State
(a)

the negationof:
R is

Relation

(b) Relation
11. State the

both reflexive

is either

If a

or transitive.

relation R is reflexive, symmetric,and transitive, thenR

(b) If a relation R

is

relation.

an equivalence

is reflexive,

then

R =

R'1.

nonzero rational numbers. For a,b G A, define


integer. Provethat R is reflexive and transitive but
not symmetric,antisymmetric,
or asymmetric.
Let A be the set of all nonzerorealnumbers.
For
a,b G A, define
(a,b) G R if a/b is a rational number. Prove that R is an

12. Let A
aRb

13.

symmetric
of:

contrapositive

(a)

and transitive.

be

the

if alb

equivalence

relation

set of

is an

on A.

Section 4.2

SpecialProperties

of Binary

Relations

343

14. Let A be the set of rational numbers. For a,b G A, define


(a,b) G R
if a-b is an integer. Provethat
R is an equivalence
relation on A.
15. LetD be the diagonal
of A x A, that is, D - {(a,a)
\\ a G A} is the
identity relationon A. Prove that a relation R on A is:
(a)

reflexive

(b)

irreflexive

DCR

iff

iff

- 0,

the empty

1. (a)

(b)

set.

4.2

for Section

Answers

Selected

D R

_\302\251

\302\256L

\302\251_

J\302\256[

\302\251_

\302\251
-*\342\200\242\342\200\242

.\302\251

(c>

(d)

'(e)

(f)
2.

irreflexivity,

(a)

transitivity,

(b)

antisymmetry

(c)

transitivity,

irreflexivity,

(d)

transitivity,

reflexivity,

3. (a)

If x R y implies y
Thus,

(xRy

vacuously,

antisymmetry,

asymmetry

antisymmetry,

asymmetry, symmetry

symmetry,
it

and yRx)

B\" must

(c)

antisymmetry

and y R x) must be false.


implies x = y. (Just as \"if A

(x R y

x, then

always be true when


(b) Counterexample:
then

A is

false.)

\302\251.

\302\251

Counterexample:

\302\251

\302\251

344

Chapter 4: Relations and

Digraphs

4.2.1

have

must

asymmetric

since a digraph that is symmetric

like (a),

Vacuous,

(d)

and

no edges.

Big O Notation

Thereis

of comparing

way

the \"sizes\" of functions,commonly


called
in many areas of applied
useful
very
of the
times of algorithms.
analysis
running

that has proven

oh notation,\"

\"big

mathematics,especiallyin
it expresses a relation
because
This notation is particularly
interesting
is neither
a partial ordering nor an equivalence
that
between functions

relation,

sometimes

it is

though

applied as if

mistakenly

it were

one or

the

other.
from the set of
R be
a function
Definition 4.2.1. Let g: N \342\200\224\302\273
the collection
into
the
real
numbers.
denotes
0(g)
nonnegativeintegers
c
k (possibly
which
of all
functions
for
exist
constants
and
there
f:N\342\200\224+R
n > k, | / (n) | < c \342\200\242
different
for each /) such that for every
| g(n)
|. If / is in
we
that
is
of
order
0(g) say
g.
/

It is

worthwhile

by

simplified,

dropping

well behaved.

are

4.2.1.

Lemma

ku f (n) > 0

and

constants c and k2
Since

Proof.
\\f(n)\\

=J^(n)

This is expressedby

We

shall

the

of Big 0 can
involved
when the functions

definition

following

be

lemma.

If there existsa constant


that for every n >
kx such
>
then
is
in
if
and
if there exist
0,
g(n)
0(g)
/
only
such
that
for every n > k2, f (n) < c \342\200\242
g(n).
and g(n) are both
\\g(n)\\ - g(n) for n

/ (n)

and

follows immediatelyfrom
functions

note
the
that
the absolute values,

taking

Definition

nonnegative

>

max(kuk2).

4.2.1.

for

n > kl9

we have

The lemma

then

\342\226\241

use this lemma implicitly in the examples


below,
are positive valued for sufficiently
large
arguments.

where

all the

- 3n.
Consider the functions
g(n)
/ (n) = 2n and
>
Since 2n
3n for all n
0, we know that / is in 0(g). (In this case we can
choose c = 1 and k = 0 in the definition above.)On the other hand, gis not
in 0(f). This canbeshown
by contradiction.
Suppose
g is in 0(f). Then
there existc and k such that for all (positive)n > k, 3n < c \342\200\242
2n, which
Example

4.2.1.

<

implies

n*

a contradiction.

l\302\260g\302\260C

Section 4.2

SpecialPropertiesof
4.2.2.

Example
Since

logc(n).

seen

log2(n*)

c =

by choosing

can be seenby

345

Relations

Binary

Consider the functions


/ (n) - log2(n*) and g(n) =
= (x/logc(2))
. logc(n),/is in 0(g). (Thiscan be

x/logc(2)and k = 1.)Similarly,
c =

choosing

loge(2)/x and

in 0(f).

g is

(This

1.)

4.2.3.
Show that 5rc3 - 6rc2 + 4rc - 2 is in
Example
- 6n2 + 4rc 21< 5rc3 + 6rc3 + 4n3 + 2rc3< 17m3 for n > 1,
= and fc = 1 and conclude 5n3 - 6n2 + 4rc - 2 \302\2430(rc3).

0(rc3).Since
we choose

15n3

17

the functions

Consider

4.2.4.

Example

,,

if rc is

_ J2n
~

an even integer

otherwise

\\n

and

oc^^integer

^ n ^s an

~ f^n
_

\\

otherwise.

\\n

functions
are pathological, as their definitions
lead
one to
might
c and k it would be
for
some
suspect. Suppose that / is in 0(g). Then
true that for all (positive) n > k, f (n) < c \342\200\242
n to be even, this
g(n).
Taking
would
mean
that
2n < c \342\200\242
is a contradiction. Similar reasoning,
n, which
consideringthe casewhen n is odd, shows thatg cannot be in 0(f).
to
it is customary to extend this nptation
Note that in practice
describedin
which define functions, so that the relationships
formulas
above would be expressed:
the
first two examples
These

2n

is in

log2(rc*) is in
avoids

This

but

0(3n),

is not

3n

in 0(2n);

0(logc(n)), and logc(n)is in

being compared. It is alsocustomary


use

to

and

the

exact

write

to

of a function
0(f (n)) where a value
unknown.
For
function
may be

n2 =

(1/3)n

12 +

22

(n

+ 1/2) (n + 1) = l/3n3

\342\200\242
\342\200\242
\342\200\242
+ n2

g(n) = l/2n2 + l/6n,

that g is in
exercises

like /

special names,

introducing

which

is a

0(n2)

for this

- (1/3)n3
is

0(g)\\ is

for

4-

l/2n2

of a

22

\342\200\242
\342\200\242
\342\200\242
+

write

we could

l/6n,
case

function

a specific

functions

the

0( / (n)) instead of 0( f),


in 0( f) is intendedbut

+ 0(n2). In this

consequence

gy

example,sincel2+

for

stands

0(n2)

g in 0(n2).

(The fact

theorem that is given

in

the

section.)

Theorem 4.2.1. TherelationQ = {(f9g)

equivalence

and

0(log2(rc*)).

reflexive

relation.

and

transitive,

but

\\ f:

is not

g: N

\342\200\224>

R,

f is

\342\200\224

R,

a partial orderingor

in
an

346

Chapter 4: Relations and

Digraphs

We

Proof.

transitive; (3) Q

1. Since|

f(n)

and
/:#\342\200\224\342\226\272#,

must

show four

is not

antisymmetric;

<

so Q

\342\200\242
| f(n)

and

k2y

cx

|/(n)|<

Exercises

for

in Q.

Q is

> 1, we know that

(/,/) is in Q

for

all

Then there exist cu c2,ku and k2


|g(n)
|, and for all n > fe2, \\g(n) I <
or equal to the maximum
than
greater
and
so Q is transitive.
cx> c2- \\h(n)\\,

| < Cj
all

|g(n)|<

it is

that

to have

possible

it is

that

\342\200\242

(fg) and (g,f) in

to have

possible

(/,#) in Q

without

\342\226\241

4.2.1

Section

1. Drawa digraph of the 0 notation


relation
4.2.1 on the functions {fuf2>f3>fA>fs>f*>fi>fs\\
f2(n) = n

/3(n) =
/4(m)

the following

If p(n)

in Theorem

\342\200\242

log2(n)

/7(m)

= m2

/8(n)

= 2n

\342\200\242

log2(M)

theorem:

= amnm 4-

(Hint:Use
3. Proveor

defined

where

/6(rc)=V

log2(n)

= n

Q as

/B<*)-*2

AW-i

2. Prove

(2)

reflexive;

in Q.

are

\342\200\242

4. Example4.2.1shows
being

is

Q is not symmetric.

is reflexive.

3. Example 4.2.2shows
and still have f ^ g.
(g,f)

and (4)

all n

| for

2. Suppose (fg) and (g,h)


such that for all n > felf \\f (n)
c2 -\\h(n)\\. It followsthat for

of kx

things: (1)

\342\200\242
\342\200\242
\342\200\242
4-

axn

| am \\ +
each

disprove

+ a0 then
and k

\342\200\242
\342\200\242
\342\200\242

4-1 a01

of the

p(n) is in 0(nm).

= 1.)

following:

(a) If / is in 0(g) and c is a positive constant, then c \342\200\242


/ is in 0(g).
If
in
in
and
are
is
then
4(b) fx
0(g)
0(g).
f2
fx
/2
(c) If A is in 0(gx) and /2 is in 0(g2) then/x . /2 is in 0(gx \342\200\242
^2).
then fx 4- /2 is in 0(gx 4- ^2).
(d) If A is in 0(gx) and f2 is in 0(^2)
4. Big 0 notation
is frequently
used in the analysis of algorithms,
wherethe functions
involved
are not always exactly known, but are
known
to
on only positive values and can be bounded
take
by
recurrence
relations.
The functions involved are ordinarily
also
known
to be monotone increasing\342\200\224that
is, x < y implies / (x) <
for
all
x
and
c
and
are
/ (y)
y. Suppose a, fe,
nonnegative
integer
constants. Prove that any positive
valued
monotone
increasing
function

T:N\342\200\224+R

that

satisfies

the recurrence

T(n) < b for n = 1, and


n for
4- b \342\200\242
T(n) < a \342\200\242
T(n/c)

n >

relations

Section4.2

SpecialProperties

of Binary

347

Relations

must be in

(a) 0(n)

if a

\342\200\242

(b)

0(n

(c)

0(nlo*<a)

< c;

= c;

if a

> c.

if

log(n))

Hint: The proofrequiresseparate


consideration
5. Suppose that T:N\342\200\224+Risa
valued
positive
function that satisfiesthe recurrence
relations
< b for

T(n)

T(n) < a
Usingbig 0 notation,

n =

\342\200\242

T(n/c)

characterize

of the

three cases.

monotone

increasing

1, and
+ 6

for n >

T for

each of

the three cases:

<c

(a)

(b)

a =

(c) a> c

6.

are characterized by the fact that


algorithms
G
0(n2) comparisonsto sort n items. On the
they
f (n)
require
other hand, most of the advanced sortingalgorithms
g(n)
require
G 0(n log2n) comparisons. It is instructive to comparen2 and
n log2n. Construct
a table that compares the values
of n2 and
n log2n for the values
n = 10, 100, 1000, and 10000.Includethe
The

sorting

simpler

ratio

n2/n

table.

in your

\\og2n

7. Show that

(a)

n\\

(b)

log2 (n!) G

0(nn)

0(n

log2n)

G 0(log2n!)

(c)

nlog2n

(d)

2n

(e)

n\\

is not

0(n\\)

in 0(2\

\342\200\242
\342\200\242
4- n) G
(f) (1 + 2 + 3 + \342\200\242
\342\200\242
\342\200\242
\342\200\24252
32
+
+
(2m
(g) (l2 +

8. Provethe

following

for

functions

0(n2)
l)2) e
/,

0(n3)

g, and h from

iV

into

the

real

numbers.

e O(g)iS O(f) CO(g)


(b)
0( /) iff the sets 0( /) and O(g)areequal.
/ E O(g) and g \302\243
If
E
and
G
(c)
O(g)
g 0(h), then / E 0(/i).
/
=
if
(d) O(f)
0(af) a isa nonzero constant.
Prove the following. You may use the definition
or exercises
2,
(a) f

9.

and 8.

(a)

nk

(b)

3m

(c)

9ra2

(d)

10n2

0(nk+1)

+ 2 E
- 4n
+

5n

where k

0(n)
+ 12 E
- 6 E

is a positiveinteger.

0(n2)
0(n3)

3,

348

Chapter

and Digraphs

4: Relations

(e) 3n
(f)

+ 2 \302\2430(1)

5(2n) +

(g) 10n2 +
(h) 0(logan)

10. Give

n2

5m

0(2\
6 \302\243
0(n)

= 0(logbn) wherea and


sufficient

and

necessary

6 are

conditions

for a

than I.

greater

integers

be

to

function

in

0(1).

/: N

11. Suppose that

limitoff

(n)

constant

k such

\342\200\224+
R is

We say that a numberL is the

a function.

oo if for every numbere > 0,there


is a
n > k, \\f (n) - L \\ < e. In this case we

n approaches

as

that for every


write lim,^ / (n) - L.
Use this definition of limit to prove the following:
(a)

= 0

liml/n

n\342\200\224\342\231\246\302\273

(b)

lim

- 0

1/n2

- A and
(c) If lim\342\200\236_\342\200\236/
(n)
A

B,

lim\342\200\236_^
/

B #

(provided

lim\342\200\236_0og(n)

(ra)g(n)

0).

(d) Suppose

lim\342\200\236_^/(n)/g(n)

/ E

then

12.

Use

O(f).
exercise

O(g) and
11(d)

(a) 0(n + 1) =

(b) 0(n3
(c)
(d)

(e)
(f)
(g)

Answers

n2

= AB,

gE 0

- L.

\302\243
then

and lining /

If L > 0, then

(/). If

the following:
+ 3) - 0(n + log2n)
=
3)
0(n3 5)
0(\302\2533)

O(10ra

n +

E 0(ra) but n $ 0(ra1/2)


+ 1) - 0(n)
0(Jn2
- 0(nu)
n10
E 0(nn
but
+ i\302\273)
2\" E 0(3\") but 3\" \302\2430(2\
2\" E 0(n2\") but n2\" $ 0(2\

4.2.1

/ E

to show

n\"

0(n10)
\302\243

0(n)

(n) +

g(n)

(n)/g(n)

/ E

0, then

nm

for Section

lim/

A/B

L > 0,
0(g) but g $

0(g). If

Section

4.3
nm +
l,|p(n)| = |am \342\200\242

2. Forn>

+|a1|.n

3. (a)

Supposefor

(b)

The

crucial

n >

ku\\

| <

< ax

\342\200\242

|g(rc)

|ax|

\342\200\242
| g(rc)

\\ <

is that

ax

\\x

(kx,k2),| /x(n)

\342\200\242

|g(rc)

fact hereis that \\x

<*i

> max

for all n

\342\200\242

\\gi(n)

\342\200\242
\342\200\242

a2

\\ fx

(kx,k2)y

|g2(rc)

(ax

k2,

/2(rc)

f2(n)

\342\200\242
\342\200\242

a2)

\\gx(n)

| < |

k2,\\f2(n)\\<a2
\342\200\242
= | fx (n)\\-\\
|
/2(rc)

\342\200\242
a \342\200\242

all

for

Suppose

\\y\\.

| < (ax + a2) \342\200\242


\\g(n)
|.
= \\x\\-\\y\\. Suppose
(n)

|rcm|

(n) | <

y\\

\342\200\242

\342\200\242

\342\200\242
| /

>

for all n

> max

4- a2

y\\<\\x\\

| and

|g(n)

|. Then

\342\200\242

ku\\fx(n)\\<ax |gx(rc)|andforallrc>
Then,

a0\\ < \\am\\


+ |a0|) nm.

\342\200\242
n +

ax

\342\200\242
\342\200\242
\342\200\242
+

\\ f(n)

for all n

The crucial

(c)

k,

fact here

fi(n)

f2(n)

n >

all

|. Then

|g(n)

\342\200\242
\342\200\242
\342\200\242
+

|a0|<(|aj+

\342\200\242
\342\200\242
\342\200\242

349

Relations

Equivalence

a2

\342\200\242

/x(n) | +

for all n >


\342\200\242

\\g2(n)\\.

f2(n) | <

\342\200\242
\302\2432(rc)|.

is true for positive valued


but
is false if we
functions,
consider negative valued functions. Consider/(x) = xf gx(x) =
x2. Clearly/is in 0(gx)and in 0(g2),duetothe
x2, andg2(x)
be in
absolute
values, but 0(gx + g2) = 0(0), and
/ cannot
This

(d)

0(0).

4.

T is

that

know

We

positive valued,

Lemma 4.2.1.Sincen/cl

<

1 iff

to

T(n)< ]T
;-o
< a/c < 1, the sum

If 0

so

T(n) <

fcbrc

T(rc) < kbn

alog<nb. Since

nlogcab.

If a/c - 1, we have
a/c > 1, we can use
T(n) < bn((a/c)log<n
(a/c)logcn = (nIogcfl)/n,

4.3

EQUIVALENCE

for

some

and

we say

means

this

for a

< c, we

have

- l)bn + nlogcflt6 - 6nlogcn. If


\342\200\224
1), to obtain
2)fij xl = (x* - l)/(x
- 1) + bnlog<a9 and from this, using
we can show that T(n) < k \342\200\242
algebra,

l)/(a/c
some

k.

constant

first

which

rclog<a,

< 1

some constant k,

RELATIONS
in

employed

alog<nb.

is bounded by

of

< (logcn

T(n)

the solution

Equivalencerelations,
differences

logca

the formulation

+ l)6n.

T(n)<(k

rclogcflt

Since

alog<n

use

will

i, we can expand this relation

(a/cYbn

-10 (o/c)1

so we

logcn <

the
are

process
irrelevant

defined

that two things are equivalent

1, are the primary tools


or selectivelyignoring

in Chapter

of abstraction,
to the purpose

at hand. Within

if the

differences

a given

between

context,

them do

350

Chapter

and Digraphs

4: Relations

For example,if
costsonedollar,it would not

not matter.

a dollar bill, or

dollar

particular

any

accepted
On the

whether

matter

That
by merchants.
other hand, there are

to purchase something that


he or she has a dollarcoinor
since all of these would
be

wants

a person

bill,

is, they are equivalent in purchasingpower.

other situationswhere

these

things

are not

more
than
a dollar bill, so
equivalent. For example,a dollarcoinweighs
not
be willing to say
that if it were necessary to mail the dollar, onemight
At an extreme, a collectorof rarebillswould
be
the two were equivalent.
to
that
all
bills
dollar
are
since
minor
unlikely
say
equivalent,
very
such as serial numbers and errorsin printing,
differences,
may
greatly
of equivalent
affect the value of a bill as a collector'sitem.The
meaning
the same in
thus depends on context and expressesthe notion
of being
those respects relevant to the context.
In terms of formal mathematics,
a binary relation is an equivalence
relationif it is reflexive, symmetric, and transitive. These properties
of being the same which are ordinarily
taken
aspects
expressimportant
and are usually obviousfor specific
for granted
relations.
For
equivalence
in
consider
the
as.\"
the
relation
born
same
month
This
\"was
example,
since
each individual
was born in the same
relationis clearly
reflexive,
A was
as himself.
month
It is equally clearly symmetric\342\200\224if
individual
in
B
born
born in the same month as individual
then
was
the
same
B,
month as A. There is no question about transitivity either. Beingtold
B were born in the samemonth and B and Cwereborn in the
A and
that
no one
samemonth,
is likely to deny that A and C must also have been

born in the samemonth.


Another

things

at equivalence relations is as ways of dividing


For the exampleabove,
\"was born in the
the
relation

of looking

way

into classes.

same month as\"partitionsthe setofall living


to the twelve
disjoint classes,corresponding

human

beings
of the

months

these equivalenceclassesconsists
Any time
relation

month.

given

an-equivalence
in
think

to

tHink

terms of

Definition

relations and at othertimesit is moreconvenient

4.3.1.
whose

subsets

disjoint

of all the people


who were born in
a set is partitioned into disjointnonempty
subsets
is involved. While sometimes it is moreconvenient

of partitions,

in terms

3.

the

notions

any B,C G

4.3.2.

equivalence

are

Given a set A, a partition


That is

to

interchangeable.
of A

is a collectionP of

A;

P, B D C -

0, B
for any xGA there existsB G P
for

Definition
Ay

the two

union is A.

1. foranyBGP,BC
2.

into twelve
year. Each of

or

= C;
such

and
that

x G

B.

relation R on
Given any set A and any equivalence
[x] =
[x] of each element x of A is defined

class

Section 4.3
{y G A
x R y.

| x R y}. Note that we can have


That is, this notation does not

[x]

equivalenceclass.

Theorem4.3.1.
A, S =

Given

A} is a

{[x] \\x
Conversely, if P

any

partition of A

is a partition of A into
is the setofequivalence
for the
classes

by

a E

b belong

a and

iff

to the

= [y], even
a unique
give

A and

set

351

Relations

Equivalence

if x \302\245=
yf provided
\"name\" to each

any equivalence relation R

into

on

subsets.
nonempty
subsets, then P
disjoint

disjoint

nonempty

equivalence

definedon

relation E

same subset of P.

Proof.

1.

Clearly

2.

[x]

Pi [y J

some

3.

Exercises

the

by

\\z

symmetric, x R y, so that
For any xG A, [x]6S.

4.3

1. Tell how

many

distinct

[y],

\342\226\241

Two

people

(b)

Two

people

are equivalent
are equivalent

(c)

Two

people

are equivalent if

Suppose

that

if they are
if they are

are for

born in the sameweek.

born in the sameyear.

A.

for equivalence

definitions

relationsthat describeeachofthe

partitions.

following

members

of the

Democratic Party;

the

(b)

classes).
Republican Party; all the otherpeople(three
the negative integers; the nonnegative integers (two
classes).
the sets {2i,2i + 1}for all i > 0 (infinitely many classes).

the

members

the odd numbers.


(d) the even numbers;
4. (a) Provethat isomorphismis an equivalence
relationon
(b) How many equivalence classes are there for loop-free

with

Prove

different

for n

elements

digraphs,

digraphs

three vertices?

5. How many

6.

of the

(a)

(c)

of the

each

they are of the samesex.


is an arbitrary
transitive reflexive relation on a set A.
the relation E defined by x E y iff x R y and y R x is an

equivalencerelationon
State

classes there

equivalence

(a)

Prove

3.

[x] =

equivalence relations.

following

2.

\342\202\254z
A, x

Section

for

of [x], [x] C A.
z and y R z}. If this set is not empty,then for
z and y R z; but then, sincei? is transitive
and

definition
A |x R

that

equivalence

numbers.

the

equivalence

= 1,2,3,4, and 5?
relation
/ E g iff

relation

on functions

relations

are there

on a set with

in 0(g) and g is in 0( /) is an
from the real numbersto the real

/ is

352

Chapter

and Digraphs

4: Relations

7. Define the relationR on the


iff alb can be expressed in

of positive

set A

the

form

2m,

integersby
m is

where

G R

(a,6)

an arbitrary

integer.

(a)

relation.

an equivalence

R is

that

Show

(b) Determinethe equivalence

classes

8. Let

A be the
set of positive integers.
a divides b or b divides a. Show
that

R.

under

DefineR on A
R is

reflexive

but not transitive.

9.

set A is
G #

flona

relation

(a,6) G

and

(b,c)

and circular

reflexive

iff

by

G R iff

(a,b)

and symmetric

said to be circularif, for all a,b,c G A,


R is
imply that (c,a) G #. Provethat
is an

equivalence

relation.

and transitive relation on a set A.


he a symmetric
b G A such that (a,6) G
if for every a G A there
exists
an equivalence
relation. Show that the

10. Let R

Show

that

/? is
#,
conclusionis false

11. Let R he
(c,b) G R
on

12.

S is

also an

a-teflexive

he

Let

G R and
relation on A. Let S - {(a,6)
| (a,c)
c G A}. Show that if/? is an equivalence
relation

a binary
for some

then

A,

equivalencerelation.
relation
on a set A.

equivalence relation iff

13.

Let

be

14.

an

that

R is

an

that (6,c) G R.

two equivalence relations on a set A. Show that


equivalencerelationon A, but that Rx U /?2need not

is an

relation.

equivalence

(a) Let/be
by

(a,6)

Show

(a,c) in R imply

and

R2 he

and

i?i

Rx Pi #2

if

by reflexive.

is replaced

symmetric

then

(a,b)

a function

from

G i? iff

A into A. Define a relation/? on A


/(b). Showthat # is an equivalence

a set

/(a) =

relation,

(b)

One
done

in computer assisted instructionis that


of
words or variant spellings.This is often
phonetic reduction routine, the first step of which is

problem

handling
by a

misspelled

a function / that definesan equivalence


relationon the set of
letters of the alphabet as in part (a).Forexample,
let / be the
function from the alphabet
into itself defined by the following
scheme:

ABCDEFGHIJKLMNOPQRSTUVWXYZ

ABCDABCHACCLMMABCRCDABHCAC

That is,/(A)

= A,f(E) -

Determinethe
definedin part (a).

equivalence

A,

f(F)
classes

= S,

etc

determined

...
by R

where R is

Section

4.3

Theorem 4.3.1to

15. Use

equivalence relations.

(a) Let

(b) Let

set of

the

be

and b

Giiiffo

positive integers
same

the

have

(d) Let

and b

and

G R iff a

(6,12)

example,

(e) Let

A
R

set of

same

A by

on

(a,b)

upon division by 7.

and defineR

A by

on

(a9b)

factors. (Thus,

prime

positive integers

be

multiplicities).
the set of all

G R iff

and defineR

(a9b)

decimal

for

G R.)

the

and

the

have

A by

on

digit in their

remainder

same

positive integers

be

(a,b)

by

the

iff

(counting

Let

(f)

positive integers

have

set of

the

be

set of

the

be

G R iff a

(a9b) El Rift

let

and defineR

units

expansion.

(c) Let

and

father.

same

the

are

relations

following

all people in the world

set of

the

be

and b have

the

that

verify

353

Relations

Equivalence

b have

and define

R on

A by

(a,b)

the same numberof primefactors

positive real numbersand defineRon A

LaJ = LbJ . (RecallLaJ

is the

greatest

integer

or equalto a.)
a
be
the
set of all integers and defineR on A by (a,b) G R
Let
(g)
iffa2 = 62.
(h) LetA be the set of students in your discretemathematicsclass
in
R on A by (a9b) G R iff a and b sit in the same row
and
define
less than

classroom.

your

Let

(i)

United States citizensand defineR on A by


b have the same zip code.
the set of all students at your university and defineR
(a,b) G R iff a and b have the same grade point

(a9b) G R

(j) Let
on

set of

the

be

be

by

a and

iff

average.

16.

relation

that

Suppose

R on

a set

each a G A,

(a) For
(b)

If

Must
17.

R be

(a,b)

(b)

(a,b)S(c,d)iftab

(c) (a,6)T
the

follows:
sum

(a,6)
of

the

6 G A

such that
G

iff

(c,d)

(a,b) G R.

#.

Rf where

then give

R is

the set of

a geometric

+ d.

set N of nonnegative integersas


# iff the sum of the (decimal) digits of a equalsthe
relation on N
of 6. Show that R is an equivalence

relation

digits

= cd.
6 = c

a +

following

A?

following relations on R

(a)

Define

exists

are equivalence
relations and
of their equivalence classes:
(c,d) iff a2 + b2 - c2 + d2.

numbers,

description

18.

there

and (6,c) G fl, then (a,6)

an equivalencerelationon

that the

Show
real

G R

(a,c)

the

satisfies

properties:

on the

354

Chapter

and Digraphs

4: Relations

classcontaining
and describe the equivalence
0 < x < 100.
all the integersx in [202]where
19. Show that the relation R

equivalencerelation,
-

a2

an

is

b2

determined

is defined

of 2. Find

multiple

integral
by R.

number

202. List

Z of all integers is
as follows: (a,6) G R

set

the

on
R

where

the

the

an
iff

classes

equivalence

and
20. Let A = R x R, where R is the set of realnumbers,
let P =
in A. If a and b are in A, define
aRb iff the
point
(*o>yo)be a given
distance from a to P is jbhe same as the distance from b to P. Prove
relation on A and that the equivalence
that
R is an equivalence
classes are the circlesin the plane having P as the center.

Selected Answers for Section4.3

1.

each

one for

R is

and

one for

and

an

If x

yf

y R

z R

and

x R x,

reflexive,

then xRy

Ey,

females

means xRz

is

Since

Symmetry:

was born,possibly

a person

y E z> then x R

transitive, this

Reflexivity:

4.3.1

in which

m#les

2. Transitivity: If x E y
Since

year

number

unbounded

(c) two,

week

for each

class

one

53,

(a)

(b) oneclassfor

andy

x,

x,

z, and z R y.
which means xEz.
x, y R

and so also x

which

meansy

E x.

Ex.

The Integers Modulom

Since

most

the

abstraction

are

One

science,
yet

hardware

structures

study

machines.

to the

finite

arithmetic

operations

some

modulo

counting

counting can be seenin

on computers,
there is a frequent need for
number m. A mundane
of modular
example
12-hour clock, which counts seconds
the
common

and minutes modulo60and


congruence modulo m
x

= y(mod

m)

iff

x =

For
isan equivalence
relation
Theorem 4.3.2.

any

on

distinct

equivalence

classes:

any

[written

y +

positive
integer.
m)], is defined
\342\200\242
m for some integer a.
be

(mod

positive
the

12.

modulo

hours

Let

4.3.3.

Definition
by

is as a tool for

of groups,
state
including symmetries, and finite
that is particularly useful in computer
application
with familiar
is modular arithmetic. Due
deals
structures,
limitations
and finite accuracy limitations of
storage

the

include

equivalence relations

ignoring irrelevant details), real applications


that are rather complex. Such applications

means

to

ordinarily

use of

important

(which

integer

integers,

and

[0],[1],..

.,[m

The relation
on the integers

relation = (modm)
partitions the integers into
m, the

- 1].

Section

4.3

355

Relations

Equivalence

That = (mod m) is an equivalencerelationwas proved


in
1.3.
section
Example
the division
If x is any integer,
algorithm implies x = mq 4- r, where q
x = r mod m and [x] = [r].Thus,
and r are integersand 0 < r < m.Thus,
for
is oneof the classes[0],[1],...,
class
this
relation
each
equivalence
=
if
where
1, then
[x] [y]
y = ma 4- x
[m
1]. Moreover,
0<x<y<m \342\200\224
=
=
<
x
a.
0
ma
<
m
a
0 and x =
for
some
Therefore,
y
implies
integer
Proof.

1.3.7 of

y.

\342\226\241

class [r] is frequently calleda congruence


class,and
with
congruence classes [0],[1],.. .,[m integers
to the relation s (modm) is customarily
denoted
by Zm, for any

The
the

equivalence
of
collection

respect

1]of

.,[m - 1]}.Arithmetic
positive integer m. That is,Zm = {[0],[1],..
can be extended to arithmetic on Zm in a natural way:
integers

M 4- [y]
[*]

\342\200\242

[y]

operators

4-

= [*

\342\200\242

y];

y].

of course, is the

these definitions,
so defined on Zm are

in

Implicit

- [x

functions.

actually

the

on

the

that

assumption

This really

should be

proven.

Theorem4.3.3.

The

operations

4-,

-, and

Zm are

\342\200\242
on

well-defined

functions.

Proof.
m). We need to show
m) and yx ^ y2(mod
that
4- y2(mod m). (Thisisthe sameas supposihg
=
=
=
and
that
and
4[x2] 4showing
[xx] [yx]
[x2]
[y2]
[xx]
[yx]
= (mod m), we know that xx = x2 4- a \342\200\242
m
the
of
definition
[y2].) By
m for some
b. It followsthat xx 4- yx =
for some a, and yx = y2 4- b \342\200\242
m, so that
xx 4- yx = x2 4- y2(mod m).
(*2 4- y2) 4- (a 4- b) \342\200\242
m for some a, and
2. Suppose that xx = x2(mod m). Then xx = x2 4- a \342\200\242
=
\342\200\242
*=
that
so
4(-a)
m,
[-xx]
[-\302\2432]-xx -x2
3. Suppose
that xx = x2(mod m) and yx = y2(mod
m). Then xx = x2 4m for some 6. It followsthat xx .
a \342\200\242
m for some a, and yx = y2 4- b \342\200\242

1. Supposexx
that xx + yx

yx =

x2

^2

y2(mod

the

defined

way

x2(mod

= x2

\342\200\242
4-

\342\200\242

.Due to
subtractionare

*2

(x2

m).

the

\342\200\242
b 4-

y2

\342\200\242
a 4-

\342\200\242
b \342\200\242\342\200\242
so

m)

m,

that

xx

\342\200\242
=

yx

operations

in Zm,

the usual

of addition,

multiplication,

lawsof commutativity,

and

associativity,

and

356

Chapter 4: Relations and

Digraphs

1. [x] +

2.

That is,

hold.

distributivity

[y]

\342\200\242
=

[y]

[x]

3. l[x]
4. ([*]

4-

\342\200\242

= [x]

[y])

\342\200\242 \342\200\242=

4- ([y]

4-

[2])

\342\200\242 \342\200\242

[x]

[2]

is commutative.)
is associative.)
(Addition
is
(Multiplication

(Multiplication

[x]

4- [2]

[y])

(Addition is commutative.)

4- [x]

[y]
[y]

([y]

[z])

associative.)

5.

([x]

4-

\342\200\242
=

[y])

\342\200\242
4-

[x]

[z]

\342\200\242

[y]

[2]

[2]

(Multiplication
over

distributes

addition.)

these assertionsis left as an exercise.


x mod
m is ordinarily used to denote the smallest
at
of looking
y such that x = y (mod m). One way
integer
nonnegative
this is that x mod m is the canonical
of the equivalence
representative
to the rule,\" which in this caseis
classofx. (Canonical
means
\"according
to selectthe smallest
of the equivalence class.)
member
nonnegative
proof of

The

The

notation

The reader

should

of certain

however,

beware,

in a

notation

this

use

which

languages

different

programming
x

when

way

or m

is

negative.

Definition 4.3.4. Letx and y be integers. Recall that x divides y if


z = y. The greatest
exists an integer z such that x \342\200\242
common
divisor of two positive
is the largest positive integer that
integers

there

of

both

divides

notation

The

them.

divisor of x

and y.

greatest commondivisor

is

common

Two

integers

gcd

(x9y)

the

denotes

are relatively

greatest

if their

prime

1.

of 237 and
204 is 3.
4.3.1.
The greatest commondivisor
Example
= 1. Thus, 237 and 203 are
Also, gcd(237,158)= 79, and gcd(237,203)
prime.

relatively

then,

for

[w 4- 2

If x and

4.3.4.

Theorem
\342\200\242

x],..

are

- 1) \342\200\242
x] are

.,[w 4- (m

relatively

w, the

integer

positive

every

prime

positive

integers

equivalence classes [w], [w

4- x]>

all distinct.

In order to prove this theoremit is convenient


characterization of the greatestcommondivisor,

to
which

have

we shall

a better

prove as

a lemma.

Lemma 4.3.1.

smallest
r =

Suppose

positive

integer

for

\342\200\242
m. Then

r =

\342\200\242
x 4-

and

which

m are positive integers and r is the


there exist integers c and d suchthat

gcd(x,m).

Section4.3
show that r

We will first

Proof.

< q < r.

where 0

is,

(That

Then,

= x-p-(c-x

q=x-p-r

be that

= (1 - p

the smallest

r is

Since

which is
x and

= 0,

Interchanging

divides m. To prove

is divided

Supposes is a

0 < q

< r, it must

a proof

that r also

and

gives

positive integer that

suppose there is anotherand

m in

r =c

\342\200\242
x +

\342\200\242
5 and

m =

Substituting

obtain r
\342\200\242
a + d - b must

\342\200\242
we

m,

= (c

x and

\342\200\242
s.

\342\200\242
a 4-

\342\200\242
5 for

divides

be

it must

that

show

divides

also

that

number

positive

6, x =

a and

q,

r.)

by

\342\200\242
\342\200\242
\342\200\242
x + (\342\200\224p
m.
c) \342\200\242
d)

less than or equal to r.


some

\342\200\242
r 4-

+ d-m)

the largest

r is

x =

Suppose

positiveintegerofthis form,
x.
to say r divides
m in the argument above

that

m, we will

x and

both

x.

divides

remainder when x

q is the

357

Relations

Equivalence

m. Then, for
6

x and

\342\200\242
s for

r and 5

\342\200\242
\342\200\242
s. Because

6)

also be positive.Thismeansthat r >


positive,c
< 1, which
if r < s then c \342\200\242
a
b
would be a
+ d \342\200\242
contradiction.
Observethat the setSofall positive
y such that y = xs + m\302\243,
integers
for integers
5 and t, is a nonempty set sincex2 + m2 is in S. Therefore, by
of the positive integers, there existsa minimal
the well ordering
property
r in S. By Lemma 4.3.1,r = gcd(x,m).
element
are both

5, since

Proof of Theorem4.3.4.

Suppose

0 <

7<f

will show
\342\200\242
= w + x
u;
x
i:
+
y,

integer

m. (We

<

combiningthex-terms,

we

(1)

1,

(2)

(i

by

and,

\342\200\242

(3) c
(4) c

the

j) = y

that this
\342\200\242
4-

+ x

\342\200\242

i]

[w + x

\342\200\242
and

y]

out the

\342\200\242
m.

Canceling

u;-terms and

obtain

\342\200\242
m. Since

preceding

[w

Forsome
leadsto a contradiction.)

lemma,

m are relatively prime, gcd(x,m)=


there exist c and d suchthat

x and

1. From (1) we obtain


- c \342\200\242
\342\200\242
m = 0. And from (2) we obtain
y
m \342\200\242
(i
(3)
y) = (i - j). Subtracting
;) 4- d \342\200\242

\342\200\242
m =

\342\200\242
x +

- j)
(i
\342\200\242
x \342\200\242
(i
\342\200\242
x \342\200\242

from

(4),

we obtain

(5) m

\342\200\242
\342\200\242

(d

(i

j) 4- c

\342\200\242
=

y)

- y.

This is a contradiction,since0 < i - j < m implies


(i - j) 4- c \342\200\242
y < 1, and there is no integer betweenzeroand
This
theorem
is the theoretical basis for a
hashing\" algorithms for rapid
average-case
searching a table of sizem for a data item xy
of locations f (x) mod m,
sequence

of so-called

family

table
these

(f

0
one.

searching.

techniques

(x)

+ g(x))

< d
\342\226\241

\"double
When

examine

mod m,

358

Chapter

and Digraphs

4: Relations

mod
+ 2 \342\200\242
g(x))
\"probe sequence\"for

(/ (x)

... (/ (x) +

m
x.

(m

/ and g

(Here

\342\200\242

1)

g(x))

the

m, called

mod

are functions chosen for

their

the order of search.) For suitable/ and g, and


ofx and the number
suitable
assumptions about the randomness
making
of occupied locations in the table, it is possibleto prove
that
on the
will
be
than
3
locations
need
to
visited
before
fewer
average
finding either
x or, if x is not in the table, an empty location.The importanceof the
oflocations
to this search strategy is that the sequence
searched
theorem
of the table, provided g(x)
location
can be relied upon to include every
and m are relatively
achieved
prime. In practice this is often
by choosing
m
to
be
a
or
be
and
to
odd
of
2, choosingm to be a prime
g(x)
power
number.
to randomize

ability

Exercises

for Section 4.3.1

1.

What

equivalentto zero,modulo

100 are

less than

integers

positive

10?

2.

the following

Consider

wrong

(b) [x]/[y] =
=

the

Verify

multiplication

for Zm.
identities
for
is an identity

following

(a) [0] + [x] =


(b) [1] \342\200\242
[x]

[x] +

(c)

is

5. Show that

if

([0]

[x]

[x] ([1]

([-*])
x =

integer <x/y)

and distributive laws hold

associative,
on Zm.

commutative,

and

addition

for

4.

the

that

Verify

What

some

for

[z]

(where L x/y J is the greatest


z such that [y z] = [x]

J ]

x/y

[L

(c) [x]/[y]

3.

Zm.

= [x/y]

[x]/[y]

(a)

attempts at defining divisionfor

each?

with

is an

identity for

addition.)

multiplication.)

= [0] (- [x]is an additive


inverse
2k for some nonnegative k and y is

of [x].)
then

odd,

x and y

are relatively prime.

6. Suppose
section.

were

m =

about

permitted
results

Which

8.

Define

and

relations

9. Define
b2

mod

following

for

identities

the

mod

m) mod m = (x + y) mod m.
- (x mod m).
a relation
R on the set of positive integersby (a,6)
G R iff a
are relatively
prime. Which of the 6 basic propertiesof

(a) (x mod m + y
(-x)

in the definitionsof this


Which would not? How

0?

disprove each of the

7. Prove or
operator:
(b)

to be negative
still hold?

would

mod

mod

m =

does

R satisfy?

a relation R

the

set Z

of all integers by

G R iff

(a9b)

that R is an equivalencerelationon
of equivalence classes.

7. Show

the number

on

Z.

a2 =

Determine

Section

4.3

integer x where0 < x < 28 suchthat

10. Find an

11.

(a)

[2][x]-[l]inZ\342\200\236

(b)

3170 = x

12.

mod 29.
is a prime

if p

that

Prove

359

Relations

Equivalence

and a2

p dividesa + b

p, then

b2 mod

or

\342\200\224
6.

(a)

What is the last digit


3400?Hint: Note that 34

decimal

10 so

1 mod

that

expansion
\302\273
1 mod

34\"

of
10 for

ordinary decimal expansionof

digit in the

last

the

is

What

n.

any integer

(b)

in the ordinary

94009

13.

are the last 2 digits in the ordinary


3400? Hint: 320 = 1mod 100.

(c)

What

(a)

Prove

decimal

of

expansion

one
of the
integer that is a square must have
its units digit:0,1,4,5,6,9.
of 0,1,5,6 for its
one
any fourth power must have

that

any

following for
(b)

that

Prove

units digit.

14. Prove
15. Prove

19

that

if n

of 4rc2

a divisor

is not

that

a prime

is not

4 for

n.

any integer

integer and n > 4, then

(n

\342\200\224=

1)!

modrc.

whether or not the 328th day


same day of the week.

16. Determine
year

17.

by 8? When

divided
18.

5110is divided

(c)

20.

is

3100

When

4?
x

(d) 117 0 mod


(e) 8 - -6
(f) 35- mod
=

-3 = 7 mod 5
0 mod 19

1 mod

8. Prove that

x2

true:
39
7

mod

17

blanks at least 3 different


ways:
= 2 mod 7
(b) 11-3 mod

(a)

(c) 6 = -4
21. Translate the

mod

into

following

integer

5 =

(d)

(a) The sum of two


(b) 4 divides36.
Any

are

statements

57 =

Fill in the

(c)

of the

16.

19. Show that the following


(a) 5 = 21mod 8
(b)

by

that x is an integer suchthat

Suppose
1 mod

104th day

the

divided by 6?

when 51101is

remainder

the

is

What

and

on the

fall

even

n #

(d) The productof

about
is even.

statements

integers

0 divides
two

odd

mod 13

itself.

integers

is odd.

22. (Divisibility tests)

(a) Use

the

for

digit

10

congruence

divisibility

of x is

by 2:

An

= 0
integer

divisible by 2.

congruences:

mod 2 to
x is

obtain the following

divisible

by 2

iff

test
the

units

360

Chapter

and Digraphs

4: Relations

the congruence10^0 mod 2 to obtain:


divisibleby 5 iff the units digit of x is divisible
Use the congruence 102 = 0 mod 4 to obtain:

(b) Use
(c)

divisible by 4 iff
divisible

is

5.

by

x is

An integer

by the last 2 digits of x is

formed

number

the

An integer x

4.

by

Generalize (c) to obtain divisibility


tests
for 8,16, etc.
=*
Use
1
the
1
0
mod
3
x is
to obtain: An integer
(e)
congruence
divisible by 3 iff the sum of its digits is divisible
3.
by
test
for 9.
(f) Extend (e) to obtain a divisibility
11 if k is odd. Then prove that an
(g) Observe that 10* - -1 mod
=
x
11 iff
...
4- c^lO 4- a0 is divisible by
an10*4integer
\342\200\224 is divisible
...
11.
+ a2
4- (
fli
ao
a3 +
l)nan
by
(d)

23. Using propertiesof congruences,


solve
for x:
s x mod

9546

(a)

(b) (16)(15)(22)
(c) (1) (2)(3) (4)
(d) (1) (2)(3) (4)
9546 ^ x

(e)

24. If

that

(5)

positive,

(b) Give

mod

11

integers, prove that ab =

relatively prime
b = c mod m.

that

Prove

(a)

mod 7
(6)-x
(6) (7) (8) (9) (10) -

(5)

s b mod m,

gcd(a,m) - gcd(6,m).

then

26.

- x mod 7

(31)

(29)

mod 11

if a

that

Prove

congruences

following

m are

and

implies

25.

the

\342\200\224'

where a and

are

ac

integers,

positive

if x and m are relatively prime integers,where


xc =* mod m.
then there is an integer c suchthat

another proof of Theorem4.3.4using

the

mod

is

of

operations

zm.

27. (a)
(b)

(c)
(d)

Prove that

a and b are relatively prime iff thete


integers
x
are integers
and y such that 1 = ax 4- by.
a and c
such
that
Lemma) If a, 6, and c areintegers
(Euclid's
are relatively prime, and if c divides ab, then c divides 6.
ab of two integers, then p
If a prime divides
the
product
a
or
6.
divides
p divides
Supposethat a and m are integerswhere m > 1. Prove that the

equation ax =

relatively

28.

two

Show

that

mod

has

an integer

solution iff a

and m are

prime.

some positive

multiple of 63 has 452as its final

three

digits.

29.

(Chinese Remainder Theorem) If m and n are relatively prime


integers greater than one,and a and b are arbitrary integers, then
x such that x = a modm and x =
prove that there existsan integer
b

mod

n.

remainder

30. (a) Find the


divided

+ 3!+

+99! +100!is

...

12.

by

What is

(b)

l!+2!

when

361

Relations

Equivalence

the remainder when

+ 1005

...

l5+25+35+

is divided

by 4?

31. (The

Coconut

Three

Problem).

sailors

islandand gathera pileofcoconuts


the

for

and

and divide

night

decides

distrustfully

for

the coconuts in the morning.One


to take his share during
the

to divide the pileof coconuts

attempts

are shipwrecked on a desert


food. They decide to retire

into

three

awakens

night.

He

shares, but

equal

finds there is one coconutleft over.He discards


the
extra
one,
takes his share to a hiding place,and
back
to
goes
sleep. Later,
another of the sailorsawakens
the pile of
and,
upon
dividing
coconuts
into
three
finds
there
is one left
shares,
remaining
equal
He also discards the extra one, hideshis share,
over.
and goes back
to sleep. Finally,the third
sailor
the process once again. He
repeats
as
the
others
that
finds,
did,
by discarding one coconutthe
of
can
be
coconuts
divided into three equalshares.
pile
remaining
How
in
coconuts
were
the
many
original pile? Also solve the
coconut

for:

problem

(a) 4 sailorsand 4

shares

equal

with

a remainder

of 1 after each

division.

5 sailors

(b)

with a

remainder of 1 after eachdivision.


solutions to

all integer

32.

Describe

33.

(a) When

eggs in a basket are removed

remain,
at a time,

1,2,3,4,5

respectively,

are

none

that

over.

left

have been in

could

(b) Supposethat
removed

the equation12*-

2,

one

3, 4,

egg

5, or

2, 3,

eggs. But

Find the

17.

at a time, there
when 7 are taken out

4, 5,6

smallest number of

eggs

the basket,

in the basket when the eggsare


6 at a time, but no eggsremainif 7 are

remains

at a time. Find the smallestnumber


could have been in the basket.
removed

34.

53y

of

eggs

that

to
of 17 pirates stole a sack of gold coins.When
tried
they
In the
the fortune into equal portions,3 coinsremained.
brawl
over who should get the extra coins,onepiratewas
ensuing
was redistributed,
but this time an equal
killed.
The
wealth
in
which
distribution
left 10 coins. Again an argument developed
was
now
fortune
another
was
killed.
But
the
total
evenly
pirate
of
was
the least number
distributed
among the survivors. What

band

divide

coins that could have


35.

been

stolen?

for men,
2 dollars
are
certain theater, the pricesofadmission
of each
one dollar for women,
and 50 cents for children. Howmany
if 100 people paid a total of 100dollars?
attended
In a

362

Chapter

and Digraphs

4: Relations

36. How old was a man


year of his birth?

37.

38.

in 1900 if

his age at

death was

the

times

1/41

know of Diaphantus' life is his epitaph,from


which
death is to be deduced:\"Diaphantus
one-sixth
of
spent
his life in childhood, one-twelfth in youth, and another onein
A son was born five
bachelorhood.
his
seventh
after
years
before
his father at half his father's
years
marriage and died four
we

all

About

his

age at

final

age.\"

Find

that integral

solution to 13*+ 21y = 1 for

as small

x is

which

a positiveintegeras possible.

39.

a pile of money, their sharesbeing


Each
man \302\243akes some money from
pile.

men

Three

possess

1/6 of the

nothing is left.The first

second1/3,

then

man

1/2 of what he took,the


he took. When
the
total
so

returns

1/6 of what

third

the

and

and

1/2,1/3,

the pile until

is divided equallyamongthe 3 men it is found that each


then possesseswhat he is entitled to. How much money wasin the
and how much did each man take from
the
pile,
pile?
original
returned

Selected

4.3.1

for Section

Answers

1. 10,20,30,
2. (a) Since

is

x/y

80, 90

60, 70,

50,

40,

in

not

general

an integer,

this is not

always

defined.

(b)

Take
that

- 3. Then [2]/[2]=

([3]/[2])[2]

division

(c) The

we

5. Supposex and
and p

than one, and y


number

4.4

can

show
has

definition

this

if and

division

since

also [3]/[2]

= [1]. It

expect from

is prime.
stated in the exercise.

only if m
are

as

is greater than
=

z exists.
If one does
such
that [x]/[y] is uniquely defined.In
all the properties we expect of

pq

for some

1.Thenp must

be

Suppose that p =

a power

integer q greater than

even and the product of an


is always even, y must be even.

p is

ORDERING RELATIONS, LATTICES, AND

even numberwith
This

is a

Bona

of 2 greater

one. However,
any

other

contradiction.

ENUMERATIONS

order on A
set A is called a partial
and
the set A
then
and
transitive,
reflexive, antisymmetric,
we
a
ordered
or
set
partially
poset. Frequently will write
denote that A is partially
ordered
by the relation R.
A relation

follows

operator.

general,
(x ,y)

but

problem is that in somecasesno

exist, however,

gcd

[1],

[3], which is not what we

called

is
a

[A;R]

to

when
is

Section

Lattices,

Relations,

Ordering

4.4

363

Enumerations

and

Since the relation < on the set of realnumbers


is the
of a
prototype
< to
an arbitrary partial
represent
partial order it is commonto write
order on A and then, of course, the characteristic properties of a partial

order
1.
2.

3.

a <

G A9

V a,b Af if a <
V a,bfc
G A, if

Two elements
a < b or 6

either

elements of

ordered

< is

relation

(reflexivity)

b and b < a, then a


a < b and 6 < c, then

a and b in
< a; otherwise
are

= b (antisymmetry)
a<c
(transitivity).

be comparable under < if


If every pair of
we say that [A;<] is totally

said to

A are

are

they

incomparable.

then

comparable,

set or a chain. In this

ordered

a totally

A is

that

or

as follows:

described

be

can

the

case,

called a total order.

Example4.4.1.
(a)

set and let A

an arbitrary

U be

Let

subsets of

Then

U.

[P(f/);

one element, then


inclusion. For if U contains

than

two

P(\302\2437) contains

distinct

incomparableunder

C] is a

P([/) is

P (U)

be the

poset but

not

if

collection of all

totally

more

contains

under

ordered

set

distinct elements x and y, then


elements \\x) and {y}9 and these sets are
the two

inclusion.

(b)

If Z

set of integersand < isthe usual

is the

only is [Z;<]partially
ordered.

(c)

familiar

Another

involves

the set P of positive integersand


write a \\ b iff a divides b or iff b =

where we

some integer c. Then [P;|] is a


Example 1.3.6of Chapter 1 for verification.
and

(d) If

3 does
is a

n. Then

3 are

not divide

positive

incomparable,

let Dn denote

partially

ordered

ordered but for


For
ordered.
totally
example,[D8;
[Dn;

|]

is totally

partially

But

that is,

ordered

[P;

set.

See

| ] is not totally

2 doesnot divide

2.

integer,

[Dn; | ] is a

then not

is totally

but,

ac for

ordered since2 and

than that, it

ordered,

poset

\"divides\"

relation

the

on Z,

ordering

more

other

the setofpositive
set.

For

values

divisors

of

some values of rc,


of n [Dn; \\ ] is not

ordered, but [D6;| ] is


Of course, Dn is totally
not because2 and 3 are incomparable.
<.
relation
ordered underthe different
ordering
n
If
a
set of integers
is
let
denote
the
(e)
In
positive integer,
>
<
<
n
x
3
but
for
is
a
Then
{x 11
n}.
In is not totally
[In; | ]
poset
2
and
3
are
ordered under | because,
for
incomparable.
example,
(f) The relation < on Z is not a partial order because it is not

reflexive.

\\ ] is totally

364

Chapter

and Diagraphs

4: Relations

Poset Diagrams

The

we have
described
for digraphs can be usedfor partially
as well. Nevertheless, posets [A;<] are traditionally
in a more
economical way by poset (or Hasse) diagrams. On a
represented
is a vertex for each element
of A, but besides that, all
there
poset
diagram
omitted
of the reflexive
are
eliminating
explicit
representation
loops
diagrams

sets

ordered

property. Moreover,an edgeis not

in a poset diagram if it is
present
If
relation.
we
write x < y to mean x < y
impliedby
a vertex xjto a vertex y iffy
covers
but x # y, then an edge connects
xf
is no other element z suchthat x < z and z < y.
that is iff there
the

Special

of the

transitivity

in Posets

Elements

Let [A;<] .bea posetand

let

B be

a subset

of A. Then

b G B is called the least element of B if b < x for all


element
x G B.The setB can have at most one least element. For if b and b'
b < b' and b' < b.
were two least elements of B, then we would
have

1.

An

Hence,

by

b =

antisymmetry

b G

element

An

B is

b'.

called the greatest

elementofB

if

< b

G B. The setBcanhave at most one greatest element.


2. An element
b G B is a minimal (maximal)elementofB if x < 6 (x >
of
6) for no x in B. If the set B containsa leastelement
6, then,
if the
set B
course, b is the only minimal element of B. However,
contains a minimal element, it need not be the only minimal
element of B.
b G A is called a lower (upper) bound
3. An element
of B if b < x
for all x

(6 > x) for

all

x\302\243B.

set of lower bounds of B has a greatestelement,


then
this
element
is called the greatest
lower bound (or gib) of B;
if the set of upper bounds of B has a least element,
then
similarly,
is called the least upper bound (orlub)
of B.
this
element
If the

4.

In a totally ordered set the concepts


ofminimal
do those of maximal and greatest.But in a partially

not totally ordered) these concepts


are
posets of Figure 4-12 (a),(b),(c),(d),(e),

quite
and

least
as
coincide,
ordered
set (that is
For example, the
distinct.
a unique least
(h) have
and

element. The posetsof (f) and (g) have several minimal elements,
namely, 2 and 3 for (f) and 2,3, and 5 for (g).The posetsof(a),(b),(c),(d),
the
and
[712, | ] of (e) has
poset
(g) have a unique greatest element while
of (f) has two
maximal elements 7, 8, 9, 10,11,12.Likewise,
the
poset
maximal elements 12and 18 while the poset of (h) has maximalelements

4,6,

and

9.

Section

Ordering Relations, Lattices,and

4.4

{a,

Enumerations

by

c}

{*.c-}

{a.b}

t4

42
1

(a)

[D\342\200\236;|]

(b)

(h)

(g) [{2,3, 5, 30, 60, 120,180,360};


Figure

4-12.

365

[9({a. b,

[{1, 2,

|]

Poset diagrams.

c});C]

3,4,6,9};

366

Chapter

and Digraphs

4: Relations

ofthe posetof(g) has a minimal and


Moreover the set {60,120,180,360}
least element (namely 60), whereasthe subset{120,180,360}
minimal
has
120
and
no
elements
but
least
element.
Note
further
that
180)
(namely
a
in
has
contrast
to
which
has
no
60)
{120,180,360}
{2,3,5,30}
gib (namely
lower bounds at all and henceno gib. Moreover,
the set {12,18} in the
4 and
9
poset of (f) has two lower bounds 2 and 3 but noglb.The elements
are not lower bounds of {12,18}.
Weil-Ordered Sets
< on

order

total

of

a set

is a

ordered.

nonempty subset B
is
said to be well
[A;<]

if every

order

well

element.

least

contains

Moreover,

A is a totally
Since
ordered set it follows that
minimal element, thenB contains
one minimal
only
is a least element of B.
element
moreover, this

if

set

B contains

element

and

Example 4.4.2.
The

(a)

the

equivalent to

(c) The

relation

not

but
minimal
numbers

(d)

x/2

e p.

Any

finite

the

poset

integers

negative

[Z;<] is not well ordered


not contain a minimal

< on

to prove two

usually

becausethe
element.

totally

the set

ordered

set is

well ordered.
in

A such

mathematics

P(x) is true
that a0 is the minimal

for

because

they

element,

induction. If it isto
A, and there is a well
then
it is sufficient

A such

that x < a, then

mathematical

a proposition

that

proven

is well

Q of rational numbersis a total ordering


well ordering because some subsetsof (?do not containa
For
element.
the set P of positive rational
example,
no minimal
contains
element for if x G P, x/2 < x, and
< on

Well-orderingrelationsare important
basis for proofs by generalized

ordering

integers,
of < is

induction, and is

does

form the

be

property

axiom.

(b) On the otherhand,

subsetof

nonnegative

of mathematical

principle

as an

taken

N is the set of
actual fact, the well-ordering

[Af;<], where

poset

ordered. In

all

x in

things:

is true;
a in A, if P(x)
any

1. P(a0)

2.

for

is true.

is true for

all

x in

P(a)

Section 4.4

367

and Enumerations

Lattices,

Relations,

Ordering

Enumerations

Well-orderingrelationsare important

in

for yet another


it is
A, ordinarily

computing

reason. To do computation on the elementsof a set


necessary to enumerate them in some order aQ,alya2y
for
sets for which this is possible,we are transferring
the
property of N to the setA. Let us illustrate.

In other

words,

the well-ordered

the set Z of integers can be


N
in ascending order and then
of
by
listing
of Z with
in N in a one-to-one correspondence.
the
elements
those
are many such correspondences;
we list one correspondence

4.4.3.

Example

pairing

There

well

constructed

on

order

elements

the

as follows:

defined
f:N\342\200\224+Z

N:

Z:

1 1 1 i 1 i i
In

other

pair

words,

-1

the even

-3

-2

integers in N with

...
...

the

of

integers

positive

the odd integersof N with the negative


of Z. Then we
integers
definea new ordering
R of Z by aRb iff/-1(a) < /_1(b).Thus,
(-1)#(-3)

Z and

1<

because

5.

The correspondence
/ above
we

4.4.3.

Definition

integers. That
/ = iV. A function
each

is a

special

case of

an enumerationwhich

define.

now

there

s\302\243S

repetitions
set

Any

have
The
able.

not

is, let /

Let / be an
=

{k \\ k

k <

of the

segment\"

n]

an enumeration
an i such that f(i)

is
f:I\342\200\224*S

exists

\"initial

G N9

for

constant

some

of S if /

= s. An

nonnegative
n, or let

is onto;that

enumeration

is,

for

has

no

= f(j) only if i = j.
function is one-to-one,
that
is, f(i)
do
has an enumeration is said to be countable.Setsthat
that
an enumeration are said to be uncountable,or nondenumeris totally
ordered
real numbers form a set which
by < but

if the

uncountable.

For
and

countable

well

construction:
be the
g(a)

of enumeration
concepts
as can be
related,
closely
of A.
is an enumeration
f:I\342\200\224+A
the

sets,

ordering

are

Suppose

without repetition

seen

by

simple

For eacha in A,

let

= a. The relation
smallest integer in / such that
f(n)
<^
<
of A for which each
defined by a <t b iff g(a)
g{b) is a well ordering
element a G A has only finitely many elements b G A such that b <^.
set A for which each
Conversely, if R is a well ordering of a countable
a G A has only finitely many predecessors; that is, thereareonly finitely
b G A such
elements
that
(6, a) G R, then there is a unique
many

368

Chapter

4: Relations

and

repetition
= min(A), f(i) =

by/(0)

</ = R.This enumeration

/ such that

without

enumeration
given

Digraphs

min (A

\\f(j)

\\j

<

is

i}).

Lattices
in which
each pair of
We define a join-semilattice as a poset [A;<]
elements a and b of A have a least upper bound;we call this lub the join of
a and b, and denoteit by a V 6.
each pair of
Likewise we define a meet-semilattice as a posetin which
elements a and b have a greatest lower bound; this gib is calledthe meet
ofa and b, and it is denoted by a A b.
if c = a A b, then c satisfies:
Thus,

1. c
2. If

< a and c < 6 (c isa lower


d < a and d < 6, then

of {a,6}),

bound
d

(c is

< c

the greatest lower bound of

\\a,b}).

Likewise
reversing the

= a

if c

6, then

and

inequalities

two similar properties by


the words lower bound to

c satisfies

changing

upper

bound.

words,

4.4.2.

Definition

elements

has a

a lattice

lattice

least upper bound

is a
and

a join-semilattice

is both

poset in

which

each

lower bound.

a greatest

pair

of

In other

and a meet-semilattice.

Example4.4.4.
(a)

U is any set, [(P(U); C] is a lattice in which


the least
upper
B and C of U is just B U C and the greatest
bound of two subsets
lower bound of {B,C}isBHC. (Proof:
H C C B and
Note
thatB
B Pi C C C so that BHCisa lowerbound of lB,C}.On the other
D C B H C. Thus, B H C is the
hand, if D C B and D C C, then
greatestlower bound of {B,C}. Similarly, we can prove B U Cis the
If

lubof{B,C}.)

a V 6 is simply the
ordered
set is a lattice in which
totally
if R is
greater and a A b is the lesser of a and 6. For example,
the set of real numbers with
usual
the
<, then
ordering
aV6 = max{a,6}
a A b = min{a,6}.
and
P is the set of positiveintegers,
isa latticein
(c) The poset [P;| ],where
a A b = gcd(a,6) and a V b - lcm(a,6)
which
where gcd and 1cm
stand
for greatest
common divisor and least common
respectively

(b)

Any

(d)

multiple.For
Of the posets
(h)

are

instance,

6 A

in

4-12,

Figure

meet-semilattices,

9 =

3 and 6

- 18.

and (d) are lattices, (e)and


is
a join-semilattice, while
(f)

(a),(b),(c),

(g) is

Section

4.4

Relations,

Ordering

369

and Enumerations

Lattices,

neither. The poset(e) is not a join-semilattice


since the elements4
10 do not have a lub; (h) is not
a join-semilattice
and
since 4 and 6
no lub;
no
have
3 have
(g) is not a meet-semilatticesince2 and
gib.

Exercises

for Section 4.4

1.

of functions

definitions

Give

sets without

that enumerate

each of

the

following

repetitions:

(a) the even nonnegativeintegers;


that are

perfect squares;
N x N.
real functions of one variable by
Q
Ry and for all x, f(x) < g(x).
ifff:R-+R,g:R-^
fQg
Prove
that
(a)
Q is a partial ordering.
(b) Prove that it is not a total ordering.
3. Provethat if R is a partial ordering on a set S, then for n > 2, there
elements of S suchthat
cannot be a sequencesu s2,. \342\200\242
\342\200\242>
sn of distinct
the

(b)

integers

nonnegative

of nonnegative
(c) the ordered
2. Considertherelation defined on
pairs

... R sn R sx.
countable.
Prove that the rationalnumbers
are
Consider the relation D on the integersdefined
Si

4.
5.

integers,

R s2

R sz R

an integer

exists

there

a such that x

(a) Provethat D is a partial orderingon

(b) Prove
(c)

What

that

are

the

by

G D

(x,y)

y (i.e., x divides y),


set A of integers
the

iff

\342\200\242
a =

a lattice ordering on A.
minimal
elements of the set

> 1.

is not

with

respect

to

D?

6. Prove that any


without

set that has an enumerationhas

an

enumeration

repetitions.

with
7. Define a well ordering on the classof all (finite)
digraphs
that
it
is a
A.
Prove
set
chosen
from
some
well
ordered
sets
vertex
well

ordering.

total orderings are thereon a


9. Prove that if a set S has an enumeration,
8.

How many

set

with

n elements?

then so doesevery

subset

RofS.

a poset diagram and


draw
each of the following
posets,
and
determine all maximal and minimal elementsand greatest
are lattices.
least elements if they exist. Specifywhich
posets

10. For

(a) [D20;\\]

(b) [D,^]

(0 [/i5;|]
(d)

[A;

(e)

[A;

<] where
| ]

where

A =

\\x \\ x is a real number and


A = {2,3,4,6,8,24,48}

0 < x < 1}

370

Chapter

4: Relations

11.

and Digraphs

(f) [A; | ] whereA


(g) [A; | ] where A
Given the subset

{2,3,4,6,8,12,36,60}

{2,3,4,6,12,18,24,36}

B of a poset [A;

boundsof B, all lower

bounds

or not

whether

Determine
tice.

exist, all upper


of B, and the gib of B.

if they

find,

<],

of B,

the lub

the posetsare meet-

or

join-semilat-

= P[{a,6})
(a) [P({a,6^});C]andB
B = {3,10,15}
[D30;
I land

(b)

= {2,7}

(c) [/12;|]andB

= {1,2,3,4,5}

[/6;|]andS

(d)

(e) [D12-{l};|]andB
12. Recall that

is a relation
on A,
= {(a,6) | (6,a) \302\243
/?}that if [A;R] is a poset
R

if

then

R~l

Prove

(called the

then

is

[A;#_1]

If

(c) If

R~lU

also

dual of [A;/?]).

is total ordered, then [A;jR_1]


is totally
[A;R]
then
is lattice
[A;R] is latticeordered,
[A;i?_1]
order on A iff
(d) Prove that R is a total
(b)

relation on

is a

by R~l

defined

(a)

= {2,6,10}
= {3,4}

[D12-{l2};|]andS

(f)

a poset

ordered.

ordered.
A =

A x

R U

|(a,c)|a\302\243A|.

a well ordering on N x N using


well ordering
on N9 the
the
set of nonnegative integers.
iff a < c and 6 < d.
14. Define the relation C on Z x Z by (atb)C(c,d)
a
C is not a total
that
C
is
that
Prove
but
(a)
partial ordering

13.

Define

ordering.

orderingon Z x Z.
15.Let [A; <} be a poset and let B bea subsetofA. Prove:
6 is a maximal
element of
(a) If b is a greatest elementof B,then
B.
b is a lub of B.
of B, then
(b) If 6 is the greatestelement
G
J3
6 is the greatest element
If
6
an
of
is
bound
then
(c)
J3,
upper
ofB.
(d) If b and b' are greatest elements of B, then b = b'.
16. Let [A;<] be poset whereA is a finite set.
one maximal element and at
at least
(a) Prove that A contains
(b)

Prove

C is

that

leastone

minimal

(b)

If, in

a lattice

element.

addition, [A;<] is a lattice,prove

that

A contains

a least

element and a greatestelement.


17.Let R be a relation on a set A, and let B be a subset of A. Definethe
relationR' on B as follows: R' = R D (B x B). Then prove or
the following assertions.
disprove
on A, then R' is transitive on J5.
(a) If R is transitive
(b) If J? is a partial ordering on A, then #' is a partial order on B.

(c) If R

is a

is a

(d) If
18. Let
(b)

(c) a A

(6

R' is

371

and Enumerations

a total ordering on B.
a well ordering on B.

Va,b,c G A

= a (idempotentlaw).

a,aVa
6 A c,

b =

aV

= (a

A c)

R' is

then
then

Then prove

a lattice.

a A 6 =

a A

on A,
on A,

total ordering
well ordering

be

[A;<]

(a)

Lattices,

Relations,

Ordering

b V a (commutative).
a V (6 V c) = (a V b)

A c,

6)

(associative).

(d)

= a, a

(a V b)

a A

= a

A 6)

(a

= oiffaV6

(e) c<6iffaA6

(absorption).

6 (consistency).

definition of semilattice. Supposethat A is a set


A which
is idempotent,
on
binary operationdefined
006 =
commutative, and associative,that is, aoa = aVa(EA,
=
o
o
o
o
boa Va,b G A, and a (b c) (a 6) c V a,b,c G A.
on
A where
J is
(a) Prove the relation J is a partial ordering
definedby (a,6) G J iff a o b = 6.
'
the
where
(b) Moreover,[A;J]isa join-semilattice
join of a and b

19. Algebraic

and o is a

b.
is a \302\251

(c)

Define the

relation M on A

a partial orderingon

defined

so

wherethe meetofa and 6 is


20. Construct examplesofthe following:
(a)

A nonempty
totally ordered
contain
a least element.

[A^/lf] is

that

with a

[A;<]

poset

but suchthat B doesnot


(e)

infinite

An

What

n =

totally

subsets do not have

B but

for

subset B for

contain

a greatest

with a

subset B for

which

there

is a

gib

element.
which

there

is an

no lub.

or

in

the

ks are positiveintegers?
the
usual
of real numbers with

kl9k2f and

and

primes

that

Show

on n such that
sufficient
conditions
ordered,
nature of the posetdiagramsfor [Dn; \\ ] where
n = p^p^p^3 where Pi,p2, and p3 are
where

] is totally
will
be the

p\\lp\\*

distinct

22.

every

Determine necessaryand
[Dn;

(b)

[A;<]

poset

upper bound
21. (a)

but

set

element.

infinite

An

a o

set in which some subsetsdo not

greatest

(d)

iff

a o 6.

L is an infinite
where
lattice
[L;<]
ordered subset of L is finite.
(c) An infinite poset [A;<] in which some

(b)

6 =

a is
a meet-semilattice
G M

by (a,b)

poset

order

<, no elementcoversany other.


with
Draw as many as possible distinctposetdiagrams
of posets
and
least
or
elements
four
all
Label
elements.
one, two,
greatest
relation

23.

elements

which

24.

The

set of

poset

diagram

appear.

all n-digit binary


for

[J34;<]

by Bn. Draw the


<
{aua2ia^a^ iff 6, < a{
(bub2,b3,b4)

sequences

where

is denoted

372

Chapter 4: Relations

and

each L Determine the least and greatestelements


of B4. In
- {(0,0,0,0),(1,1,1,1)}, find all maximal and minimalelements.

for
B4

25.

Digraphs

totally ordered but it may

not be

may

[A;^]

poset

ordered

subsets.

al<a2<

\342\200\242
\342\200\242
\342\200\242
<

subset

Any

a chain in
< ai+l then the
ax and ak.
fe the
set of
ak is

such

that

with

endpoints

(a) If

at<b
=

P(t7)

[A;<], and

if

have
such

is no

there

chainis called

totally
that

b G

chain

maximal

all subsets of U = {ax,a2,..


.,aj,
in [P(U)y

chains

maximal

all

determine

of

.,aj

{alfa2f..

with
\302\243]

endpoints

<t>

andf/.

n =

where

k2 are

and

Selected Answers for

1.

l,r)

for

r2

< r2 + r
+ r<i<(r

+ l)2

also includea proofthat

exercise should

sketch: If such a sequence

would have
not

n in [Dn; \\ ]

prime integers and kx

is correct.

solution

that

to this

solution

complete

< i

r2

- 1) for

- r

\302\243

3. Proof

1 and

endpoints

p2 distinct

Section4.4

- (i + l)2
(c) /(i) - (i ~r2/(0 = (r, - r2
each

px and

integers.

positive

(b) /(*)

with

p\\xp2*

= 2i

f(i)

(a)

chains with

all maximal

Determine

(b)

sx R s2f

sx R

be antisymmetric,
sx R sn by use of

s3,...,

since

existed,
sx
sx

we
by transitivity,
as sn R sx.Thus R could
(A better proof would prove
then,

as well

R sn,

sn.

induction and the definition

of

transitivity.)

sketch: To prove this, construct an enumeration


of the
rational numbers. (There is no needto avoid
repetitions.)
Every
rational
number can be expressedas a fractionof two integers,
a/b.
In exercise 1(c) we constructedan enumeration
f:I\342\200\224+N x N, of the
we want
to do here is to extend
pairs of nonnegative integers.What

4. Proof

it to an enumerationof all pairs of


integers.

integers,

including

negative

Let

*<40-/<0

g(4i + 1) -

verify

Now,

6.

Proof

n >

(-a,6)
where f(i) = (a,6)

g(4i

*(4i

+ 3)-(-a,-\302\253

that
sketch:

0 define

2)-(a,-&)

Suppose

g(n

enumeration of all the pairs of integers.


for
D is onto D. Define g(0) = /(0) and
/: / \342\200\224
= f{k)f for the least k suchthat
in
is
not
f(k)

is an

this

4-

1)

Section 4.4

G(n) = {g(i)|i <


that

is such

there

include a proof
repetitions.)

rc}.

that

4.4.1 Application:
Strings

and

so

on Strings

Orderings
<

on the

be taken

as to

familiar

so

probably

is always finite,

solution would also


of D and has no

(A complete

enumeration

an

is

orderingrelations< and

While the

are

n.

every
g

set G(n)

the

that

Observe

a k for

373

and Enumerations

Lattices,

Relations,

Ordering

there

granted,

domain, of

special importancein computer


This
familiar.
relations are probably
less

and real numbers

integers

for

where

science,

is another
the ordering

domain of character

is the

strings.

Definition4.4.4.

called

any finite

2 be

Let

more elements chosenfrom

is a

string

set. A finite
over 2.

of zero

sequence

or

In this context,2 is

an
The length of a string w is denoted
alphabet.
by | w |. The
of length 0 is denotedby A and called the null string. The set of
of length k is denoted by 2\\ That
is,
strings

string
all

2\302\260

{A}, and

2*+1 -

[wa

G 2*

and a

G 2} for

k >

0.

(^J

2*,

denoting

the set

of all strings over

\\^J

2*,

denoting

the set

of all nonnull

2*

\302\253

2+

2.

strings over

2.

k>0

Thus,

strings

for every
w

and

2*, | w |

y. If w =

wx...

= k.
wn

(Here
and

y =

Example 4.4.2. If 2 = U,B,C,D,\302\243,F,..


with
words that can be written
capital
includesthe string \"ALPHABET.\"

denotes

wy
yx

...

ym, wy =

wx

...

2* includes

.,X,Y,Z],

letters

and,

of

catenation

the

wnyx

...

all the

in particular

28

is
are many applications where an ordering relationon strings
or lexicographic
One ordering, commonly called \"dictionary\"
in dictionaries
and
is used to assist in searchingfor words
ordering,
total
a
indices of books. This orderingis defined
extending
given
by
ordering <A on the alphabet A to a total ordering<L on A* as follows: Let
x and y be any two strings
in A*. Without loss of generality, suppose
<
of x and y; that is, the
x
Let
be
the
| | \\y |.
7
longest common prefix
=
=
w and z in A*. There
for
some
such
x
and
that
yz y
longeststring
yw
There

needed.

374

Chapter

and Digraphs

4: Relations

are three

cases,exactly

one

(x and y

are identical);

1.

= z

2.

= A

(x

3.

u;

# 6,a,6 G A,

The

= A

and z # A
= 6/3, a
aa,z

1. x

<Lyandy

2. x <Ly and y
3. if a

<A

<4 on A,

the

x and y

and

\302\243E
A*.
\302\243

a,

is definedin eachcaseas

follows:

x;

x <L y

4.4.1.

and y ^L x, elsex \302\243L


y and

Given any finite

A and

alphabet

<L defined by

ordering

lexicographic

y <Lx.

any total

extending

<A

ordering
is a

total

on A*.

ordering

Proof. It should be clearby


and
definition that <L is reflexive
concentrate on

showing

Theproof

that

that

prefix of y); or

proper

<Lx;
^L

b then

Theorem

is a

between

relationship

must hold:

of which

anyone

enjoys

<L

The

three

cases in the

proof will

is transitive.

the relation

that

of the

examination

antisymmetric.

is a \"messy\" proof by cases.It is unlikely


of proof,but the casesare forced upon us by

is transitive

this kind

We
wish
to prove that xx <L x2
the definition of <L,which has threecases.
and x2 <l *3 implies xx <L x3. There are three ways that xx <L x2 can come
about and three ways that x2 <l *3 can come about. Therearethus nine
which we can label by pairs (ij), where
(i) is the case by which
cases,
x2 <L x3. In order not to miss any
xx
<L x2 and
(j) is the case by which
to this system. To keep
we label the sections of the proof according
cases,
the proof short, we combinecaseswhenever
possible.

1. (1,1), (1,2), (1,3).


x2 <L x3 we obtain xx

Case
x2 in

for

Case 2. (2,1),
(3,1).

In

xx <L x2 we again
Case
x2 in

for

definition

obtain xx

then

xx

gives

xx

x3, which
cases

these
<L

is what

x2 =

x2. By

substituting

xx

we want to prove.

x3. By substituting x3

for

x2 in

x3.

3. (2,2). In this casex2


x3 = x2z2 we obtain x3
of <L. Thus
xx <L x3.

Case 4. (2,3). Inthis


are two

In all thesecasesxx
<L

=
=

xxzx and

x3 =

xxzxz2,

which

x2z2.Bysubstituting xxzx
satisfies case 2 of the

=
case
ybft, and a <A b. There
x2 = xxz = ya a, x3
subcases, depending on whethera falls in xx or in z. If a falls in xl9
is divided into xx = yah for some 5, and so case3ofthe definition
<L xz. If a falls in z, then a^ is a prefix of xs and X!<L x3 by case 2 of

the definition of <L.

Section

4.4

Case
5. (3,2).
Since x3 = yb/3z it

In this casexx =
followsthat x{<L

Case 6. (3,3).In

case

this

Lattices,

Relations,

Ordering

70a,
x3 by

7i6ij8i

and a2 < b2. There are three subcases,


depending
in
falls
71,61,or ft.

72a2\302\2532>*3

ax < &!,

If a2
<L

xY

case 3.

x3 by

xx <L x3 by

that xx
We

If a2

then
falls in

in bu

falls

case 3. Finally,

if a2

7X
f}u

*)2a2a3

on

for some

= a2 <A

72, ax <A bx

then

x3

- 7ibij83 for

72&2#2>

whether

a2

a3, and

so

b2, and

so

someft, so

by case 3 of the definition.


every case and shown that in each casexx <L x2 and
Thiscompletes
the
<L x3, so that <L must be transitive.

x3, again
covered

<L
have

string yu then xx

of the

as part

occurs

375

Enumerations

x2 = 76/?, a < b, and x3 = x2z.


case 3 of the definition.

- 7ia1a1,x2 -

xx

and

*2 ^l *3 implies xx
\342\226\241

proof.

the lexicographic
ordering <L is a total ordering of A*, it is
B = {akb \\ k > 0},
a well ordering. To see this,just consider
the
set
B has no minimal element with respect to <L,
which is a subset of {a,b}*.
Although

not

since

aab

<L

ab,

aaab

<L aab,

aaaab <L aaabf..

.,a*+16<L

a*b,

not correspond to any enumeration of A*. It is


as an ordering of A* for some applications.
When a
another
well orderingof A* is required,
extension of the alphabeticorder
A is used.
on
We shall call this new ordering
on A* the enumeration
it from the lexicographic
ordering and denoteit by <E to distinguish
ordering<L just defined. In enumeration order, strings of unequal length
areordered
and strings of equal length are ordered
as
by length,
exactly
they are by <L. For example,if A = {a,6}, the enumeration of A* we want
does
ordering
therefore
unsuitable

This

is

A,a,b,aa,ab,ba9bb,aaa9aab,aba,abb,baa,....
on A* (defined
Theorem 4.4.2. Enumeration ordering<\302\243
above) is a
well ordering on A* if <A is a total ordering on A. Moreover, for each
such that wt <E w.
elements
w G A*, there are only
^GA*
many
finitely

(This is

Proof.
Exercises

for

Section

1. (a)

the
definition

ANIMAL,
BAND,

the

reader.)

4.4.1

Arrange

the

left as an exercisefor

CAN,

following
of

strings

lexicographic

AND, AN,
BAN,

CAR

into ascending
ordering:

ANIMATION,

order accordingto

376

Chapter 4: Relations
(b)

and

Digraphs

these same strings into ascendingorderaccording


of enumeration ordering. (Assume the
on the letters.)
ordering

Arrange
alphabetic

2. (a) SupposeA
List

(d)

List all

\342\200\242
B =

{6,c}*.
\342\200\242
is the

defined

and

for x and

of values

pairs

cases

the

state the relationshipbetween


(a) x - \"RED\",
y
(b) x - \"REDOLENT\", y

Hint:The

on that of

subset S
the

of

2*

and

a minimal

has

string(s)

ordering

finite n-tuples of

.,wn) | wt G

Theorem 4.4.1.To show

2*

shortest

enumeration

set of

{(wuw2y..

and

\"REDONE\"

modeled

of

on the

ordering

lexicographic
x and y,

y.
\"RED\"
- \"REDONE\"

use induction on the length n of


5. Extend the definition

of

nonempty

every

of

= \"REDONE\"
y

be

can

proof

that

(further)

y, classifyx and y

x and

y =

= \"REDUCE\",

(d) x - \"RED\",
4. Prove Theorem 4.4.2.

on

operation

by

(1-3) of the definition


the
Also, identify
longest commonprefix

ordering.

Akt>

AandbGB}.

{a6|aG

eachof the following

according

well

{a,b,c}3

sets of strings called\"catenation\",

jc

strings are therein

the elementsof {a,6}2\342\200\242


{c}, where

to

usual

elements of {a,6}3.

of
(c) Listallthe elements

(c)

How many

n elements.

has

all the

(b)

3. For

to

definition

the

element,

in S.

on strings

to definea

strings,

n > l}.

SelectedAnswers for Section4.4.1

1.

(a)

AN,

AND,

ANIMAL,

AND,

BAN,

ANIMATION,

BAN, BAND, CAN,

CAR

(b)

AN,

CAN, CAR,

BAND, ANIMAL,

ANIMATION

2.

(a)

nk

(b) aaa,

aab, aba, abb, baa, bab, bba, bbb

(c) bbb,bbc,bcb,
(d) aac, abc, bac,bbc
bcc,

5.

Define

(wl9..

,,wn)

ebb,

< (xu..

1<k

< n suchthat for

wk *

xk.

all

cbc,

ccb, ccc

.,xm) iff n < m, or n = m and there


< k, Wi = xiy and, if k <nywk<

1 < i

exists
xk

and

Section 4.4

Relations,

Ordering

There

4.4.2 Application: Proving

programming

Computer

of functions.

definitions

functions
we need

of programming

properties

number of characters,say A.
Every legal program is a string of a finite

2.

assume we are

Let us

these

two

N
{h:N\342\200\224*
f:N\342\200\224+

0 if g(i)

question

languages:
of

an

alphabet

with a finite

in A*.

length,

given

with the

function it computes,but somestrings

definitions.Thereforelet us define
gives a function for each string in A *.

legal function

are not

are

eachprogram

in

string

a function

computes

there
this

a programming
that satisfies
language
A*
of A*
let g: N \342\200\224>
be the enumeration
4.4.3 and in Theorem 4.4.2. Every programin this
A*. We would like to associate
that

Definition

after

discussed

algorithmic

and

properties,

languageisa
A*

languages may be used to write


It is an interesting questionwhether

programminglanguagemakesuse

1. Each

Functions

Noncomputable

be definedin this fashion.To answer

that cannot

only a few

Are

377

and Enumerations

Lattices,

\\

that

is not a syntactically

legalprogram,

when

but

legal

executed

program,

with

input

in

a function
Let

f(i){x)

is a syntactically
program outputs a

or if g(i)

x this

or
one
is not a nonnegative integer, outputs morethan
value,
value
be
the integer
does not terminate. Otherwise, let f(i)(x)
output by program g(i) on input x.
N be defined
if d were
that
Letd:N \342\200\224>
by d(x) = f(x)(x) + 1.Observe
would
computed by any program g(i) then
equal d(i), but that
f(i)(i)
would contradict the definition
of d. This
completes the proof of the
value

that

simply

following

theorem.

mathematically

For any

4.4.3.

Theorem

function

definable

program that

may

be

defined

The argument used in

argument

and

is due

programming languagethere is a

N that
d: N \342\200\224\342\226\272
cannot
in the language.

the

to Cantor,

be computed by any

of this theorem is a diagonal


proof
who used it to showthat the realnumbers

It is
not
numbers.
and hence that there are irrational
countable,
in
of d pairs
functions with
called diagonal because the definition
inputs
the way they would be encounteredif one were to lay all the possible
in a square matrix and to run down
the
functions
and
diagonal.
inputs
tool in
an important
are
This is illustrated in Figure 4-13. Suchproofs
problems
computability theory and canbeusedto show that a nijmber^f
of practical interest have no computable
Several more
solution.
are
a proof
that there are undefinable functions,
applications, including
in the exercises.
suggested
are

378

Chapter

4: Relations

and Digraphs

/(0)(0)

/(1)(D

/(2)(2)

f(i)(i)

Figure 4-13.

Exercises

construction.

diagonal

4.4.2

for Section

1. Considerthe programming
language
of Defense).
the U.S. Department
supposeg(i) =
is
\"functionh(x:
wherei is somespecific
integer)

the

(a registered trademark of
proof of Tl^orem 4.4.3,

x +

return

begin

integer.

This

value of

is the

What

definition.

Ada
In

string

/(i)(x)?

is

1; end h;\",
a legal Ada function

What

is

the

of

value

d(0?

2. Supposeg(j) =

\"functionh(x:

integer)

is

begin

loop

null;

end loop;

end

h;\"9

subprogram definition,but definesa


is the
without returning any value. What
of d(;)?
value of fijHx)*! What is the value
What
definition.\"
function
3. Suppose g(k) = \"Thisis not a legalAda
is the value
of d(;)?
is the value of f(j)(x)? What
4. Use a diagonalconstruction
to show
that the real numbers cannot
between 0 and 1.
the
real numbers
Hint:Consider
be enumerated.
Each of these real numbers may be represented by at most two
which

is a

computation
that

infinite

legal Ada

loops

series

forever,

10_1d0

di < 9.

4- 10\"2dx +

... + 10\"i-1d;
+ ...,

5. Use a diagonal constructionto show


cannot

be enumerated.

that

the

functions

where

/: N

<

\342\200\224\302\273
N

Section 4.5

379

on Relations

Operations

we assume that all mathematicaldefinitions


can
be
in
a
finite
of
set
Then
writing using only
expressed
symbools.
every
mathematical definition consists of a finite
over some fixed
string
finite alphabet. Usea diagonalconstruction
to show
that there must
that
cannot
be defined mathematically.
be functions f:N\342\200\224\302\273N

6. Suppose

Selected Answers for

1.

- x

f(i)(x)

d(i) and

expansion
number

is an enumeration
of the realnumbersbetween
/: N \342\200\224\342\226\272
[0,1]
1. Let
denote the ith digit in the decimal
fraction
dig(x,i)
of x, as described in the hint. Definez to be the real
defined
the ith digit of z be (dig(f(i), i) + 2) mod
by letting

10. That

is z = dig(f(0),0)
4- 1)

((dig(f(i),i)

number would
would have

4.5

be

10) +

mod

10

. dig(f(l),l)
existence

since if /

a contradiction,

dig(z,i) = (dig(z,i)+ 1) mod10.

\342\200\242
\342\200\242
\342\200\242
10'
+

(i) = z for

\342\200\242

a real

of such

\342\200\242
\342\200\242
\342\200\242
The

i, we

some

RELATIONS

ON

OPERATIONS

+ 1

\302\243
+ 2

4. Suppose

Section4.4.2

it is often useful to think of one


working with relations,
< on
derived from another. For example,
relation
the
=.
as
a
of
and
be
viewed
combination
the
relations<
integers may
is
a
there
clear
connectionbetween
the
human
relation
kinship
Similarly,
\"
\"is a parent of,\" \"is a child of,\" and
is a descendant
of.\" In this section
will
such connections
and develop some algebraon relations.
we
explore
We will begin with
some
that apply to rc-ary relationsand end
operations
with
some
that
to
binary relations.
apply only
from the standard
come
Several operationson relations
directly

one is

When

as being

relation

operations on sets, without


AY x

\342\200\242
\342\200\242
\342\200\242
x

An. Thenflx

need

(Ax

definitions.

further

for

\342\200\242
\342\200\242
\342\200\242
x

An)

Rx

Suppose

complement
union
RY U R2 is

\342\200\242
\342\200\242 The
xA\342\200\236.
Rv Suppose further that R2 C^xa relation, as are the intersection Rx D R2 and the difference

Example
relations

<,

<,

4.5.1.
The relationships betweenthe usual
=
in terms
and
on the integers can bedescribed

complement. The relation< is the


relation< is the relation<
the
relation<
the
relation
<,

union

minus

of

relation

the

Rx

of

is the

relations
=; the

also

Rx

ordering

of union and
< and =; the

relation =

is the

minus

the
Another operation, called projection, is derived from
a lower
dimensioned
with the same name. It produces
from one of higher dimension.

concept

geometric

relation

380

Chapter

and Digraphs

4: Relations

The

of R

projection
. .,xk) |

{(xlv

If R

(a,c),

component is the unary

some

projectionof
(i.e.,

relational modelsfor
of
intersection,
application the union,
Work on

G
.,a\342\200\236)

R).

set of ordered triples {(a9a9a)9


the projectionof R with
(a9c9c)}9

componentsis the

relation

fc-ary

(alv

R.

relation

the

is

(b,a,c)> (b,c,c),

to the first and third


(b,c)}. In this case the

respect

,,sk is the

(aSi,...,asJfor

{a9b9cf

relation and

componentpositions1,...,nof

to sl9..

respect

an rc-ary

An be

\342\200\242
\342\200\242
\342\200\242
x

of the

.9xk) =

(a,a,c)>

(b,b,c),

(a,b,c),

with

(xu..

4.5.2.

Example

Ax x

a subsequence

be

.,sk

sXfs29..

Let R

4.5.1

Definition

let

the set)

computer

relation

binary

with

{(a,a),

first

to the

respect

{a,fcj.

database

complement

has
systems
and projection

led to

well as a number of moreesoteric


operations.
model, a database is a collectionof rc-ary
According
in
or \"tables\"
to what are called \"files\"
relations,
corresponding
data
relation
traditional
of
each
(The
processing
terminology.
n-tuples
are called \"records\" or \"rows.\")
Oneof the operations
used
correspond to what
in work
on relational databases that is especiallyuseful
is the join
(not to
be confused with the join operationon
lattices defined in Section 4.4).
in
a means
Thejoinprovides
of combining two relations in a natural way
the event they have a componentdomainin common.
on

operations

as
relations,
the relational

rc-ary
to

Definition4.5.2.
jB2 x

join

\342\200\242
\342\200\242
\342\200\242
x
x An and R2 C Bx
x
Let
Rx C Ax x A2
=
i
be
and
for
some
and
The
relations
Bm
j.
suppose At
B;
to component i ofRx and component
respect
R2 with

\342\200\242
\342\200\242
\342\200\242
x

and

ofRi

j of R2 is

the relation

{(al9...,an,bl9..

\\ (alv

.9bm)

. .,an)

G Rl9 (bl9..

Example 4.5.3. SupposeRx= {(a9b)9


\\{a9b9x)9

R2 with
R2 is the

(c9a9y)9

(b9a)}

to the first

componentof Rx

and

the

at

- &,}.

the joinofRx

second

component

with

ordering

C SUPPLIER-NUMBERS

C PART-NUMBERS

ORDERS C SUPPLIER-NUMBERS

(b9a9a9b9x)).

who wishedto store information


do
so as threerelations:
parts might

A manufacturer

4.5.4.

Example
concerned

SUPPLIERS

and

relation
(a9c9a9a9x)9
{(a9b9c9a9y)9(a9b9a9a9x)9(a9c9c9a9y)9

PARTS

J?2,

x SUPPLIER-NAMES
x STATUS-CODES
x COLORS x WEIGHTS
x PART-NUMBERS
x QUANTITIES

PART-NAMES

C {a9b9c}2andR2

{a9c9x)\\ C {a9b9c}2x {x,y}.Then

(a9a9x)9

respect

(a9c)9

.9bm) G

ADDRESSES

and

of

Section 4.5

Operationson

381

Relations

of a quadruple in SUPPLIERSis that


it gives
the
interpretation
number
of
a
identification
the
a status
supplier, supplier's
unique
name,
code indicating reliability of the supplier,and the supplier's
address.
The
The

of a quadruple in PARTS is that it gives


the
unique
of a part, the nameof the part, its color,and its
of a triple in ORDERS
is that
it gives the
interpretation
of a part
number of a supplier, the number
ordered from the supplier,
of this
and the quantity
Thisscheme
part ordered, but not yet delivered.
is probably
much
than
a
real
database
would
be
for
such
an
simpler
interpretation

number

identification
The
weight.

but it

application,

the relational

be

will

suppliers

utility

of

some

of

operations.

Suppose the manufacturer


with

the

to demonstrate

adequate

status

from which

in knowing

interested

is

3 he

code

has ordered the part with

number

k, and

how

s is oneof these
is
and
the
of
on
suppliers
q
quantity
parts outstanding order could be
obtained
from the relations SUPPLIERS and ORDERS
of a
by means
series of projectionsand joins.
Since{k} is a unary relation on the domainPART-NUMBERS,
we can
take the join of ORDERSand {k}with
to
PART-NUMBERS,
respect
of Rl are all the
obtaining a relation which we shall callRl. The members
such
in
that
is
a
ORDERS.
To
(x,k,z)
quadruples (x,k,z,k)
triple
eliminate undesired
we
take
with
the
of
Rl
to
information,
respect
projection
in SUPPLIERthe first and third components,yielding
a binary
relation
call R2. R2 consists of all
we shall
NUMBERS x QUANTITIESwhich
a
s
is
the
number
of
such
that
supplier of the part with number
pairs (syq)
since
k and q is the quantity of the part outstanding on order.Similarly,
the
can
take
we
on
the
domain
is
a
relation
STATUS-CODES,
{3}
unary
to
SUPPLIERS
with
of
and
{3}
STATUS-CODES,
calling
respect
join
that
such
the result RS. R3 consistsof all the quintuples
(x,;y,3,z,3)
many parts each has yet

(x,y,3,z)
to

respect

with

(s>q) such that

Pairs

deliver.

is in SUPPLIERS. Again,
the first component we

taking

obtain R4,

the
the

of R3 with
projection
of all
set of numbers

3. Relations
R2 and R4 share
R4
R2
and
that
can take the
so
we
SUPPLIER-NUMBER,
elements
of
The
a
i?5.
to
this
new
relation
domain,obtaining
respect

suppliers with
domain

to

component
joinof

code

status

s is the number of a supplierof the part


that
of the part outstanding
3 and q is the quantity
on order. All that remains
is to eliminate the redundant suppliernumber.
to the first and second
This
can be done by projecting J?5 with
respect
in
set
of
the
desired
components,resulting
pairs.
relations. Three of
on binary
Some further operationsare defined
only
We review the
closure.
these are inverse,
and
transitive
composition,
1.
in
definitions
of inverse
and composition
Chapter
given

R5 are the triples(s,q,s)


such
with

number

k with

status

Definition 4.5.3.
by

R~l9

is the

relation

Suppose

C A

R}.
{(yfx) | (x,y) \302\243

x B.

The inverse of R, denoted

382

Chapter

4: Relations

and

Digraphs

R~

Figure 4-14.

and

relation

4.5.5. The inverse R'1


Example
(z,y),
(z,y), (z,x)} is the relation{(yfx),

its inverse.

of the relation

(x,z)}.

(y,z),

These

(y,z),

{(x,y),

relations are
of the inverse

that
the digraph
shown as digraphs in Figure4-14.Notice
of the digraph of the originalrelation,
of a relation has exactly
the
edges
directions
of the edges are reversed.
but
the

Example 4.5.6.

As

another

also
that
the
is symmetric.
is itself.

Observe

relation
integers

4.5.4.

Definition

of Rx

composition

(x,y) G Rl

and

4.5.7.

Example
(a,6),

(y,z)

Suppose

Rt

and R2, denoted


G R2l

then

of relations
(RS)T

= R(S

and R2 C

x B

by Ri

The composition
Rx

(cfc)f(cfd)}.Theserelationsareshown
Composition

ordering

relation >.

inverse of a relation is the relationitself iff the


In particular, the inverseof the relation= oncthe

(c,6)} and R2 = {(a,a),(6,c),(bd)}

relations,

is the

relation

of this

inverse

the usual,

consider

example,

relation < on the integers.


The

\342\200\242
is

R2

\342\200\242
of

R2

the

the relations

Figure

is associative,that

i?x

{(x,z)\\

{(a,a)> (a,c),

is thejrelation
in

B x C. The

relation

is,

if

R, S,

and T

T).

\342\200\242o

c \342\200\242
R,

Figure

4-15. The composition of binary

(a,d),

4-15.

^\342\200\2426

/?\342\226\240

{(a,a),

Ri -R2

relations.

are

Section

4.5

Operations
notation
is, Rl =

The
That

Rk+l

and

constructionleadsto

another

important

that

Observe

closure.

transitive

the

383

Relations

iterated composition of R with itself.


R, for k > 1. Taken to its limit, this

for the
= Rk .

used

is

Rk
Ry

on

Rk+n

operation
- Rk Rn.

on binary

relations\342\200\224

Definition 4.5.5. SupposeR C A x A. The transitive closure of


R, denotedby R+ is R U R2 U R* . . . = LJtel/2*. The transitive
reflexive closureof J?,denotedby /?*, is i?+ U {(a,a) | a G A}.
transitive
closure
R of the relation
Example 4.5.8.
(6,c), (c,d)}is the relation{(a,6),(a,c),(a,d),(6,c),(6,d),
illustrated
by the digraphs in Figure 4-16.

i? =

The

another

As

\"is

a parent

relation

\"is

a grandparent

transitive closure,considerthe
of this relationwith itself is the
and the transitive closureofthis relationis

smallest

R+ is the

4.5.1.

Theorem

of,\"
of.\"

ancestor

an

\"is

is

of composition
and
of.\" The composition

example

relation

therelation

{(a,b),

This

(c,d)}.

relation

containing

that

is

transitive.

First we

Proof.
y R

x Ri+jz,
Now

and sox R+

fe >

every

Q is

and

so i?+

xRly

is transitive.

xR

Suppose

and y RJ z for

C Q. D

Suppose

Q. Thus, by

some

Rk C

ij

> 1.

y and

Thus

Q. Then, since
Rk C Q for

on k,

induction

closure of
reflexive
it and is both

contains

that

relation

is transitive.

Rk+1 C

transitive

the

Similarly,

smallest
Theseare

U **i Rk>

Q and Q

transitive,

1, and

z.

R C

suppose

RQQ

since

z. Then,

that

show

shall

a binary relationis the


transitive and reflexive.

the
Forexample,
whole realm of possibleclosures.
also
says that iiR includesa pair (x,y) then R must
include
(y,x). The symmetric closureofa relationR is thus the set R U
R. In general,
R _1,which is the smallest
relation
that
includes
symmetric
if P is a property
such that P can be madetrue for any set by adding
only

of a

two

property

symmetry

abed
#

\302\273\302\273#

^#

\302\273\302\273t

#
>

R+

Figure

4-16.

relation

and

its transitive

closure.

384

Chapter

and Digraphs

4: Relations

certain elements to the set,we

of
the P-closure

closure property and define


set that containsit and satisfies

P a

call

can

the smallest

to be

set

P.

property

set of all nonnull character strings overalphabet2, is


a closure. In this casethe property
with
respect
which the closure is takenis:Ifx and y are elements of 2+ then xy is an

Note

Exercises

2+, the

that

another

example

to
element

of 2+.

of such

for Section 4.5

1.

(b)

Draw

a digraph
a digraph

(c)

Draw

a digraph

(d)

Draw

(a)

Draw

R =

{(a,b), (b,c), (b9d),(d,a),(c9c)}.


for the relation R.
__
for the complementof R, R.
for the inverse of RyR'1.
for the intersection of R and
the

relation

the

Consider

digraph

of

inverse

R,RClR-1.
for the relation
2. Answer the questions asked in exercise
(1)
Q {(a,b),(b,c),(b,d),(d,d),(c,c),(a,c)}.
3. With R and Q defined in exercises 1 and 2, determinethe
a digraph. What is the differenceof R
R \342\200\242
Q. Draw
composition
Draw
a
and
Q, i?-Q?
digraph. Give a set of n-tuplesfor the join ofR
to the first component of R and
the second
and Q with
respect
of
component
Q.
= {(x,x9z)
z
4. Let P = {(x,y,x \342\200\242
\\ x and
y) | x and y are intergers} and Q

are integers}.

(a)

D Q?

is P

What

(b) What is

the projectionof P

Q with

P)

third components?

(d)

R be the join of P and


component of P. DescribeR.
T be the join of R and
Let

(e)

What

(c)

{3,5}

Let

T.
componentofR. Describe
is the

projection

of T

and

y are

with

{7} with

with

to the

respect

respect

respect
the

to

the

to

respect

first and

to the

first

second

third

component?

5.

Let

P =

and

(a)

What

is P

(b)

What

is

{(x>y,x \342\200\242
y) \\x
are integers}.

integers} and,

S = }(x,y,x+ y)

\\x

H S?
the

join

of P

and S

with

respect

to

the

third

the

third

component of each?

(c)

is

What

the

projection

of this

= y

\342\200\242
z for

some

R~l?

Is R

join,

with

respect

to

component?

6. Let R
positive

{(x,y)

\\ x

z greater

than one, and xyy,z

integers}.

(a) What

is R

symmetric? Reflexive?

are

Section4.5
(b) Prove

that RD

(c)

is

What

the

of R

projection

transitive closure of i??

is the

\342\200\242
R. What

385

on Relations

Operations

with

the

to

respect

first

component?

7.

closure, the transitive reflexive


closure, represented as digraphs,for

the transitive

Give

symmetric

the

and

closure,

of the

each

relations:
following

(a)

8.

is an

x RyiSx

(b) x R y

x =

integral multipleofy, on the set


1, on the set {0,1,2,3,4,5}.

{2,3,4,5,6}.

y +

of the

closures

the

Give

iff

set {l}with

to each

respect

of the

following

properties:

(a) If

element
of S then x + 1is an element
of S.
is an elementof S then x + 1 and -x are elementsof S.
If x is an element of S thenx + 2is an element
of S.
(c)
x \342\200\242
2 is an element
of S.
(d) If x is an elementof S then
9. Answer
the
same
as in (8) for the set {0}.
questions
10.Prove composition
of relations
is associative. That is if R, S, T are
T = R \342\200\242
relations on A, then (R . S) \342\200\242
(S \342\200\242
T).
11. Prove by mathematical
induction that if R is a relation on A, then
is an

(b) If x

(a)
(b)
12.

Rm -Rn
(Rm)n =
an

Give

Rk+1

13. (a)

Rm+n

Rmn

of a

example

\342\200\242
*
i?\"1

relation i? and a

fc

positive

that

such

/?*.

Show that the transitive closureof a

is

relation

symmetric

symmetric.

(b) Is

the transitive closureof an

relation

antisymmetric

always

antisymmetric?
and
that the transitive closureofa reflexive
symmetric
is an equivalence relation.
and
R2 be arbitrary
binary relations on a set A. Prove
the following assertions.

(c) Show

relation

14. Let

Rx

disprove

(a) If Ri
(b)
(c)
(d)
(e)

and

R2 are

If Ri and R2
If/?x and R2
If/?x and R2
If i?x and R2

reflexive,

are

irreflexive,

are

symmetric,

are

antisymmetric,

are transitive,

then

then

be a binary relationon a set


that the transitive closureof R =

15. Let R

16. Prove that if R is a transitive


Q R.
positive integer n>Rn
17. Let i? be a relation on a set A.
(a) If R is reflexive, then R C
(b) R is transitive iff R2 C /?.

\342\200\242
is

R2

/?x

then
then

reflexive.
irreflexive.

i?x

\342\200\242
is

i?x
then

\342\200\242
is

i?x

R2

symmetric.
antisymmetric.
\342\200\242
i?2 is transitive.
R2

J?x

A where
U ?-i

\342\200\242
is

R2

has

#2.

Prove

n elements.

J?1.

relation on a
Prove:

or

set A,

then

for

each

386

Chapter 4: Relations

and

Digraphs

S aie relationson

that R and

18. Suppose

is
19. Suppose

a set

Q S

A, where R

and S

positive integer n.
S are symmetric relations on a set A. Prove:
R and
that
then (y,x) G R . S.
(a) If (x,y) GS.fi,
\342\200\242
\342\200\242
. S - S . /?.
(b) If i? S C S
/?, then/?
.
S is symmetric
iff i? S - S \342\200\242
/?.
i? \342\200\242
(c)
for each positive integer n.
(d) Jf?\" J j symmetric
20. SupposeR and S are relations on a set A. Prove or disprove:
S.
so is R \342\200\242
then
(a) If R and S are reflexive,
and
S is
then R \342\200\242
(b) If R and S are both reflexive
symmetric,
\342\200\242
\342\200\242
=
reflexive
and symmetric iff/? S
S /?.
S is transitive
iff
/? \342\200\242
S =
(c) If R and S are transitive, then R \342\200\242
Rn

that

Prove

transitive.

S
\302\243

each

for

s./?.

(d) If

S are

and

relations on

equivalence

21.

then

A,

S
equivalence relation iff/?
A.
S
a
R
and
are
on
set
relations
Suppose
.
.
S~l
Z?\"1.
Prove
that
(a)
(/? S)\"1
- Z?\"1 U S\"1?
(b) Is it true that (/? U S)\"1
O
R1 C\\ S\"1?
Is
is
true
that
S)\"1
(c)
(R
on
If
R
is
an
relation
(d)
A, is it true that
equivalence
\342\200\242
S =

equivalencerelation

on

an

R'1 is an

A?

of relations
in
satisfies any of the six properties
defined
R'1
or
determine
whether
not
satisfies
same
the
4.2,

If R

(e)

\342\200\242
S is

\342\200\242
/?.

Section
properties.

22.

R C

that

Suppose

(f)

relation
on a set A.
that R is a reflexive
J?-1
is reflexive
and symmetric.
(a) Showthat R \342\200\242
is transitive.
R'1
(b) Proveor disproveR \342\200\242
closure
(c) Prove or disprove that the transitive

Assume

23. Let R and S berelations


from B to C. Prove:

(a)

U
(T H

\342\200\242

(b)

i?

\342\200\242

(c)

Ifi?CS,then/?.

(T

(d) If
V

25. If

is

i? and

Let
Rn

Pi

Sn for

WO

WO

from

B and

A to

(R

\342\200\242
U

(R .

(R

\342\200\242
O

(/?

\342\200\242
is
i?\"1

an

T)

T)

let T and W

be

relations

WO

\342\200\242

W)

TCS-T.
relation

\342\200\242
i? C

relation.

equivalence

24.

S. Showthat i?\"1\302\243
S~\\

from

D to

A,

and

if

/? C

S, prove that

\342\200\242
S.

S be relationson a
each integer n > 1.

set

A. Prove

that (R D

S)n C

S are equivalence
relations on a set A, prove
that
both
R and S.
is an equivalence relation containing
on A such that
relation
Moreover, if T is any
equivalence
U SC
T.
R
U
that
S)+ C
(R
T, prove
i?

and

(i? U S)+

Section 4.5

26. Prove that if the relation


R is a partial
Af then R'1 is a partial order(totalorder)
If R is the relation on the
b - 2a, and if S - {(c,d)
GZ

27.

28.

Prove

29.If

A,

Z\\d

of

on

a set

A.

on

defined

integers

= 3c}, find

J? .

by aRb

iff

relation

on

S.

if R is a reflexive
and
transitive
each positiveintegern.
relation defined on a set A, then

R for

a symmetric

is

i?

Rn =

then

order (totalorder)

that

induction

by

a set

set

387

on Relations

Operations

R U

J?2 is

symmetric.

30. Findthe transitive

of R if

closure

(a) R =

{(a,6),(6,c),(c,d),(d,e)}

(c)

{(a,b),(b,c),(c,d),(d,e),(e,a)}

(b) * = {(a,a),(a,6),(6,c),(6,d),(d,c),(d,d)}
(d)

# =

{(a,6),(a,c),(c,c),(c,d),(d,c),(c,e),(e,/),(/,d)}

Selected Answers for Section4.5

1.

(d)

(b)

a*
<\342\200\242>

4.

(a)

{(x,x,x2) | x is

(b)

{(x,x2)

(c) j(3,y,3

an integer}

an integer}
\342\200\242
|y is an integer}
y,3)
x is

U {(5,y,5\342\200\242
y,5)
|y

is an

integer}

(d) {(3,7,21,3,7),
(5,7,35,5,7)}

(e) {21,35}

6.

(a)

The

is empty.

intersection

nor is it

(b) If x = y

greater
transitive

The relation

is

not

symmetric,

reflexive,
\342\200\242
a and
than

one,

closure,

y =

\342\200\242
b then

then

so is b

since

it is

x =

\342\200\242
a. The

\342\200\242
.

(b

a).

relation

already transitive.

If a

and 6

J? is

its

are

own

Chapter

and Digraphs

4: Relations

projection of R

(c) The

with

setof integers> 2.

8.

the

(a)

the integers

(c) the odd


(d)

PATHS

the

integers

positive

(b) all

component is

to the first

respect

integers

positive

the integer

powers of two

CLOSURES

AND

Many

of directed graphs involve


applications
of a graph are connected
to the other along some
vertex

of

questions

vertices

Two
connectivity.

is a

there

if

path that

goes

of the edgesof the graph.


consitutes
a path,
Different
authors
disagree about details, such as what
as
a sequence
of edges, though
however. Usually a path is defined
as a sequence of vertices. Whether
occasionally it may be defined
of edges
or vertices is permitted is a common sourceof
repetition
well
as other
as
a
details, such as whether thereis always
disagreement,
of length zero from each vertex to itself.Thesedifferences
not
are
path
in what
due to whimsy. They correspondto realdifferences
\"connected\"
real-life
structures
that graphs
may mean as it is appliedto the different
that
follow
have been
may be called upon to model.The definitions
chosen for their generality of application,but the reader
should
be
in the meanings of
discrepancies
prepared to pay attentionfor possible
terms as they may be used between one book and another.
one

from

Definition4.6.1.

directed

in a

path

sequence of zeroor moreedgesel9...,en

in

et_!is tothe vertex that ex is from; that is, et


1 < i < n. Sucha path is saidto befrom

each
this

case,

path

v0 and

in G

vn

are

Vi_i)

with

the endpoints

may
v0

of the

is a sequence of zeroor moreedges

path. A

nondirected

.,en in E

eu..

for which

or et = (vi9
v0,.. .,vn such that et = (i\\_i,i>i)
if all edges and verticeson the
is simple
for each 1 < i < n. A path
are
distinct,
except that v0 and vn may be equal. A path of length s* 1
is a circuit.
A
no repeated
edges and whose endpointsare equal

there is a sequenceof
path

called

digraph A = (V,E) is a
that for each 2 < i < n,
be written
as (i>;_i,vt) for
to vn9 and its length is n. In

E such

simple circuit
Note

directed

that

vertices

is calleda cycle.

the

definitions

and nondirected

of simple,

circuit, and cycle

paths. It is alsoimportant

to

apply

notice

equally

that

to

a path

of length zero is permitted, but it does not have a unique pair of


as being
from
Such
a path has no edges and can be viewed
endpoints.
a vertex to itself. When
we wish
to exclude paths of length zerowe will
use the term nontrivial
path. Ordinarilythe termpath will be qualified

Paths and

Section 4.6

simple or not. When

or nondirected,

as directed

kind of path may

the context,

from

inferred

be

is not

it

.,en is

el9..

path

e/s is to or from

kind of

There

are

two

paths from

directed

simple

(c,d), and (a,c),

(c,d). In

(6,d).

a number

are severalmore

to

addition

et

a to d. They

the simple
from a
paths

all

nondirected

simple

of the

path,

= (y9x)y

shown in Figure 4-17includes

The digraph

path and cycle.

of the

more)

(or

x and

4.6.1.

Example

each

the

qualified

or doesnot matter.

said to traverse a vertex x if one


x is not serving as oneofthe endpoints
or more precisely, if e, = (x,y), then 2 < i < n, or if
1 < i < n \342\200\224
1.
A

389

Closures

then

some

are

(a,6),

of

(6,c),

directed paths, there


to d, including (a,6),

directed cycles,including (a,6),


(6,c),(c,d), (d,e), (e,a) and a larger number of nondirected cycles,
includingall the directedcycles as well as cycles such as (a,6),(6,c),(c,a).
We
shall
now explore
some ways in which the conceptofpath
is related
to other concepts we have
discussed
with the
previously,
starting
\342\200\242
E \342\200\242
...
composition of relations.
of n
(Recall that En = E \342\200\242
E, the composition
copies of E.)
are

There

Theorem 4.6.1. If
En

iff

of

definition

path

since

x toy,

the theoremis
(if)

Suppose

(iV\302\273-i)

true

\302\243
#> so
(y\302\273-i\302\273y\302\273)

(V,E)

is a

digraph, then
x to

for

> 1,

(x9y) G

y in A.

1, En - E. The
is a path of length 1
that (x,y) G E iff there
guarantees
1is
a path of length
of A. For n > 1, we assume
an
edge
\342\200\224
n
for
break the proof into two parts:
1, and

(vq^x),.

\302\243
#n-1>

path of length n from

The proof is

Proof.
from

directed

is a

there

of nontrivial

by

that

Figure

by

on

induction

n. For

directed path

. .,(yn_i,yn)

is a

induction.

By definition

(u0, vn) G

4-17.

n =

from

\302\243n-

\302\243n.

A directed

graph

with

paths.

un. Then

v0 to

En~l

and
\302\243,

390

Chapter 4: Relations and

that

such

vn_x

(v0,vn) G

Suppose

if)

(only

some

Digraphs

En. Then,sinceEn

(v0,vn_l)

hypothesis, there is a directedpath


from

L>0

to

desired.

E,

exists

there

the inductive
of length n - 1

2?. By

,(yn-2>yn-i)

(y0^i),...

to this

(yn_i,yn)

!>\342\200\236_!.
Adding

= En~l

(un_i,u\342\200\236)G

and

2?n_1

path gives the

path of lengthn

\342\226\241

of transitivity.
are also related to the property
and composition
= (VJE) is a digraph then E istransitive
iff every
directed
path in A
has
a \"short-cut.\"
That is, if there is a nontrivial
directed
from a
path
from x to y. This
vertex x to a vertex y there must alsobean edge directly
Paths

If A

reasoningleadsto
3/ in

V,

corollary.

4.6.1.

If A

Or ,3/) G

\302\243iff

Corollary

x and
in A.

useful

digraph then for any two


nontrivial directed path from

is a

(V,2?)

there

is a

of
the
Proof. This is a consequence
previous
directed path from x to y in A of some length n

G 2?+.

that

(x,y)

n >

1, and

Conversely,

so the previous

path of lengthn

from

to

(6,c),(c,d),(c,e),(d,e)}.
different

, then

guarantees

Or,3/)

is a

so
\302\243n,

(xyy) G 2?n for some


that there is a directed

y.

Let
We

E, 2?

(xyy)

theorem

jc

4.6.2.

Example

if

x to

If there

theorem.

> 1, then

vertices

compute

{a,6,c,d,e}
the

and
transitive

let R = {(a,a),(a,6),
closure of R in two

ways.

1. First,

Method

only compute
composition,

we us6 Definition 4.5.5.SinceR* =


each
k, and take their union.

for

Rk,

we need

U*;>i#*
By

of

definition

we get

R2 =
i?3

i?4 =

{(a,a),(a,6),(a,c),(6,e),(6,d),(c,e)}
{(a,a),(a,6),(a,c),(a,d),(a,e),(6,e)}

{(a,a),(a,6),(a,c),(a,d),(a,e)}

i?5 = {(a,a),(a,6),(a,c),(a,d),(a,e)}

Notice

that

Then
R+

R+
-

R5 so it

the union

will

follow

of these

that

R4 =

i?5 = R6

= #*

for all

graph
vertex.

of

fe

>

4.

sets, so that

{(a,a),(a,6),(a,c),(a,d),(a,e),(6,c),(6,d),(6,e),(c,(i),(c,e),W,e)}

Method
compute

jR4 =
is just

2. We apply Corollary 4.6.1,consult


of all possible lengths from
paths

the
each

Ry

Then,

and

for

a
is a path of length 3 from
there
example, we know (a,d) G R+ because
R+
to d, namely,
G
because
the path (a,6),(6,c),(c,d).Similarly,
(a,b)
there is a path of length1 and length
2 from a to b. Likewise,(a,e)E:R+

Section

becausethereisa path

of

a to

3 from

length

391

Closures

Paths and

4.6

e (and a path of length 4

as

well).

We can continue this


a path of length 20 from

and finally

(a,6),

along

process,but wheredoesit end? Note that there is


a to c by going around loop (a,a) 18times,
then
But
note
that
since
there
are
only 5
along (6,c).

vertices x and y must


vertices, any path of lengthgreaterthan 5 between
must
a
so
includea
such
a
vertex
and
circuit.
have
Therefore,
repeated
x
to
to
oneof
or
to
from
be
shortened
less
than
could
y
equal
path
length
= R U R2 U R3 U R4 U i?5, and
R+
we need not
5. In other words,
considerpaths of lengthgreaterthan 5. Thus, we can again conclude that
R+ is the samesetas above.
In

is a relation on a set of n

if R

general,

reasoning in the

above

example

shortened to a path of
R+ = R
Based

meant

U R2

at

length

if R is

Rn,

a relation

digraphs that we
4.6.2.

Definition

connected

if

is

there

strongly

directed path

from

n elements.

vertices

in a

digraph are weakly

if there is a directed path


A graph is (weakly,unilaterally,

if every pair of verticesin the graph


Al of a graph
strongly) connected. A subgraph
connected

connected

strongly)

is

what

exactly

of connectivity

a nondirected
path between them.
if there is a directed path between

to x.

of

pair

in general,

Therefore,

on a set with

are

They

them.

connected
connected

unilaterally

or
unilaterally,

any path can be

that

now.

discuss

shall

the

extend

we can

vertices,

conclude
most
n.

on the definitions of paths it is possibleto define


Thereare three kinds
by a graph being connected.

relevant to

are

...

and

is
A

from

They

to y

x
or

and a

strongly)

or

unilaterally,
(weakly,
is a (weakly,

if it is a maximal (weakly,
component
subgraph; that is, there is no (weakly,
contains
connected subgraph of A that properly

connected

unilaterally,

or

unilaterally,

or strongly)

strongly)

A\\

4.6.3.

Example

edges,

{a,b,c}
and

either

between

in

Figure

all of the

4-18 illustrates

and their incident


graph, comprising vertices {a,6,c,d,e,/,g}
vertices
even weakly connected. The subgraph comprising
not
connected
but
the
{(a,6), (c,6)} is weakly connected,
edges
of the stronger
definitions, since there is no directedpath
their
and
and c. The subgraph comprisingvertices{d9e,f,g}

entire
is not

The

by

The graph shown

relations.

connectivity

incident
edges is unilaterally
since
there is no directed path

connected, but not

from

e to

d. The

connected,

strongly

only nontrivial strongly

and
connectedsubgraph is comprisedofvertices{e,f,g}

the

edges

{(g,e),

392

Chapter 4: Relations

and

Digraphs

c
\342\200\242

\342\200\242

4-18.

Figure

A graph

connectivities.

illustrating

are
weakly connected components,which
sets {a,b,c}and {d9e9f,g}.
of
There
are a number
unilaterally connected components.Two of them are the subgraphs

(e,f)y

This
(/>#)}\342\200\242

graph

has two

vertex

with

subgraphs

The strongly
({a,b},{(a,6)}),and ({6,c},
{(c,6)}).
vertices a, 6, c, and d, and

connected

the individual

Note that
qualification

Exercises

it will

term

\"connected\"

when

the

mean

weakly connected.

the

are

components

({e,f,g}, {(e,/),

subgraph

is used without

further

for Section 4.6


the

Consider

digraph

in Figure

4-16.

a to d.
from
(a) Find all of the simpledirected
paths
a to d.
from
(b) Find all of the simplenondirected
paths
that
start
at d.
(c) Find all of the directedcycles
(d) Find all of the nondirectedcyclesthat start at d.
Consider the digraph in Figure 4-17.
Find
all the weakly connected components.
(a)

connected
(b) Findallthe unilaterally
components.
Find all the stronglyconnectedcomponents.
Draw
a digraph
connected
with 5 vertices that has 4 strongly
2
and
3
connected
components,
components,
unilaterally
weakly

(c)

connected

exactly.

components,

Draw a

digraph

with

4 vertices

and one

strongly connected

component.

Draw

has

a digraph
3,
length

directed
with 5 vertices whoselongestsimple
has
whose longest simple undirectedpath

longest directed cycle has


undirected
cycle has length 5.

whose
What

digraph

is the

longest

length possible

with n vertices?

length 2,

and

path

whose

for a simple directedpath

How about the longest

cycle?

5,

length
longest

in

Section

Paths

4.6

(a) Cis
(b)

an

of

the

digraph suchthat

classes of
an

of

the

C are

equivalence

equivalence

these vertices

between

Cy

iff

each weakly

connected

digraph.

the definition

8. Give

such that x

relation.

equivalence

the equivalence
components

a digraph

path from x to y. Proveor disprove:

nondirected

is a

there

Con theverticesof

the relation

7. Define

393

Closures

and

are the strongly

on
relation
classes together
connected

the vertices of a
with

the

edges

components.

D on theverticesofa digraph
such
that x D y iff
directed path from x to y. Proveor disprove:
D is not an equivalence relation on the vertices
of a digraph.
(a)
D
is
iff
a
order
the
no
has
(b)
partial
cycles of length
digraph
the relation

9. Define

is a

there

10.

(x,y)

greater than one.


A - (V,E) be a digraph.Define
A1 - (V,^1) where (x,y) G El iff
G E or (y,x) G E. Proveor disprove:

(a)

El

(b)

Let

is an
l

equivalence relation.
connected

is unilaterally

iff

A is

weakly

connected.

= (VfE)
Prove or disprove
be a digraph. Define A+ = (V,E+).
iff A is unilaterally
connected.
connected
that A+ is strongly
of En are equivalent:
12. Prove that the following
definitions
(a) El-EttndEn-En-l.Efoin>l;
(b) B1- EandEn= \302\243. E\"\"1 for n > 1.
13. Provethat the following definitions of E+ are equivalent:

11. Let A

(a)

E+

U7=iEl;

(b) C1 * JS, Cn+l = C* . Cn, and E+ = UFLi C1'.


14. Let R be a relation on a set A and let S = i?2. Prove that (xyy) G S+
x to y of even length.
iff there is a directed path in R from
x to a vertex y, then
If P is a path from
15. Proveby induction:
a vertex

a simple

contains

path.

connected
16. Prove that a digraph G is unilaterally
directed path in G containingall theverticesof G.

17.

that

Prove

directed
(vl9v2)9:.

Selected

Answers

for

iff

there

is

is a closed
G is strongly connected iff there
a digraph
in G. (A path
vertex
(v0,Vi)9
path containing every
.,(un_!,u\342\200\236)is

Section

closed

4.6

1. (a) (a,6),(6,c),(c,d)

(a,c),(c,d)

if v0

un.)

394

Chapter

4: Relations

and Digraphs

(b) the

above,plus

(a,b),(dtb)

(a,c),(6,c),(d,6)
(e,a),(d,e)

(c) (d,6),(6,c),(c,d)

(d,e),(e,a),(a,c),(c,d)

(d,e),(e,a),(a,6),(6,c),(c,d)
(d)

the

plus

above,

(d,6),(a,6),(e,a),(d,e)

(d,6),(a,6),(a,c),(c,d)

(d,6),(6,c),(a,c),(e,a),(d,e)

(c,d),(6,c),(a,6),(e,a),(d,e)

(c,c0,(6,c),(d,6)

(c,d),(a,c),(e,a),(d,e)

(c,d),(a,c),(a,6),(d,6)

(d,e),(e,a),(a,6),(d,6)
(d,e),(e,a),(a,c),(6,c),(d,6)

2.

(a)

(b)

are
are two weakly connected components.They
a
nd
and
all
incident
vertices
with
{a,b,c}
edges,
subgraph
and
all
incident
vertices
with
edges.
{d,e,f,g}
subgraph

There

the
with

{d,e}

and

four

are

There

subgraph

edge {(d,e)}>and the


edges {(d,e),(e,/),(/,g),(g,e)}.

6. Since only

the

five

for

except

vertex
last

greater than n.

with

iff

there

is a
w to

vertices

{d,e,f,g}

They

are:

);({e,/,^},{(e,/),(/^),(^,e)}.

not

have

length

a simple

path.
and there is

path from v to w
course it needs to be verified

directed

v. Of

They are
subgraph

vertices

components.

graph, then a simplepath may


The sameistrueofa cycle,which is

directed path from

the

may be repeated on a simple path,


must go to a new vertex. If there are

in the

n vertices

E w

0 );({<*}, 0

the

subgraph

connected

strongly

0);({c|,

starting

eachedge
8. Define v

{a,b} and

and

(c) There are


({a},0 );({&},

only

vertices

{b,c\\ and

vertices

connected components.
edge {(a,6)},the
the
{(c,6)},
subgraph with
edge

unilaterally

with

the

that

this

Section

Directed Graphsand

4.7

395

Matrices

Adjacency

classes
are the
equivalence relation, and that the equivalence
connected
components.
strongly
En as defined in (a), and let E(byn)
denote
En as
12. Let E(a,n)
denote
defined in (6). We wish to prove that E(a,n) = E(b,n)for all n > 0.
on n. For n = 1, we know that E(a,n) =
The proof is by induction
=
\302\243
n
E = E(b,n).Forn = 2, we know that E(ayn) = E \342\200\242
\302\243(6,n). For
- 1). E(a,n) =
> 2, let us assume that E(a,n - 1) = E(bfn

is an

E, and,
E(a,n - 1) \342\200\242

= 2?(6,n

E(a,n)

- 1)

E(6,n

\342\200\242
\302\243(a,n

4.7

E -

\342\200\242
\302\243

2)

E(b,n

1,
since

we have
- 1)

induction,

AND

GRAPHS

DIRECTED

\342\200\242
=
\302\243

- 2),by

E(a,n

- 1) =
\302\243(a,n
by induction,
\342\200\242
E. We know that n - 1 >
- 2) . E. Thus,
\342\200\242
\302\243
E(b,n

- 1)

\302\243(a,n

and

- 1).Thus

so

=
E(a,n)
- 2) =

\302\243(fc,n

- 2) \342\200\242
\342\200\242
E = \302\243
E(a,n) = \302\243
E(b,n
= \302\243
1) = \302\243(6,n).
\302\243(6,n

MATRICES

ADJACENCY

related
to
seen that digraphs
and binary relations are closely
have
to another
other. They are both relatedjust as closely
important
review the
structure: matrices. We will now therefore
mathematical
definition of matrix, to seehow a matrix can represent a binary relation
and how this matrix representation
can be useful in extracting
We

each

information
about

a digraph.

be

Let S any set and ra,n be any positive


4.7.1.
n matrix
over S is a two-dimensional
m rows
elements
of S with
and n columns. The elements
the first,index
with
indexed,
indicating the row number and
index
the column
number, as shown in Figure
indicating
Definition

An

integers.

of
rectangular
are
the second
4-19.

in
Matrices interesting
mathematical
However,
are

most

Column

Column 2

Column

Row

A(\\,l)

A(\\,2)

A(\\,n)

Row

-4(2,1)

-4(2,2)

A(2%n)

Row m

doubly

own right and are the subjectofa rich


of
of this theory is beyondthe scope

their

theory.

array

A(m,\\)

Figure

A(m,2)
4-19

...

A(m,

n)

396

Chapter 4: Relations
the

and

book. We are

present

special

Digraphs

For this purpose we will


matrices over the set {0,1}.
the

between

by

J) =

by A(i

1 iff

in matrices
for one
or binary relations.
which are
matrices,

Boolean

is a natural one-to-onecorrespondence
and the square Boolean matrices,as

definition.

following

Let
Definition
4.7.2.
{vu.. .,vn}. The adjacency
defined

interested

of digraphs

consider

There

relations

binary

demonstrated the

presently only

representation

application\342\200\224the

E be any

relation

binary

matrix of E is the n

on a finite set V
n Boolean
matrix

matrix
every n x n Booleanmatrixis the adjacency
also
that
the interpretation
unique binary relation on V. Note
ordering
of the set V.
adjacency matricesdependson the presumed

by

the

The relation
matrix

4.7.1.

adjacency

G E.

(vhVj)

Note that

Example

of

of

< on the set {0,1,2,3,4}


is represented
1

l]

|\"l

1111
0 0 111
0

11

Lo o o o lj

Notice all
because< is
that

the

reflexive,

Example
adjacency

4.7.2.

diagonal
and

will

entries in the matrix


be true for any reflexive

The digraph in

o o ol

0 0 10

0 0 0 11

110
I 0

relation.

Figure 4-20 is representedby

matrix,

To

above are 1. This is

OJ

the

Section4.7

Directed

and Adjacency

Graphs

y2

Vi

\302\273.#

397

Matrices

v3
#

4-20

Figure

the Boolean matrix representationof


binary
computations
involving relations are performed.
this
a
and
two
representation,
By
using
generalized way of combining
scalar operators to get a matrix operator(defined
it
is
below),
possible to
It is often

very

to use

convenient

when

relations

describe in simple termsalgorithms


information
from

In the

takes

two

a binary

definition

following

arbitrary

for

scalar

is

chosen

for

it is

because

a similar

much

useful

operators
(The

on operators, that

an operator

we define

\302\251
and

matrix operator \302\251.\302\256


as result.
APL

extracting

relation.
and yields a
arguments
used for this operatorhere

\302\256
as

notation

used in the programminglanguage

the notation

operator.)

4.7.3. Let S be any set and let \302\251and \302\256be any two
Definition
\302\251is
that
binary operators defined on the elementsof S. Assume
is
of
denoted
\302\251
a
nd
The inner
associative.
\302\256,
by \302\251.\302\256,
product
=
B
D
that
such
n
x
A\302\256.\302\256
ri
over
for
matrices
defined
Shy
B(l,j))
D(i,j) = (A(i,l) \302\256

...
\302\251

\302\251
(A{i,n)

\302\256
B(n,j)).

such an inner product to


when we wish to iteratively
extension,
apply
the matrix A in the case that
a singlematrix,we write (\302\251.\302\256
)kA to denote
\302\251.\302\256
k = 1 and for k > 1 to denote the matrix ((\302\251.\302\256
A).
)k~lA

By

For

any single

and B to

scalar operator

we
\302\251

denote the matrixE such

will

also write

B
\302\251

for

matrices

that

E(i9j)-A(i,j)\302\256B(iJ).

Note that in the case that \302\251and


the
usual
addition
\302\256
are
the
multiplication operators on the integersor the realnumbers,
defined above is the usual definition
of matrix
product
product.

and
inner

398

Chapter 4: Relations

and

Digraphs

Let S be the set


4.7.3.
OR and AND definedby the table:

{0,1}

Example
operators

0
1
1 0
1 1

0
1

Let

inner product A

the

\302\256
be

4.7.1 and B be the


B is

OR.AND

1 1 1

[l

\302\251
and

1
1

in Example

matrix

the

be

4.7.2. The

let

x AND y

x OR y

and

in Example

matrix

the matrix

ll

11111

110 11

110

[o

oj

elements of this matrix are


representative
2
is
from
the
column
obtained
second
row of
2,
entry
A and
AND
the second
column of B, and is (0 AND
OR
1)
(1
0) OR (1
=
AND
AND
1.
in
OR
The
row
OR
AND
column3
is
(1
0)
(1
1)
0)
2,
entry
obtainedfrom the second row of A and the third column of B, and is (0
AND
1) OR (0 AND 1) OR (1 AND
1) OR (0 AND 0) OR (0 AND
0) - 1.
in row

The

4.7.4.

Definition

two

the

When

of OR and AND,

operations

particular

two

how

show

will

We

obtained.

operations

\302\251and

then

respectively,

the

\302\256are

we shall

refer to

their innerproductasthe Booleanproduct.


The

theorem

following
between

relationship

an important computational
and these operations on Boolean

expresses
relations

binary

matrices.

Theorem 4.7.1.
{vu..

represented

.,uj,

\342\200\242and

RB,

relation

RnA.

Proof.
(vjtvk)

the
Here

RB be

and

binary relations on a

matrices

and

B respectively.

set

Then

OR.AND

matrix

Recallthat RA
RB for

RA

by adjacency

B is the adjacency matrix of the relation


(OR.AND)nA is the adjacency matrix of the
means A OR.AND A.
(OR.AND)2^

the Boolean product A


RA

Let

some j}.

\342\200\242
=

RB

Thus

if

Rc where Rc - {(viyvk)\\
C is the adjacency

(vhVj)

G RA

matrix of Rc

and

then

Section

Directed

4.7

C(i,k) = 1 iff
same as saying

consequence
of

OR.AND

(A

OR

the

AND

(A(i,n)

is thus a

direct

Let

the

be

V = {vu. . .,vn}.

a set

on

399

is exactly

1. This

...

theorem

The

B)(iyj).

definitions.

the

4.7.1.

Corollary

relation R

= 1 and A(vjyvk)
=
AND B(1J)) OR

j, A(vhVj)
- (A(i,l)

C(ijk)

is

which

B(n,j),

some

for

and Adjacency Matrices

Graphs

transitive closure i?f is

the

OR

by

given

of any binary
matrix of the
OR ... OR
(OR.AND)2A
matrix

adjacency
Then

adjacency

(OR.AND)M.

Corollary
relation
R*9

R2

where

\342\200\242
\342\200\242
\342\200\242
U Rn.

4.7.2.
Let
R. The adjacency

(/ OR
by

is given

/ is

the preceding theoremand

follows from

This

Proof.

i?+ = R

the

fact

that

\342\226\241

be

the

matrix
OR

A OR

(OR.AND)2

...

OR

binary

closure of

reflexive

transitive

the

of any finite

matrix

adjacency
of

(OR.AND)\"

Ry

A),

the identity matrix

1 0
0 1

Lo

Proof. Thisis

reader

the

to

left

...
as an

i.
exercise.

\342\226\241

Let us apply Corollary4.7.1to the relationR of


other words, A = {a,6,c,d}
and R = {(a,a)(afb),
Let Ar denote the adjacency matrix of the relation
(6,c),(c,c0,(c,e),(d,e)}.
Rk.
4.7.1, AR is the Booleanproductof AR and AR, that is,
By Theorem
=
AR
AR OR.AND
AR. Likewise, for k > 1,AR is the Boolean product of
Ar~1 and AR.
Example

Example

We

see

4.7.4.
4.6.2.
In

that

Aj-

0
0 0
0 0
0
0

0
11
1 1
0 1
0 0

1110

0 0 0

0 0 0
ASA%-

11
0 1

0 0 0

400

Chapter

and Digraphs

4: Relations

11111
0 0 0
0 0 0
0 0 0
0 0 0

11111

0 0 0 1

0 0 0 0 0

A3

AJ

- AR

0 0 0 0 0
0 0 0 0 0

0
0
0
0

0
0
0
0

we can compute
the separate matrices by appeal
to the
For instance,
the second
observing paths of different
lengths.
row of A% means that there is a path of length2 from b to d and one of
length 2 from b to e. The third row of AR reflects the fact that there is a
path of length 2 from c to e.
Now if V stands for the Boolean operation OR, then the adjacency
Of

course,

graph and

matrix

transitive

of the

closure R +

is:

11111
0 0 111
AR+

=ARVA2RVARVA4RVAR

11

0 0 0 0 1

0 0 0 0 0
and
and integer
use
of operations
other than \"AND\"
\"OR\",
information
from
it is possible to extract other useful
an
is the number of
matrix. Among
such
useful
information
adjacency
to another in a digraph,
distinct
of a given length from
one
vertex
paths
of the
the lengthof the shortest path between two vertices, and the length
longest path between two vertices.
Making

matrices,

Theorem 4.7.2.
adjacency

matrix.

Let

Suppose
\302\251
and

x if x

\302\256y

- (VfE)

\302\256
denote

is a directed graph and A

the

operations

>y

y otherwise,

\302\256
y

x+

if x

> 0

0 otherwise,

and y > 0

is its

Section

Directed

4.7

Graphs

401

and Adjacency Matrices

and
A

k =

for

Lk~l\302\256

Lk(iJ) is the

Then
Vj

has

that

\302\256
(L*-1\302\251 \342\200\242
A)fork>l.

length of the longest

length

directed

nontrivial

<&, unless Lk(i,j)

= 0, in

case

which

path from
no such

ut

to

path

exists.

Proof.
conclusion
k > 1, we

The proofis
= 1 there is

= 1 we have Lk = A.
of
path
length 1 from i>t to vj9 the
follows directly from the definition of adjacencymatrix.For
caii assume the theorem holds for smaller
of k. Lk(iJ) =
values
k. For k

on

induction

by

Since A(i j)

a directed

iff

...
\302\256
\302\251
\302\251
Lk-\\i,k) \302\251(Lk-l(i,l)
(Lk-l(i,n)
A(lj))
is
the
maximumof
words, Lk(iJ)
Lk(iJ)and all of
1 <

Case 1. Supposethereis no nontrivial


<k. We need to showthat L*_1(i\\
length

nonzero,

then

Vi to

Vj.

If

path

from y,-to

directed
;) and

all of

the L*\"1^)

t>,

\302\256
A(t

of

j)

is nonzerothere
If Lk~l(if j) is
<k.
from
to
of
u,
path
length
Vj
is
of
there
a
nontrivial
induction
path length<k - 1
by
is
\302\256
nonzero
for
some
Lk~l(i,t)
A(\302\243,
t, then by induction
j)

are zero in this case. We will


must
be a nontrivial
directed
from

for

Lk~x{i,t)

\302\256
A(tJ)

two cases:

We will consider

< n.
\302\243

In other

\302\256
A(nj)).

thereisa directed

path

from

vt to

if one

that

argue

ut

combined to form a directed path


shown in Figure 4-21.)

an

and

edge

of these

from

of length <k from

vt

to

Vj

y,- to

that
Vj.

can
(This

be
is

directed
Case 2. Supposethereis a nontrivial
path from vt to Vj of
<fc.
Choose
one
that
has
maximum
such
path
length.Let/ be the
length
this
the
on
it.
of
of
and
be
last
edge
By definition
length
path
(vt,Vj)
adjacency

matrix,

A(tJ)

whether/ is greaterthan

= 1. We

break

this

1.

Figure

4-21

into

subcases,

depending on

402

Chapter 4: Relations

and

Digraphs

If / = 1, sincewe are considering


the case where k j> 1, we know thac
of length
<fc - 1, and so by
also the length of the longestpath
= 1. This means that Lk(ifj) is at least 1,but we are
induction
Lk~1(iyj)
not done, since it might be that one of the Lk~l(i,t)
A(t, j) is greater. To
seethat this cannot be, suppose that Lk~l(i,t) \302\256A(t, j) is nonzero. Then,
in Case 1, there must be a directedpath
seen
as wasalready
from
vt to Vj of
>1
which
would
be
and
a
contradiction
than
<k,
/,
(see
longer
length
Figure 4-21). Thus Lk(i, j) = 1.
directed
(b) If / > 1, thereis a nontrivial
path from t>f to vt of length
- 1 and
/ \342\200\224
1. There
can be no directed path from
ut to vt longer than /
shorter
than
to
k, since otherwise such a path couldbejoinedwith
(vt9Vj)
obtain a path longer than / from
the definition of /.
ut to vjt contradicting
= / - 1. It follows
from
the
Lk~l(ift)
Thus, by induction,
immediately
= /. Once again, we have
definition of \302\256that
\302\256
Lk~l(iyt)
A(t,j)
only
shown
that Lk(if j) is at least I.Suppose
that
Lk(i, j) is greater than /. This
can only be if either Lk~l(iJ) is greater than / or some term Lk~1(i,t)
\302\256
than
this would
A(t,
/, since
j) is greater than /. Lk~l(iJ)cannotbe greater
contradict the'induction hypothesis. On the other hand, if Lk~l(i,t) \302\256
/ - 1. By induction,
is greater
than /, Lk~l(i,t) must be greaterthan
A(tJ)
there must bea path of length Lk~l(i,t) from vt to vt and this must not be
1. Such
a path could be joined with
(vt ,v}) to obtain a path
longerthan k \342\200\224
/ and
of length greater than
less than or equal to k from
vt to vj9 a
Thisconcludes
of the definition of / (see Figure4-21).
contradiction
the
(a)

/ is

that

proof

Lk(i, j)

- /.

this

theorem

that

Note

not be simpleand

so

\342\226\241

deals

the
of the
longest
harderproblem.

simple

length

matrices

Adjacency

next section

we

the

computing
however,

must

we

convenient

vertices and

path between two

edges. Finding
vertices is a much

look

transitive
closure of a relation. Beforemoving
one
point out that adjacency matrices are only
purposes.

vertices and

many

definition need

in our

which

a simple and very elegant means of


for describing algorithms on digraphs. In the
at one such algorithm, due to S. Warshall,
for

of digraphs, and are not


are especially inefficient

representations

some

representation
for

will

paths

repeated

provide

and

digraphs

representing

with

include

may

very

edges.

and
study of graph representations

book.

best

the

They
few

Regrettably,
algorithms

is

on,

of several

for

graphs

with

however, a complete
beyond the scope of this

Exercisesfor Section4.7

1.

(a)

matrix of the digraph


adjacency
where J? = {(a,6),(6,c),(<i,c),((i,a)}.
Give

the

({a,6,c,d},#),

Section

4.7

(b)

Give

the

closure,

Jf?+.

Give the

(c)

Boolean

Give the

2.

3.

Graphs

matrix

representation

Boolean matrix

403

of the transitive

representation of

transitive

the

Jf?*.

reflexiveclosure,

(d)

and Adjacency Matrices

Directed

matrix

4.7.2 for

in Theorem

defined

L3

this digraph.

matrix of the digraph shown


in Figure
the adjacency
Give
4-16.
of the
closure
transitive
(b) Give the Booleanmatrix representation
of the relation represented by this digraph.
(c) Give the Boolean matrix representation of the transitive
reflexiveclosure
of this relation.
in Theorem
4.7.2 for this digraph.
(d) Give the matrix L2 defined
(a)

Prove

4.7.2.

Corollary

alternative definitions

4. Give

\302\251
and

for

so
\302\256

that

for the definitionsin Theorem4.7.2make


Lk(i,j)
shortest nontrivial
from v( to Vj of
directed
path

them
of the

substituting
the

length
<&.

length

5. Suppose that G is a directedgraph,


vl9 t>2,.. .,vn are the vertices of G,
and A is the adjacency matrix of G.LetAk denote
the inner product
of A*\"1 and A where k > 1 and \302\251
and
\302\256
the usual addition and
denote

multiplication operations.

(a) Provethat

the

that

M(if j) is
from
v( to

entry
paths

(c) For the


-\\-

A2

graph

A3

-\\-

= A

that

Suppose

that

we denote by
paths

Vj of

A2
+ ...
+ Ak is a matrix whosei-j**1
number of distinctdirectednontrivial

of

Vj

in

-\\-

A4

at most

length

k.

exercise

1(a) compute A2,


the entries
interpret

and

S are relations definedon a set A.


are the adjacencymatricesof R and S

Prove th^t

(a)

AR

matrix of R

S, where

(b)

AR A

binary operation
As is the adjacencymatrixof R
operation AND.

S, where

(c)

The

As is

the adjacency

A2, and

of each of the

R and

AR and As
V

to

vt

is

j),

Ak(i,

from

the total

matrices.

6.

directed

exactly k.

length

(b) Then prove

of A*, which

entry

i-jth

of distinct nontrivial

the number

also

Suppose

respectively.

V denotes

the

OR.

transpose

of

AR

is

transposeof a matrix

the
is

adjacency
matrix

A is the

binary

matrix of R~l. (The


MT where MT(i,j) ==

M(jfi).)

7.

In

the

adjacency

manner of Corollary 4.7.1,describehow


closure
matrix of the transitive reflexive

defined on a set A.

to

of a

obtain

relation

the

404

Chapter

4: Relations and Digraphs

8. For

ofrelations
each of the 6 properties

an interpretation of their definition

(a)

terms

in Section
of adjacency

4.2, give
matrices.

Section4.7

Selected Answers for

1.

defined
in

\"0

0 01

1 0

0 0 0
_1 0 1 oj
0

1 1 Ol

\"0

(b)

0 1 0

LI
(c)

[1

(d)

0 0 0

1 1

1 1
1 1
1
1

OJ

Ol

Li

lj

ol

Li

oj

r\302\260

4.7.1 WarshalFs

Algorithm

and the rest of this chapter,dealswith


of the
applications
of
the
and
relationsto
of
Several
theory
digraphs
study
algorithms.
tomathematicalanalysis.
The
first
aspects of algorithms lend themselves
An algorithm
and most basic aspect is the correctness
ofan algorithm.
is
on
considered to be correctif, when
that
satisfies
its
input
performed
terminates
and
input requirements,the algorithm
yields
output that
This

section,

is frequently
satisfies its output requirements.Correctness
broken
into
termination and partial correctness.
Terminationmeansthat
the
halts on every input that meets its input requirements.
algorithm
if ever the algorithm halts, and if the
Partialcorrectness
means
that
the
met
input
input requirements, the output must meetallthe\"output
the input and output requirements
of
Precisely
requirements.
specifying
but
an algorithm,
and then verifying its correctness,are very
challenging
definition
very important
applications of the techniquesofmathematical
two parts:

and

proof.

the next most basicissuein the study of algorithms


to studying
the
The most widely
approach
accepted
or
functions
of
is
in
termsof
measures,
efficiency algorithms
complexity
such
as time or
that relate the resource requirementsof an algorithm,
how
of
a
to
the
the
details
sizeofthe
Because
computer
memory,
input.
After

correctness,

is efficiency.

Section

Directed

4.7

such
algorithm is implemented,
may

affect

very

hard

resource

its exact

the

as

requirements,

resourcesrequired
by

factor.

constant

of

on which it is executed,
and becauseexactfigures
are
an

describe

that

the

approximately,

algorithm

notation is frequently

Big-0

if we assert
that the running time t of
be that this timeis expressible
in
the
form

example,

0(n2), it may

405

computer

used in this context.

For

and Adjacency Matrices

is customaryto derive formulas

to obtain, it

rate of growth of the


within the tolerance

Graphs

an

is

algorithm

then
such
coefficients

and

the

things as program
a0, au and a2, but

time. (Note,
assumes
certain
cost.

constant

operations

primitive

that

implementation

Any

the

increase

the

that

however,

that

details and executionspeedsaffect only


do not alter the order of the running
of any algorithm generally
analysis

order

can be performed with


violates this assumption

time. In this

of the running

structures may affect the orderofthe running


We emphasize that the orderofthe running

increase of running time with


running times of two algorithms
that

know

we

the

increase

second by a
Essentially,

the

size.

it

for example, if the


0(n2) and 0(n3), then

Thus,

respectively,

values of n, a two-fold

time of

factor of 8.
then,

are,

algorithm.)
the rate of

indicates

time

increasein input sizewill

the first algorithm by a factor

is the

time complexity

of

an

of

4 and

algorithm

the
that

if
problem an algorithm can solve.Forexample,
n
time
of
where
is
has
a
order
2n,
running
algorithm
graph-theoretic
of 10 in the number of
number of vertices, then an increase

determines
some

for large
running

input

of an

time

may

of data

choice

the

way,

how large a

the running
from
10 to 20, or from 20 to 30\342\200\224will increase
1000. Also, for
constant multiple of 210, or by approximately
such an algorithm,even a tenfold increase in computer speed adds only
3
in a given time, since 23 is
three
to the size of problem that can be solved
vertices\342\200\224say

time by a

approximately

Therefore,

estimate of

10.

the running timeof an


its practicalfeasibility.
Nevertheless,
the order of

that the orderofthe complexity

algorithm

we

should

us an
not forget

gives

is a measureof
of an algorithm
algorithm, as the sizeofthe input goes
to infinity. It is possible, for small
that an algorithm of higher
inputs,
There is a
order.
orderactually
can
be more efficient than one of lower
time of
to assume
that an algorithm with
running
tendency, for instance,
that
order n2 is better
than one with running time of order n3. Indeed,
in some practical
of
is correct for large values
n, but
assumption
situations the lattermay have a better performance for small values of
the

n.

asymptotic

performance

function

of the

406

Chapter

4: Relations

and

Digraphs

is said to be polynomial-bounded if its running


time is
An algorithm
n
of order
where
is
the
size
k is a
and
bounded by a function
nk,
input
constant. Accordingly, an algorithm is regardedas being
relatively
fast or
and
otherwise.
if
is
it
inefficient
polynomial-bounded,
efficient
is said to be easy if some
polynomial-bounded
Therefore, a problem
algorithm
has been found to solve it.
with
computational
efficiency is
polynomial-boundedness
Associating
in
above
a
a
certain
input size,
polynomialtheoretically justified that,
have
a smaller
bounded algorithm will always
running time than a
nonpolynomial-boundedalgorithm.(Of course, for very small input sizes
could
have a better performance.)
the nonpolynomial
algorithm
in the remainder of Chapter 4 that
show
We
shall
there
are several
that
have
efficient
for
their
algorithms
graph-theoretic problems
in
solution.
discussed
is
also
an
efficient
(Kruskal's
5,
Chapter
algorithm,
On
the
other
there
are
a
of
number
hand,
important
algorithm.)
graph
have
ever been found. Among
problems for which no efficient
algorithms
difficult
these
more
problems, we have:

1. The Subgraph

does contain
2. The Planar

a subgraph

a
positive integerk < | E |, is
= (VJE')is
\\E'\\ > k such that G'

a graph G = (V,E) and


E' of the edges of G with

Given
subset

there

G and H,

to HI

isomorphic
Problem.

Subgraph

two graphs

Given

Problem.

Isomorphism

is discussed

(Planarity

planar?

a
in

Chapter 5.)

Does
3. The HamiltonianCycle Problem.
Hamiltonian cycle? (Hamiltoniancycles

graph contain a

a given
are

in Chapter

discussed

5.)

4. The ChromaticNumber
a way that no

two

are

numbers

All

the

Cook of
problems
problems

a class

problems,

NP-complete

the

is now

notorious

of

University

for

known to
their

discussed

above belong

listed

problems

vertices

adjacent

(Chromatic

vertices

the

color

a graph
of G with

Given

Problem.

to
integerk, isit possible

of

in such

painted the
in Chapter 5.)

to a larger classof
This class

contain literally

same color?

problems

introduced

problems

computational

positive

k colors

are

in 1972.

Toronto

G and a

called

by Stephen
of

NP-complete

of different

hundreds

intractability.

computer science,
some sense the
mathematics,operations
economics,
research,
hardestproblems
in polynomial time by algorithms
that
can
be solved
that are allowed
to \"guess\"
arecorrect.
and then verify that their guesses
These
all
are
have
two
First,
problems
equivalent
important properties:
in the sense
that all or none can besolved
(More
by efficient
algorithms.
into
each
be
transformed
can
any other
precisely,
NP-completeproblem
NP-complete problems,which

occur

and

in such

areas as

are in

Section4.7

Directed

407

Matrices

and Adjacency

Graphs

transformation;
NP-complete problem by a polynomial-bounded
clearly
transformable
into an easy problem, then it is also
if a problem is easily
the NP-complete
an easy problem.
Thus,
problems are all easy or noneof
the
of
them
times
all
methods
are
Second,
currently
easy.)
running
known for finding general solutionsfor any of the NP-complete
problems
of
can always blowup exponentiallyin a mannersimilarto the behavior
T. (Even
for relatively small values of n, 2n is a very large number. For
example,when n = 70, a computer that can perform 106operations per

second

would

Since

many
for

intensively

of the

NP-complete problems
no efficient algorithms have

have

and

decades,

them, Jt seems likely


mathematicians

they

is inherent in

algorithm is known for

no efficient

should be

all

solving

of \"hardness\",

for any
an

find

efficient
problems:

NP-complete

any

of

many

\"hard\"

problems,

of them.

The reader

an infinite hierarchy of
including many that can

The study
harder than the NP-completeproblems.
and
the
classificationof
such
classes,
problemsaccording
complexity
is an important
of the algorithms that can solve
them,
complexity

be proven
to

degrees

studied
found

exist. Indeed,

considered

exists

there

that

however,

aware,

of
classesof problems

operations.)

been

the inability to

the nature of

be rightfully

may

problems

NP-complete

270

been

algorithms

that

suspect

procedure
believe that no such procedurecan exist.

since

of

such

no

that

strongly

solution

to perform

centuries

300,000

require

to

branch of

be much

computer scienceknown

as

computational

complexity

theory.

The algorithm describedin this sectionis one for which


the issues of
termination and complexityare rather simple.
The
outer
loop is always
of the
performed n times, wheren is the dimension
input matrix. Each
iteration of this loop looks at each pair (i,j) of vertices,and performs
a
constant-cost
on the pair. The total running
of the
time
operation
can thus be estimatedto be 0(n3),and
its
total
algorithm
memory
to be 0(n2), for the matrix.
The issue of partial correctness,
requirement
is less simple,
and it is to that issuethat we will pay the most
however,
attention.
The following
for computing
the transitive closure of a
algorithm,
is due to S. Warshall
Besides
(1962).
relation,
being a wa^ to calculatethe
transitive closureofa relationthis algorithm
can be generalized
to solve a

number of otherrelatedproblems.

Algorithm

4.7.1

Inputs The
{vly..

adjacency

matrix

of

a digraph

(V,E), where

.,vn].

Output:
+

(V,E

Closure

the Transitive

Computing

).

new

adjacency

matrix

M, which

is the adjacencymatrix of

408

Chapter 4: Relations and


Method:

Digraphs

For each

For each

1 up to n (sequentially)

k from

pair (ij) such that

<

the

do

< n (in

ij

following:

any order) do the

following:

(*)

If M(i,k)

= 1, M(kJ)

= 1,and

- 0

M(iJ)

then changeM(iJ) to 1.

this algorithm is shown in Figure4-22.The


the figure is that if there is a path from vertex v(
fall into one
traverses
that
to vertex
only vertices in {vl9.. .,vk) it must
Vj
of two cases. It may
the path traverses only vertices in
be
that
it traverses
{vlt...,vk_i). Otherwise,
only vertices in {vlf.. .,vk_x} to get to
the first time, may visit vk several
more
times via subpaths that
vk for
in {vu.. .9vk_i), and finally reaches Vj via a subpath
traverse only vertices
k
that traverses only vertices in {vx,...,i>*_i}.
incrementing
By
0 through
n, we eventually considerall paths betweenvt and
successively from
The

reasoning

behind
goes with

idea

basic

that

Vj.

Another
way of looking at it is that for
through it, the main loop of the algorithm

two-step paths from

vL to

found, the algorithm

Vj

that

builds a

go
bypass

into

vk and

vertex

each

all of

considers

and out
(vhVj),

of

vk,

provided

all the

paths
the possible

and,

such

are
a bypass

if any

doesn't already exist.Ultimately,


vertex
is bypassed, which means
each
that for each path in the original graph there will be a direct connection
(edge) in the result.
To seethat this algorithm works, it is useful to view the progress of the
on the values
takes
algorithm as a sequenceof n stages,ask successively
the initial
matrix M. Let Mk denote the matrixat
1,.. .,n. Let M0 denote
the endofthe fcth stage. Note that no entry of M is ever setto 0,sothat

{v,

Figure

4-22. Warshall's

algorithm.

v*_,}

Section

Directed

4.7

Graphs

= 1 impliesthat Mk+l(i
=
>j)
+
of
matrix
(V,E ).
adjacency

This

theorems.

Theorem 4.7.3
from

vx to

1 if there is a nontrivial
in {vi,.. ,9vk].
vertices
only
=

Mk(iJ)

traverses

that
Vj

In orderto prove

theorem

this

Lemma 4.7.1 If thereis a

we will need
directed

proof of

The

Proof.

S = 0, the lemmaistrivially

S is

and

nonempty

from a to b that

c is

in S

vertices

traverses exactly

digraph from vertex a

by this path, then for any


to c and from c to b such

{c}.

induction

there

since

true,

is no

on the size of S. If
vertex c in S. Suppose

of S. Let eu.. .,ek


the

path

\342\200\224

Lemma 4.7.1is by

an element

directed

a lemma.
in a

path

to vertex b and S isthe setofvertices


traversed
c in S there exist directed paths from
vertex

that eachtraversesonly

409

Matrices

Adjacency

1. What we wish to prove is that Mn is


will follow from two separate

Mk(iJ)
the

and

vertices

in S.

be

a directed

path

By the definition of

traverse, thereisat leastone edge ex in the path that is incidentto c.Let


let e, be the last
ek be the first edge on the path that is incidentto c and
=
c.
and
is
from
We
know
that
incident
that
(xfc)
ex
edge
e, = (c,y) for
x and y, from the definition of path. Thus el9...,etis a path
from a
some
to c and ej9.. .,ekis a path from
c to b. Neither
of these traverses c, but
in S of eu.. .,en so that they
both
are subpaths
traverse
only vertices

{c}.

\342\226\241

the

that

Now

lemma

is proven we

can proceedwith

the

of

proof

4.7.3.

Theorem

The proof is by induction


on k. For k = 0, we know that
=
1
iff
is in E. To prove the theoremfor k > 0 we assume the
M0(i,j)
(vi9Vj)
theorem holds for smaller
k. Suppose
directed
there is a nontrivial
path
from Vi to Vj that
traverses
only vertices in {vu.. .9vk].By the preceding
Proof.

lemma,

either

traverses

only
Vi to

from

first

vk

is a nontrivial
there
vertices in [vu.. .9vk_i\\
and from vk to Vj using

case, by the

inductive

caseMk(i,j)is setto 1by


Taking

= n,

the

directed

path

from

algorithm.

we obtain an

else

there

to

that

Vj

paths
In

the

second

\342\226\241

immediate corollary,

which

really wanted to show.(Notethat this is typical of induction


to prove something more specificthan what
necessary
in order to get a \"handle\"
desired
on the induction.)

often

vt

are nontrivial
in {vi9.. .9vk_i).
only vertices
= 1, and in the
hypothesis,Mk_x{iyj)
or

is what
proofs\342\200\224it

is ultimately

we
is

410

Chapter 4: Relations

and

Mn(iJ)

is not

This

If there is a nontrivial
- 1wheren = | V\\.

4.7.3.

Corollary
then
(V,E),

the

Digraphs

v{

to

Vj

in

if there

only

algorithm

from

path

= 1 at the end of
We also need to know
that
M(iyj)
is a nontrivial directed path from
Vi to Vj. The

enough.

next theorem

directed

proves that.

not specify precisely in what order the pairs (ij)


but in any execution of the algorithm we assume
some order is chosen. Thus the step(*) is performed
that
for
repeatedly,
different values of ij and k in someorder.By time t we will mean that
t times. Thus time 0 is beforethe step(*) has
step (*)has been performed
been performed
at all, time 1is just afterit has been performed
once, and
4.7.1

Algorithm

be

to

are

so forth.

does

considered,

This will

enable

to prove

us

the following theorem by

induction.

4.7.4.

Theorem

If M(iJ)

= 1 at

the algorithm,thereisa nontrivial


Proof.

Suppose

never

M(iJ)

change

to 0,

pair (ij).) For t = 0,

we

time

path

= 1.Theproofis by

M(iJ)

which entry M(i,j) is first

any

directed

to 1.

set

so that
have

the

(As observed

this can happen


original

during

the

from

v( to

in
Vj

on the

induction

of

execution
(V>E).

time t at

earlier, the algorithmcan


at

adjacency

once

most

for each

matrix, so that
edge in E. For t

if

= 0 it must be true that (vi9Vj) is an


>
M(ifj)
is
from
1
t.
to
at
time
Then
at
timet
0
0, suppose
entry M(i,j)
changed
1itmust be true for the current value of k that M(i,k)= 1and M(kJ) = 1.
directed
from vt to vk and
By induction, there must be nontrivial
paths
from vk to Vj. Joining these at vk we obtain
a nontrivial directed path from
= 1

at time t

\342\226\241

VitOVj.

To apply Algorithm
of
WarshalPs
Algorithm.
with M0, the adjacencymatrix of the relationR, and then
construct the matrices Ml9 M2,...,
Mn, where n is the number
successively
k > 1, we can construct
for the relation R. Moreover, for each
of vertices
Condition
of
in
terms
of the previously constructed Mk_x.
(*)
Mk
the (ij) entry ofMk, from
Mk(iJ)f
Algorithm 4.7.1 tells us how to obtain
= 1, then Mk(iJ) = 1
of Mk_x. In particular, if Mk_x(iJ)
entries
certain
Application

4.7.1,

we start

also.In other
Moreover,

words,

if Mk_x(iJ)
were
ones in

every

entry

- 0, then we

remainsa 1

of Mk_x that is a 1
get a new 1 in position

if there
positions (iyk) and (k J) of
=
= 1 and Af^fej)
way,M*(;,;) = 1 if Mk_x{iyk)
we need only examinecolumnk and row k ofMk_u

Mk__x.

in

Mk.

(ij) ofMk only

To

1. Thus,if

put

it another

M^xdJ)

and then if

= 0,

there is a 1

Section

Directed

4.7

in positioni of column
is described

this

of

succinctly in the

= Mk_x(iJ)

Mk(iJ)

construct

we may

Thus,

position j of row fe,al

a 1 in

will

be

411

entered

(ij) ofMk.

in position
All

k and

and Adjacency Matrices

Graphs

V (Mk.x(i9k)
from

Mk

expression:

following

Mk_x

Mk_x(kJ)).

the following

by employing

procedures:

Step 1.

all positions

entry is

Step3.

all l's in

Mk_v

pu p2,... in columnk of

1, and the positionsqiq2>-.

\342\200\242
in row

entry is 1.
a

Put

1 in

each position

already therefrom
4.7.5.

Example
discussed

to Mk

transfer

First

Record

2.

Step

previously

WarshalFs

of

(pstqt)

a previous

Mk

Mk_u

k ofMk_u
(provided

where

the

where the
a 1

is not

step).

We find the transitive closure of the


4.6.2 and 4.7.4.Thistimewe

in Examples

relation

will

apply

algorithm.

First, we let
0

110

0 0 10
Mo

Next we

0 0 0
0

0'

11
0

0 0 0 0

that
Mv To sSe if there are any new l's, we observe
M0
1 and 2 of row 1. Thus,
position 1 of column 1 and positions
but since the (1,1) and (1,2) entriesof M0 were
Mx(l,l) = 1 = Mi(l,2),
transferred
to Mu we introduceno new l's. Thus, Mx = M0.
already
Now we compute M2 so that in this computation we let k = 2. In
1 and there is a 1 in position 3 of
column 2 of Mu thereisa 1 in position
=
1. This is the only new 1 to be added to Mx.
row
2. Thus,
M2(l,3)
find

has l's in

Hence,
1110
0
M2

0\"

10

11
0 0 0 0 1
0 0 0

0 0 0 0 0
Proceed

3 have

next

to compute

M3. We

l's, while positions 4

and

observe that positions1and 2 of column


=
5 of row 3 have l's. Thus, M3<1,4)

412

Chapter

4: Relations

and

Digraphs

* M3(2,4)

M3(l,5)

= M3(2,5) = 1.Therefore,
11111\"

0 111
0 0 0 11
0

Afft-

Nextobservethat M3 has a
a 1 in position 5. Thus,

1 in

0 0 0 0

positions 1,2, and 3ofcolumn4 while row


= M4(2,5) = M4(3,5).None of
M4(l,5)

1 =

4 has

theserequire

M3 =

Therefore,

changes.

M4.

1 in severalpositionsof column
5 but
no l's in row 5.
Thus, no new l's need be added to M4. Therefore,M5 = M4 = M3 is the
adjacencymatrix of R+. Of course, it is no surprise that we obtained the
Finally, M4 has a

same

4.7.4.

Corollary
matrix

Exercises

of the

4.7.4.

in Example

as

result

transitive

WarshalPs algorithm computes the


closure (V,E +) of digraph
(V,E).

adjacency

4.7.1

for Section

of the
matrix
1. Using Warshairs algorithm,computethe adjacency
4-16.
transitive closure of the digraphjnFigure
2. Using
Warshairs
algorithm, compute the adjacency matrix of
G = ({a,6,c,d,e},{(a,6),
of the
the transitive
closure
digraph

(6,c),(c,d),(d,e),(e,d)}.

3.

Using

basic

the

idea of

computea matrix P
directed
(including

WarshalPs algorithm,
such

that

P(i,j)

devisean algorithmto
number of distinct

is the

with cycles) from v{ to Vj in a


paths
paths
(V>E). Verify that your algorithm is correct.Notethat
any
vertex
has
vk with a loop or which lies on a directedcycle
infinitely
many paths from vk to vk. In order to represent this situation,extend
oo and define x + oo = oo for each
the
to
include
integers

digraph

xEZ.

4. Usingthe basicidea

of

WarshalPs

compute a matrix D such that

directed

path

algorithm

from

u,- to

Vj in

algorithm,
is the

D(ifj)

a digraph

devise an
length

(V,E).

algorithm to

of the
Verify

shortest

that

your

is correct.

5. Similarly, devise an algorithm to computea matrixL such that


from
is the length of the longestdirected
vt to Vj in a
path
L(iJ)
is
correct.
that
(Hint:If there
(VJH). Verify
digraph
your algorithm
isa path with a cycle there is oneof infinite length.)
6. In each of the following,
whose
let R be a relation onA = {afb,c,d}

Section

413

Directed Graphs and Adjacency Matrices

4.7

adjacency matrix is given.Computethe adjacency

matrix

of R*

using Warshall's algorithm.

(a)

10

(b)

10

10

(d)

0 0

10

0 0 0 0
0 0 10
(e)

10

0 0 1

11
11

0 1

10
(f)

0 10

0 1

10

0 0
0

10

(c) 110

110

0 0 0 0

0 0 0 1
0

10

10 0 1
0 110
110

10

10

0 1

SelectedAnswers SolutionsforSection
4.7.1
1.

We

will

the vertices

consider

original adjacency matrix is

a,.. .,e to be numbered

5. The

a b c d e
a

\"0

c
d

10

0 1
0

During the first

added

10

0 10
LI

0l

0 0

iteration, which

e to

from

0J

b and

from e

looks

at paths

through

to c, resultingin

the

a, edges are
matrix

shown

below.

1 1 0 0'

0 0

10

10

0 10
0 1
LI 1 1 0 0J
the

During

is added
0 1 1

second
d to

from

10

0 0 0

0 110
LI

0 0'
10

0
1

0J

which looks at paths throughb, an


iteration,
c, resulting in the matrix shownbelow.

edge

414

Chapter

and Digraphs

4: Relations

third iteration,which

During the

added

from

a,6,e,

the column

has

looks

at paths

through

c, edges are

the matrix below,


for d now completelyfilled.
d, to

and

d, resulting in

which

1 Ol

[0 1 1

110

0 0 1 0

1111

Ll

During the
it to dy

edges
filling

OJ

since every vertex now has an edgefrom


iteration,
has an edgeto c and an edgeto e,all possible
remaining
in the
for c and
columns
are^ added to c and e, resulting
The resulting
matrix is shown below.
up.
fourth

and d

i ll

[o i i
1111

ll

1111

1111
the

During

edgeto e,
are

edges

ll

and

fifth

e has

and

since every
final
iteration,
an edge to every vertex, all
in a

resulting

added,

matrix of the completedigraph


3. Let Pn(iJ) be the number
traverse

that

M(i J)

- 0or if

only

vertices

i \302\245*
j, and

matrix

5 vertices).

of

directed

{vi9v2f...,vk\\.

P0(i9i) =

<*> if

M(i,i)

l's

of

full

on

vertex now has an

remainingpossible

paths
Then

P0(iJ)

- 1. For

(the

adjacency

from

vt

to

= M(iJ)

k > 1,Pk(iJ)

Vj

if
-

1) (Pk-i(kJ).
case
equationsto

These
can
+ Pk-i(i>k) (Pk-i(k,k) +
Pk-i(iJ)
equations
be proved using induction and
analysis.
We
must
be more careful in using these
derive
an
than we were with
WarshalFs
since we do not
algorithm
algorithm,
want to count any path twice. To avoid this, we will use two
M and P. so that the values
of Pk_x can be held fixed until
matrices,

all the values

of

Pk have

been computed.

Input: the adjacency matrix M of a digraph G = (VJE), where V =


{vuv29...,vn}.
A new matrix M such that M(iJ) gives
the
number
of distinct
Output:
in
from
to
the
the
matrix.
vt
represented
input
paths
by
digraph
Vj
Method:For each k from 1 to n sequentially, if M(k,k) = 1, change
M(k,k)tOoo.

For
Copy
For

eacji k
the
each

from 1 to n sequentially,do the following:

values
pair

(ij)

matrix M into the matrixP.


change M(iJ) to P(iJ) + P(i,k)(P(k,k)+

of the

l)P(kJ).

Section

4.8

4.8

Application:

APPLICATION: SORTING

Sorting and

415

SEARCHING

AND

< is a total ordering relationon a set


of
elements chosen from D is said to be
.,an)

Suppose
(au..

Searching

are
every i such that 1 < i < n. Sortedsequences
in computer algorithms, sometimesin the guises

D. A

sorted

encountered
of

lists,

sequence
if

a, < ai+l

for

frequently
arrays, files,

or

of sorted
tables. One important property
lists is that each item is greater
or equal
to all the items precedingit and lessthan
than
or equal
to all the
it
in the
items following
list. The following lemma expresses this
formally.

(i)

a, <

(ii) a; <
The

If (alf..

4.8.1.

Lemma

total order

is a
.,a\342\200\236)

on D and 1 < i < n,


a; for every
at

for

j such

follows

proof

that

with

respect

to

j < n, and
1 < j < i;
from the

immediately

orderingrelation.

sequence

i <

j such that

every

sorted

then.

transitive property of the

performed on sorted sequencesin


a
computer
applications
sequence A = (au.. .,an) for some
item x. The objectiveis to find an i such that 1 < i < n and at = x,
to this problem, called
solution
such an i exists. A classic
provided
divides
to be searched as nearly
the
binary search, repeatedly
sequence
in half as is possible, narrowing the search to oneof the two halves at each
to the null sequence.
stage, until x is found or the searchis reduced
One

Algorithm

operation

4.8.1

Binary

is frequently
is searching

that

Search.

of n elements (alf.. .,an) drawn


from
a set
sorted
sequence
total ordering relation,denotedby <, and another element x
drawn from the sameset.
index
The
j of an element a}suchthat a; = x,if such a j exists,
Output:
otherwise zero.

Input:

with a

Method:

1. Leti 1,1(1)
2. If > u(i)
3. Letm(i) =

= 1,

l(i)

*LxJ denotes

= n.

step 5.

go to
L(/(0

and u(l)

u(i))/2J

.*

the greatest integer<x.

416

Chapter

and Digraphs

4: Relations

Let
Hi +

1) =

< a m(i)

id)

if x

m(i)

if x =

[m(i)

+ 1

ifx

a,\342\226\240ro(i)
>

>amii)

and

+ 1)

u(i

m(t) -- 1

ifx<am(0

m(0

if x

ifx >am(0

.w(0
4. Increaset by

5.

l(i)

Output

one

and go

if l(i)

= w(i)

= am(t),

to step 2.
and x ^ am\\

otherwise

0.

output

On the sequence(1,3,3,4,7,12,13,15
4.8.1.
for
> searching
binary search algorithm would go through step 3 threetimes,

Example
12, the

the

computing

following

values:

/(/)

m(i)

u(i)

4
6

8
8
6

9o(/))

=*/(/)'
<

1,3,3,4,7,12,13,15

<7,12,13,15>

<12>

would be 6, as desired.

The output

are two essential things that needto be


it halts
first is termination\342\200\224that
after
The second is partial
a finite number of steps, for every
input.
legal
it terminates
the output is correct.In addition,
it
when
correctness\342\200\224that
of steps the
or
be nice to know the time complexity,
number
would
of the
expressed as a function
algorithm may take before termination,
length of the input sequence.
Two
of Algorithm 4.8.1 are stated in the following
important
properties
This
theorem
theorem.
gives what is often calledan invariant assertion.
a fact
about
the variables and parameters of the
That is, it states
is true
that
is
every time a certain point in the algorithm
algorithm
In this case, the assertionis strongenough
reached.
that
we will be able to
use it to prove the correctness
of the algorithm.
As

proved

with

Algorithm

Theorem 4.8.1.
following

are

there

algorithm,

any

about

4.8.1. The

Every

time Step

2 of Algorithm

4.8.1

is reached,

the

true:

(a) x is in

the subsequence(a/(l),...,au(l))

(alf.. .,an);

iff

is in

the sequence

Section

4.8

Sorting and

Application:

(b) u(i) - l(i)< n/21-1;


the

As

part

of the

which

lemma,

proof

this

of

prove the

we first

theorem,

an important

expresses

sorted according

isexactly
Step 2 has beenreached

of times

number

total

(c)

417

Searching

consequence

i.

following

a sequence

of

being

to sometotal ordering.

Lemma4.8.2.
to a

A = (au..
with
Let
.,an) be a sorted sequence
respect
< on D, let 1 < m < n, and let x = at for somei (1 < i < n).
one of the following cases holds:
and i < m, or

total order

Then

exactly

(a)

x <

(c)

x > am and

am

(b) x = am,

or

Proof. It is
one

of x

<

amt

m.

i>
a

< being

of

consequence

= am,

and x >

am

must

a total
What

hold.

ordering that
remains

exactly

to be shown

i < m and in case (b) i > m. By


the
preceding
>
is
the
minimum
if
of
so
in
i
case
lemma, am
m, x < am <
(c),
(am,..
.,an),
a,-, which would be a contradiction.Thusi < m in case (a). Similarly, am is
of (al9..
the maximum
.,am), so that in case (b) if i < m then a^ < am < x, a

thereforeis that in case(a)

contradiction. Thus i > m in case(b).

\342\226\241

of Theorem
4.8.1.
The proof is by induction
on the number
If this
is the first time, i = 1,
Step 2 has beenreachedpreviously.
=
since
l(i)
1, and u(i) = n, so that (a) is satisfied trivially
u(l) and,
=
1(1) n 1< n/2\302\260,so is (b). Part (c) is satisfied,sincethis is the first time
Step 2 is reachedand i = 1. Suppose Step 2 is reachedand it is not the
first time. Fix i to denotethe value
of i at this time. Due to the structure
of the
it must be that the previous
three
were 2,3,4. By
steps
algorithm,
induction, the theoremheldthe last time Step 2 was reached. At that
it is now, since the only changeto i is
time the value of i was one lessthan
madein Step 4, where it is increased by one.Thefact that Step 3 was
us to conclude that
5, permits
performed after Step 2, rather than
Step
at what
was done in Step 3, we see that oneof
l(i-1) < u(i-1). Looking
the
three cases must now hold:
following
- 1;
=
= m(i-l)
(1) x<am(i_u,/(0
/(i-l),anda(i)
Proof

of times

(2) x -

am(l_D,

= u(i);

= ro(i-l)

l(i)

(3) x>am(l_1),/(i)- m(i-l) + l,anda(i)

In

(1), we

case

<flm(i-i)r

\342\200\242

-Pua-i)),

(alv . .yan)
i*(i-l))/2J

all.

at

(u(i-1)

know
so

Thus

that

4.8.2

Lemma

it must

(a) is

- 1, u(i)

l(i-1))/2

by

1, and, by

<

that

be in <aw_D,..

be in

cannot

if it is
.,<*\342\200\236(,\342\200\242_!)_!>

proven for

l(i)

u(i-l).

W-l)

case

(1).

u(i) = l(l(i

Since

+ a(i-l))/2

induction, this

is lessthan

since at the lasttimeStep2

- l(i)

1)

- 1-

Part
(c)
value of
(1). In case

n/21\"1.

was
follows by induction,
the prooffor case
i was one lessthan it is now.Thisconcludes
x = al(i) =
since
(2), part (a) of the theoremholds
trivially,

reached

in

\342\200\224

the

auii)y

and

418

Chapter

4: Relations

and

Digraphs

x must be in the full sequence


(ab...,an).
Equally
trivially, part
that
(b) must hold in this case,sinceu(i)-l(i)< 0;The argument
part (c)
there
is case (3), which is somuch
holds is the sameas in case(1).Finally,
of the proof is left to the reader. \342\226\241
like case(1)that the completion
therefore

will

We

the analysis of this algorithm by


the
that the order in which
steps

begin

observe

We

.,2,5.
1,2,3,4,2,3,4,2,3,4,..
2
be executed
infinitely

is, for the

That

often. By

must

imply

would

do

to

reach Step 2 for

- l(i) < n/2log2n

have u(i)

would
thing

when we

that

be to

to be

algorithm

would

i =

we
time,
(log2(n) + \\)th
this were true, however, the next

go to Step 5 and halt. It is thus

for

impossible

4.8.1 to take morethan log2(n)4- 1 iterations.


that we have not only proven termination. We

Algorithm
Notice

executed is

not to terminate, Step

the precedingtheorem,this
the

1. If

termination.

verifying

are

have

shown

also

time complexityof this algorithmis 0(logn).


The
next
thing to prove about this algorithm is its partial correctness.
This follows
from
(a) of the preceding theorem. Supposethe
part
2
That
means the last two steps were 2,5.At step
terminates.
algorithm
next
tells us that
the theorem held. The fact that Step 5 was performed
case
l(i) > u(i). Thereare two possible cases. Either l(i) = u(i), in which
=
the theorem
in
iff
x
or
>
x
is
in
that
which
l(i) u(i)>
(au.. .,an)
says
ai(0,
case the theoremsays that x is not in (au.. .,an) at all. Lookingat Step 5,
we
in the former case the output is l(i) if x = a^ and zero
see
that
in the lattercase algorithm
and
0. In both cases the
otherwise,
outputs
that the

output is correct.

The

search

binary

quickly

searching

permits

algorithm

an unsorted

than

list may

be

searched

becausethis and a number of otheralgorithms


the
useful operations on lists requirethat
rearranging

important
and
a

elements

the

one. The

number

of an

by
for

list

performing

efficiently

the problem

be sorted,

unsorted list into sortedorderis a

problem of sortinga list has beenextensively

of rather

complex solutionshave

simplest approaches to solving this problem,not


abstract
understood, is describedby the following
Algorithm

a sorted list far more


any algorithm. Largely

efficient

very

very

studied,

One

evolved.

of

but

of the

easily

algorithm.

Interchange Sort.

4.8.2

Input:

a total

sequence

A of

relation,

ordering

n elements

(alya2,.. .,an>

drawn

from

a set

with

denoted by <.

Output: The elementsof

into

arranged

sorted

sequence

Method:

1. Searchthe current arrangement


that is out of order.

2. If

no

such

pair

is found,

halt.

of

the

sequence

for a

pair (ahaj)

Section4.8
3. If a pair is found

It is

to

worthwhile

unlike

but

Algorithm
what

exactly

specify

is out

of order,

back to step 1.

interchange the positionsof

the

4.7
notice that this algorithm, like Algorithm
4.8.1, is nondeterministic. That is, it doesnot
In
order.
steps are to be performed and in what

take

nondeterminism was in the orderin

4.7 the

Algorithm

that

and go

elements

two

419

and Searching

Sorting

Application:

which

the

pairs

In the presentalgorithm
is in
the
nondeterminism
to be interchanged.
the choice of a particular pair that is out of order,
This is in contrast to Algorithm
which
4.8.1,
specifies uniquely what to do
at each step,and is therefore
called deterministic.
When analyzing an algorithm it is ordinarily
to describe
it in
desirable
the simplest, most abstractform,
so that
whatever
results are obtained
can be appliedto the widest
of implementations.
possible
Stating
range
for
an algorithm in a nondeterministic form
is
a useful
technique
there
are a
4.8.2,
achieving this objective.In the caseof Algorithm
in use that may be
number of distinct deterministicsorting
algorithms
viewed as refinementsof this algorithm,
including
algorithms that have
becomerather well known under the names \"Bubble Sort\", \"Successive
Minima\"
\"Shell
Sort\". Any results we can prove about this abstract
and
nondeterministic
will also apply to all of these deterministic
algorithm
(ij)

were considered.

of

versions

it.

nondeterministic
For example,

tend
because of their generality,
Largely
algorithms
it is probably
to pose special problems for analysis.
though
obvious that Algorithm
4.8.2
cannot
terminate
unless the list has
into
the desired
must
order, it is less obviousthat
algorithm
arranged
terminate.
terminate,
eventually
Assuming the algorithm doeseventually
it is still less obvious how many
be performed
before
interchanges
may
this happens. We could solve this problem by making the algorithm

been

the

deterministic,by
considered,

and

then

specifying

apply

a particular

the technique

order in which

of invariant

pairs are

assertions,

as we

did for

It will be more instructive,


however, to analyze this
form.
In doing so we shall
algorithmin its most general,nondeterministic
see how the theory of ordering relations can be put to gooduse.
of these problems, suppose that the list A to
Tosimplify
the
discussion
has no duplications. (It will be seen, when all is done, that this
be sorted

Algorithm 4.8.1.

restrictioncanbe

lifted.)

Each

by a

permutation

of the n

sequence consistingof

the

elements of A
numbers

1,..

can

be

described

.,rc arranged in

abstractly

some order.

for the ith


will
follow
the convention
that the number i will stand
will be
order
sorted
largest element of A. Thus the desiredfinal
of A will be described by
order
represented by (1,2,.. .,rc). The initial
\342\200\242
to be in after
where
->Pn)>
<Pi>P2v
pt is the position that at is supposed
the
the sequence is sorted. For example,
if A = (64, 10, 2) initially,
A
desired
sorted sequence would be B = (2,10,64).We would
represent
We

420

Chapter 4: Relations

and

Digraphs

2,1) and B by < 1, 2,3). As a further example, if A were (6789,9000,


345, 547,100001), we would represent A by <3, 4,1, 2, 5), and the desired
sortedsequence,
<345,
547, 6789, 9000, 100001), by <1,2, 3, 4, 5). In this
as
the
some
abstract
form,
problem of sorting can be viewed
taking
.
of
the
sorted
order
and
it
to
undoing
(pu. .,p\342\200\236)
get back
permutation
by <3,

to the sortedorder,

(1,2,..

.,rc).
< nand(x;

= x, only if

that is, all the


relation
R on
Pn
n-tuples describingpermutations
from x by interchanging one pair of
so that x R y iff y may be obtained
elementsthat are out of order in y; that is:
=

LetP\342\200\236

.,*\342\200\236}
11 <xt

{(xu..

n items.

of

\\(x,y)\\x

= (xu.

..,*\342\200\236),y

3/ <

;', (xt

Vfe ^
The
at

some

insight

into

the

nature

of R,

.,yn),

(yu..

= xh
yj9 yt
=

xL

>

*,),

y*)}.

the permutation
of a set achieved
and y is the permutation achieved
the
next
time, then x R y. To obtain
consider the representationof R as a directed

of R is that
importance
stage of the Algorithm

for
after step 3 is performed

i\\/\\(*a

i =./)},

Define the

if

x is

4.8.2

some

Figure 4-23for S = (64,20,10). In this diagram an arrow


4-22 seems
is drawn
x to y for each ordered pair (x,y) in Jf?. If Figure
from
of Section
familiar, it may be becauseit is similarto the latticediagrams
R* of R is a partial
closure
reflexive
4.4. In fact, for any n, the transitive
orderingof Pn, and the transitive closure R+ is irreflexive. Proving the
latter will be the main effort of the remainder of this section.First,
to this algorithm of R+ being
consider
the relevance
irreflexive.
however,
of
transitive
reflexive
closure
and of R, it follows
From the definitions
that if x and y are any two permutations obtained by the algorithm
at two
.,an)> and x is equal to or
(aua2y..
sequence
stages for the same input
occursbeforey, then x R* y. Suppose now that for some input sequence
the algorithm never terminates. By the pigeonhole
since there
principle,
of n items, some permutation is
are only finitely
many
permutations
graph, shown in

Figure

4-23.

The relation

R on

P3.

eventually repeated. That is,for some


so that proving R+
is irreflexive,

xy x

This cannot happen if

R+ x.

will

irreflexive

is

will

We

R+ is

prove

irreflexive by relating it to the known

positive integers. Definethe degreeof


= <*!,.. .,xn) to be 5(x) =
<*x(i,j)>
Z^isjsn

x
permutation

ffx

= 1

(i>j)

The ideais that

>

iffXi

total

ordering

of each

disorder

where

= 0

ax (ij)

otherwise.

of pairs that

the number

measures

d(x)

and

Xj

R+

that the

prove

algorithm must terminate.


of the

421

and Searching

Sorting

Application:

are out of orderin

x.

us apply

Let

4.8.2.

Example

numbers and observewhat


recorded

happens

Permutation

Sequence

Degree

(6,4,5,2,3,8,1,7)

15

<22,60l28i8,14,81,3,69)

(4,6,5,2,3,8,1,7)

14

>

(22,8,14,28,3,60,69,81

>

(8,22,14,3,28,60,69,81

>

(4,5,2,3,6,1,7,8)

(4,2,3,5,1,6,7,8)

(2,4,3,1,5,6,7,8)

(2,4,1,3,5,6,7,8)

(8,22,3,14,28,60,69,81)

(8,3,14,22,28,60,69,81)

(2,1,3,4,5,6,7,8)

(3,8,14,22,28,60,69,81)

(1,2,3,4,5,6,7,8)

In the

each

9
6
4
2
1
0

in going

one interchange

was

there

chart

above

after

of disorder

<60,22I28I8I14I81I3I69)

(22,28,8,14,60,3,69,81

of

a sequence

degree of disorder

the sequence (60,22,28,8,14,81,3,69).

We sort

change.

to

4.8.2

Algorithm

to the

from

the

the sequencein line two. However, there were


several interchangesin goingfrom line two to line three; namely, 60and
28,then 60 and 8, 60 and 14, 81 and 3, and finally 81 and 69. These five
of disorder by five.
of the degree
interchanges led to the reduction
in line

sequence

one to

Lemma 4.8.3. Ifx R


Suppose x

Proof.
except for
xP

y.

yq,yp

that

Recall

d(y).
x R y

iff

and

y are

identical

pair. That is, thereexistp < q such that


interchange
>
for
and
all k ^ p,q, xk - yk. The relationship
xqfxp
xq
and
can
be
tabulated
completely:
ay
of one

the

between ax

d(x) >

y then

<Tx(p>q)

and

ox{p,k)= <Ty(q,k),
=

VxikyQ)
\302\260x(iJ)

<jx(kyp)

<Ty(k,p)

\302\260y(iJ)

oy(p,q)

for

ay(k,q)y

k ^ p,q;
* p,q.

for all
all ij

= 0;
ax{q,k)

- oy(p,k),and

422

Chapter

and Digraphs

4: Relations

Applying these
5(x) =

1+

relationshipsto d(x) = 2Ul-s;-sn(rx(i,7),

X!

(\302\260x(k,p)

<rx(M))

p<k<q

ls:k<p

= 1+

+ *x(M))

(^x(p^)

X!

obtain

we

X!

Mp.*)

+ <rx(g,fe)) +

X!

MM)

+ <Ty(k,p))

(\302\260y(q>k)

M?>*)

+ <ry(p>k)) +

X- <rx(ij)

\\<k<p

X!

<*y(k,p))

p<k<q

X!

down

5(y)

breaking

By

\302\253(y)-1

\302\253(*)

M?>fe) +

X]

is lackingto concluded(x)

All that

0y(q>k)

if

yk

>

<ry(k,p)

This can be seenby

(i)

and subtracting we obtain

similarly

p<a<9

<yp<yq

>

the

(iii)

if

yp

<yk<yq

0 +

0;

ifyp

<yq

0+1.

<yk

follows

that

Proof.
So

far,

<k <q.

do now.

which we

<ry(fe,p)

<ry(pyk)

<ry(kfq)

then

<ry(g,fe) +

ay(k,p) = 1 + 1> <yy(p,k)

<7y(fc,g)

then

(ry(qfk) +

<ry(k,p)

+ 1 = <ry(p,k)

o-y(A,qr)

If x R+ y then
R

z such that
8(x) > d(z) >

Theorem 4.8.2.
an obvious

all p

<ry(q,k) +

5(x)

some

be

MM)).

show that
for

o>y(k,q)

then

Proof. Supposex
k > 1. If k = 1,
some
must

^y(p\302\273fe)

= 1

- 0

+ 0

=
=
=

\342\226\241

4.8.4.

Lemma

is to

d(y)

cases,

1 +0;

(ii)

^y(*\302\273p)

<ry(p,k) +

examining

X- o-y(tj).

If x R+

The

x, then

y. By
>

6(y),

x Rk~*

definition of transitive closure,xRk y for


by the preceding lemma. If k > 1,there
z R

d(y). D
transitive

y. By

of R,

Lemma4.8.3,it

R+, is irreflexive.

lemma gives b(x)> d(x),which

is

\342\226\241

shown that

intuitive notion of relative

induction and

closure

the preceding

contradiction.
we have

5(x) > diy).

Algorithm

degrees of

4.8.2

must

disorder,

always

terminate.

corresponding

The
to dis-

Section 4.8

Sorting

Application:

the diagram in Figure 4-22,was

tances on

Essentially,

the

of this

basis

each step of

is that

shows

4.8.3

Lemma

what

the

the degree of disorder, and thereforeonly


a finite
is completely
steps may be performed before the sequence
a more
careful analysis, to see just how
will now proceed with
may be taken in this process.
4.8.3
Lemm&
gives a quick upper bound on the number of
_

each

since

Thus,

\302\273

izi
* X]

\302\243 *x(ij)

the algorithm reduces5(x)by


- l)/2
n(n
steps on any input

step of

never take morethan

at

of

number

We

order.

in

many

steps

steps.

- o - n(n

\302\273pl
i - X>

proof.

algorithm

decreases

\302\253(*>-

423

and Searching

1)
\342\226\240

least

sequence

one, it can
of length

n.

Of course,we have not shown that this number of steps is required for
any input sequence, though there are several
widely
sorting
taught
for
some
inputs.
algorithms that do perform this numberof interchanges
makes
One of these is the \"BubbleSort,\"which
repeated
bottom-to-top
of
pairs
passes over the sequence to be sorted,comparing
adjacent
elements.

Though
technique

has

4.8.2

Algorithm

not typical of the algorithms

more

in

an interesting

provided

by means

termination

of proving

use

where

of

an

ordering

long sequences

example
relation,

of

the

it is

must be sorted.

of sorting is basedon the concept


ofmerging
two
into one sorted sequence. This operationis alsoof
of
other
because it lies at the heart of a number

method

typical

sorted

sequences
in itself,
fundamental
algorithms, including the usualmethod of updating
in data
it is
and
because
sequentialfiles
processing applications. For variety,
we
for
this
as
a
recursive
shall
an
natural,
operation
algorithm
interest

present

definition.

function

Algorithm

4.8.3

Input:

Two

Output:

the

total ordering,
merge

sentence,

single

sequence

(au..

Sequences.

= (al9..

sequences,

to some

according

of

Two Sorted

Merging

<.

.,an) and

B = (bu.. .,fcm>,

(A,23), which

is a sorted permutation

.,6m>.

.,an,bu..

Method:

Aif|B| = 0;
merge (A,B)

|Bif|A|
\\(bx)

Here the symbol\"

(au..

0;

\342\200\242
<\302\243*!> merge

\342\200\242\"
stands

,,an)

\342\200\242

merge

for

\342\200\242

(blf..

(<a2,..
(A,

catenation
.,6n)

.,an),B)

sorted

if

aY

<62>.. .,6m>) if a!

<

6^

and

^ bx.

That is,
(au.. .,an,bu.. .,6n).
of sequences.

424

Chapter

4: Relations

and

Digraphs

If A =-(1,2,5,12,12,16)
and B - < 2,3/7,13,21)
then
=
The
(1,2,2,3,5,7,12,12,13,16,21).
merge (A,B)
important propertiesof
are stated in the following
of two sequences
the
lemma.
merge
4.8.3.

Example

Let C

4.8.5.

Lemma

sequences

with

respect

and a

sequence

to

= merge (A,23),
of A

permutation

the lemmais

A-23orC

left: eitherax

<

bx or bx

< ax.

and

B are

S. Then C is alsoa

sorted
sorted

\342\200\242
23.

If | A | = 0 or | B | = 0
= 23 = A-23. Supposing| A

Proof.

where

order on

a total

\\ >

true,

trivially

0 and

|B

\\ >

0, there

C =

since

are two

(One must hold,since< is assumed

case, C = (ax) \342\200\242


merge

cases
to

be

argue that
of A \342\200\242
we may assume by induction
this is clearly
a permutation
23, since
=
(on n and m) that (c2,...,cn+m)
.,an), 23) is a sorted
merge((a2,..
\342\200\242
permutationof <a2,...,a\342\200\236) 23. To show that C is sorted, we rely on
to conclude that <c2,...,cn+m)
is sorted
induction
and reason that ax < c2
of (a2,..
(as follows):
JB, a2 is
.,an) \342\200\242
By Lemma 4.8.1, c2 is the minimum
that
the minimum of <a2,...,an)and 6X is the minimum of B. It follows
and that ax < bx by the
c2 = a2 or c2 = bx. We know at < a2 since A is sorted,
of the case being considered.
Thus
ax < c2 and C is sorted.
assumption
Thereis onecaseleft, when bx < ax. In this case C = (bx) \342\226\240
(A,
merge
23 is
of A \342\200\242
(62,.. .,6m)). The reasoning that C is a sorted permutation
to the previous case,and is left to the reader. \342\226\241
analogous
total.)

In the first

is the

Merging

algorithms.

These

.,an),

((a2,..

B). We

behind an important family


sort
a large list by breaking
algorithms

basic concept

list into small sorted lists and then merging


until they have all been combined
backinto

these
a single

of

sorting

the

unsorted

sorted

lists

together

sorted

list.

4.8.4. The sequence(5,4,1,2,6,3,2,3)


be
broken
Example
might
below might
of merges
(5) (4) (1,2) (6) (3) (2,3).The
sequence
in the desired
sorted list.
then be performed,resulting
into

(5) (4)-(4,5)

<1,2)<6)

\342\200\224

(3)

(2,3)

(4,5X1,2,6)
(1,2,4,5,6)

(1,2,6)

\342\200\224(2,3,3)
\342\200\224(1,2,4,5,6)

(2,3,3)

\342\200\224

(1,2,2,3,3,4,5,6)

of different algorithms for sorting


by
isbroken up and
to
how
the originalsequence
differing according
that
are merged
used to determinethe pairsofsequences
together.
these is given in the algorithm below.
There

are

a number

merges,
the rule

One of

Section 4.8

Sorting

Application:

425

and Searching

4.8.4 Merge Sort.

Algorithm

Input:

A sequence
S of n elements (aua2,.. .,an) drawn
from
a set with
orderingrelation,denotedby <.
The elements of S arranged into a nondecreasing
sequence

a total
Output:

<a*(i)Ar(2\302\273-

is a permutation of

\342\200\242

-Ar(n)>

where

<ir(l),ir(2),..

.,7r(n)>

.,n.

1,2,..

Method:

1. Break S into a collectionof up to m sorted


S{1},.. .9S{m.
sequences
2. Repeat the following
until
only one list remains: Suppose this is the
beginningof the ith stage and the sequences so far are S}0,.. .,S*l).
- Sj\302\260
for i = 1,.. .,Lfe/2J and SL&+j,}
LetS}m)-merged,
,S\302\243,)
in the case that k is odd.

The objectivebehind
It can

merges.

length lessthan

21.

By the

4.8.3.

Theorem

produced by
the

this
is to build up large lists with
few
algorithm
be shown that by the endofthe ith stage there is no list of

4.8.2

Algorithm

end of the ith stage(i


all

have

lengths

>

1), the

>2\\ except

for

sequences
(possibly)

last one.
less than 1. Thus, as a
have
length
first stage every list has length at least 2,
i - 1 every list
By induction, at the end of stage

Initially, no sequencemay

Proof.

basis for

after

induction,

except

last.

the

(possibly)

has length>2',except

the

(possibly)

the

last,

S{kl).

1}
two
lists
Every new list S{ff
produced
by the end of stage i comesfrom
> 2', except for the last one, which may be S(kl)
Sy ! and S'jj*, each of length
or a list created
list. It follows that all but
by merging S{kl) with another

the lastofthe Sf+l)

have

length

>2l+1.

\342\226\241

on
the
it is possible to obtain an upper bound
n. Since
step 2 of
required to sort a list of length
4.8.4
when one list is left, supposethe end of stage i
terminates
Algorithm
to one. Then there
is reduced
is the first time the number of sequences
are two lists at the beginning of stage i. Thismeanseitheri = 1 or the two
1. In the latter case, we know
lists were produced at the end of stage i \342\200\224
that one of the two lists is of size >21'\"1.Thus n > 21'\"1 + 1, which implies
i < log2(n - 1) + 1.
two
that
show
of the complexity of merging would
merging
Analysis
each stage of
Thus
sequences of combined length t takes0(C) time.
4.8.4
takes
0(n) time. Since the algorithm goesthrough at most
Algorithm
Using

number

this

theorem

of stages

426

Chapter

and Digraphs

4: Relations

log2(n -1)
0(n \342\200\242
log2n).

the

of

the number

bound on

upper

of

is thus

algorithm

algorithm must

result

for

specific

time complexity

is no need to show separately that this


we have already
shown a stronger

There
terminate,

the total

1 stages,

stages

demonstrating

by

it

go through.

may

that
when it
Similarly, the partial correctnessof this algorithm,
follows
from
the
that S is
is a sorted
fact
terminates S
sequence,
directly
into
sorted
Lemma
the
broken
4.8.5,
sequencesand, by
merge
initially
of being
sorted.
operation preservesthe property

Exercises

4.8

for Section

1.

of values for i, l(i), m(i)>


4.8.1
with inputs x = 24 and
by Algorithm
the

Give

and

sequence

u(i)

computed

(1,8,9,15,24,

32,34,35,37,43,95,99).

2. Give the digraph of the relationR on P4


3. Give the degrees of disorder of the following
(a)

in this

defined

section.

permutations.

(1,2,3,4)

(b) (4,3,2,1)

(c) (1,3,2,4)

(d) (3,1,4,2)

4.

Give-the

merge(A,B)

sequence

B = (1,24,93,97,101,102).
Show

merges

of

shorter

where
how

A = (1,24,95,100,101) and
it is defined in terms of the

sequences.

= < 10,8,9,7,5,6,4,2,3,1
as input to
> is given
1
it
is
into
the
broken
collection
of
4.8.3,
Algorithm
Give
the
(10),
(8,9), (7), (5,6), (4), (2,3), (1).
sequences
collection of sequences
as it would be at the endof each succeeding
stage,
until the algorithm terminates.
the sequence S

5. Suppose

and

6. Complete
the

and

7. Derive

8.

prove

of the

evaluations

and B

proof

at Step

of Theorem

4.8.1.

a formula
for the total number
function merge to evaluate merge{AyB)>

of

(recursive)

where

are sequences of length n and m, respectively.

Which

of a total ordering are actually used (explicitly


in the proof of Lemma
by
this
lemma
fails if any one of these

properties

implicitly)
that
counterexample,

or

4.8.1?Prove,
propertiesis

not

satisfied.

9.

10.

used
(explicitly
properties of a total orderingare actually
in
4.8.2?
the
of
Lemma
Prove,by
implicitly)
proof
that
this lemma
fails if any one of them is not satisfied.
counterexample,

Which

Show

that

obtained by
an algorithm

any

of
permutation
of at most n

the sequence

- 1 pairwise
that takes as input two sequences,

a series

or

(1,2,.. .,n> can be


Invent

interchanges.

= (au..

.,an>

Section4.8
and B =

<

bx,..

permutation
.,n).

<1,2,..

wise

11.

An

427

and Searching

Sorting

Application:

the sequence A according


to the
.,6n) and rearranges
described by B. (Assumethat B is a permutation of
The desired output is <a6i,a6z,..
.,a6n).Useonly pair-

interchanges.)
variation

important

sorted

sequences,

is taking the union of two


which has no repetitions.Thisis defined

on merging

each of

by

unionCA,23)

\\

if|B|

if| A

(a^
{ax)
(bx)

union((a2,..

= 0;

if ax <

bx\\

.,an>,<62,..

if ax =

bx;

.,6m))

\342\200\242

if&i<a!.

union(A,<62>-\342\200\242-,bm>)

is an odd or
of elements are
then the degree of disorder is
interchangedin any permutation,
odd
an
or decreased
eitherincreased
integer. In fact, if i < j and
by
is decreasedby an odd
that
and
are
d(x)
interchanged,
prove
Xi
Xj
<
if
if
>
increased
and
x, Xj.
x> Xj
integer

l(i)

1
4
5

m(i)

6
3
4

u(i)

12
5
5
5

(a)

(b)

6 (The

pairs are

(c)

1 (The

(d)

3 (The

only pair
only pairs

<

permutation

a pair

4.8

Section

for

1. i

4.

\342\200\242

.,an),23)

the degreeof disorderofany


if
that
an even integer. Then prove

Answers

3.

union(<a2,..

Observe that

12.

Selected

\342\200\242

= 0;

(4,3),(4,2),(4,1),(3,2),
(3,1),
(2,1).)
out of order is (3,2).)
out of order are (3,1),(3,2),
(4,2).)

1,1,24,24,93,95,97,101,101,102)

This

is obtained

as

<1>merge\302\25324,95,100,101>,
(1,24,93,97,101,102))
<1> <1> merge\302\25324,95,100,101),
<24,93,97,101,102\302\273
(1>(1)
(24) merge\302\25395;i00,101),
(24,93,97,101,102))
(1) (1) (24) (24) (93) (97) (101) (101) (101) (102) merge\302\253),
(102)).

5.

(8,9,10)

(5,6,7)

(2,3,4) (1)

(5,6,7,8,9,10)(1,2,3,4)

(1,2,3,4,5,6,7,8,9,10)

11.

The
the

main
case

difference
between
this and
at = fej. Prove the following

merging is the treatmentof

lemma.

Chapter

and Digraphs

4: Relations

Let

Lemma.

without

sequences

is a

repetitions,

repetitions and

sorted sequence without

{c,-|l< i <

\302\243} {a,-|

1 < i

< n]

..,6m> be sorted
C
<clf...,cg).
Then

U {6,.|1 < i < m}.

SORTING

TOPOLOGICAL

APPLICATION:

and B = (6lv
.,an)
=
and C
union(A,B) =

(au..

There are many situations where a natural partial orderingon a set


and it is desired to extend this partial orderingto a total ordering;
the elements of the set in some
order
that
consistent
is, to enumerate
with the given partial ordering.
of this arises in compiling programs in the programming
One
example
exists

language

In

Ada.f

compilation

a program may be brokeninto many


Each unit includes a list specifying
certain

independent

information

an

Ada,

units.

must be compiled before it. From this


these
compiler must discover an order in which

which

these
that is consistent
specifications,
fits
This is a problem
naturally
relationsand digraphs.Let be the set
that

binary

relation

that

must

ux

1.

on compilation
J?* is

whether

digraph (U,R) containsany

of binary
units. Let R be the

of compilation

units defined by ux R u2 iff it is specified


compiler'sproblemis thus:

a partial orderingon
directed

nontrivial

[i.e.,

whether

If not,

cycles].

We

call

shall

discovering
algorithms

fairly

a sequence
of U

such as
with

the onedescribed
above

respect

to

R,

such

call the

and

the

report that

there is no legalorderofcompilation.
2. If R* is a partial ordering, constructa sequence
(ulf...fun)
<
in
k.
that
U = [uly.. .,uj and for each
R*9j
(ujfuk)
topologicalenumeration

Ada

may be compiled
such an order exists.

units

before u2. The

be compiled

Determine

units

provided
into the terminology

with

other

process of

There are severalnatural


topological
sorting.
for
this problem. We shall consider
that
solving
to state and prove, though not necessarily
simple
one

oneof them
is
the most

efficient.

Algorithm

4.9.1

Topological

Input:

digraph

sort.
G =

(V,E),

with

n vertices.

A topological enumeration Sn = (slf.. ,9sn


Output:
on V.
E, providedE* isa partialordering
tAda is

a registeredtrademark

of the

U.S. Department

>

of

V with

respect to

of Defense(AJPO).

Section4.9

Topological

Application:

429

Sorting

Method:

1. Let

U0

= ( ) (the
u / v}.

V, S0

E
\302\243

{u | (u,v)

and

2. Repeat the following

(a) Choosest

Ut-Ui-i -

= 0, provided
that T^si)
halt and output a messagethat

{*,-},

all vGV.

3. If

not

already

\342\200\242 and

S-S,..!

<*,->,

Example 4.9.1. Considerthe digraph


{(a,6),(a,c),(a,e),(6,d),(6,e),
(c,d),
(d,e)}.
The topologicalsorting
described
algorithm
sequence

following

To

Si

u,

0
1
2
3
4
5

\\a,b,c,d,e\\

- {sjfor

where E =
figure 4-24.)
would compute the

is shown in
above

G:

T,(a)

TAb)

TAc)

<t>

\\a\\

[a]

<t>

4>

<t>

T,(d)

\\b.c\\
\\b.c\\

T,(B)

la.b.d]
\\b,d\\

\\c,d,e\\

(a,b)

4>

4>

4>

[c\\

id)

{d.e}

(a,b,c)

<t>

<S>

4>

4>

(a.b.c.d)

<S>

<t>

<S>

4>

4>

(a,b,c,d,e)

4>

<t>

4>

4>

4>

prove

topological

ordering

on

a
Sn computed by this algorithm is actually
of V with
to E, provided E* is a partial
respect
need to prove a stronger theorem,onewhich
V, we actually
the state of completion at the endofeachstagei.

the
that
enumeration

G*

Figure

st

is not

= ({a,6,c,d,e},2?)

(This

<a>

<

{b.c.d.e}

characterizes

on input

of sets

= T^v)

TO

an

such
E*

Sn.

output

halted,

T0(v)

1,.. .,rc:

[/,-_! such

from

exists. Otherwise,
antisymmetric.

(b) Let

i =

for

sequence of length zero),and

4-24.

A digraph to

be sorted and

its

transitive

reflexive closure.

430

Chapter4: Relations

and

Digraphs

For each i = 0,1,.. .,n the


4.9.1.
sort
algorithm satisfy the following:
topological
Theorem

2. Ti_l(si)r4>;
=

u
\302\243,

4.

1 < ,/,/z

3.

Proof.
that (l)-(4)

is

{a | (u,u) G
G 2?* and

Tf(y)
If (s,,s*)

+ v,

and a

< i

consists

then

1
\302\243
{*lf..

j < &.

on i.
i >

For

.,sj}

for all v

V;

For i = 0, S( = 0, and f/t = V, so


0 we assume that the theorem

Each part of the theoremis considered

of i.

values

in Vand [/,-

are

The proof is by induction


are satisfied,trivially.
smaller

for

true

by the

computed

oft distinct vertices


not in St;

Si = <$!,.. .,st > is a sequence


of all the vertices in V that

1.

sets

separately:

in

of

2(b)

step

!/;_! and

distinct

and

If

(2)

were

Ti_l(si)

2(a) of the

Si_l =

1 distinct
of
i (sl9.. .,$,_!>is a sequence
of all the vertices in Vthat are not in St.By
the algorithm, St - (slf.. .,$;)and [/,- = [/,-_! - {sj, wherest is
therefore distinct from sl9.. .,s,_i. It follows that slv . .,st are
of all the vertices in Vthat are not in St.
[/,- consists

By induction,

(1)

vertices in Vand Ui_l

consists

not empty,

s, would not

algorithm.[The

in step
early if all

chosen

been

have

terminated

have

would

algorithm

the T^iiv) were nonempty.]


(3)

step
and

Ti_1(v)
By induction,
of the
2(b)
algorithm,

$ {slf..

{u

G E,u

\\ (u,v)

Tt(v) =

u (J

=\302\243
v, and

T^t(v) -

fo}

{u | (u,u)

{sl9.. .,sj}. By
G E, u * vy

.,sj}.

if (s,-,s*) G JS* and 1 < ./,& < i - 1 then ; < k. We


to
one
or both;
consider the case when
and k is equal
only
= i, there is no problem,
to i. Suppose(sjtsk) G E* and 1 < jyk <i.lik
< k. The only remaining caseto prove
is thus
for j = i.
sincethis implies./
k
<
of
theorem
is
for
some
that
the
false
is, (si9sk) G E*
i;
Supposepart (4)
k for which this happens.This
and k < i. Choosek to be the smallest
meansthat for some v in V, (shv) G E* and (v,sk) G E. [Note that it
might be that v = st and (si9sk) G E.] We have already shown that Ti\342\200\236x
= 0, and by induction we know that T^isi) = {u | (u,st)
E Eyu
^ st
(st)

(4) By

induction,

have

therefore

and a

It follows
$ {$!,...,$;_!}}.
2?.Otherwise,by
than i, we know

and (s,,Sfc) G
are both less

that

v =

st for

induction,

that

some t

since

< k.
\302\243

If

< i.

(st,sk)

= i
\302\243

G E*

Since & was chosen


i, we know that t =

then

and

i>

\302\243
and

to be

st
k

the

k. We have
(si9sk)
shown
so far that (si9sk)
must
be in E. By induction, TV^s*) = 0 and
= {u\\(u,sk)
a $ {slf.. .,**_i}}.This is a
E E, u f sky and
7Vi(s*)
G
J5
that
since
and
(4)
contradiction, (s,-,s*)
part
s, $ {$!,.. .,sj. It follows
of the theorem must be true. \342\226\241

smallest k for

Parts

corollary,

(1)

G jE*

which

and

for the

(4) of

case when

and

&

the theorem
i =

n.

<

immediately

yield

the

following

Section 4.9

431

Sorting

Topological

Application:
/

4.9.1.

Corollary

a topological

is

algorithm

sort
by the topological

The sequence Sn produced


enumeration
of V with

the algorithm doesnot halt beforethe stagei = n.

proven is that the algorithm doesnot halt before


is not antisymmetric.We will argue that this is so
it as a formal theorem. Suppose the algorithm
does
halt
stating
=
<
in
somei
n.Thismeans
v
for
that
for
2(a)
0
Ui_x.
Tt_i(v)
every

i = n

without

. in

step

By the

unless E*

preceding theorem,

In other words,

Ti_l{v)

in [/,-_!

vertices

the

{u

nonzero in-degree. We

shall

u G

=\302\243
v, and

edges in the Ti_l(vYs


which

in

such a

that

prove

G E,u

\\ (u,v)

and the

that has no self-loopsand

of G

subgraph

has

every

subgraph must

will

It

E*

unless

= (V,E) is a digraph the following

have

is

statements

equivalent:

has a nonempty subgraph without

(1) G

vertex has

(3) E* is not
Proof.

no

zero.

then

cycles,

is a

there

vertex

with

G without

Let

zero

loops.
denote

that

prove

in each

if

nonempty

in-degree.

Since G contains
a directed path

of maximal

length. We assert that the in-degree


(Actually, the out-degree of vp is also zero, but we leave that

->(up_i,i>p)

i is

loops

cycles neither does H.

\342\200\242

(ui,l>2)>-

directed

nontrivial

without

that is, we

the contrapositive,

prove

2)

be any nonemptysubgraph of

no directed

every

directed cycle;

\342\200\224\342\226\272
We

subgraph of G
Let H

which

antisymmetric.

(1

G contains

in

self-loops

nonzeroin-degree;
a nontrivial

G contains

(2)

of

If G

4.9.1.

Lemma

Ui_l}.
form

vertex

nontrivial
cycle and therefore that E* cannotbe antisymmetric.
that
follow
the algorithm never halts before reachingstep5
not a partial orderingon V.

are

provided

to be

remains

What

stage

to E,

respect

in H

result as an exercise.)

If the in-degree v v is
of

that the

edge (wyVi)

Case 1.
edgesof P and

Suppose

path P':

directed

is

the

not zero, then there existsa vertex w


in H. Two cases present themselves:

Case 2. Supposew
C:

loops

i where

.,(up-i,Up),

(w,Vi).

edge

each

But this

1<i

whose

< p. Then

edges

is a

there

contain

contradicts that P was

H such

all the
a path

of

length in H.

maximal

circuit

\302\245>
v> for

(w,Vi)y(vlyv2)y-.

in

and

(vltv2)f..
no

v{ for

.,0>i\302\273Vi)- This

directed

nontrivial

The contradiction in

there is no edge(w,vx)

in

the above
if.

In

some i.
again

Then in H, thereis a directed


contradiction, since H has no

is a

cycles.
leads to the conclusion that
the
other words,
in-degreeof vx is zero.
two

cases

432

Chapter 4: Relations

and

Digraphs

Suppose

3)

both in E+f

can

we

assume

vx

4.6.1, which

Corollary

by

(2). Let

G satisfies

\342\200\224\342\226\272

(2

Since it is nontrivial,

such a cycle.
and
(vuvk)
(u*,tfi) are

\342\200\242
\342\200\242
Avk,vx)

(l>i,l>2),

Then

=\302\243
vk.

means that

be

E+ (and henceE*) is not

antisymmetric.

not antisymmetric. Then thereexistv =\302\243


w such
in E*. By Corollary 4.6.1, there must
both
be
nontrivial
directed
paths from v to w, and from w to v. If one of these
paths includesa cycle,we are done. Otherwise, putting them together we
(3

Suppose

2)

(v,w) and

get a nontrivial

are

(w,i>)

directed

cycle.

G includes

\342\200\224\342\226\272

(2

Suppose

1)

the

Then

(VkM).
(1).

subgraph

An

(vl9v2)9...,
satisfies

of the proof of the topological


corollary
sorting
finite antisymmetric binary relation on a countableset
to a well ordering. Note that this is false for infinite
the
as can be seen from
relation defined
lexicographic
ordering

interesting
is that
any
be extended

relations

in section

4.4.1.

Corollary 4.9.2.
or

a nontrivial directed cycle


({vl9v2,...,vk),{(vi>V2)>-\342\200\242->(Vk,Vi)})

\342\226\241

algorithm
may

E* is

\342\200\224\342\226\272

that

infinite

countably

ordering

that

such

Let

This fact is crucialin


of

complexity

some

a finite antisymmetric relation on a finite


R* is a partial orderingand there is a well

bounds on the algorithmic


and sorting, one of which
is

of lower

proofs

searching

involving

problems

exercises.

in the

considered

R be

set. Then
R C W.

Exercises for Section4.9

1.

of the set {a,b,c,d,etftg}


that extendsthe
a well
ordering
relation{(a,a),(a,^),(6,a),(c,a),(d,6),(d,c),(d,/),(e,d),(e,^),(e,/)
2.
there
can be no well ordering of the set {a,6,c,d,e,/}
that
Find

Show

that

relation

the

extends

{(a,6),(a,d),(a,c),(6,d),(&,c),(c,e),

W,/),(e,/),(/,a)}.

3. Perform Algorithm

on

4.9.1

the

digraph

G =

where
({a,6,c,d,e},2?),

E = {(a,d),(6,c),(6,d),(6,e),(e,a),(e,<i)}.
all steps,
as
4.9.1. Drawthis digraph and the
of its transitive
Show

digraph

in Example
reflexive

closure.

The

can

that

algorithm

sequence by

choose
of

means

form

exercises

two

following

the

fcth

the
largest

comparisons

pairwise

heart of a
element

proof that
out

must use at

of an

any

input

least n

\342\200\224
1

comparisons.

4. Prove

Let
suppose

the following lemma:


R

be

that

an

antisymmetric
in every total

on a set S = {sly..
.,sj and
R
extends
the
element
S
that
of
ordering
relation

Section

4.9
se is the

feth

for every i

Then

largest.

Sorting

Topological

Application:

=\302\243
e, 1

< i <

n9

either

seR+

433
st of

SiR+ se. (Hint: Supposethat some element


sx is not related to seby
i?+.Showthat then thereexist more than one total ordering of S
that extendR and that in one of them seis not the feth largest.)
the following

Prove

lemma:

Let R, S9and sebeas in

the

exercise.

preceding

Then R contains

at

least n - 1 ordered
Set up a
pairs
(si9Sj) such that st =\302\243
s;. [Hint:
\342\200\224\342\226\272
i? between
one-to-one correspondencef: S \342\200\224
a subset of the
{e}
ordered pairs in R and the elements si9 i =\302\243
e. The
exercise
preceding
is at least one directed path in
that
there
may be viewed as saying
(S,R)from st to se or from se to st. Taking/(s^) to be any one of these
not
Jf?, but
edges on such a path gives a function f: S - [e\\ \342\200\224>
necessarily a one-to-one function. The problemisto define
/so that
it is

one-to-one.]

Consider a path P: (vlfv2),..


.,(up-i,up)
no
directed graph G, whereG contains
has

Selected

FOR

length

in a

cycles. Prove that

vp

for Section 4.9

1.

e,d9c9b9ayg,f

2.

This

relation
cannot

therefore

REVIEW

maximal

zero.

out-degree

Answers

of

directed

contains several
be extended to

It

cycles. One is (a9d)9(d,f)9(f9a).


a well-ordering.

FOUR

CHAPTER

1. Define
x2 + y2
Section

the relation, R
=

1. Of

on

the six

G R iff
the set of real numbers by (x9y)
special properties of relationsstudiedin

4.2,

(a)

determine

those properties that

(b)

determine

those properties R

2. For
two
following
digraphs,
isomorphicor exhibit isomorphism
pairs of verticesand also
the

an

corresponding

satisfies.

does not satisfy.


either prove that they are not
by
pairs

corresponding
listing
of edges.

Chapter

4: Relations

3. For

and Digraphs

the set A

determine

{a,6,c,d},

number of different equivalence relationson

(a) the

A.

(Show

analysis.)

your

number of nonisomorphic
digraphs

(b) the

of

equivalence

A.

on

relations

be the relationdefinedon the setA of nonzero


by(a,6) G J?iffa6>0.
(a) Show that R is an equivalence relation on A.

4. Let R

real numbers

class
of 1.
(b) Determinethe equivalence
-1.
the
classof
Determine
(c)
equivalence
(d)

5.

What

(a)

An

(b)

partial

(c)

total

(d)

A total

order on A

is a

is a

that is

relation

well ordering
A

and

to the

respect

(with

that is

relation

is a

that

if
El A,

then a

relation R)

is a minimal

if

digraphs of all possiblepartial orderson


a is a minimalelement.

the

Exhibit

such that

8.

order on

a partial
A

set

is a partial ordersuch

on A

order

is

on a

order

of

7.

relation

equivalence

element

is determined by Jf??

definitions:
on a set

the following

Complete

(e) If

6.

of A

partition

= {a,b,c}

if R is a reflexive and symmetric


relation
Show
that
on a set A, then
so is therelationJR\"1.
Given
R - {(a,a),(a,6),(6,c),(c,6)}
the relations
and S = {(a,6),
=
on
defined
the set A
(c,b),(c,c)}
{a,b,c}f list the elements of the
following:

(a)

- S

(b)

\342\200\242
S

(c)

Rl

(d) R H

(e) The transitive


9. Let

MR

and

Ms

closure

be the

of R.

adjacency matrices

for

the

relations

defined in problem8 above.


(a)

List

the

entries

(b) ComputeMR
(c)

Carry out
intermediatematrix.

of MR and
OR.AND

Ms.

Ms.

WarshalFs algorithm

for

MR,

listing

each

R and

Section

4.9

Application: Topological Sorting


10.

the following by giving


a counterexample.
a relation J? on a set A is not symmetric, then

Disprove
(a) If

antisymmetric.

(b)

435

The lexicographic ordering


is a well ordering.

on the set of

on an

strings

is

alphabet

(c)

the topologicalsorting

relation

the adjacency matrix


R

is

an

whose

ri

the

of

directed

closure

transitive

of the

is

matrix

adjacency

following

vertices.

the

of

the

on

algorithm

graph, list a topological


sorting

12. Compute

a set

relation.

equivalence

11. Using

R on

relation

transitive

and

symmetric

Any

o o o]

1 1 0. 0 0

0 0 110
13. Find

an

14. Let A

x where

integer

o o o lj

MAID, MADE,
RED, REASON,
Arrange

of

16. Give
(a)

them

x mod

13.

the relation R on
a partial orderon A. Find

and define

R is

MINE,

ME,

MEAL,

lexicographic

(b) Arrange

< 12and 5243

maximal elementsof

15. Given the words:MY,

of

0 <x

{2,5,8,10,20,25,50,60,100}
a divides
b. Then

(afb) G R iff
minimal and

(a)

111

|o

MAIL,

into ascending

A under

the relation

MAMA, MOO,
MART,
MARRY,

MOST, MARE,
REST, RAIL,

order accordingto the definition

ordering.

ordering.

the degreeof disorderofthe following


(2,3,4,5,1,6)

(b) (3,2,1,6,5,4)

the

R.

them into ascendingorderaccordingto the definition

enumeration

A by

permutations:

436

Chapter

4: Relations

17. Sort

and Digraphs

the sequence(3,2,1,5,4)
using

no

than

more

four

interchanges.

18.

the binary search algorithm to search for


(1,2,2,4,5,7,8,10,10,12,14,15,16,16,18,20,21).

Use

19. Prove by

mathematical

15

in the

sequence

induction:

a symmetric relationdefined
on
a set A, then Rn is
n.
for
each
positive integer
symmetric
(b) If R is a reflexive and transitive relation defined on a set A,
R = Rn for each positive integer n.
then
20. Show that 3n3 + 6n2 - 4n + 7 is in 0(n3).
(a)

21.

If R is

\342\200\242
\342\200\242
N = an10n + a^lO\"-1+ \342\200\242
Prove
that
an integer
+ ax10
where each at is an integer such that 0 < a, < 9, is divisible
by
ax10 + a0 is divisibleby 25.

+ a0,
25 iff

Graphs

5.1 BASIC

CONCEPTS

and a number of related


graphs,
as a way of viewing relations on sets.
of graphs, including digraphs,
kinds
general
We
begin by extending the terminology
multigraphs.
directed
to
nondirected graphs. We discuss
graphs

introduced
concepts,
Thischapterdeals more
nondirected
and

Directed

earlier

important

cases

properties

of directed

that

may

graphs,

by

possessed

with

graphs,

for

introduced

of

a number

graphs, as well

and nondirected
be

were

a few

as

such as

important

planarity and

colorability.

Definition 5.1.1.

G is

graph

of verticesand E isa setofedges.If G

elementsof E areordered
said

to be

elements

of sets (VjE),

V is a set
(digraph) the

where

directed
graph
In this case
of vertices.

pairs

from u to v, and to
of E are unordered

a pair

join

is a

u to v.

an edge (ufv)
If G is a nondirectedgraph

In this
pairs (sets)of vertices.

case

an

is
the

edge

u and v. An edge that is


{u,v} is said to join u and v or to be between
between a vertex and itself is calleda self-loop
(loopfor short). A graph
with no loops is saidto be simpleor loop-free.
a loop
Strictly
speaking,
v and v is not a pair, but we shall
between
allow
this slight abuse of
{v,v\\
terminology.If G is a graph, V(G) and E(G) denote its setsof vertices
in
and
V(G) is assumedto be a finite
set,
edges,
respectively.
Ordinarily
which case E{G) must also be finite,
we say that G is finite. If G is
and
the number
of vertices in G, and is calledthe
finite,
| V(G)
| denotes
order of Similarly,
if G is finite, \\E(G)\\ denotes the numberof edges
in G, and
is called the size of G.If oneallows
one edge to join a
than
more

G.

pair of vertices,the resultis then

called

One of the appealing featuresof the


lies in the geometric
or
aspect
pictorial

a multigraph.

of graphs
of the subject.

study

and multigraphs

Graphs

may

be

437

5: Graphs

Chapter

expressed by diagrams,in which

the planeand

each

edge

by a

vertex

each

curve joining

is represented

by a

the points.In such

point in

diagrams

an edge should not pass through


that
any
points
the graph otherthan the two endpoints
of the
from
curve. Such diagramsshould be familiar
4, where they are
Chapter
usedto representdirectedgraphs.
It is convenient
to refer to a diagram of a graph G as the graph itself
since the sets V and E are clearly discernible from the diagram.
curve

the

representing

vertices of

represent

Example5.1.1.

of Figure
5-l(a) and (b) illustrate two
G, shownin Figure5-1(a), is not simple since
G' shown in
the graph
there is a loop incidenton vertex c. By contrast,
G\"
in
other
the
is
O
n
the
5-l(c)
5-l(b)
hand,
diagram
simple.
Figure
Figure
the
vertices
b
represents a multigraph since there arethreeedgesbetween
= {a,b,c,d\\ and E(G) =
and c. From the diagram, it is clearthat
V(G)
= V(G')
but E(G') =
V(G)
Moreover,
{{a,6},{a,c},{6,c},{c,c},{a,d},{c,d}}.
E(G) - {{cfc}}. The edges of the multigraph G\" do not, in fact, form a set in
the strictestsenseof the word, so to list the edgesof G\" we need to indicate
b and c somehow.For instance,
we could
between
of edges
the multiplicity
where 3{6,c}
indicatesthat thereare
list E(G\") = {{a,6},{a,c},3{6,c},{a,d},{c,<i}},
nondirected

The

diagrams

The graph

graphs.

b and c. By no meansis this the only


to indicate
a
between
way
edges
multigraph; we discussother ways in Section 5.9.
The graph G has order4 and size 6 while Gf has order 4 and size5,and,
of course,
it would be appropriate to say that the multigraph
G\" has order
4 and size 7.
three

Observethat nondirectedgraphs
for
graphs, in which
every
edge

direction

is also

there

direction.
Thus, the
as being \"the same\"

be viewed

may

(ufv) between

directed
two vertices in one

as symmetric

an edge (v9u) between the sameverticesin the other


nondirected graph in Figure5-l(a)could be viewed
as the symmetric
directed
shown in Figure 5-1
graph

(d).
G

G'

mb

(a)
5-1.

nonsimple

^*f
(d)

(c)

(b)

directedgraph.

G'\"^#t

*d

*d

\342\200\242d

Figure

G\"

graph,

a simple

graph,

a multigraph,

and a

symmetric

Section

439

Basic Concepts

5.1

Following this convention,it is possibleto translatethe entiretheory


into the language of directed graphs.However,
nondirected
graphs
it
is
this is not always
For
desirable.
certain
always
possible,
though
(such as colorability, to be discussedin a later section),
concepts
in terms
direction is irrelevant. Such conceptsaretraditionally
discussed
of nondirected graphs. In situationswhere
the
direction
of edges is not
is clearer
and simpler, and
relevant, the languageofnondirectedgraphs
so it will be used in this chapter.
Sometimes it may be useful to view a directed graph as a nondirected
In
within
a context
where we wish to ignorethedirectionof edges.
graph,
case
we shall
this
speak of the underlying nondirectedgraph of the
which has the same set of verticesand
has
a nondirected
edge
digraph,
has an edge (u,v) or (v,u).
{u,v} between two vertices iff the digraph
we shall
use the term underlying simple graph to denotethe
Similarly,
all loops from a graph.
simplegraph obtained
by deleting
Therefore,the graph of Figure 5-1 (a) is the underlying nondirected
in
of the
directed
graph
graph in Figure 5-1(d). Likewise,the graph
in Figure
is the underlying simple graph of the graph
5-l(b)
Figure
of

5-l(a).

The terminology of Chapter


extendedin the presentchapter:

for

directed

graphs

is retained

and

In a directed graph an edge {u,v)


is said
Definition
to be
5.1.2.
incident from u, and to be incident to v. Within
a particular
graph,
of the
the number of edges incidentto a vertex
is called
the in-degree
vertex and the number
of edges
from it is called its out-degree.
incident
of a vertex
v in a graph G is denotedby degreeG+(i>)
Thein-degree
and the
In
the
of
an
case
a
nondirected
by degreeG~(i>).
graph,
out-degree
is
u
v.
of
a
unordered
an
incident
on
and
The
degree
pair {u,v}
edge
vertex is determinedby counting
on it twice and each
each loop incident
otheredgeonce.The degree of a vertex v in a graph G may be denoted by
if it is clear
degreeG(y) or by degG(i>).(The subscriptG may be omitted,
A
is
isolated
vertex.
from
vertex
of
zero
called
an
context.)
degree
u to v or incident on u
In either case, if there is an edgeincident
from
and v, then u and v are said to be adjacent orto beneighbors.
G is denoted
The
minimum
of all the degrees of the verticesofa graph
of G is
o
f
the
the
of
the
vertices
and
maximum
all
by 6(G),
degrees
= k, that
G has
if
of
each
vertex
denoted by A(G). If d(G) = A(G)
is,
k.
G
is
to
be
o
r
then
said
Usually, a
k-regular regular of degree
degree k,

3-regulargraph is calleda cubicgraph.

If

vlf

where

vertices

are
the vertices
of G, then the sequence(dx,
.,t>\342\200\236
=
we
of Usually,
is
the
dt
degree (u,-),
degreesequence
i>2,..

the degreesequence
is monotone
= A(G).
<
<
<
...
d2
dn

so that

that 5(G)

= dx

G.

increasing,

d2>.

\342\200\242
->dn),

order
that

the
is, so

440

Chapter 5: Graphs

5-2.

Figure

c of the graph G

The vertex

5.1.2.

Example

degree 5 while the degreeof c in

(2,2,3,5)

while

the

Example 5.1.3.

of G'

sequence

degree

is 3.

G'

in

Figure

The degree

is (2,2,3,3).

has

5-l(a)

sequence of G is

a diagram to represent a graph is


the two diagrams in Figure 5-2 look
considerably
the same graph since each
different,
yet
they represent
the same information,
diagram
conveys
namely, that the graph has five
vertices
a, 6, c, d, and e, and eachvertex
is adjacent
to every other vertex.
Moreover,notethat this graph is 4-regular since each vertex has degree4.
basically

basic

The

in

described

of

Theorem

instance,

of degrees

relationship
the following

theorem,

or
Theory\"
its corollary

Graph
and

theorem

the

draws

one

How

For

immaterial.

of vertices to the numberof edgesis


frequently referred to as \"TheFirst

as \"The Sum of DegreesTheorem.\"


Both
are valid for multigraphs
as well as for

graphs.

Theorem 5.1.1. If V
G,

graph

.,vn] is

{vu..

\302\243,deg(vi)

If G

the vertex set ofa nondirected

then

2\\E\\.

is a directed graph,then
=

\302\243deg+(^)

The proof

Proof.

edge

contributes

on which

a count

the edge

is easy,

since

of one

Edeg-(<;;)=|\302\243|.

when

to the

is incident. D

the

degrees

are summed,

degree of eachofthe two

each

vertices

Section

Basic

5.1

has an interestingcorollary:

The theorem

Corollary5.1.1. In

nondirected

any

W be

Let

the set

of verticesof even degree.Then


=

deg(v)

\302\243

vEV(G)

Certainly,

that | W

is

deg(v)
2\342\200\236ei/

deg(v) =

]T

let

even number

U be

the set

2\\E\\.

vGU

hence

even;

is

deg(v)

2uew

proving the corollary.

= 5(G) is the

If k

5.1.2.

Corollary

of vertices of odd degreeand

\302\243deg(v)
v\342\202\254.W

and thereby

| is even

is an

there

graph

of verticesofodddegree.

Proof.

441

Concepts

even,

implying

\342\226\241

minimum

degree

of

all the

vertices of a nondirectedgraph G, then

*|V|*
In

if G

particular,

\302\243 deg(v)-2\\E\\.
v\342\202\254.V(G)

is a fc-regular

then

graph,

*|V|-

deg(i;)-2|JBf|.

\302\243

uGV(G)

5.1.4.

Example

(a) Is therea graph

with

of

such

(b) Is there a simple graphwith


Assume there is sucha graph.Then

all othervertices,so in

degree1.

two vertices of
to which the

is simple,v
five

adjacent

the

to v.

(1,1,3,3,3,4,6,7)?

degree 7 is adjacentto

be adjacent to both verticesof


6
cannot
be adjacentto either of
degree
leaves

to itself

But then

contradiction showsthat thereis no

six vertices (including v


it is assumed that the graph

only

Since

is adjacent.

be adjacent

cannot

vertices

v of

degree 1. But this


vertex

sequence
of
vertex

degree

it must

particular

vertex

the

Hence,

itself)

the conclusion

5.1.1.

Corollary

the

(1,3,3,3,5,6,6)?
would violate

sequence
a graph

degree

No, because the existenceof

and, therefore, therecanbeonly


v

have

cannot

graph

simple

with

degree

the given

6. This

degree

sequence.

(c) Is

there

3,3,4,6,7)?

Yes, the

nonsimple

graph

diagram in Figure5-3exhibits

with

such

degree

a graph.

sequence

(1,1,3,

442

Chapter 5: Graphs

5-3.

Figure

5.1.3.

Definition

moreedgesofthe form

as v0

and vn

l>x

is the

...

vn)

In a nondirected graph G
{l>0,i>i }, [vifv2}9..
is called

a path

vertex, and

terminal

-,{vn_uvn}

a sequence

(sometimes
vn; v0 is the

P of zero or
abbreviated

from v0 to
initial vertex
of the
they both are calledendpoints

P. Moreover, it is convenientto designatePasay0-^ path.


definition
of path, vertices and edgesmay be repeated.
In fact, if
=
P
then
is
called
a closed path. But,on the other hand, if v0 ^ vn,
v0 vn,
P is an open path.
then
In general,we should observe that the path P is a graph itselfwhere
= {v09vu.. .,vn] C V(G) and
C
V(P)
E(P) = {{vMvuV*},..
.,{vn_l9vn}}
<
<
1
n + 1 and 0 <|\302\243(P)|<
E(G).
Moreover,
| V(P) |
n,
where
are
vertices
| V(P) | may be less than n + 1 if there
repeated
and | E(P) \\ < n if there are repeated edges.
P may have no edges at all, in which
0\302\243
the length
of P is
course,
case,
P
is
called
a
trivial
and
is
the
zero,
V(P)
path,
just
singletonset {v0}.
A path
P is simple if all edges and verticeson the path
are distinct
an open
except possibly the endpoints.Thus,
simple path of length n has
n + 1distinctverticesand n distinct edges, while a closed simplepath of
n has n distinct vertices and n distinctedges.
The
trivial
is
length
path
taken to be a simple closedpath
of length
zero.
A path of length > 1 with
no repeated
edges and whose endpoints are
path

In

the

equalis called circuit.


a

the

endpoints;

a cycle

A circuit

may have

is a circuit with

no

repeated verticesotherthan

other

repeated

vertices

except

its endpoints.Thug,a cycleis a simplecircuit,and, in particular,


a loop is
a cycle of length1.Of course,
in a graph a cycle that is not a loop must
have
at least 3, but there may be cyclesof length2 in a multigraph.
length
Two paths in a graph are said to be edge-disjoint
if
share
no
they
common edges; they are vertex-disjointif they
share
common
no,
vertices.

Example 5.1.5. In Figure5-l(a)the


while

the

sequence

of edges

{cfc\\ is a cycle of length 1,


a
nd
form
{o,6},{6,c},{c,a} {a,d},{d,c},{c,a}
cycles
path

Section

443

Basic Concepts

5.1

ir-O

a*

5-4.

Figure

is a cycle of length 4. Moreover,


path {a,6},{6,c},{c,d},{<i,a}
of
is
a
circuit
{a,6},{6,c},{c,c},{c,a}
length4; it is not a cycle because the
vertex.
more
than
one repeated
of
vertices
a-b-c-c-a
includes
sequence
forms
a
of
the
Similarly
sequence edges{a,6},{6,c},{c,a},{a,d},{d^c},{c,a}
the
closed path of length 6, but this path is not a circuitbecause
{c,a}
edge
3. The

of length

is repeated

twice.

Example

5.1.6. Forthe

facts:

Path

have the following

Closed path?

Simple path?

Length

5-4, we

in Figure

graph

Circuit?

Cycle?

a-d-c-e-f-j-d-a

no

yes

no

no

b-c-e-f-g-j-f-b

no

yes

yes

no .

a-b-a

no

yes

no

no

a-d-c-b-a
i-i

4
1

yes

yes

yes

yes

yes

yes

yes

yes

0
5
3

yes

yes

no

no

no

no

no

no

yes

yes

yes

yes

e-f-g-j-f-b

d-b-c-d

By definition, a simple
conversestatement not

path

need

5.1.2.

Theorem

is

a path

certainly

we have

be true,

In a graph G, every

u-v

the
path

and although

following

contains

the

result.

a simple

u-v

path.

Proof. If a path is a closedpath, then it certainly contains the trivial


the proof by
path. Assume,then,that P is an open u-v path. We complete
induction on the lengthn of P. If P has length one,thenP isitself a simple
1 < k < n>
k, where
path. Suppose that all open u-v paths of length
a simple
u-v path. Now suppose that P is the openu-v path
contains
{i>o,i>i},..

-9{vn9vn+l} where u

has repeated

vertices, but

if

v0

not,

and

v =

then

vn+l. Of

P is

course, it may

a simple u-v

be

that

path and we're

444

Chapter

5: Graphs

vertices in P, let i and j be


is
integers
vt
positive
Vj. If the closed path vt\342\200\224Vj
<
n
since
at
from P, an open path P' isobtainedhaving
removed
length
from P. Thus, by the inductive
was
deleted
least the edge {vitvi+l}
done. If,

on the otherhand,

are

there

hypothesis,P' contains
we

Finally,

u-v

a simple

that

mention

or necessary

natural

repeated

j and

i <

where

distinct

path and,

thus, so doesP.

a numberof applications
where

there are

to apply \"weights,\"

or \"labels\"

\"capacities,\"

edges or verticesofa graph.Theseare merely


of a graph by a function.
elements
with
the

values

that

shall

refer

We

it

is

to the

are associated
to these all as

labelings.

Definition 5.1.4.
D is

where

E(G)\342\200\224+D,

An

graph G

of a

labeling

edge

some domain

of labels.A

vertex

is a function

f:

of G

labeling

is

a function/: V(G)-*D.

The degree
graph its degreeis

a nondirected
example
labeling. Labelings will be seen
in
context
of
the
minimal
again
spanning trees in Section5.4,in the
of binary trees in Section 5.6,in the context
context
in Section
of coloring
flows
in Chapter
7.
5.11, and in the contextof network
Exercises

to
assigns
of a vertex

which

function

an

for Section 5.1


1.

and state whether


a picture of each of the following
Draw
graphs
is directed or nondirectedand whetherit is simple.
(a)

Gx

= (VlfEx)9
=

(b)
(c)

where

Vx

{{a,6},{fe,c},{a,c},{a,d},{d,e}}.

G2 =

(V2yE2),

V2 =

where

{a,6,c,d,e}

and

{a,6,c,d,e}

and

E2 - {(a,6),(a,c),(a,d),(a,e),(e,c),(c,a)}.
G3

= (V3,E3),

where

V3

{(a,a),(a,6),(6,c),(c,d),(e,d),(d,e)}.

and
(d) Determinethe in-degree

in Exercise

the

give

directed graph. Give


drawing
A

sequence

sets

the

nondirected graph
sequences
following

are

(a) (2,3,3,4,4,5)

(b) (2,3,4,4,5)

with

degree

of

the

vertex in the

1
Exercise
nondirected

give the
graphs

to an

of

.,dn) is

not graphic.

in

given

translation

the graphs.
d = (dlyd29..

of each

out-degree

graphs G2 and G3.


For each of the directed graphs

underlyingnondirectedgraph.Foreach

3.

it

and

{a,6,c,d,e}

\302\243i

E3 =

2.

each vertex in

equivalent (symmetric)
vertices and edges, as well
as

graphic

sequence

if

there

d. Show

is

a simple

that the

Section

Baste

5.1

445

Concepts

(c) (1,3,3,3)

(d) (2,3,3,4,5,6,7)
(e)

(1,3,3,4,5,6,6)

(f)

(2,2,4)

(g) (1,2,2,3,4,5)

(h)

all the

.,dn) where

(dud2..

sequence

Any

c^s are distinct

and

1.

n >

(i) (1,1,3,3,3,3,4,5,8,9)

4. Supposethat G is a nondirected graph with 12


G has 6 verticesof degree3 and the rest have

Determinethe
5. Let be a nondirected
degree

has
order 9 such that eachvertex
least 5 verticeshave degree 6 or at least

6. Prove that at

6 verticeshave

have.

gfaph of

5 or

than 3.

degrees less

G can

of vertices

number

minimum

that

Suppose

edges.

5.

degree

of a
Suppose that we know the degreesof the vertices
G. Is it possible to determine the orderand
nondirected graph

6. (a)

size

of

G? Explain,

(b) Suppose that we know the order and


the
graph G. Is it possibleto determine

of

size

degrees

a nondirected
of the vertices

of G? Explain.

7.

a simplest

Give
(a)

having

(b)

having

no

(c)

having

exactly

one

having

exactly

one

having

exactly

two

exactly

two

(d)
(e)
(f)

having

vertices

8. Supposeyou
party

all

with

hands

shook

After

married

other

place.Noone
and no

and

married

are

three

with

example of a nonnull nondirectedgraph:


of odd dfegree;
of eveft degree;
vertex of odd degree;
vertex of even degree;
vertices
of odd degree;
vertices
of even degree.

possible

no vertices

one shook hands with


the

handshaking

eachperson,
your
had shaken.Eachperson

gave

(c)

What

is

the

nor

himself
the

same

was completed,

including

(a) How many hands


(b) How many hands

your spouse attendeda


handshakestook
Several
couples.

you and

did you

how
spouse,
a different

one's

with

own

spouse,

once.
asked
that
you
suppose
many hands that person
person

more than

answer.

shake?

did your spouseshake?


to (a) and (b) if there

answer

were

a total

of 5

couples?

9. Let

(G)

and

AG denote

the

minimum

the verticesof G, respectively.


Show
G,5(G)<2.|\302\243|/|V|<A(G).

and
that

maximum
for

degrees
a nondirected

of all
graph

446

Chapter

5: Graphs

have if they contain:


many vertices will the following
graphs
(a) 16 edgesand all vertices of degree 2;
(b) 21 edges,3 verticesofdegree
4,and the other vertices of degree
3;
(c) 24 edges and all vertices of the same degree.
11.For each of the following questions, describe how the problem may
and then answer the
be viewed in terms of a graph
model,

10. How

question:

Must
the number
of people at a party who do not know an odd
number of other people be even?
ever
born who had (or have)
an
(b) Must the numberof people
of brothers and sisters be even?
odd number
an odd number
of
Must
the number of families in Florida with
(c)
children be even?
12. What is the largest possible number of verticesin a graph with 35
and all vertices of degree at least3?
edges
13.Show that in a graph G there is a vertex of degree at least
[2\\E\\/\\ V\\ 1 and a vertex of degreeat most L2 \\E\\/\\ V\\ J .
14. (a) Let G be a graph with n vertices and m edges such that
the
if G has Nk vertices
vertices
have degree k or k + 1.Prove
that
of degree k and Nk+1 vertices
of degree k + 1, then
(a)

Nk-

(k

- 2m.

l)n

G have
(b) Supposeall verticesofa graph
odd number. Show that the number of

degree
edges

of/e.

15. For

any

graph

simple

or equal

than

G, prove

to l/2n(n

- 1),

that the

numberof edgesof G

n is

where

k, where k is an
is a multiple

in G

the number

is less

of vertices

of

G.

16.

of the following are true


statements that are not true for
example.
Which

(a) Therearean
(b) Therearean

(c) There
(d)

17.

There

odd

number

even

number

odd

number

are

an

are

an even

for

every
every

of vertices
of vertices

graph
graph

G?
give

For those
a counter

of even degree.
of odd degree.

of vertices of odd degree.


number of verticesof even degree.

to Organic Chemistry: Molecules


atoms
that are chainedtogetherby
up
model
this
chemical
bonds.
can
(We
by a graph. Theatomswill be
vertices
and the bonds will be the edges of the graph.) A
hydrocarbon
molecule
contains
only carbon and hydrogen atoms. Moreover,
eachhydrogen
is bonded
to a single carbon atom and each
atom
carbonatommay be bonded to 2,3, or 4 atoms,which can be either

Applications

are made

of

of

Graph
Theory
a number
of

Section 5.1

BasicConcepts
atoms. For
and 6 hydrogen

carbon

or hydrogen

carbon

atoms

represented

the

by

example, an ethane moleculehas

C2H6 and
graph: N

following

atoms, thus, ethaneis represented

formula

molecular

the

by

447

the moleculecan be

H
\342\200\242

-\342\200\242H

H\302\273-

\342\200\242

know

We

must be

A. Find

that in any such graph the degree of


4 and the degreeofany hydrogen
atom

the number of

bonds

any

carbon

must

atom

be 1.

in

the cyclobutane molecule C4H8


a cyclohexane
molecule C6H12

(a)
(b)

(c) a hydrocarbonmoleculeCnH2n
a decane

(d)

molecule .C10H22.

(e) a hydrocarbonmoleculeCnH2n+2.
Can there exist (at least theoretically)a hydrocarbon
with the following molecular formulas?

B.

(a)

C3H5

(b)

C5H10

(c)

C5HU

molecule

(d) C20H39
2 in a graph G is
of length
18. Prove that the number of simplepaths
is the degree
+ d\\ + ... + dl, where
.,d\342\200\236)
(dud2i..
d\\
sequence for
G. Hint: for each vertex v in G, count the number of paths of length

with

v as

midpoint.

19. How many different


set{vlyv2y.. .,uj?

simplegraphs are therewith

\"20. (Havel-Hakimi) Prove that

there existsa simplegraph

... <

where
dn
dx < d2 <
(dud2,.. .,d\342\200\236)
sequence
exists one with degree
(d\\ydl2i.. .,di_i)>
sequence

dl

Thus

dk
1dk

(1,1,1,2,2,2,3,3,3,3,5)

is graphic.

= 1,2,..

\342\200\224
1 for

k = n

for

the

is graphic

if and

given

with

vertex

degree

only if there

where

.,n - dn - 1,
- dn>...,n - 1.
if and only if

(1,1,1,2,2,1,2,2,2,2)

448

Chapter

5: Graphs

result to determineif

the Havel-Hakimi
are graphic:

Apply
sequences

the

following

(a) (1,1,1,1,2,2,2,2,2,2)

(b) (1,1,1,2,2,2,3,3,4,7)
(c)

(0,1,2,3,4,4)

(d)

(1,1,2,2,2,2,3,3)

(e) (1,3,3,4,5,5,5,5,5)

(f) (1,2,3,4,4,5,6,7)

Selected Answers for Section5.1

3.

(a)

of

Sum
odd

(b)

is odd,

degrees

degree.

A simple

or there is an odd numberof verticesof

graph of order 5 cannothave

of degree

vertex

5.

degree sequence. Each


of degree
3 has an edge leadingto eachothervertex.
= 1.
a, by c, d be the verticeswhere deg(a)
6, c, d have
b
to
there
must
be
one
a,
edge
joining
degree 3,
joining c to
a
a.
one
d
to
Hence
has
and
a,
degree 3 or more.

(c) Suppose that

with this

a graph

is

vertex

Let

Since

an

joining

Contradiction.

(d)

A simple

of order 7 cannot

graph

(e) Supposethat a graph G

Let v

the

be

of

vertex

of degree

vertex

1, G

is impossible.

6. This

degree

of degree 7.
a vertex
the given degree sequence.
\342\200\224
v has 6 vertices and at least
have

with

exists

5. Usethe PigeonHolePrinciple.
8.

Hint:

this

Represent

each

and

most 6.The 7

different

10.

(a)

16

(b)

13

(c) Solve

12.

2\\E\\

15. The

>

V\\

31 V\\or

= 48

2/3

this

for all

\\E\\

graph where the vertices

represents

edge

graph.

responses

6.

by a

situation

to people
correspond
consider the degreesof

The

degree

a handshake. Now
of any vertex is at

have been

must

0,1,2,3,4,5, and

divisors k of 48.

(2/3)

35 > |

V\\implies|

number of edges <C(n,2)sinceeach

edge

V\\

< 23.

connects

2 vertices.

Section 5.2
5.2

and

Isomorphisms

449

Subgraphs

AND SUBGRAPHS

ISOMORPHISMS

The concepts
of

Two graphs G

5.2.1.

Definition

nondirected

to

function/: V(G)\342\200\224* V(G')

defined
subgraph,
graphs.

and

isomorphism

Chapter 4, extendnaturally

if there is a
isomorphic
of G to the verticesof G' such

G' are

and

the vertices

from

previously in

that

is one-to-one,

(i) /

(ii) / isonto,

and

vertices u and v
[f(u),f(v)}eE(G').
each

(iii)

for

Any

function

isomorphism

from

pair of

the above

/ with

adjacent in G iff

G E(G)iff

three propertiesis calledan


that

in G'.

are adjacent

andf(v)

f(u)

G, {u,v\\

condition (iii) says

G'. The

G to

of

vertices

u and v

In other words,

we

are
say

f preserves adjacency.
G' are isomorphic and / is an isomorphismof G to
is the names
G', then intuitively the only differencebetween the graphs
of the vertices. Indeed, if we were to change the names of the verticesof
the function

that

If the

G'

G and

graphs

to v for each v G V(G),


then G' with
the
named
f(v)
newly
would be identicalto the graph
G, for then
they both would have
the
same
lists of vertices and edges.
Of
if G and G' are isomorphicgraphs the isomorphism
course,
/ is by no
from G to G\\ But if
means unique, there may be several isomorphisms
such
conclusions
we can
an isomorphism
/ exists, then there are several
make, namely,
from

vertices

1. |V(G)|-|V(G')|

2.

\\E(G)\\-\\E(G')\\

3.

If

v G

V(G)f then

sequencesof G

4. If

{vyv}

is

in G,

a loop

generally,if v0
in G, thenf(v0)

vx

v2

f(vx)

and,

degG(/(i>)),

thus,

the degree

the same.

Gf are

and

degG(i>)

then
-

{f(v)ff(v)}

... -

- f(v2)

vk_x

... -

is a loop
vk = v0 is
f{vk_x)

in G', and more


a cycle of length k
f(vk) is a cycle of

vectors of G and G' areequal,


the vector
of G is by definition
where
the cycle
vector
(cuc2,.. .cn)
in G of length i. Of course,
of cycles
where c, is the number
cx = Ofor
only for multigraphs.
simple graphs and c2 is nonzero
k in

length

Discovering

In

G\\

particular,

the cycle

Isomorphisms

Theproblem
of

determining

is known

as

the

isomorphism

whether

problem,

or not two graphs are isomorphic


and for arbitrary graphs,the only

450

Chapter

5: Graphs
to the
known algorithms which guarantee a correctanswer
isomorphism
n is the
where
usually require approximately 2n operations
For instance,
if G and G' are two
number of vertices.
with
the
graphs
to answer the isomorphism
same number of vertices, we might
attempt
the entire list of one-to-one onto
searching
question by exhaustively
\342\200\224*
if n = | V(G) |, there aren\\ such
But
one-to-one
V(G').
mapsf:V(G)
onto maps /, and, of course,n\\ is quite
large even for small values of n.
is particularly
The isomorphism
itself
difficult, but once we
problem
onto map f:V(G) \342\200\224*
of checking
a one-to-one
the process
have
V(G')
is fairly easy. We
whether or not this map is, in fact, an isomorphism
matrix
as a bookkeeping
device for
simply employthe adjacency

problem

all
recording

adjacencies.

If vuv2y..
this

the vertices
of G, then
vertices of G is the n x n

are

-,vn

of the

ordering

the adjacency matrix


the
of G; otherwise, A

matrix

A, where

17th

for

entry

= 0.
(ij)
edge {vifVj} is an edge
matrix each of whose entriesis either0 or 1.
Thus, A is a symmetric
1 will appear on the ith position
is
of the diagonal of A iff there
Moreover,
if we change the orderingof theverticesof G, then
a loop at Vi. Of course,
the entries of A will be rearranged.
the proof
Then we have the following
of which we leave to the
fact,

A (ij)

of

1 iff the

is

reader.

Suppose

that

V(G')

is a

for the vertex

matrix

Let A' be the


/(t>i),/(L>2),.

be

if

.,vn

for

matrix

/ is an

Then

adjacency matrices

iff the

Of course,
that

ordering Vi,v2y-.

adjacency

\342\200\242
->f(vn).

V(G')

G' are two graphs


onto function. Let

and

one-to-one

and that /: V(G)


A

be

and

\342\200\224\342\226\272

adjacency

vertices of G.
vertex ordering

of the

the

isomorphism
A

the

A' are

from

V(G)

to

equal.

A and A' are not equal,then


matrices
all
adjacency
the function
still
/ itself is not an isomorphism;it may
under
some
other
graphs G and G' are isomorphic

the

proves is that
the case that

function.

The next question is this:


we do to help locate a potential
can
Or other words, can we refine the brute forcemethodof
isomorphism?
onto
so that
we consider only
consideringall possibleone-to-one
Wh&t

in

maps

those maps from

a smaller

list.

For one thing, we can attempt to use the fact that


an
isomorphism
map a vertex of G of degreed to a vertexof G'ofdegree For many
this will shorten the search for isomorphisms
considerably.
examples,

d.

must

Example

5.2.1.

The graphs G

and

G' of

Figure 5-5

are isomorphic.

Firstwe observe that if G and G' are isomorphic,


the
then
and e must be mappedtotheverticesb\\d\\
e' respectively
and

6, d,
since these

vertices

Section5.2

and

Isomorphisms

451

Subgraphs

Figure 5-5.

are the unique verticesof degree2,5,and 1. Now instead of 5! maps, we


2 maps
of these
have
to consider. In this case, both
only
maps are
isomorphisms. For instance,we can verify that the map /which maps a to
c', b to b', c to a'y d to d', and e to e' is an isomorphismbecausethe
for G for the ordering a9b,ctd,eand the adjacency
matrix
adjacency
= b\\
matrix
for G' for the ordering f(a) = c', f(b)
f(c) = a', f(d) = d',

/(e)

e' is

the matrix

10
110

10

1110

10

10

111

0.0010
It
d\\

is routine
and

e to

Thus,

in

to

each have

(^n-iO

one-to-one

more

Next

manageable

Graphs

we

numbers

than

any

luck,

this number

will

n\\.

Are Not

Isomorphic

this
How do we showthat graphs
question:
of exhaustive
search?
show
that two graphs are not isomorphicis to find

are

not

short

One way
and G'

b', c to c', d to

address

isomorphic,

property

a', b to

at least,

of degree i to verticesof degreei. With

When

a to

search

and G'

be

maps

the degree sequenceofa graph canbeused


for isomorphisms. In fact, if the simple graphs G
...
of degree i, then there are (V0\\)(Vi\\)
V{ vertices
to V(G')
onto maps from
that will map the Vt
V(G)

cases

some

the

shorten

vertices

Determining

to check that the map /' which


e' is also an isomorphism.

to

that

isomorphic

graphs must

do not share. Thus,

example,

if G

the

and G'

then the graphs are not isomorphic.


degreesequences,they are not isomorphic.

of vertices,

have different

for

share, but which

two
have

Likewise,

some

graphs

different

if they

452

Chapter 5: Graphs
But

unfortunately,
the
hence

(and

two

the samedegreesequence
vertices and edges)and still not

may have

graphs

number of

same

be

In this case,we must dig deeper for reasons why they are not
Here's where the rub comes;there is generally
no
set
works
and
we
must
resortto
that
a
whole
of
tricks.
procedure
grab-bag
one approach seemsto work fairly often. Let us attempt to
Nevertheless,
isomorphic.
isomorphic.

describethat approachin
basic idea

The

terms.

general

is that we attempt to classify

according to some property

preserved

the

classes
if the two

into

vertices

Then

isomorphism.

by

graphs are isomorphicthe verticesof a given class in one graph must


correspond to the verticesof the same class in the other graph. But, on
then
we
the
other
hand, if the vertices in these classesdo not correspond,
For example,
if we
to conclude that the graphs are not isomorphic.
have
two in each graph, these
classify into a singleclassthe verticesof degree
classes form a graph in their own right and we could ask if these
To clarify what we mean we need to discuss
are isomorphic.
subgraphs
the concept of subgraph.

Definition 5.2.2. If

H are graphs then if is a subgraph of G


G and
subset of V(G) and E(H) isa subsetof E(G). A subgraph H
= V(G). If W is any
of G is calleda spanning
of G iff V(H)
subgraph
induced
W
is
subset of V(G),thenthe subgraph
the subgraph H of G
by
=
W
and
to
be
those
obtained
V(H)
E(H)
by taking
edges of G that join

is a

iff V(H)

pairs of verticesin
Example
G'
graph
V(G')
G,

while

W.

Consider the graphs shown in Figure 5-6.The


G shown
in (a), with
(b) is a subgraph of the graph
G\"
The
in
is
shown
a
L
(c)
{v! ,v2,v4fv5
graph
spanning subgraphof
the graph G'\" in (d) is the subgraph inducedby the set W 5.2.2.
shown in

{viyV2yV4yV5}.

The

graph

{l>! ,v5 } was

not

G\"\" shown
in E(G).

in (e)

is not a subgraph of G

the

because

edge

If e is an edgeof a given graph G, we use the notation G - e to denote


the graph obtainedfrom G by deleting the edge e; in other words,
E(G
e. More generally, G - (eb.. ,yek)
e) is the set of all edgesin G except
stands
for the graph obtained from G by deleting the edges
el9..., ek.
if v is a vertex of G, we use the notation
G - v to denote
the
Similarly,
with
all
v
obtained
the
vertex
from
G,
together
edges
graph
by removing

incident on v\\

more

obtained by deleting

of them.
A

simple

nondirected

a complete

graph

on

generally,

the verticesvx,...,
graph
n vertices,

we write
vk

and

[vly..

.,vk\\

all edges

for

the

incident

graph

on any

with n mutually adjacent verticesis called


and may be represented by the symbol

Section

5.2

Isomorphisms and

453

Subgraphs

v4#

(b)

vi

e7

\342\200\242
v,#\342\200\224\342\200\224

*5

v4#-

\\

\342\200\242
v.

*4

v4#

\342\226\240\342\200\242
v\302\253

(c)

(e)

(d)

5-6.

Figure

l?n. A complete

vertices

has

vertices

two

\"building
graphs
K2

graph,

Graphs G, G\\

graph on n verticeshas n
\342\200\224
1. A

degreen

by an
which

joined
blocks\"

in Figure
and a

may

subgraphs. For example,both


at a common edge, a
graphs
joined

are complete

5-5 consist

of two K3

loop.

5.2.3.

Example

(n

graph

Any

edges, and eachof its


on two vertices,K2,isjust
be viewed as made up of

- l)/2

\342\200\242

subgraph

complete

edge.

G\", G\"\\ and

We

show

the two

that

graphs in Figure

5-7 are not

isomorphic.

Both

graphs

degree 2,4

the

similarity

have 8

vertices and 11 edges;both

verticesof degree3,and
ends.

If the

Figure

one

two graphs

5-7.

vertex

of degree

have

3 vertices

of

4. However, there

were isomorphicthen the respective

Two nonisomorphic

graphs.

454

Chapter5: Graphs

subgraphs induced by

the

first

no pair

graph

Two nonisomorphic

5-8.

Figure

the

vertices

of vertices

graphs.

of degree 2 would be isomorphic.


In
of degree2 are adjacent,
whereas
g' and

vertices of degree2 in the second


that
are adjacent.
(There is
graph
also a differencein thestructureofthe subgraphs
induced
by the vertices
of degree 3 in each graph.)A third reason these graphs are not isomorphic
is that in the first graph the vertex of degree 4 is adjacentto two vertices
of degree
3, whereas the vertex of degree4 in the second graph is adjacent
2.
to a vertex of degree
ti are

5.2.4.

Example

two graphs

These

degree 3.

first

a-b-j-a,

triangle

length

The

The graphs in Figure 5-8arenot

isomorphic.

and
all vertices
have 10 verticesand 15edges,
are of
a subgraph
of 3 adjacent vertices(the
has
graph
for example),
but the second containsno cycles
of

3.

Example

5.2.5.

The graphs in Figure5-9are

Figure

5-9.

isomorphic.

Two isomorphic graphs.

Section5.2

and

Isomorphisms

455

Subgraphs

these graphs have 7 vertices and 14 edges. Every vertex in each


has
an isomorphism.
a
degree4.We construct
graph
Starting with vertex
in the left graph, we can matcha to any vertex
of the right graph, since
each graph is symmetric.Let us match a to a'. Now the set of neighbors
of
a must be matched to the setofneighbors
of a'. It might seem conceivable
that g couldbe matchedwith g\\ b with b\\ f with e\\ and c with d\\
and g' and h' are not
However,
g and b are adjacent in the left
graph
in
the
we
must
another
Thus,
right
graph.
try
approach. Let us
adjacent
of neighbors
of a and the subgraph of neighbors
of
considerthe subgraph
Both of

a'. (See

Figure 5-10).

Clearly/
then

be

must

g to

match

d\\

to

not
adjacentto e
not to /'. Hence
but

we

b'.

and

match

and

e,

isomorphismbetweenthesegraphs

/ is matched
remain
only

there

Now

d' (matched
e to c' and

d, whereas
must

or b'. Say

either g'

c to

vertices in each graph:d

unmatched

there is an

with
e', and

matched

with

c' and

then

g\\

two

/'. Vertex g is
to c' but

is adjacent

g)

d to /'.

to

We

the

that

conclude

if

we have

matching

obtained,
a -\302\273a'
b \342\200\224*
e'
\342\200\224
c
6'

d -/'

\342\200\224\342\226\272
c'

\342\200\224\342\200\242*'

\342\200\224
d'

must

be such

fact it is an

an isomorphism.

isomorphism.

Thereis a simpler

way

involves

the

Checkingthat edgesmatch,we

use

to

verify

of complements

that

these graphs

see

that

in

are isomorphic.It

of graphs.

of H in
of G, the complement
Definition 5.2.3. If if isa subgraph
H are
G
of
is
the
that
the
E(H);
is,
G,denotedby H(G),
edges
subgraph

mc

/\342\200\242

Figure

5-10.

e'*

Neighbors of a

\342\200\242
d'

and

a'.

456

Chapter

5: Graphs

v5#C

from

deleted

A graph

5-11.

Figure

those of

its

and

v2
\302\273

complement.

G. If H is a simplegraph

H of H is the complement
of#

complement

\\

v5#

^#v2

in

V(/f) and any


from^this definition that V(H)
in H.
are adjacent in H if and only if they
are not adjacent
degreeofa vertex in H plus its degree in H is n - 1,where
It follows

Example

5-ll(a)

5.2.6.

A graph

the

vertices

with
Kn.

vertices

two

Note that the


n

= | V(H)

and its complementare shown

in

\\.

Figure

and (b).

Now two simple graphs are isomorphiciff their complements


are
the
definitions
of isomorphism
(This follows directly from
and complement.) The complements
shown
in Figure
ofthe graphs
5-9
are shown in Figure 5-12.
are nothing more than cyclesof
these
complementary
graphs
Clearly
has more pairs
7, and hence are isomorphic. In general,if a graph
length
of verticesjoinedby edges than not, its complement will have fewer edges
and thus probably will be simplerto analyze.
isomorphic.

5.2.4.

Definition

G and G\\ written G

Figure

Let G

D G\\

and G' be two

is the

graph

The

graphs.

whose vertex

5-12. The complementsof

the

graphs

of

intersection

set is V(G)

in Figure

5-9.

V(G')

Section 5.2
and whose

the

graph

the
union
edge set is E(G) D E(G').Similarly,
set V(G) U V(G') and edgesetE(G)
vertex

if G

complete

on

graph

is a simple graph with

vertices,

457

Subgraphs

of G

with

In general,

Special

and

Isomorphisms

and G' is

E(G').

G U

then

G is a

n vertices.

Graphs

There are a number of


important to have names.
other

graph

complete

One

example

graph

complete

Every

previously.

classes of graphs, sufficiently


is the complete graphs,discussed
with n vertices is isomorphicto every
special

interesting

now introducea few more such


like the complete
form
a
each
graphs,

with n vertices. We

of graphs, which,

special

classes

class of

isomorphic graphs.

Definition 5.2.5.
whoseedges
a cycle

of order n is a connected graph


n. Cycle graphs aredenotedby Cn. A
wheel
of order n is a graph obtainedby joining
a single new vertex (the
to
each vertex
of a cycle graph of ordern - 1. Wheels of order n
\"hub\")
are denotedby Wn. A path graph of order n is obtainedby removing
an
edge from a Cn graph. Path graphsof ordern are denoted
by Pn. A null
of order n is a graph with
n vertices
and no edges. Null graphs of
graph
order n are denotedby Nn. (Note that this is in contrast to the empty
which
has no vertices and no edges.)
graph,
A

Example 5.2.7.

of length

of

classes

K5, C5,

W5, P5, and N5


Nb

is

are

shown

the

Kb.

Definition

set

of

Graphs

5-13(a) through (e), respectively.Note that

in Figure
complement of

graph

cycle

form

vertices

5.2.6.
can

bipartite

be partitioned

is a nondirected graph whose


graph
into two setsM and N in such a way that

each edge joins a vertex in M to a vertex in N. A complete


bipartite
of M is adjacent to every
is a bipartite graph in which
vertex
graph
every
into
be partitioned
of N. The complete bipartite graphs that may
vertex
such
that | M \\ = m and | N \\ = n are denoted by Xmn
sets M and N as above
'

/X

.4fe-

(a)

i\\71

\342\200\242/X-

(d)

(c)

(b)

Figure 5-13.

K5,

C6,

lV6f P6,

and N6.

\342\200\242

(e)

\342\200\242

458

Chapter5:Graphs

\342\200\242

\342\200\242
\342\200\242

\342\200\242

\302\273

\342\200\242

(a)

\342\200\242

(c)

(b)

5-14.

Figure

Khn is called a

star graph.

Example5.2.8.

such that m < n). Any


K3t3, K2t4 and

are

that

Graphs

graphs.

bipartite

order m and n

we normally

(where

Complete

(b), and (c) of Figure5-14,respectively.


next

The

graphs,

5-15, shows

Figure

figure,

the graphs

of

the

edges

octahedron,cube,

and

icosahedron,

Exercises

1. Determineall nonisomorphic
3. Do the samefor those
11 of order 4.)
Which
are

five

other

are

interesting

especially

five platonic

in (a),

shown

solids: tetrahedron,

dodecahedron.

5.2

for Section

2.

of the

Khb

is

that

graph

of

the

isomorphic?

following
Justify

simple

of order

nondirected

4. (Hint:

graphs

there are 4

of order
3 and

of order

pairs of nondirected graphs in Figure5-16


your answer carefully.

\\

\302\273

*\302\273

<1

,1

\\
Tetrahedron

Octahedron

Cube

/I/VA|\\

Dodecahedron

Icosahedron

Figure 5-15.

Section5.2

and

isomorphisms

Subgraphs

459

b'
c
\342\200\242

(a)

a'%

(b)

c'e

(c)

(d)

Figure

5-16.

460

Chapter

5: Graphs

(e)

g\302\273

(f)

\342\200\242

(g)

(h)

Figure

5-16.

continued

b'

Section

5.2

isomorphisms

(i)

and Subgraphs

461

c
\342\200\242

\342\200\242d'

am

(j)

\342\200\242
c

>\342\200\242/>'

(k)

(1)

Figure

5-16.

continued

462

Chapter

5: Graphs

(m)

(n)

J>fc<L

(o)
c
\342\200\242

(P)

gf

\\

c
\342\200\242

\342\226\240
\342\200\242r

Vs

*y\"*y

(q)

*^

\302\243\342\200\242

r
\342\200\242

M
e'

Figure

5-16.

continued

>y

Section

5.2

Isomorphisms

463

and Subgraphs

(r)

Figure

(a)

Give an
2 edges

5-16.

continued

example of two nondirectedgraphs with


that are not isomorphic.Verify
that

4 vertices

they

are

and

not

isomorphic.

(b) Let G, G', and


4

and

G\"

size 2.

be any

3 nondirected

Prove that at least

two

simple graphs of
of

these

graphs

order

are

isomorphic.

The 3 graphs illustrated in Figure


5-17
are isomorphic.
The
vertices of the first graph are labeled a, 6, c, d, e,f, g, h, i, and j.
as
the labelling
of the vertices of the secondgraph
Complete
for each letter x in
a',...,
j' in such a way that the map f{x)=x'
is an isomorphism.
Also label the vertices of the
{a,6,c,d,e,/,g,/i,ij}
third graph as a\",6\",..., j\" in such a way that the map g(x) = x\" is
The graph is known as the Petersen
an isomorphism.
graph.
then
6
with
Prove
that
if G is a simple nondirected
vertices,
graph
vertices.
G or the complement
3 mutually
of G contains
adjacent
shown
in
The two graphs
and
8 vertices
5-18
have
and
Gx
G2
Figure
8 edges. Moreover, they have the same degree
sequence

(a)

(b)

Figure

5-17

464

Chapter5: Graphs
\342\200\242

\342\200\242

\342\200\242

\342\200\242

\342\200\242

\342\200\242

\342\200\242

\342\200\242

\342\200\242

G2
>

\342\200\224
\342\200\242

\342\200\242

5-18

Figure

graph

every

with

(2,2,2,2,2,2,2,2)to
has

an example of

7. Give
with

(2,2,2,2,2,2).

sequence

degree

vertices

G be a simplegraph

8. Let

21

|\302\243|

9.

Isit true that


they are not isomorphic.
and 8 edges and degree sequence
be isomorphic
to one of Gx and G2? Explain.
of order 6 and size6
nonisomorphic
graphs

Verify that

(2,2,2,2,2,2,2,2).

a graph

that

Prove

What

-3.

V\\

said about G?
G is isomorphic to a graph H

vertices of

of the

ordering

have degree 3

vertices

of whose

all

and

11. (a)

two

that

Show

is an

the resulting

of K2t5.

the graph

Draw

there

if

that

such

adjacencymatricesareequal.
10.

and

can be

simple

complements are

(b) If a simplegraph
complement, how

graphs are

and

only

if their

to its

is isomorphic
does it have?

n vertices

with

vertices

many

isomorphic if

isomorphic.

(c) Can a simple graph

with

be isomorphic

vertices

to its

complement?

12.

Let

cycle

be the

Cn

cycle graph with


to its

isomorphic

graph

13. Note that the Petersengraph


cycle
this

its

with

graph
C5,

and

vertices

generalized

5 vertices,

that C5 is the only

Prove

n vertices.

complement.
be obtained
by taking an outer
may
5 \"spokes\"incident to the verticesof

an inner cycle graph on 5 vertices attachedby joining


to every second spoke. M. E. Watkins
has
defined
the
Petersen graph P(n,k), which
consists
of an outer

n-cycle, n spokes

incident to the verticesof this

and

n-cycle,

fe-th
inner n-cycle attached by joining its verticesto every
Thus, P(5,2) is the Petersen graph.
of P(7,2), P(9,2), P(7,3), and P(9,4).
Draw
a diagram
(a)
is isomorphic to P(nfn - k).
Prove
that
(b)
P(n,k)

14.

Let

be
\302\247n

the

each vertex

class

of all

simple graphs with

has degree3,that

is

is
\302\247n

the

vertices

class

of all

and

an

spoke.

where

cubic graphs

Section

5.2

Isomorphisms

on n vertices.Then Sn can
wherewe define two graphs
(a)

Show
is a

if G

that

into equivalence classes


as equivalent if they are isomorphic.
is in Sn, then n is a multipleof 2 and | E \\

(VyE)

of 3.

multiple

class

determined

(c) Showthat X33

and

one

equivalence

(d)

Show

the

graph

graphs

nonisomorphic

that

every graph in

(e) Showthat noneof


isomorphic. Note

that

class

for

\302\2474,
namely

by K4.
H:

\342\200\242

\342\200\242c

are

465

be partitioned

(b) Showthat thereis only


the

and Subgraphs

the

all 6

in

\302\247e.

is isomorphic
\302\2476

6 graphs

illustrated

graphs are in

to H.
below are

to K3>3 or

Ss.

to one of the above


is isomorphic
*(f) Showthat every graph in \302\2476
6 graphs listedin (e).
at least 2 nonisomorphicgraphs in g10.
(g) Exhibit
15.Thelength of the longest simple path between two distinctvertices
in a graph G is called the diameter of G. The length of theshortest
in G is the girth of G while the lengthof the
cycle is
longest
cycle

466

Chapter5: Graphs
of
circumference
the following

the

of
circumference

(b)

(a) C5

16.

(c)

K5

The Petersen

(d)

that

Prove

every

the diameter, girth, and

G. Find
graphs,
K3.3.

graph of Figure 5-17


circuit contains a cycle.

17. State the contrapositive

of the

converse

the

and

following

statements:

are isomorphicgraphs,then G
numberof vertices.
If G and H are isomorphic graphs,then G
degree sequence.
and H

If G

(a)

(b)

of

Which

18. Determinethe number

of edges

determine the number


19.

20.

Show

that

Ln2/4J

vertices

of

a simple

H have

the same

and

H have

the same

are true?

statements

these

and

graph

with

in (a) Kn
in Xm>n.
| V |

(b)

= n

(c) Cn

Kmn

is not

(d) Pn. Also

bipartite

if

| E \\ >

= M U N and
where
that G is a bipartitegraph
V(G)
in
N.
Prove
that
the
eachedgeofG joins a vertex in M to a vertex
sum of the degrees of the verticesin M is equal to the sum of the

(a) Suppose

degreesofthevertices

N.

in

Are

(b)

there

graphs with the

bipartite

following

degree

sequences?

(i)

(3,3,3,5,6,6,6,6,6,6).

(ii) (3,5,5,5,5,5,5,5,5,5).

(iii) (4,5,5,5,5,5,5,5,7,10,10,10).
G has n vertices, all but one of odd
a graph
how many
degree,
in the complement?
vertices of odd degreearethere
If vu i>2,..., vp are the vertices of a graph G and A is the adjacency
matrix of G, prove the following:
from vt to v}-oflength n
(a) An(iJ) = the numberof different
paths
inG.
(b) A2(iyi) = degree of vt.
in G. Here Tr(B) for a
of 3-cycles
(c) (l/6)Tr(A3) = the number
B means the trace of B which
is defined as the sum of
matrix

21.If
22.

the
23. If

{vltv2,...,vn)

incidence

matrix

B(iJ) = 1 iff

of 23.

entries

diagonal

and

V(G)

of the

vertex

{elye2y.. .,em} =

graph G as the

vt is

incident

with

E(G), then define

the

B where
matrix
= 0
edge
e; and B(iJ)
incidence
matrices:

facts
about
otherwise.Prove the following
(a) No two columnsofB are equal.
The
sum of the entries in any columnis 2.
(b)
G'
If G and G' are two graphs, then G and
(c)

are isomorphic

iff

Sectiori

5.2

their incidencematricesare
verticesand edges.

24.

G is bipartite

a graph

that

Show

in sucha way

iff

some

of their

ordering
of G

vertices

the

matrix

its adjacency

that

for

equal

467

and Subgraphs

Isomorphisms

can be labeled
in the

be represented

can

form

B]

[0

[B1 o]
whoseonly

A2

with

1 1
2 2
2 2

1 1 4 1 1
1 3
1 2
1 2 2 1 2 3

26. Prove that

B and 0 is a matrix

zero.

the graph G

1 1
3 2
2 3

of the matrix

transpose

are

entries

25. Determine
4

the

means

Bl

where

A such

matrix

adjacency

that

4 9 9 4 9 9]

and

A*

5
4 9
9 4
9 4
9

4
9
4
4

9
4
9
9

4
9
4
5

4
9
5
4J

> 3, where
([(G) is the diameterof the simple
d (G) < 3, whereG is the complement
of G. Then if G
to Gfd(G) = 2 or 3.
is a graph where the set of vertices
be
graph
may
into three subsets so that no edge has incident vertices

if

d(G)

G, then

graph
is isomorphic

27.

tripartite

partitioned

in the
(a)

same subset.

Give

of a

an example

In general,a
the
set
of
vertex

tripartite graph.
G is

graph

G into

is possible to partition

k-partite

if it

k disjoint

subsets VlyV2i..

,Vk

such

the other
each edge has one endpointin one subset
V,- and
i ^ j. A complete
graph
k-partite
endpoint in some V} where
the additional
is a simple k-partitegraph
with
property that
i =\302\243
to each vertex in V} where
each vertex in V,- is adjacent
j,
=
k
for all i and j. If ni
-partite graph is
\\Vi\\i then the complete

that

denoted

by

(b)
(c)
(d)

Selected

Answers

2. (a)

Kni,n2,...,n,.

an example of X2>2,3.
an example of #2,2,2,2
Draw
Determine
the size of Knun^.
Draw

for Section

\342\200\242
m nk.

5.2

Nonisomorphic; verticesof degree3 areadjacent


in the other.

nonadjacent

in

one

graph,

468

Chapter

5: Graphs

(b)

remove vertices of

Isomorphic;

degree 2 and comparethe

graphs.

remaining

different number of vertices.


(c)
Nonisomorphic;
verticesof degree 3 are adjacent in one graph
(d) Nonisomorphic;
and nonadjacentin the other.
consider their degreesequences.
(e) Nonisomorphic;
their

consider

Nonisomorphic;

(f)

complements.

5 and
their
incident
(i) Isomorphic; remove the verticesof degree
from
each
an
observe
graph,
isomorphism for the
edges
extend.
and
remaining
graphs
of the vertex
of degree
(k) Nonisomorphic; considerthe neighbors

5 in each graph.

3. Hint:If
adjacent

4 and

has order
graph
or nonadjacent.

8. Note that

1^1 = 6:Concludethat

size 2, then the 2 edgesmay


G

is isomorphic

to X33

be

or the

graph

13.

(a)

P(7,2)

P(7,3)

5.3

TREES

PROPERTIES

AND THEIR

In

this

we

section

as a

known

tree is a

root. rooted
is a directed
A

nondirected

simple

rooted

a very

important specialkind

of

graph

simple graph G such thaj thereis a


of G. A
each pair of vertices
between
path
tree in which there is one designated vertex, called a
is a directed
tree if there is a root from which there
one
such
to each
In this case there is exactly
vertex.

Definition 5.3.1.
unique

will study

tree.

tree

path

tree

is a

Trees

Section 5.3

and

Spanning

G2

<?i

469

Trees

\342\200\242

\342\200\242

b%

b*^

%d

\342\200\242
e

\342\200\242

root, and we
one vertex

shall

that

(V,EX)

Ex

\342\200\242
i

nondirected trees.

the root.

it as

The level ofa vertex

to v from the root. A tree


path
T is a nontrivial
otherwise
tree;

Two

trees,

and G2 ='(V,E2),

V=

T with

v in

only

tree.

of this definition
applies to nondirectedgraphs
A tree may be either a digraph or a nondirected
tree any vertex may be designated
asa root.

Example5.3.1.
-

t
\342\200\242

part

in

if

the

is calleda trivial

graph.Note
Gx

Two kinds of

designate

is the lengthof

Note that the first


as well as to digraphs.

hm

\342\200\242/

5-19.

Figure

^%d

\342\200\224

rooted tree

#c

\342\200\224
\342\200\242\342\226\272\342\200\242

Gx and

G2, are

where

shown in Figure 5-19.

{afb,cfd,efffgfhfij}f

= {{a,c},{6,c},{c,d},{c,\342\202\254},{e,^},{/,^},{^,i},{h,i},{i
J}}, and

E2 = {(c,a),(c,6),(c,d),(c,/),(/,e),(/,0,(^,d),(/i,e),0\302\273}.

Neitherof these
each

Example

(V,E),

were

tree,

vertex./

5.3.2.
V

directed
is at level

tree. If

is a

trees

rootof

tree

directed

{a,b,c9d,e,f,g,h}

Figure

4 in Gx

5-20.

vertex c is designatedasthe

and

at level

3 in G2.

5-20. T =
=
and E
{(a,6),(a,c),(a,d),(6,e),
T is

A directed

shown in Figure

tree.

470

Chapter5: Graphs
root of T is the vertexa and the verticesat level
2
trees are conventionally
drawn
with the root at the
top and all edgesgoing from the top of the page toward the bottom, so
of edges is sometimes not explicitlyshown.
direction
that
the
The

(d,/),(e,\302\243),(e,/i)}.

are

e and

/. Directed

Trees arise

in

many

situations where many


that

hierarchy

first, or

elements

what

is more

For
what is moredesirable.

the order

in

product;

expresses

applications;
are to be

practical

which

the root

they occur in

frequently

organized into

important,

instance,

what

can be

a tree

some sort of

must

be

done

used to show

tasks
of some
are to be completed in the assembly
and tasks that can
can represent the finished
product,

be done concurrentlyappearon the same level, whereas if task A must'be


to lie on a higher
have
before task B can start, then A would
completed

levelthan B.

Example 5.3.3.
algebraic

formulas

as tree

Frequently

computer

as

Figure 5-21

If b werethe expression
x
(c

scientist

For example, a

structures.

d) we

may write

a + (c x d)

Figure

5-22

can

describes
be diagrammed

Section

Trees

5.3

The expression

and

[(36+ c)/(d+ 2)]

(a + 5) x

be

can

471

Trees

Spanning

as

pictured

Figure 5-23

If we now read the verticesof this tree once


we
write
and proceedingcounterclockwise,

each

starting

from the

top

a
~

\302\251.^

\\\302\251

\"

\\

A.

\302\251

\302\251>

>\302\251

\302\251

\302\251/'\\

\302\251\342\200\236

a5/+

X3bc + d2

Figure 5-24

which is the samealgebraic

notation
this

invented

notation

by

is that

Jan

it is

formula

Lukasiewicz

written

in the

(1878-1956).

unambiguous despite the fact

prefix
operator
The advantage of
that

it does

not

employ parentheses.
algebraic

Any*
with

the

operator

expression

written

can be written in
before its arguments

operator prefix notation

(or its operands).Analo-

472

Chapter

5: Graphs
after
gously, one can placethe operator

its

this is

and

arguments,

called

the
operator postfix notation.Thus,
algebraic
expression
depicted in
in
written
5-21
can
be
notation
as
the
a6+,
postfix
Figure
expressionof
acd
x
the
5-22
and
becomes
notation
for
the
+,
postfix
Figure
expression
of Figures 5-23.and5-24isa5 + 36xc + d2+ 4- x. (Prefix and postfix
notation are nothing morethan the preorder
or
tree traversals
postorder

in Section

described

5.6.)

Now let us prepareto give

graph aresaidto beconnectediff there


in G, and then the graph
G is connected
connected.

In

is a

vertices

nondirected
each

iff

pair

this we

b of a
path from a to b
of its vertices is
a and

G by aRb
define the relation R on the verticesof a graph
connected, then R is an equivalence relation.Consequently,
of G can be partitionedinto disjoint
sets Vlt V2>- \342\200\242
\342\200\242>
nonempty
Vk
if we

general,

b are

a and

iff

To do

of trees.

a characterization

of connectivity.Two

the concept

discuss

to

need

the

vertices

and

the

respectively,

subgraphs Hlf H2,..., Hk of


are called the connected

components

C(G)and,

of G. Usually
G is

of course,

denote

we

connected

iff

induced

by

components

\342\200\242
and
\342\200\242>

VltV2>of

or

simply

Vk,

the

the number oT components of G by


= 1. Equivalently, a component

C (G)

G is a connected subgraphof G not properly


a graph
contained in any
other connected subgraphof G; that is, a component of G isa subgraph
of G
to the property
of being connected.In other
that is maximal with
respect
a connected
of G if for each
words,
subgraph if of a graph G is a component
F of G where HCFCG,
connected
V(H) C V(F), and E(H) \302\243
subgraph
then
it follows that H = F.
E(F)f
of

Definition5.3.2. If
G

that

If

is

and e

connected

G is

graph

is not connected,then eissaid


v is
vertex
of G such that G \342\200\224

- e

be a

bridge
not connected,
to

is an edgesuch
or a cut edge.
then

is

a cut

vertex.

Example

Let G

5.3.4.

This graph G

has

be

the

3 components;

depicted in Figure 5-25.


the vertices a and d are connected
as

graph

^b

a<*

\342\200\242
c

em

Figure

5-25.

\342\200\242

A graph

with

%g

3 components.

i
#

k
\342\200\242

Section

Trees

5.3
are i and g and j
vertex of the first

but

k,

5.3.1.

Theorem

connected.Moreover,

c is

a cut

nondirected

simple

of trees.

properties

interesting

G is

graph

a tree

iff

is

no cycles.

and contains

connected

k are not

i and

473

Trees

Spanning

component.

present a few

let us

Now

and

and

G is a tree. Since each pair of vertices


that
arejoined
connected. If G contains a cycle
distinct
containing
u and v are joined by at least two
then
the
simple
paths,

Proof. Suppose
G is

a path,

by

u and v,
one along one portion of
vertices

the cycle

betweenu and v,
b be

and

thus
that

a tree
G is

of verticesof G.If thereare


we can find a cycle
paths there must bea vertex

different

paths suchthat

vertex

the

path completing
is a unique simple

the

path

has no cycles.
connected and containsno cycles.Leta

6, then

a to

other
there

that

any pair

and P2, from


P2 are

and

suppose

Conversely,

the

and

cycle. This contradictsthe hypothesis

following

vx

on

Px

2 different

simple

paths, Px

as follows. SincePx and


vx (possibly
vx = a) on both
is not the same as the vertex
vertex
at 6, there is a first

in G

P2. Since Px and P2 terminate


= 6). Thus,
after
v2
vu call it v2, which Px and P2 have in common(possibly
the part of Px from vx to v2 together with that part of P2 from vx to v2 form
G has no cycles.
a cycle in G. This contradictsthe assumption
that
one
Therefore, G has exactly
path
joining a and b. \342\226\241
vx on

following

In every

5.3.2.

Theorem
of degree

nontrivial tree thereisat leastone

vertex

1.

(We are

excludingthe trivial

tree

with

only one

vertex.)

Proof. Start at any vertex vx. If deg (vx) =\302\243


1, move
along any edge to
a
a vertex v2 incident
with vx. If deg(i>2) ^ 1, continuetoa vertex
u3 along
- v2 different edge. We can continuethis processto producea path
vx
\342\200\224
(Here we mean that there is an edgefrom
vx to v2, one from v2
u4...,
u3
since then we
to i>3 and
so on.) None of the v's is repeatedin this
path
a tree
would have a circuit\342\200\224which
may not have. Since the number of
Where
it
in the graph is finite, this path must endsomewhere.
vertices
must be a vertex of degree
ends
1 since we can enter this vertex but
5.3.3.

Theorem

Proof.
vertices.

If

n =

it.

leave

cannot

We

employ

1, there

Assume, then,

for

tree

with

n vertices

has exactly n

- 1 edges.

on the number of
induction
mathematical
for n = 1.
are no edges. Hence,the resultis trivial
> 1 that all trees with
n vertices
have exactly n - 1

474

Chapter

5: Graphs

v./-

\342\200\242^./*

\\

5-26

Figure

edges.

Then

consider an

arbitrary tree T with

previoustheorem,thereis

1 vertices.

degree 1. Let us

T of

v in

vertex

By the

\"prune\"

this

T that
is,
by removing this vertex and its associatededgee from
in
v. Let us illustrate
the
5-26.
consider T\" = T \342\200\224
picture Figure
by
Notethat T\" has n vertices and one fewer edge than T.But morethan
a and b in T\" there
is a
T\" is connected
since for any pair of vertices
that,
a
in
T.
has
not
been
to
b
this
from
Moreover,
path
unique simple path
of the vertex v and the edge e. Likewise, there are
affected
by the removal
no cycles in T\" since there were none in T. Thus, T\" is a tree and the
1 edges.
But then T must
inductive hypothesis impliesthat T\" has n \342\200\224
T\".
n edges
\342\226\241
as T has one more edgethan
have

tree

We

can

Corollary 5.3.1. If
verticesof degree1.

Proof.

Let

5.3.2.

upon Theorem

improve

= the

is

tree then

a nontrivial

number

of vertices of

G containsat least2

G. By

the

of degrees

sum

formula,

degdu)
\302\243

Now if there

- 2(n - 1) -

- 2|E|

is only one vertex,say


deg(i>t) > 2

X! deg(i>t)
i' = l

But

of degree
i =

for

2,...,

2).

1, then
n

and

i^,

(2n

= 1

+ X! <*eg(i\\)

>

1 +

2n

- 2 \302\253
2n

1.

i-2

then

2n

\342\200\224
2 >

2n

- 1 or

-2 > -1, a contradiction.\342\226\241

Section

Trees and

5.3

#
\\

Example 5.3.5. Thereare


in Figure
5-27.
They are shown

Theorem
by adding

5.3.4.
an edge,

/\\

y\\

trees

nonisomorphic

fact about treeswill

The following

on 6 vertices.

The trees

5-27.

Figure

\342\200\242

A\\

\\

/\\

475

Trees

#v

Spanning

also

prove

with 6

vertices.

useful.

If 2 nonadjacent verticesofa treeT are connected


will
contain
a cycle.
then the resultinggraph

If T has n verticesthen T has n - 1 edgesand then if an


edge is added to the edgesof T the resulting graph G has n
5.3.3.
verticesand n edges. Hence G cannot be a tree by Theorem
the
the addition of an edge has not affected
However,
connectivity.
Hence G must have a cycle. D
Proof.

additional

Example5.3.6.
will create

5-28

have

We
definition.

this

already
There

Adding

any

of the

dotted

lines to the tree in

Figure

a cycle.

are

the
onemore

given one characterization of trees in addition to


we list
several other characterizations;

at

point.

Theorem

5.3.5.

A graph

G isa tree if

and

only

if G

has no cyclesand

\\E\\-\\V\\-1.

-^

\342\200\242\342\200\224\342\200\242\342\200\224\342\200\242

Figure

5-28

476

Chapter 5: Graphs
5.3.3 we have already proved
In Theorem
one
of the
Proof.
half
theorem. To prove the other half we need only show that if G has no
G is connected.
Denote by GUG2,.. .,Gkthe
| = | V| - 1,then
and|E
cycles
=
>
1.
k
the
o
f
where
Let
number of vertices of G,-.
G,
| V^ |
components
and G, contains no cyclessinceG
each Gt is a tree, for Gt is connected
Now
not. Thus,
does
G, has | V{ \\ - 1 edges. Hence G has (| Vx \\ - 1) + (| V2 \\ . +
\342\200\242
\342\226\240
\342\200\242
+ |V,|+ . \342\200\242
+
D+
D-IVJ
\\Vk\\-k-\\V\\-k
<|VJ\342\200\224
1
k = 1, and G is
G
has
Thus,
|V|
edges.
edges. By hypothesis,
connected.

Exercises

\342\226\241

5.3

Section

for

1. Tell how
(a)

(b)

different

many

of order

trees there

nonisomorphic)

(pairwise

are

(c) 4

(d) 5

2. (a)

if G

that

Prove

is a

tree, then the sum

of

degrees

21 V \\ \342\200\224

equals

2.

all pairwise nonisomorphic trees with


one vertexof degree> 4.Hint:Determine

Draw

(b)

V \\ = 7

the

degree

and at

least

sequence

first.

(c) Is there a tree with

3.

an

Give

4. Listall

5 and

2 vertices

of degree3?

graph G such that for each pair of distinct


exactly 2 paths from a to b.
trees
with degree sequence
nonisomorphic
of a

example

vertices a

=
| V \\

and b

there

pairwise

are

(a) (1,1,1,1,2,2,3,3)

(b) (1,1,1,1,2,2,2,3,3)
5.

(c)

(1,1,1,1,1,1,2,3,5)

Show

that there
(1,1,2,2,3,3)

(a)

is no tree with

degree

sequence

(b) (1,1,2,2,2,2,3,3,3,3,3,3)

(c) (1,1,1,1,1,1,2,3,7),

6.

different

possible

degree sequences

of a tree

exactly one vertex of degree 5, one of


and
two
of degree 3.
vertices
4
,
degree
(b) with 12 vertices and at least 3 verticesof degree3.
An
e in a connected graph G is a cut edge if G - e is not
edge
if
connected.
Prove
that a connected graph is a tree if and
only
each edge is a cut edge.

(a)

7.

the

Determine
with

17

vertices

and

Section

and Spanning

Trees

5.3

8. Provethat a simple
the additionof any
9. Let G
10. Show

a formula

that a

graph G

circuits.

11.

(a)

with k

a graph

be

Obtain

tree.

edge

for

is

a tree iff

forms

no cycles

contains

a cycle.

477
and

Hint: Considerthe case

2 components.

at least

G contains

where

G is

graph
new

Trees

is a
components, where eachcomponent
k.
| E | in terms of | V | and
a tree iff G is connected and containsno

n > 2 and dltd2t.. .,dn,dn+l


are n + 1 positive integers
such that their sum equals2n.Usethe pigeonhole
to
principle
=
1
that
there
existsan
indexi
that
is
such
and
there
dt
prove
Suppose

an indexj such that d; > 1.


to prove that if n is
induction
(b) Use part (a) and mathematical
are
an integer > 2 and dud2y..
.,dn
positive
integers such that
= 2n n vertices
there
is
then
tree
with
whose
a
2,
Tn
2?-i di
are
Hint:
think
about
how
dl9d2,...,dnyou would
degrees
from one
construct a tree with degree
(1,1,1,2,2,3)
sequence
with

sequence

degree

12. Characterize

vertices as

(1,1,2,2,2).

all connected graphs

edges (that is, what

the

having

such

must

same

a graph

number

look like

of

and

explain

why).

13.

14.

a nontrivial tree with vertices


.>vn. Let Nx be the
vuv29..
numberof verticesof Twith degree equal to 1. Prove that Nx - 1 +
of x.
(1/2) S?.! | deg(vt) - 21 where | x | means absolute value
T
>
v
in
T
iff
a tree
is a cut vertexof
(a) Show that a vertex
deg(y)
Let

T be

1.
1 > 2 contains
at
that a connectedgraph with | E \\ = | V \\ \342\200\224
least 2 verticesthat are not cut vertices.
1 > 2 contains
at
Show that a connectedgraph with | E \\ = | V | \342\200\224
least one cut vertex.
of degree
that
a tree T has Nx vertices
1, 2 vertices of
Suppose
4.Find
2, 4 vertices of degree 3 and 3 verticesof degree
degree

(b) Show
(c)

15.

(a)

Nx.

(b)

that a

Suppose

degree 2, N3
Find

Nx

in terms

16. Characterize trees


all

17.

Write

the

a tree

of degree
1, N2 vertices of
3,.. .,Nk vertices of degreek.

vertices

of degree

of N2,N3,...,

and Nk.

with

2 vertices

exactly

of degree 1.

expression

{[(a +
as

tree T has Nx

vertices

and then

6)xc]

x(d + e)}-

express the

[f-(gxh))

result in operatorprefix

notation.

478

Chapter

5: Graphs

18. Let T = (V,E)

graph that

a directed

be

in V. Suppose

vu..

the

are

.,vk

vertices

is a tree and v0
to

adjacent

v0.

S( =
=
E
E{

path that doesnot traverse v0}y


for i = 1,.. .,fe.

to v( by a

is connected

S,-),and Tt = ($,\302\243,),
(a) Showthat the subgraphs
T{
(b) Show that each T{ is a tree.
(c) Show that every edge of T

are

disjoint.

not

incident

to

v0

is

a vertex

be

Let

in one

\\ u

\\u

(S, x

of the

7Vs.

19. Supposethat

is a

be connected

20.

is

forest

connected

= n. Prove that G must


| V\\
- 2).
graph with no circuits. Show that the
(n

(1/2)

a simple

21. Showthat the removal

of

2 connected

exactly

are trees.

a forest

of

components

with

graph with
- 1) (n

simple

if\\E\\>

an

from a

edge

tree results in a forest

components.

forest G with k connected components,


must
be addedtoit to obtain a tree?
edges
with
Prove that any 2 simple connectedgraphs
degree 2, are isomorphic.

how many new

22. Given a
23.

24.

G is

If

(a)

a simple

that if e

graph

is any

with

of G,

edge

if

C(G)

exactly

a simple

For

(b)

+ 1 components.
C(G)
graph G with

\342\200\224
e has

is a

than G

forest,

- e

has

See Exercise21.
connected

prove

components,

on the number of edgesof

by induction

all of

show
components,
at most C(G) + 1

connected

C(G)

then G

components.In particular,

n vertices,

that

| V(G)

\\

<

C(G)+\\E(G)\\.

25.

pairwise nonisomorphicforests with


components and 5 verticesin all.
(b) 3 or 4 connected componentsand | V \\ = 6.
k components
and | V | = 17 and
(a) Suppose that G is a forest with

Draw all
2 or

(a)

26.

more connected

| E | = 8.Determine

k.

(b) If G is a forest with

Hint:

7 connected

See Exercise

9.

components

and | V \\ =

33, find

\\E\\.

27.

Show

a graph

that

degree0
28. If

a graph

is

Is the

connected.

no

with

not

tree can
of

the

of odd

degree and no verticesof

connected,

prove

that its

complement G

is

converse true?

29. In a connected
graph
length have a common
30. Prove by

vertices

a circuit.

contain

must

G,

prove

that

any two

paths of maximal

vertex.

induction on the numberofverticesthat the vertices of a


at most
two colors so that no two vertices

be coloredwith

same

color

are adjacent.

Section5.3

Treesand
31. Suppose

that

graphs. Prove that

Gx and
G2 are isomorphic
then G2 is connected.

connected,

479

Trees

Spanning

if

Gx is

1 for

Selected Answers for Section5.3

1.

(a)

3.

Any

Cn.

graph

cycle

(d) 3

(c) 2

(b)

of G,then | E{Qi)
Gl9.. .,Gkarethe components
= Z?_i (W(Gd
each L Then | E(G) | = &M \\ E(Gd
|

9. If

|
\\

= | V(Gt)
- 1) =

\\

| V(G)

\\

k.

15. (a)

Recall that

for

|E

a tree

\\

| V\\

sum of degrees

by the

\342\200\224
1 and

formula

iV1

2.2

4.3 + 3-4 = 2|JE|=

2(|V|-l)

= 2(NX

=
(b) Similar
Nv

2iVx

+ 2

3-1)

laThus^^l^

to (a); observethat

2 = N3

+ 2N4 +

3iV5

...

+ (*

- 2)Nk.

17.

P
^>f

fu\\

A
0

\302\251

-XX

A
\302\251

\302\251

+abc+de-fXgh

each
22. Label the componentsGX,G2,..
Fix roots
.,0^.
vt in
G,. Join
one edge between vx and v2, one between y2 and v3, etc. There are
1 such
k \342\200\224
Also we could apply Exercise9.
adjunctions.

Chapter

5: Graphs

TREES

SPANNING

5.4.1.

Definition

tree of

if is

(a)

(b) H
A

a tree,

of

tree

trees

the

vertices

is a

that

play an

important role in many

for
exploredin the exercises

{a,6,c,d,e} and E in

which

Figure
is T

this

still

allowing

computer

algorithms

of the

definition are

V =

where

(V,E)

{(a,c),(6,a),(6,6),(6,c),(c,d),(c,e),(d,c),(d,
directed spanningtreesof G,one
(shown in Figure 5-30).

= (V,{(6,a),(a,c),(c,d),(c,e)}),

graph

Consider

represents

verticescorrespond
to
communication
links.

consequences
section.

There are many

5-29).

Example 5.4.2.
that

this

the

Consider the digraph

5.4.1.

Example

of

of G.

directed tree is calleda directed spanning

graphs. Some of

work on

(shown

G is calleda spanning

G.

Spanning,

that

a graph

H of

subgraph

and
all

contains

spanning

tree

if

stations

G in Figure 5-31(a). Suppose


the
graph
a communication
network in which the
and

the

edges

correspond

to

largest number of edgesthat canbedeleted


the stations to communicatewith
other?
each

What

is the

First observe that cycles are not necessary,


sincecycles
in which stations can communicate
all that
is needed
and

give

while

two

is one

ways
way

to

the cycle d-c-e-d gives two ways for d and e


to communicate.Namely,
the path d-c-e or directly from
d to e. If
along
the edge {d,e}is deleted,d and e can still communicate
via c. Likewise,
oneedgeof each cycle in G can be deleted. The edgesleft are the fewest
necessary to maintain communicationbetweenall stations.One way of
this is shown in Figure 5-31(b).The resultis a spanning
accomplishing
tree
of Figure 5-31(a). Of course,
for the graph
another
by deleting
communicate.

For example,

Figure 5-29

Section5.4

Trees

Spanning

481

*%d

Figure 5-30.

Tof the

tree

spanning

graph

in Figure

5-29.

of edges to eliminatecycles,we may obtain other spanning trees


G has 15 edges and the.spanning tree for
for G. Thegraph
G has 10 edges
so 5 edgeshave to be deleted.
In general, if G is a connectedgraph
n vertices
with
and m edges, a
the
5.3.3. Hence,
spanning tree of G must have n - 1 edgesby Theorem
number of edgesthat must be removed
before
tree is obtained
a spanning
\342\200\224
\342\200\224
n + 1. This number is frequently called the
must hem \342\200\224
(n
1) = m
sequence

circuit

of

rank

The

idea

following

in the above

example is the essenceof the

theorem.

5.4.1.

Theorem
contains

G.

illustrated

a spanning

until no further

cycles

nondirected

remain,

connected if and only if G


delete edges of cycles
successively
the result is a spanningtree of G.
graph

tree. Indeed,

if

then

G is

we

If G has a spanningtree T, thereisa path


Proof.
between
any pair of
G is connected.
vertices in G alongthe treeT.Thus
tree by
Conversely, we prove that a connectedgraph G has a spanning
mathematical induction on the numberk of cycles in G.Ifk = 0, then G is
connectedwith no cycles and hence G is already a tree. Supposethat all
tree. Now
with fewer than k cycles have
a spanning
connected
graphs
k
G
with
Remove
an
that
is
a
connected
edge e from
cycles.
suppose
graph

f
a%

J*J

bm-

\302\251\302\243

(b)

(a)

Figure

5-31

482

Chapter5: Graphs

hypothesis because

the inductive

since
one

The

G.

Before

Suppose

simple path in
vn_i

(b)

v09vu..

(e) If
If

(f)

T. Then

child of vn_x.
an ancestor of v,

of

subgraph

as a

designated

is an

internal

of v and

vertex
of T.
all its descendants,with

of Figure
5-19, a is designated as the
of T; i is the parentof h and j;f,h,i, and
c are the ancestors
of e; and the children

the tree

the descendantsof g; a and


of c are
bfd, and e. Moreover, the verticesa,c,e,g,and
vertices to the tree rootedat a.
If,on the other hand, we let c be the root,then a becomes

the parent

and

Search

based

algorithm

until

a cycle

on the

no cycles

proof of the Theorem

for

are

finding

known

depth-first search
The

on a
the

idea

cycles

remain.

the

and c is

tree

as breadth-first

of breadth-first

be designed

could

such

Unfortunately,

of a
search

an

to

is
of finding

algorithm

process

time-consuming
we
can
define

spanning

(abbreviated

5.4.1

other

rather

efficient

connected graph. These


(abbreviated BFS) and

DFS).

search is to

visit

all

vertices

given level before goingontothe nextlevel.Depth-first


other hand, proceeds successively to higher levels

opportupity.

a leaf,

graph. Recall from the proof that


in the graph by removing an edge

a connected

not very efficient because of


cycles. But, on the other hand,
algorithms

internal

are

Search

Depth-First

produce a spanningtree for


all that one needdo is destroy

algorithms

a.

of

from

j are leaves

and

b.d,f,h,

of u.

a descendant

root, is the subtree of T rootedat v.

j are

An

for

is a leaf of T.

T consisting

If, in

5.4.3.

Example

Breadth-First

trees

of vn.

v is

then

leaf of T, then v

not a

v is

(g) The

root,

\342\226\241

be a rooted tree with designated


root
v0.
\342\200\242
\342\200\242is a
in T and that v0-vx- \342\200\242
-vn

then a

no children,

has

then

induction.

vertices

are

of vn.
parent
are
the
ancestors
.,un_i

vn is a
If u is

(d)

cycles than G. But


tree
for G - e is also

is the

(a)

(c)

Let T

5.4.2.

u and

that

mathematical

tree by

a spanning

for obtaining spanning


other
methods
let us introduce the following
terminology.

graphs,

Definition

has

fewer

of G, the spanning

all the vertices


result follows by

describing

connected

\342\200\224
e has

\342\200\224
e has

for

G - e isstillconnected
and

cycles. Then

of the

one

sequentially
at

search,

on

the

first

Section 5.4

illustrate breadth-first searchon

Let us

5.4.4.

Example
of Figure

483

Trees

Spanning

the

graph

5-31 (a).

the ordering
of the vertices abcdefghijk.Thenwe select
a as
T and designate
vertex chosenin the spanning
it as the root
tree
T. Thus,
a. Add to T all
at this stage, T consistsof the single
of
vertex
edges {a>x}, as x runs in order from b to k, that do not producea cycle in T.
Theseedges are now called tree edges for the
Thus, we add {a,b}and {a,d}.
select

We

the first

breadth-first searchtree.
Now

the process
for all vertices on level one from
each vertex in the designatedorder.Thus,
since

repeat

examining

level one, we
For

{b,c}as a tree edge.Then

the edge

include

we

by

edge {d,c}sinceits inclusion

would

produce

{d,e}.

Next,

the

consider

we

include

and

{e,/}

root

by

d are

at

b.

examine

first

the

b and

at level

vertices

d, we reject the
T. But we include

for

a cycle in

two. Reject the edge {c,e};

{e,g}.

Then repeat the procedure again for vertices


on
{f,g], but include{f9h). At gy reject {fyg] and {g,h}.

three.

level

Reject

On levelfour, include
{hfi}> {h,j\\, and {h,k}.
on level five at i, j> and k, but
the
Next, we attempt to apply
procedure
ends. The
so
no edge can be added at thesevertices
the
procedure
the
and k,
includes
vertices
spanning tree T therefore
afb,cfdfefffg>hyij,
and
and the edges{a,6},
{a,d},
{d,e}, {e,/}, {e,g}, {f,h}> \\h,i},
{6,c},
{hj}y
ML

The edges

that wererejectedin

edges. Clearly,

us give

let

Now

Algorithm5.4.1.
Input:

Output:

connected

A spanning

(Start)

2. (Add

Let

vx be

Search

Breadth-First

graph

G with

tree T

Method:

1.

search

breadth-first

partitions

the edges

are called cross


of the graph G

of tree edgesand crossedges.


a formal description of breadth-first search.

two sets

the

into

the

search

breadth-first

the root

for

a Spanning

vertices labeled

vuv29..

Tree.
.,u\342\200\236.

for G.
of T. Formthe set V

new edges.) Considertheverticesof V

in

{vx}.
order
consistent

with

the original labeling.Thenfor each vertex x G V, add the edge {xfvk}


k is the minimum
to T where
index
such that adding the edge {x>vk}
T
then
to T does not produce a cycle.If no edgecan beadded,
stop;
is a spanning tree for G. After
been
all the vertices of V have
in order, go to Step 3.
considered
3. (Update
V by all the children v in T of the vertices x of
V.) Replace

484

Chapter

5: Graphs

the edges

V where

Step2
An

search is

to breadth-first

alternative

Example 5.4.5.

2. Go back and repeat

in Step

added

were

{xyv}

set V.

new

the

for

depth-first search.

how to find a depth-first search


Figure 5-31(a).
in
As
breadth-first
choose an ordering of the vertices,say,
search,
a as the root of T. The vertex
a is said to be visited.
Select
abcdefghijk.
Next, we select the edge {a,x} where x is the first label in the designated
order that doesnot form a cycle with those edges already chosenin T.In
this
we add the edge {a,6}.The edge{afb} is now said to be examined
case,
a is the parent of b and b is the
and becomesa treeedge.In this context,
child of a.
In general,while we are at some vertex x, two situations arise:

spanningtree for

the

situation,

two

on

ordering

In

edge
vertices

this

Case 1. If y
a tree

y is

where

{x,y\\,

present

been

the first

themselves:
visited, visit

previously

continue the searchfrom

edge, and

edges incident on x, then


vertex in the designated

{x,y}is unexamined.

for which
cases
not

has

unexamined

some

are

there

the

consider

G in

graph

Situation 1. If
we

illustrate

us

Let

the

y, select{x,y} as
the parent

case, x is

In this

y.

ofy.

Case 2. If
{x,z}

visited
previously, then reject the
and proceed to select anotherunexamined

been

has

it examined,

consider

on x where

incident

z is the

unexaminededge.Eachsuch

searchis called back


a

In the

select

and

{x,y},

edge

{x,z} is

an

context of depth-first

edge.

example at

searchat c,

in the

edge

rejected

which

for

vertex

first

edge

hand, we
{c,d}.

select

would

Then

we would

the edge {6,c}, continue the


continue the searchat d and

the edge {d9a}and then selectthe edge{d9e}. At e, we reject the


reject
in this
we select {/,#}, reject
manner,
edge {e,c},select{e,/}.Continuing
first

select
{g,e}

reject

this

waare

{gyh}>

At

point,

examined, then
from

the

parent

return

we

of x.

scanned. Moreover,

backtracking.

and select

presented

with

{h,i}.
a second

If all the edges incident

2.

Situation

{hj},

to

the

parent

The vertex x

the processof returning

is

situation.

general
x

on

of x

said

now

to

have

already

been

and continuethe search


the

to

parent

be

completely
of x is called

Section

5.4

Spanning

Thus, in the example that


unexaminededgesat iy we must

considering,

to h and

backtrack

Actually,

485

since there are no


continue the search

we select {hJ] and {j,k}and, finally,


reject
we are through, because there are no

Then

h.

from

are

we

Trees

{k,h\\.
more

unexamined

had limited vision


(as a computer
may have), we may be
there are no unexamined edgesat k. Therefore,
aware
we
to Situation 2, to j. But then we must
to
backtrack
backtrack,
according
h, etc. Eventually we must backtrackallthe way back to the root a.
In general,depth-first searchterminates
when
the
to
search
returns
the root and all verticeshave been visited.
As before, let us give
of the depth-first search
a formal
description
But if we
only that

edges.

algorithm.

Algorithm5.4.2.
Input:

Output:

connected

graph

A spanning

for

Search

Depth-First

G with

tree T for

a Spanning

vertices labeled

vuv2t..

Tree.
.,un.

G.

Method:

a vertex.) Let vx be the root of T, and set L - vv (The name L


stands for the vertex last visited.)
an unexamined
(Find
edge and an unvisitedvertex adjacentto L.)
Forall vertices adjacent to L, choose the edge {L,vk}, where k is the
minimum index suchthat adding {L,vk\\ to T does not create a cycle.
If no suchedgeexists,goto Step3;otherwise,
add
{L9vk} to T
edge
2 at the new value
for L.
and set L = vk\\ repeat
Step
(Backtrack or terminate.) If x is the parentofL in T, set L = x and
apply Step 2 at the new value of L. If, on the other hand, L has no
parent in T (so that L = vL) then the depth-first search terminates

1. (Visit
2.

3.

and T is a spanningtreefor

Minimal

Spanning

G.

Trees

and in order to
The application of spanningtreesaremany
and
varied,
gain some appreciationfor this fact, we will describe what is sometimes
we have a collection of n
that
calledthe connector
Suppose
problem.

cities, and that

we

wish

to

construct

utility,

communication,

or

that
we know
connecting all of the cities.Assume
the cost of building the links
each
between
pair of cities and that, in
addition, we wish to construct the network as cheaplyas possible.
The desirednetwork
can
be represented
by a graph by regardingeach
as a vertex
and by placing an edge between verticesif a link runs
city
cost of
the
between
the two corresponding cities. Moreover,
given

transportation

network

486

Chapter5: Graphs

The

the total

minimize

minimal cost, it

be

cities

between

a link

constructing

the edge{vifVj}.

and

vt

then,

problem,

vjt we

can assign

cost of construction.IfMisthe graph

is essentialthat

the weight ci;to

design such a network

is to

for all

be connected

of

so

a network

as to

of

of the citiesareto

it is also necessary that there be no


for
otherwise
we
remove
can
an edge from a
graph M,
reduce
the total cost by the cost of construction of
circuit and thereby
that
of the
tree
Hence, a graph of minimal costmust bea spanning
edge.
n
of
the
vertices.
graph
a network
at minimal cost can now be
Thus,the problemof building
in general terms. Let G be the graph
of all possible
stated
links between
the cities with the nonnegative
cost of construction C(e) assignedto each
edgee in G. Then if H is any subgraph of G with edges eb.. .,em the total
connected

links.

by

in

circuits

Moreover,

the

= %Zi C(et). A spanning


H is C(H)
costof constructingthe network
tree
T where C(T) is minimal is calleda minimalspanning
tree
of G.
It should be clearat this point that finding
to the connector
a solution
is
to
a
for a connected
minimal
tree
problem equivalent finding
spanning
G
where
G
is
with
each
of
labelled
a
cost.
graph
edge
nonnegative
Now let us describean algorithmthat will, in fact, construct
a minimal
is
tree.
The
known
as
KruskaVs
spanning
algorithm
Algorithm (after the

mathematicianJ. B,

Jr.).

Kruskal,

Kruskal's

5.4.3.

Algorithm

Algorithm for Finding a Minimal

Spanning Tree.

Input:

A connected

graph G with

values

nonnegative

assigned

to each

edge.

Output: A

minimal

tree

spanning

for G.

Method:
of minimal
value that is not a loop.Thisisthe first
value,
(If there is more than one edgeof minimal
choose one of these edges.)
arbitrarily
does not
that
Selectany remaining
edge of G having minimal value
included in T.
the
form a circuit with
already
edges
Continue Step 2 until T contains n-1 edges, where n is the number
of G.
of vertices

1. Selectany
edge

2.
3.

edge

T.

of

We leave it to the readerto verify


produce a spanningtree. Letus call

economytree.The point
minimal

Suppose

that

maximum

tree

spanning

or

of

problem

minimal).

the

and thus
calls

Suppose,

that

any

tree

this

does, if fact,
by this process an

algorithm

obtained

is that an economytreeisa
connectorproblem.
for finding an optimal solution (either
to
further, that an algorithm is designed

next

theorem

solves the

Section

5.4

make the

optimal choicefrom

at each

data

available

the

487

Trees

Spanning

stage

the

of

such an approachis calleda greedy


the
first
heuristic
algorithm is usually
algorithm
solutions
one may try to implement and it does lead to optimal
of a greedy
but not always. KruskaPs algorithm is an example
sometimes,
that does, in fact, lead to an optimal solution.
algorithm
based on

Any algorithm
process.
A greedy
algorithm.

Theorem 5.4.2.
labelled

are

Let

by nonnegative

be

graph where

a connected

numbers. Let T be an

obtained from KruskaPsAlgorithm.

T is

Then

the edgesof

economy

a minimal

tree

of G

spanning tree.

Proof.

As
for each edge e of G, let C(e)
the value
denote
before,
to
the
the
assigned
edge by
labelling.
If G has n vertices, an economytree T must
n - 1 edges. Let the
have
be
in
chosen
as
KruskaPs
edgeselfe2f...,e\342\200\236_i
Algorithm. Then C(T) =
Let
be
a
minimal
G.We show that C(T0) =
treeof
2\302\243ll
T0
C(et).
spanning
and
thus
T
also
conclude
is
minimal
that
C(T),
spanning tree.
If T and T0 are not the same let et be the first edge of T not in T0. Add
the edgee(to T0 to obtain the graph G0. Suppose e, = {a,b}.
P
Then
a path
from a to b existsin T0 and so P together with
in
a
C
circuit
et produces
G0
no circuits,
there must be an edge e0
by Theorem 5.3.4.SinceT contains
in C that
is not in T. The graph Tx = G0 - e0 is alsoa spanningtree of G

since

Tx has n

\342\200\224
1

edges.

Moreover,

C(TX) =
However,

we

tree of G.Thus,

know

C(T0) + C(ed -

that C(T0)

C(TX)

<

- C(T0)

C(TX)

T0 was

since

- C(c,-)-

C(e0)

C(e0)

a minimal

spanning

* 0

implies that

C(e,-)* C(e0).
T was constructed
since
However,
by KruskaPs algorithm, et is an edge of
without
smallest value that can be added to the edgesel9e29-.
.,el-_1
a
if
circuit.
is
to
the
added
Also, e0
edges eue29...,^_i, no
producing
is a subgraph
of the
circuit
is produced
because the graph thus formed
tree T0. Therefore,C(et)- C(e0), so that C(TX) - C(T0).
We
have
from T0 a new minimal spanning tree Tx such
constructed
the number of
that
T exceeds
the number of edges commonto 7\\ and
commonto
T
and
one
edges
T0
by
edge, namely e(.
another minimal spanning tree T2
to construct
Repeatthis procedure,

488

Chapter

5: Graphs

Figure 5-32
one

with

more

in common

with

this procedure,
in common

with

edge

was in common

T than

between

7\\

andT.

continuing

By

tree

all

with

edges

we finally

itselfa minimalspanning tree. D


The

Example 5.4.6.
the

cities

in Figure

the use

illustates

example

following

Determine

the
we

{6,c},
edges
have
options:

the selection
{a,b}-

{a,g}

3
4
5

led]

\\b.c]

cost

for

fee}
{aM
{a,d}

15

\\f,h\\

15

\\g,h}

15

15

15

18

{d,f}, {a,g}, {c,d},{c,e}.


we may choose only oneof {a>b\\

of both createsa

3. Likewise we may

choose{/,M.

of minimal

Cost

if.g}
Choose

network

a table:

{d,f}

Then

of KruskaFsalgorithm.

railway

Edge

1.

thus

5-32.

We collect lengths of edgesinto

2.

minimal spanning
we conclude that T is

at a

arrive

and

T,

choose only

one

circuit.

Suppose

of

{g,h} and

that

and

we

for
choose

{a,d}

{/,/*}- Suppose we

Section

5.4

Spanning

4. We then

as illustrated

tree

a spanning

have

\342\200\242

*\342\200\242

\342\200\242/

5-33

Figure

minimal

in Figure 5-33.

g^

The

489

Trees

cost for constructionof this treeis

3+

5 +

5 +

5 +15 +15 = 52.

ExercisesforSection
5.4

1.

G in Figure 5-34. Which


Consider
the
graph
Figure 5-35 are spanning treesof G and why?

Figure

of

the

graphs

a-f in

5-34

e%-

(a)

(b)

Figure

5-35

-\342\200\242d

(c)

5: Graphs
*\342\200\242-

(e)

(o
5-35 (Continued)

Figure

2. Provethat

graph

\\V\\-1-\\E\\.

3.

that

Prove

4. Prove

is a

a tree

only

if G

is connected

tree

is a

if and

and

1.

only if G has fewer

vertices.

5. Suppose that G
the complement

is a connectedgraph.Provethat
of any

of

spanning

3 algorithms,
vertex
orderings

tree

spanning

the complement a spanning


6. Find
trees
for each
all

and

if

connected graph then| E | > | V

that a connectedgraph G
than

edges

if G

G is

tree

of the

have

any

an edge in

circuit

and

common. Is

spanning tree?
graphs in Figure 5-36by

also a

BFS, DFS, and destructionof cycleswith


abcdefg and gfedcba.

using
the

e
\342\200\242

(b)

(a)

Figure 5-36

7. Determine the different


graph in Figure 5-37.

nonisomorphic

spanning

trees

for the

5.4

Section

Spanning

Trees

491

Figure 5-37

8. Definethecircuitrank of a disconnected
graph to be the sum of the
Derive
circuit ranks of all its connected
a formula
for
components.
E
the circuit rank of G involving
and
C(G).
|
|, | V|,
9 Letv0-Vi-. \342\200\242
.-ym be a path of maximal length in a connected
graph
G. Prove
that
connected
G-v0 is connected. Concludethat any
contains
a vertex that is not a cut vertex.
graph
10.If the intersection
H of a collection of subtrees of a tree T is
H is a subtree of T.
then
nonempty,
11 Let H be a subgraph
of a connected
graph G. Showthat H is a
of
TofGiSH
some
tree
contains no cycle.
subgraph
spanning
12 Describehow to obtain all possiblespanning trees for the following
the total number of different spanningtrees:
andjist
graphs

\342\200\242

\342\200\242

(b)

Figure

(a) Cn, the

n-cyclegraph.
G in

(c) The

graph
graph

(d) The

star graph Kltn.

(b)

(e)

The

The

5-38

tetrahedron

(f) The wheel W5

Figure 5-38(a).

in Figure

5-38(b).

W4.
of

order

5.

492

Chapter 6: Graphs
13.

a minimal

Find

spanning tree

for

of

each

the

in Figure

graphs

5-39.

(c)

(b)

(a)

14.

connecting

to build

wishes

company
its

7 branches.

an intercommunication

The distances

are

in

given

system
the

following

table.

a
b

20
0

42

31

26

35

41

28
29
33
34
0

29
24
22
36

41
0

33

31
38
40

32

26

493

Spanning Trees

For example,the distancefrom


(a) Find the cheapest
way
(b) Find the total cost.
(a)

Define

(b)

Then

16.

KruskaPs
finds a

C(e). If

graph such that

no two edgeshave
for

method

(Another

methodis based

on

it is

unless

same

the

let us

delete one by

(a)

(b)

graph

greedy

one

that

fact

each edgee has

cost,

a positive

a minimal spanning
it is foolish to use a

insure the connectedness


of the
those

costliest

edges whose

cost

G has a unique

prove that

tree.) This
costly

graph.

edge

Thus,

deletion doesnot

graph.

why

Explain
connected

finding

the

needed to

disconnectthe

the system.

by a maximal spanningtree.
so that one has
algorithm

minimalspanningtree.

17.

k times

maximal spanning tree.


tree for the graph in exercise1(a).
spanning

a connected

G be

Let

build

to

is meant

what

modify
that
algorithm
Find
a maximal

(c)

the costof

between them.

the distance

15.

a to / is 29. Suppose that


2 branches is someconstant

between

of lines

construction

this process

gives a spanning tree for

any

G.

that
this
proof of Theorem 5.4.2to show
process
a minimal spanning tree.
a minimal
spanning tree for the graph in Figure5-40using
in (a).
described
process

the

Modify

produces
(c)

Find
the

Figure 5-40

18. (a) Provethat

any
edge of a connected simple graph G is an
spanning tree of G.
for any ttoo edges of a simple connected
that
graph
is a spanning tree containing the two
edges.

edge

of some
(b)

Prove

there

Kruskal.

G,

Hint:

494

Chapter 5: Graphs
19.

the following:

Disprove

G with
connected simplegraph
more than 2 edges has a
unique minimal spanning tree, then the costs of all the edges
are distinct.
Given
G, there
any 3 edges eue2yezof a simpleconnected
graph
is a spanning tree of G containingeue2,and
e3.
G have
a
Any two spanning trees of a simple connected
graph

(a) If a

(b)

(c)

common

edge.

T is a spanning tree for G,


and
(d) If G is a connectedsimple
graph
there
is an ordering on the verticesof G so that BFS
then
tree.
produces T as a BFSspanning
G
(e) Different
orderings on the vertices of a connectedgraph
different DFS spanning trees.
produce
always
20. Prove that if a simple connected graph G has only one spanning
tree, then G itself is a tree.
21. (Prim's
a minimal
algorithm
for
spanning tree,) Let G be a
to each edge.
connected
with
values
nonnegative
assigned
graph

First, let Tbethe

tree

of any

consisting

vertex

a circuit

form

T. The processterminates
after

it to

wheren

22.

Tx and

be an

let e

and do not

cost

selected

have

all

G. Among

and

add

- 1 edges

|V(G)|.

of the

Let

we

of

in T

algorithm to obtain minimal spanning trees for


graphs in Figure 5-39 and 5-40.
G and
T2 be spanning trees of a simpleconnected
graph

Prints

Apply
each

vv

T that are incident


on a vertex
when added to T, select oneof minimal

the edges not in

edge of Tx

not

in T2.

that there is a spanningtree T3

(a) Show

but oneedgeofT2.

of

G containing

e and

all

that
a sequence
of
Show
Tx can be transformed into T2 through
one by removing one edge
trees, each arisingfrom the previous

(b)

and adding another.

23.

24. An

an

edge e

endpoints

depth-first

search spanning

n-cycle.

= {a,b}of a graph G
a

b are

and

multigraph

resulting

and

search

breadth-first

Compare

trees for

is denoted

if it is deleted and the


When an edge is contractedthe
e. If e = {ayb}
is not
a loop,
by G \342\200\242

is contracted

identified.

observe that

(a) \\V(G.e)\\= \\V(G)\\-l


(b)

\\E(G-e)\\

= \\E(G)\\-l

of G = C(G \342\200\242
e)
(c) C(G) = the numberof connectedcomponents
= the number of connected componentsof G \342\200\242
e.
Let
T(G) = the number of spanning trees of a connected
G.
Then for an edge e of G that is not a loop, prove:
graph

Section

5.4

Spanning

(d) T(G

- e) is the number

of

(e)

is

There
spanning

spanning

(f)

Use (d)

of G

trees

spanning

containthe edgee.

that do not

a one-to-one
correspondence between
of G containing
trees
the edge e and
e.
trees
of G \342\200\242

and (e) to

concludeT{G)= T(G -

e)

495

Trees

the set of

T(G

the set

of

. e).

that a tree is a bipartitegraph.


1 in a connected simple graph
that v is a vertex of degree
Suppose
G and
that the edge e is incidenton v. Explain
why each
suppose
spanning tree of G must contain the edge e.

25. Show
26.

27. Let vltv2t..


such
that

(a)

and let dlfd2f.. .,dnbe positive


integers
2.
We
know (see Exercise11ofSection5.3)
2^x dt
is a tree T with
there
vertices
-,un where deg(^) = dt.
vlfv2,..
is
Prove by induction
on n that the number of such
trees
be n
.,t>\342\200\236

vertices

= 2n

that

- 1)!.. .(<*\342\200\236
1)!]

2)!]/[(d,

[(\302\273

the number of

(b) Use (a) to prove that


nn~2.

(This

28. Let Tbe

tree

classical result

is a
with

vertices

trees

spanning

of Kn

is

due to A. Cayley.)

vuv29..

T we

With
.,u\342\200\236.

associate

the

Delete the vertex


as follows:
sequence (tl9t2t.. .,\302\243n_2A-i) obtained
1
let
be
the index
of its
of
with
the
least
index
and
tx
degree
vSl
neighbor. Let vS2 be the vertex of degree one in T - vSl of least index
so
and let t2 be the index of its neighbor in T - vSl. Delete
vS2 and
on, repeating this processuntil a treewith only one vertex remains.
n - 1 integers
of
This produces a sequence (tut2,...,tn_2itn_x)

called the Prilfercode


(a)

Note that

deg(^)

(b)

(c)

tn_x

of

= n.

- 1 timesin

T.

Observe

that the

(tut2,..

.,\302\243n_i).

In particular,
the vertices of T of
vertices whoseindicesdo not appear
Show

that

is the

(4,3,5,3,4,5,8)

index of

degree

a vertex

precisely those
Prufer code of T.

1 are

in the

Prufer code

tree:

\342\200\242
v,

v2#

>v7

#'v8

vt occurs

>v6

of

the

following

496

Chapter

5: Graphs

(d)

the Prufer

Obtain

code for

following trees:

of the

each

v4\302\273

\342\200\242V2

v5#-

-\342\200\242
v3

v*i

v7 %'

v8
^# \342\200\242

v8

v6<

i; v,

V7(

\342\200\242
v9

vI2
\342\200\242

(a)

(e)

(f)

(b)

Observe that the edges of T arejust the edges


{v8i, vt.} where
are the indices of the verticesremovedand t{ is the
sl9s29.\342\200\242
-Ai-2
index of the neighbor of v8i.
Observe
that st = min {k | 1 < k < n and k does not occur in

(tut2,...,^-2)},

\302\2532 min

{slys2,...,Si_l9ti9ti+l9..
1 <

where

sx

s9 - 8.
Then

t{;

<

= 1,

if we

a Prufer

v4

3,

the vertices

v5

c\302\273\342\226\240
rw

that

s,

in general

and

min

0.

{k\\k

code (^,t2,..

.9tn_x)

the

tn_x = n determines the indicesof


(3,4,4,5,5,6,6,8,10)
v8.. For example,
2, sz = s4 = 4, s5 = 7, s6 - s7 = 9, ss =

connect

v2

.^\302\273-iIK

n and

s2 =

v3

Note

{sl9t29..

Thus

.,tn_i}}.

vertices

removed
determines

{k\\k$

be defined recursively by

S; can

< \342\226\272 v7< \342\226\272.

the Prufer

5,

v8.

to

ut. we

obtain

6,

the tree

v6
-* p

V9, >

code of this treeis (3,4,4,5,6,6,8,10).

Section

5.4

Spanning

(g) Given the following

use

sequences,

the process

to determine the indicesofthe removed


the tree for which the given
sequence
(i) (1,4,4,5,6)

described in (f)
obtain

Then

vertices.

is its

497

Trees

Prufer code,

(ii) (1,4,4,6,6)
(1,4,4,5,6,5,7,7,10)

(iii)

of sequences
number
= n is
obviously nn~2.

The

(h)

tn_i

we obtain

Thus,

are nn~2 spanning

Selected

1. Only

and

(c),(e),

3. A connected

^ < n

and

code

of a

of

Kn.

there

trees of Kn.

5.4

for Section

Answers

1 <

such
and spanning trees
sequences
that
another proof of Cayley'sformula

between

correspondence

where
.,\302\243\342\200\236_i)

Moreover,there is a one-to-one

tree of Kn.

spanning

(tut2t..

Each of these is the Prufer

(f).

graph has a spanning tree with

1 edges.

removing

edges

V\\

4. Apply Exercise3 and Exercise2.

5.

how

Recall

to

a spanning

obtain

tree by

from

circuits.

8. If

Glf.. .,Gkarethe componentsof G,and

|V(G,)|then

Yl (mi

n>i

1) circuit

= m_

rank of

C(G)

-|tf(G)|-|V(G)|+C(G).

(e)

if ra,

= \\E(G)

| and

nt

Chapter 5: Graphs
{dye}, {d,f}, {b,e}t{a,c}y and one of {a,/}, {e,/}, and {a,e}.
for a
of edges. The result is obvious
on the
number
20. Useinduction
k
graph G with
graph with 0 edges. Suppose for any (connected)
G is already
a tree.
that if G has only one spanningtree,then
edges
Consider a graph H with only one spanning tree and having k + 1
edges.If H is not a tree, H contains a circuit (becauseH must be
one edge ex from the circuit,Hx = H - ex is
Remove
connected).
tree for Hx is also one for H. By
still connectedand any spanning
the inductive
hypothesis Hx is a tree, and henceis the unique
tree of H. Replace ex and remove another edgee2 of the
spanning
circuit in H. Get a new spanning tree H2 for /f. This contradiction
17.

(c)

Delete

proves the

(k + l)th case,and

the

result

is proved

by mathematical

induction.

DIRECTED TREES

The

arises:

now

question

directed

spanning
of directed trees

tree? The

and

of

what conditions does a digraph have


answer requiresus to give a characterization

Under

connected

quasi-strongly

graphs.

Two vertices u and v of a directed graph G are


Definition
5.5.1.
saidto be quasi-strongly connectedif there is a vertex w from which
to v.
there is a directed path to u and a directedpath
u to v then certainly u and v
Of course, if there is a directed path P from
are

quasi-strongly

connected,

then there is the trivial


from

path

because
with

we may take w to
from u to u

no edges

be

u itself,

and the path

and
P

u to v.

The graph G is said to be quasi-strongly connected if each


of G is quasi-strongly
connected.
It should
be clear that if a directed
graph G is quasi-strongly

pair

of

vertices
then
connected,

the

underlying

nondirected

digraph in Figure 5-41(a)


digraph in Figure 5-41(b) is not.
The

graph

is

will

quasi-strongly

be

connected.
but

connected,

(b)

Figure

5-41

the

Section

Directed Trees

5.5

499

In the graph of Figure 5-41 (a) the vertex e is specialin the sense that
a directed path from e to every other vertex. By no meansis this

there is

accidentalas

shown

theorem.

following

Let G

5.5.1.

Theorem

the

by

be

Then the

a digraph.

following are

equivalent:

1.

G is

connected.

quasi-strongly

2. There is a vertex r in G such


all the remaining vertices of

there is

that

a directed path from

r to

G.

G is
that
(2) implies (1). On the otherhand,
suppose
i
ts
There
is a
vertices
connected
and
consider
vifv2t..
.,un.
quasi-strongly
vertex w2 from which there is a path to vx and a path to v2. Likewise, there
is a vertex w3 from which there is a path to w2 and to t>3, and so on until
we conclude
that there is a vertex wn from which there isa path to
finally
to vn. Clearly,
there
and
a path
is a directed path from
wn to each
wn_x
vertex Vi of G since wn is connected
to vuv2t.. .,un-i through wn_v
Thus,
Proof.

Clearly

(2).

(1) implies

\342\226\241

in
present
a directed

We

characterizations
of

the next theorem a number of equivalent


to and dependent
tree. These are both analogous

Theorem5.5.2.
1. G

2.

4.

is

r in G such that
vertex of G.
other
every

of r

in-degree
v

7.

is zero (that

Then the

1 for

each vertex

=\302\243
r, and

Proof. (1

\342\200\224*
The

(2\342\200\224*
3)

By

quasi-strongly

a vertex r suchthat
deg+(i>)

= 1

the

for each

=\302\243
r.

- e is not

is, deg+(r)= 0) and

has

a vertex

2)

Theorem
connectivity

circuits and no
that deg+(r) = 0 and

directed

no

r such

=\302\243
r.

quasi-strongly connected without


There is a vertex r suchthat
deg+(r)
vertex

and contains

G is

quasi-strong

vertices.

there is a unique directedpath

edge e of G.

G has no circuits (that is,


nondirected circuits)and has
deg+(v)

6.

> 1

with

and

connected
connected

quasi-strongly

vertex
5.

be

a vertex

is

r to

G
is quasi-strongly
for each
connected
G

a digraph
equivalent:
G

is a directed tree.

There

from

3.

Let

are

statements

following

upon

5.3 characterizingnondirectedtrees.

in Section

the results

the underlying

circuits.

and deg+(i>) = 1 for each


nondirected graph of G is a tree.
= 0

r in G satisfies the property.


5.5.1, G is quasi-stronglyconnected.Suppose
is
when some edge (ufv)
i, not destroyed

root

500

Chapter

5: Graphs

removed. Then thereisa vertex

oneto

w such

there are two directed paths,


uses the edge(u,v). Thus, in G

that

neither of which

to v,

one

and

w to v and hence two distinct


from
two distinct directedpaths
directed paths from the root r of G to v. This contradicts
(2).
We leave the proof of (3 \342\200\224\342\226\272
4) to the reader.
sum of the in-degrees is equal to n - 1. Therefore,
(4 \342\200\224*
5) The
by
the
nondirected
Theorem 5.1.1, G has n - 1 edges.
Clearly,
underlying

there are

Theorem 5.3.5 implies that G is a tree


Therefore,
graph G is connected.
and hence has no cycles.Thus,G has no cycles and likewise no circuits.
since
the sum
6) By Theorem
(5 \342\200\224*
5.1.1, the graph G has n edges
1. Since
G has no circuits the underlying
of the in-degrees is n \342\200\224
thereis a
G * must t>e a tree.
nondirected
*

Thus,

graph

the vertex r to every

path from

nondirected

any path P

from

vertex

another

to

directed
path from r to v,
would have in-degree
path

for

otherwise

v we assert
at least one

greater than 1, contrary

G is quasi-stronglyconnectedby Theorem
The ideas of the proof of (6\342\200\224*
7) are
the

Moreover,

proof

(7\342\200\224*
1)

We

5).
proof of (4 \342\200\224*

path
such

that

know

is the following.

is, in

path

not destroy

G will

if we

Therefore,

let
and

and

connected

Theorem

5.5.2, there

us
also

some related

discuss
study

two special

Definition5.5.1.

is not

the

root

directed

Theheight ofa vertex

in

of

quasi-strongly

a directed

are edgeswhose

these edgesfrom

tree,

removal

the quasi-strongly connectedproperty

remove successively all

graph is a directed spanning tree.

resulting
Now

3 of

statement

if and

tree

G has
a directed
spanning tree T then obviously
the conditionsof Theorem5.5.1so that G is

Conversely if G is quasi-strongly

trees,

fact,

a nondirected graph G has a spanningtree if and only if


The corresponding
theoremin the case of directed graphs

Proof. If
T satisfies
connected.

from

to any

from r

A digraph G has a directedspanning


5.5.3.
is quasi-stronglyconnected.

Theorem

only if G

by

the

since

for

(5\342\200\224*
6),

\342\226\241

G is connected.

then

a
the

5. Thus,

statement

in the

G* is a tree thereis a unique simple


G. As above, we can observethat any

of

vertex

directed.

that P is, in fact,


of the verticesin
to

underlying graph
other

Now for

of G.

5.5.1.

contained
in
contained

is

simple

unique

vertex

other

G,

of

then

G.

the

combinatorial facts about directed

classes of directed trees.


forest

a directed

is a collection of directed trees.


forest is the length of the longest

Section

directed path from


of its

height

v to

root. We

501

Trees

Directed

5.5

a leaf. The height of a (nonempty) tree isthe


adopt the conventionthat -1 is the height of the

empty tree.

The level ofa vertexv in a forest is the length of the path to v from
root of the tree to which it belongs. A directed
T is said to
tree
k if k is the maximum of the out-degrees
ofallthe vertices
degree
5.5.1.

Example

Tu

trees,

T2> and

Tx = ({a,6,cUi),
T2 = ({d},0),

^3 -

in Figure

shown

is

forest

consistsof three

the
have

T.

in

5-42. This forest

T3.

where

Ex

{(a,6),(a,c)}

and
where

({eyfygyhyiyjyk}yE3)y

\302\2433 {(eyf)y(eyg)y(gyh)y(h9i)y(hyj)y(hyk)l

The root

of Tx

the parentof

the root of T2 is
and
a child of e. Vertex g

d,

is a,
h

and

root

the

of T3

is e. Vertex g is

is the properancestor

of

hy

iy

jy

same thing as saying


that
hy iy jy and k are proper
descendants of g. The leaves of this forest are 6, c,d, /, iy jy and k. The
vertices with height 1 are a and h, and the only vertex with height
2 is g.
Tx has height 1, T2 has height
0, and Ts has height 3.Theverticesat level
0 are a, d, and e. The verticesat level
1 are 6, c, /, and g. Vertexh is the
2, T2 has degree 0, and T3 has degree
only vertex at level 2. 7\\ has degree
k9 which

and

is the

3.

The
height,

relationships between the degreeof a tree,


such
of verticesin it, and severalotherparameters,

combinatorial

its

the number

as

*A

Level 0

e
\342\200\242

\342\200\242d

X
K
Level

T
b\302\273

\\7^7

\342\200\242\302\243

> Height
1

\302\273

Level:

>
Level

/
IA
.

3 -

\\
\\

\\

\\*|

Figure 5-42.

forest.

= 3

502

Chapter

5:X3raphs

the number of leaves, are of great interestin computer


applications,
because
Some
of
they influence the time and storagecostsofalgorithms.
will be explored in the next few theorems,
these relationships
and others
will be derived in the exercises.
about
trees
facts
are most naturally derived by meansof
Combinatorial
For example,
recurrence
the
relations.
suppose one wishes to know
of vertices L(fi,fc) in the fith level of a (nonempty)
number
maximum
directed tree of degree k. Sincefor fi = 0 there can be only one vertex,
which
is the root, it follows that

L(0,k) = l,forall/2.

For

fi

> 0,

vertex at level fi is the child of a vertex


l,k) vertices at level fi - 1, and each
follows that

each

are up to L(fi

It

children.

L(fi,fe)

L(fi

of level fi - 1. There
of them has up to k

\342\200\242
*.

1,*)

= fce, which
solution
to this recurrence relationis L(fi,fc)
can be easily
= 1; fc8-1 \342\200\242
k = k*. This
verified by induction: k\302\260
reasoning proves a

The

theorem, which

we

now state.

shall

5.5.4. There arebetween


degree k.

Theorem

It is also
entire
for

to

interesting

a tree

tree,

as

fi

in

any

directed
special

\"compact.\"

number of verticesin the

if

8-0

8=0

each

Lh + 1 _

is as full

level

tree

the

last

as possible,the

-I

\342\200\224
\302\261

the proof of a theorem,which

below.

is given

(The

an exercise.)

Theorem 5.5.5.
Two

at level

vertices

and degree k. In such

half of

constitutes

rest is left

in a

fcfi

maximum

the

know

of height h

nonempty level is level h, sothat,


in the tree is
number
of vertices

This

0 and

tree of

directed

There

are

k and

h +

between

tree of height h and degreek.


of directed trees are
is, they are no taller than

kinds
That

this, it is possibleto get a tighter


in termsofthe height
and
the

lower

degree

- 1

of interest becausethey
they

bound

of a

kh+1

\342\200\224\342\200\224\342\200\224
vertices
~~

tree.

need

on the

to be.

are

Because of

number of vertices,

Section5.5

Directed

5-43.

Figure

5.5.2.

Definition

the

maximum

(exactly

of degree k has
vertices in each level,

tree

(directed)

complete

3.

fce) of

The tree in Figure 5-43is a completetreeofdegree

5.5.2.

Example

of degree

last.

the

possibly

tree

complete

number

possible

except

503

Trees

3.

between

There are

5.5.1.

Corollary

kh

- 2

andJ

A-i

vertices

in

Proof.

We

tree of

directed

a complete

know

already

kh+1

nrrr

degree k and heighth.

that
-

feh+1

k-1

is an upper bound on the number


of vertices,
from Theorem
is full except for the hih level,and that must have
level
vertex, the number of verticesin the entiretree is at least
every

l +

8-0

g-0

5.5.3.

Definition

directed

+ Efe'-i

^Ltf^-i

A B-tree

tree such that:

1. allthe

leaves

are

at the

^r-^^r2\342\200\224
\302\253
1

\342\200\224
1
\302\253

of order k, (or a fc-way

5.5.5. Since
at

least

one

B-tree)

is a

same level;

the
has at least
2. every internal vertex, exceptpossibly
root,
[xl
means the least integer > x.)
[k/2l \342\200\242
(here
children;

504

Chapter

5: Graphs

/l\\

//\\\\

/l\\

\342\200\242
\342\200\242 \342\200\242
\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\
\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242\342\200\242

(b)

(a)

5-44.

Figure

3. the
4. no

root is a leafor has at leasttwo children;


morethan k children.

Example5.5.3.

vertexhas only

two

B-trees

have

sequentialfiles.

value

Exercises

for

is desirable,

5.5.6.
leaves,

be

cannot

a B-tree.

children, but

vertex

has five

is less

than T5/21.

since the costto access


with

of

B-tree

for /i >

Its

another

vertex

one

is high,

k.

height h has at least

k and

order

1.

The proof is by

Proof.
exercise.

which

increasesignificantly

Theorem
\342\200\242
[k/2lh-1

one

since

5-44, only (a) is a

shown in Figure

4. Tree (b)

in implementing
indexed
applications
for directories of files stored in disk systems.A

important

for k

but does not

trees

3 or

children,

are used

They

two

(a) is

the

Of

order

and

vertex has

of tree
B-tree.The
order must be at least5,

large

non-S-tree.

and a

B-tree

on h,

induction

and is

left to the readeras an

\342\226\241

Section

5.5

l.(a) Draw a directed tree of

one, exactly
3, and

(b)

How

being

directed

many

up to
the

at level 4.
are there

trees

that

fit

the

description

same).

3. Deriveformulaefor
a directed

at level

isomorphism (that is, count isomorphictreesas

2. Prove that every


vertex
has a unique parent.
of

exactly one vertex at level


2, exactly three verticesat level

4 with

height

four vertices

exactly

above,

vertices

two

tree

the

in a

directed

minimum

of degree k

with

and

tree different
maximum

formulae for the minimum


and
maximum
of a directed tree of degree
k with n leaves.
the

minimum

the

root

possible heights

n vertices.

4. Derive

5. Deriveformulaefor

from

and the

possible

heights

maximum possible k for

Section

which there existsa

complete

directed

tree

of

degree

6. Complete the proof of Theorem5.5.5.


7.
a formula
for the maximum possible height
Derive

with

degree k with n vertices.


a formula for the maximum possibleheight

of

a complete

of

a B-tree

tree of

directed

8. Derive
9.

height h.

and

vertices

505

Trees

Directed

5.5

of

order k with n leaves.


Prove Theorem 5.5.6.

10. Derivea formula

B-tree

with

for

the

maximum

number

of internal

verticesin a

n leaves.

entities
as noun
sentence consists of a numberof syntactic
(such
which
are
phrases)
phrases, verb phrases,or prepositional
in accordance with
other
certain
concatenated with
each
grammatical
of
or
rules.
The process
parsing
resolving a sentenceinto its
think
leads naturally to a tree. For example,
syntactic
components
root
of
the
of
the
entire
sentence
as the
tree, the syntactic
of the sentence
as the internal vertices, and the words
as
categories
this
tree
the vertices of degree one. Using
a
procedure,
give

11. A

depiction of the following

sentence:

smiled at the blond girl.


12.A directed true T of degree k is said to be regularif every internal
T is regular if
vertex has exactly k descendants. In other words,
Forexample,
every vertex has 0 or k out-degree.
The

and

are regular

T2:

of degree 3.

tall boy

506

Chapter

5: Graphs

in the sensethat each level has the maximum


number of vertices.The treeT2 is thin in the sense that eachlevel
of internal
number
vertices (either 0 or 1).
has the minimum
Note that any full regular tree of degree k is a completetree of
k, but the converse need not be true.
degree
Draw
a thin regular tree of degree 3 and height4. Note
that
(a)
there
must be 9 leaves.
a regular
tree of degree 4, height 4, and having
13
(b) Draw

The tree Tx is full

leaves.

(c)

Draw a

(d)

Show

full

regular tree

is the
internal verticesand \302\243

of leaves,

number
- 1 if T is
\302\243

number

then (k -

of

l)i

regular of degree2.
Consider
of connecting 28 lamps to a single
outlet
electrical
extension
cords each of which has 4
by using
there are many ways to connect the lamps,
outlets.
Although
extension
this
how
cords are always needed? Hint: view
many
In particular,
i
the
problem

\302\243
-1.
(e)

2 and height 3.
T of degreek, if i is the

of degree

tree

regular

for a

that

as a

problem

(f) How many

tree.
must
be played to determine a tennis
is played with 64
tournament
elemination

matches

champion
if

a single

players?

(g)

a certain computerhas
sum of 3 numbers. How
instruction have to be executedto find
Suppose that
computes the

an

instruction
times

many

of 27

sum

the

which
will the

numbers?

(h)

Derive

leaves
(i)

a formula for the maximum and minimum


in a regular tree of degreek and height
h.

Show that a
vertices.

regular tree of degree2 has

13. Definea tree Ttobea

2-3

tree

and

Draw

height 3.
A

(c) Derive a
a

Derive

leaves

14.

Suppose

the

maximum

2-3 tree of height h.


for the maximum
formula

in a

the

for

values

possible

and minimum

number

of

and minimum

number

of

T is

2-3 tree of heighth.

a tree

descendants,all
number

for

of

internal vertex of T has 2or 3


the same level.
of a 2-3 tree with
10 leaves
and

B-tree of order k. Find

formula

number

in a

vertices
(d)

is a

tree

2-3

odd

of

if each

descendants all leaves are at


two
different
(a)
examples
(b)

an

number

leaves

of descendants

with

the
occur

property
at the

of internal

that

same

the root

has at least 2

level, m =

vertices different

from

minimum

the

root,

= maximum numberof descendantsfor all internal vertices


(including the root). Prove that if M < 2m, then T is a B-tree of
orderk for any integer k such that M < k < 2m.
and M

Section

Binary

5.6

Selected

complete directed tree of degreek has


we know that kh~l < n. From this we obtain

if a

5.5.1,

Corollary

By

n vertices,

h and

height

h < log*(n)+ 1.

8.

507

for Section 5.5

Answers

7.

Trees

Theorem

By

9. Let

rti

2 Tfe/21
the

be

smallest
k

the

recurrence:

nx

1,
2,

fy = n^kfe!

Solvingthis we obtain n, =
12. (d) There are ki descendants
of

number

minus

1.

>i. From

height

n0 =

the

number of verticeson leveli of a


the definition of B-tree, we

possible

and

n vertices,

and

It follows

h~l.

B-treeof order
obtain

B-tree of orderk has heighth


that h < logrk/2i
(n/2)

if a

5.5.6,

then n >

1, since

, for i

> 2.

2 ffe/211~1.
of the

vertices. But ki
number of leaves
the
plus

i internal

internal

vertices

the root

is not a descendantof

any

vertex.

Thus,

ki = i

\302\243

or

- l)i -8-1.

(k

of finding the sum of the numbersas a tree


leaves representing the numbers and
internalverticesfor each time the instruction is executed.
Thus we have (3 - l)i = 27 - 1 or i = 13 internal vertices.

View

(g)

where

the

problem

are

there

27

Therefore, the addition instruction must

be

executed

13

times.

5.6

BINARY TREES

Definition 5.6.1. binary


an edge-labeling
together
most one edge
from

tree

with

f:

is a

E\342\200\224+
{0,1}

directed tree

such

that

T = (V,E),

every vertex has at

and at most one edge


with 0 is called a
from
labeled
incident
it labeled
with 1. Each edge (u,v)
v
v
is called the left
left edge; in this case u is called the parent of and
child of a. Eachedge(u,v) labeled
1 is called a right edge; in this
with
u
is also called the parent of v, but v is called the right child of u.
case
u are the
The
subtrees
of which the left and right childrenof a vertex
roots are calledthe left and right subtrees
of u, respectively. We may
represent a binary tree by a triple (VJE,f).
It is implicit in this definition
vertex in a binary tree has a
that
every
and a unique right child, if it has any at
left
unique parent,a unique
child,
incident

it

labeled

with 0

508

Chapter5: Graphs

Figure

./\\

./\\

/\\

./\\

5-45.

Four

distinct

trees.

binary

follows
from the
That
each vertex has a unique parent (if any)
be a unique path from
definition of tree, whereit is requiredthat there
the rootto eachvertex.
vertex v were to have two parents there
(If any
the
these paths
would
be a path
to each of them from
root, and extending
to v would yield two paths to v.) That eachvertexhas a unique left child
from
and a uniqueright child (if any) follows
the labeling of the edgesof
the treewith 0's and l's. (At most one edge from the parent can have a 0
label and at most one edgecan have a 1.) It is also implicit in the
definition
that
vertex other than the root has a parent.Thisis so
every
v
vertex
in a tree must have
a path
to it from the root. The
because
every
last vertex before v on such a path must bethe parentof v.
The left-right
on the verticesof a binary
orientation
tree
that
requires
we view as distinct binary
those
trees
that would otherwise be the sameas
directedtrees of degree at most 2. (See Figure 5-45for an illustration.)
all.

5.6.1
Details such as edge labelsand the direction
of
in
are
of
trees.
edges
usually represented only implicitly
binary
drawings
The conventionis that for each vertex v the root of i/s left subtreelies
v and
to its left on the page,whereas
below
the
root of i/s right subtree
lies belowv and to its right on the page.Figure5-46shows an example of a
binary tree drawn with and without
edge labels and directed edges.
There are a few special kinds of binary trees that are important in
is the complete binary tree.
one
of these
computerapplications;
Example

\342\200\242XX

Figure

O
5-46.

XX
Conventions

for drawing

binary

trees.

Section

5.6

509

Trees

Binary

Let T be a binary
5.6.2.
Definition
tree.
vertex v in T has a
Every
as follows:
If v is the root, let index
unique level-order index, defined
\342\200\224
(u) \342\200\242]
1; if u is the left child of a vertex
u, let index (v) = [index
(v)
2;
= 1 + [index
if v is the right child of somevertex
a, let index (v)
otherwise,

(a)]

\342\200\242
2.

that the index of a child is obtainedby doubling


Note
the index of its
parent and adding the labelon the edge that goes from the parent to the
of looking
at this vertex numbering schemeis based
child.Another
way
on
the
fact that
each vertex corresponds to a unique string w in {0,1}*,
determined
to it from the root. The
by the sequence of labelson the path
to w is the integer represented by lw,
index of the vertexcorresponding
as
a binary
number. Thus, the level of any vertex v can be
viewed
as Llog2(index (y))J .
computed

Example 5.6.2. The


Figure5-47, time with the

5-46 is repeated in

in Figure

shown

tree

binary

the locationof
children
eachvertex.
indices, and right childrenhave
The string corresponding
to vertex number 18 is 0010.
indices.
odd
of this, we get 10010,which
base two
a 1 in front
is the
Putting
representation of 18.
this

Left

Definition 5.6.3.
which

1,.. .,n of

vertex

in

binary

complete

indices

level-order

the

tree

with

index i for

5.6.3.
Of the two
Example
(a) is complete.In particular,(b)
index

every i from
trees

binary

ten

binary tree

complete

has n vertices

a tree

such

has

is a

tree

vertices form

of the

the integers.That is, if

the

index written at

level-order
all have even

in Figure 5-48, only


but has no vertex with

shown

10.

Figure

5-47.

binary

tree,

there is a

n.

1 to

vertices

for

interval

with level-order

indices.

510

Chapter

5: Graphs

(a)

Figure 5-48.

Completeand

It is probably apparent
correspondsto a speciallabeling

Thisis

of a

possibly the

last.

Lemma 5.6.1. In
of the verticesin
-

2e+1

the

complete

\302\243th
level

from 2ethrough n

1, or

following lemma, which showsthat

binary tree

complete

complete
binary tree
directed tree of degree 2.

a complete

of the

a consequence

formally

level

every

of

each

that

now

by

trees

binary

noncomplete

has exactly

28 vertices,

for

except

tree with n vertices


binary
the complete interval
comprise
1.
if n is less than
2e+1\342\200\224

the indices
28through

= 0 and n = 0 the lemma


\302\243
induction on \302\243.
For
For
one
vertex
with index
holds
and n > 0 there is exactly
vacuously.
= 20+1 - 1 = 1, and that is the
2\302\260
root,which is also the only vertex at level
of \302\243,
we
the lemma holds for \302\243
0. For larger values
assume
1, by
induction. If n < 2e, the lemma holds vacuously. Otherwise, we invoke the

proof is by

The

Proof.

= 0
\302\243

definition

from

the

of level.
The vertices in level \302\243
those at distance \302\243
are
exactly
\342\200\224
\342\200\224
1 are exactly
root. The vertices in level \302\243
those at distance \302\243
level
\302\243
the root. It follows that the
are
the
precisely

verticesat

1 from

children

of the

assertsare

vertices at level \302\243

1, which the inductive hypothesis


2e \342\200\224
1. By the definition
2*~l through
of
in the range 2*through 2e+1 \342\200\224
have
indices

indices

with

those

level-order index,thechildren
1. This
interval, or the initial segment of
complete
be in T, by the definition
of complete
binary tree.
the

of

Because

segment

the

represented

efficiently

of

very

excellent
and
implementation,

algorithms

that

by at

the

heights

most one.

through

n, must

way their vertices correspond to an initial


complete binary trees can be
on computers.
They are applied in a number of
Sort,\" priority queue
\"Heap
including
for the efficient ordering of data in hash tables.
integers,

Definition5.6.4.

such

up

\342\226\241

natural

positive

algorithms,

it

height

of the

balanced

left and right

binary

tree is a binary

subtrees of every

vertex

tree

differ

Section5.6

511

Trees

Binary

trees are important in computerscience


because
the
balanced tree is always
0 (log n) with
to
the
respect
number n of vertices in the tree. Thus,
a number
of algorithms
for
in
to
frequently performed operationscan be implemented
perform
0 (log n) time on tables that are organized
as height
trees.
balanced
balanced
Height
of a height

height

The tree

5.6.4.

Example

height-balancedbinary
in a

tree that

tree

in

shown

of height

would no longer be height

5-47 is a

and

5-46

Figures

vertex (13)would

4. Deleting

result

it would

since

balanced,

have a

left subtree of height3 and


also

would

in a

result

(4) would

vertex

height 1.

Note that
tree.

every

a right
subtree
of height 1. Deletingvertex (8)
tree that would no longerbe height
since
balanced,

have a left subtree of height -1


complete

trees are

binary

Height-balanced

general

than

complete binary
lower bound on the

nontrivial

tree

binary

a right

and

subtree

of

is also a height-balancedbinary
of interest becausethey are more

trees but it is still possibleto obtain


a
number of verticesin a tree of a given

height.

Theorem 5.6.1. Thereare

vertices

in

Proof.

denote the

any

bound can

tree

binary

height-balanced

This

least

at

with

be obtainedfrom

least achievablenumber

of

[(1 +

(1/V5)

vertices

height

V5)/2]h+3 - 2

h.

Let

recurrence.

in a

V(h)

(nonempty) height

h. Then clearly V(0) = 1 and V(l) = 2. For


tree
of height
balancedbinary
h > 1, we observethat there must
and two subtrees, possibly
be a root
1.The height of the other
The
of
one
h
subtree must be
height
empty.
\342\200\224
h
1
h
2.
is
is
not
or
It
clear
that
it
possible to construct a
may be
\342\200\224
h
1
fewer
vertices than are
with
height-balanced subtreeof height
h - 2. A
of
subtree
height
required to constructa height-balanced
height-balanced

of height

tree

the

with

consists of a root, one height-balanced

fewest

subtree

vertices

possible
of height

thus

- 1 and one

of vertices
in
h - 2. Thetotal number
of height
subtree
=
1
is
tree
such a
4- V(h
2).
V(h)
1) + V(h
it is nearly the sameas
since
This recurrence should be very
familiar,
solved in Chapter 3.
for
which
was
the
Fibonacci
the recurrence
numbers,
similar
the
solution:
we
obtain
techniques,
Using
height-balanced

where
<j>

and
\342\200\224^\342\200\224

- 0

'
\342\200\224g\342\200\224

512

Chapter

5: Graphs

We also obtained a solution

of Chapter 1,namely
V(h)

= -U

=
since it is

But

see

that

It is

for

-7T (1

1,

<t>)M

Fn is

\342\200\224
where

Fh+2

the

71th

1
number.

Fibonacci

immediate that

to

-1

^(1-0)

different solutionsarethe same.


bound

this

compare

binary trees

complete

_5-2V5

_^

two apparently

these

interesting

vertices

(<t>)h+3

5 + 2V5
___

we

1.10.11

in Example

relation

recurrence

of this

that

of

bound

lower

the

with

of height h. Since0 isbetween

2h

1.61803

1.61804

and

-1 <

(1 -

<t>)h+z

-^

1, and,

in particular,

-lso that

^i(l-0)h+3>

V(h) >

<

(0)*+3

2.

V(h) is greater than (1.89)(1.61)h


of vertices
exponential lower bound on the number

2;

Thus,

tree comparableto the bound

A binary

5.6.5.

Definition

vertex labeling
with ax < a2 <

for

/: V\342\200\224*
A,

where

anf and

\342\226\240
\342\200\242
\342\200\242
<

a complete

that

in a

is,

have

we

an

height balanced

binary tree.

\342\226\241

search tree is a binary


{al9a2,.. .9an]is a totally
where the labeling Z satisfies
A =

tree

with

ordered

set

the

properties:

(i)

For

(ii) For

vertex u in the left subtree of a vertexv, l(u)


each vertex u in the right subtreeofa vertex
v, l(u)
each

< l(v)

> l(v).

Given a sequence of numbers 17,23,4,7,9,19,


a binary
search tree for the set A obtained
by
the
the numbers in their proper order.Firstlabel
root
with 17;
sorting
then since 23 is largerthan
a right child for the rootand label
it
17, make
23. Next since 4 is lessthan
the
the
root, label a left child of the rootwith
label 4. Continue
to the next number7 in the list. Since 7 is lessthan the
root17,7 will appear as the label of somevertexin theleft subtreeofthe
child of the vertex 4.
7 the right
root,
yet 7 is greater than 4, so label with
Example

5.6.5.

let
45,6,2,37,99

us

build

Section

5.6

Trees

Binary

the label9. Again

Next use

a label

in

the

9 must
be the label of a vertex in the left
9 < 17.Moreover,
9 is greater
than 4, so 9 must be
of 4. Likewise 9 > 7,so9isa l$bel for the right
subtree

root since

of the

subtree

513

right

than
child of 7. Next,19is greater
label
some
vertex in the
17, so 19 will
of
but
19is
less
than
the
of
subtree
child
17;
23,
17, so labelthe
right
right
>
of 23 with the label 19.Nextconsider
left
child
45
17
so 45 is a label
45;
for
in the right subtree of 17;45 > 23, so label the right child of 23
a vertex
with
45. Continuing
as above, we see that 6 must bethe labelfor the left
child of the vertex 7, 2 is theleftchildof 4, 37 and 99 are respectively the
left
of 45. Thus, we have
and
children
the
binary tree:
right
following

17
\342\200\242

./\\

\\9

6.'

One nice feature of the


an inorder traversal of the

properorder.
Also,

if T\"

minimum

and

is a

find the

minimum

children

until

T\"

of the

subtree of the binary


labels

maximum

start

label,

a leaf
by

The labelon
we can

Likewise,

successively

search

that now we can perform

7 in this

section),and this

original sequence into its


tree

T with

on the vertices of T\"


at the root u and

is reached.

label on the subtreeT\".

verticesof

(see Exercise

a rearrangement

give

tree is

search

binary
tree

\\99

37\302\253'

5-49

Figure

traversal will

\\45

19 #/

.1

are

root u, then

easily

To

visit successivelyleft

this
leaf is the minimum
find the maximum label on the

right children until

visiting

the

located.

we arrive

at

leaf.
have a dynamic feature as well;
original sequence can be
incorporated into
the binary
had been in the sequence
search tree just as if these
all along. For instance,if 1,5,11,39,84,87
to the original
are appended
of 6,11 is a right
child
a left child of 2,5 is a left
sequence,then 1becomes
child of 9,39 is a right childof37,84isa left child of 99, and 87 becomesa

But that

additional

is not all. Binary

numbers

right childof 84.

appended

search

trees

to the

514

Chapter

5: Graphs

can be deleted in sucha way that the resulting


tree is still a
but
we
search
leave
the
of
such
a
tree,
binary
discovery
procedure as an
Vertices

exercise.

Exercises for Section5.6

1.

the

Draw

whose level

tree

binary

order indicesare

{1,2,4,5,8,10,11,20}.

2.

maximum possible heightof a complete


then H is in O(log(n)).
binary
3. Show that if H(n) is the maximum possible heightof a heightbalanced
tree with n vertices then it is in O(log(n)).
binary
4. Another
of balanced
kind
binary tree is called an a-balanced
r be the number of
Let T be a binary tree and \302\243
tree.
and
binary
vertices in T\"s left and right subtrees, respectively. Define the
balanceof Ttobethe ratio (1 + 9)1(2 + 8 + r), and say that T is
a. Derive
if the balance of T is betweena and
1 \342\200\224
a
a-balanced
lower bound on the numberof verticesin an a-balanced
binary
tree of height h.
5. Draw a height balanced binary tree of height 4 with the minimum
possible number of vertices.
for
trees borrows heavily from human
6. The terminology
binary
that

Show

is the

if H(n)

tree

with

n vertices

kinship relations.Are

the

human beings really binary


7. (Tree

Traversal Algorithms.)A

enumerateseachof

the

between
answer.
Justify
your
traversal
of a tree is a processthat
in the tree exactly once. When
a

parent-child
trees?

vertices

relationships

order of enumeration specifiedby a


vertex.
We
that we visit the given
to traverse a
here three principal ways that may
describe
be used
will
be defined
binary tree; eachscheme
by specifying the order for
the 3 entities: the root (N), theleft subtree
and
the
(L),
processing
we
traversals;
right subtree OR).There are severalnamesfor these
of the
choose the names that indicate the orderof occurrence
vertex

in the

is encountered
process,

particular

we say

root.

1. Preorder

Traversal (abbreviatedNLR).

For
first visit the root.
(a)
any subtree,
on the
entire
(b) Then performpreordertraversal
from that root (if a left subtreeexists.)
(c)

Perform

preorder

traversal

on the

left subtree

root's right subtree.

5.6

Section

Binary

515

Trees

Figure 5-50

2. InorderTraversal(abbreviated
(a)

it

(b)

perform

First,

LNR).

inorder traversal on the root'sleftsubtree(if

exists).

Then visit

(c) Perform

the root.
on the

traversal

inorder

3. Postorder Traversal(abbreviated
(a)

Perform

postorder

(b)

Perform

(c)

Visit

postorder
root.

the

root's right subtree.

LRN).

traversal on the root'sleft subtree.


on the root's right subtree.

traversalsin the treeshown

For example, the path


5-50 are given by:

in

Figure

Preorder: a-b-c-d-e-f-g-h-i
\342\200\224
\342\200\224
\342\200\224
c \342\200\224
e \342\200\224
a \342\200\224
h \342\200\224
i
b \342\200\224

Inorder:

Postorder:

d-e

Show
following

the

c-f\342\200\224b-h

are

\342\200\224
\342\200\224
i\342\200\224g a

orders in which the verticesof the


in a preorder, an inorder, and a

sequential
trees

\342\200\224

visited

postordertraversal.
a
\342\200\242

(a)

b%'

yy

(b)

bj

^#c

y\\

/.(

/
n%

o#

/
p\\

516

Chapter 5: Graphs
8.

of a binary tree completein


an example
Give
Definition 5.5.2 but which is not a completebinary
sense of Definition 5.6.3.

9. Determine
If not,explain

or

whether

the following

not

trees are

sense

the

in

tree

of
the

height balanced.

not.

why

(b)

(a)

%c

em

me

md

cm

bm(

'\342\200\242/

(d)

(c)

em

dm

d*

\342\200\242/

mh

trees
all regular binary
exactly 7 vertices.

10. Draw
(a)

with

(b)

with

9 vertices.

exactly

(A regular

binary tree is a binary

tree

where

each

vertex has

0 or 2

children.)

11.

all

Draw

distinct

binary

(a)

with

(b)

with 4 vertices.

12. Draw

trees

3 vertices.

search

binary

trees

for the

following lists:

(a) 18,44,2,5,73,45,14,6,8,10,20,11
(b)

2,1,5,6,8,9,7,3,4

(c)

Carol,

Bob, Dumpty,

(d) Ask, Art,


(Hint: on (c)

Ace, Ellen, King,Humpty,

Ate, Able, Alto,

Also,

and (d) usethe usual

Avid
dictionary

ordering.)

Joe,

Myrtie

Section

5.6

ordered tree is a directedtreefor


vertex are orderedsequentially.
Draw

13. An

of each

children

the

which

an

tree of

ordered

517

Trees

Binary

degree 3

with

7 vertices.

(a)

(b) 10 vertices

and height4.

Explain

view

a binary

height

of the

to

how

14.

the

Determine

indexis
(a)

24

(b)

2s +

(c)

26

binary tree

whoselargestlevel-order

17
31

(d)

26 +

33

(e)

4s

(f)

2* for k

(g)

n for

15. Given

ordered tree.

tree as an

a positiveinteger
positive integer.

n a

index

level-order

of a vertex

index

level-order

the

the level-orderindexof v

's left

child,

in

a binary

tree, determine

right child, and

parent if

the

of v is

(a) 29

(b) 410
n,

(c)

16.

an

Design

n is

where

to delete

algorithm

17. Determine
the

binary

Answers

integer.

that the resultisstilla binary

caseswherev

Selected

a positive

for

search

Section

is a

leaf, has

conditions

tree to

a vertex
search

from

tree.

a binary

Hint:

tree so
the three

search

consider

one child, or 2 children.


that

will cause

each internal vertex

have exactlyonechild.

5.6

1.

,2

Figure 5-51

of

518

Chapter

5: Graphs

3. By

Theorem 5.6.2, if

balanced

height

v5

+
ra*75(1

\\*

V5<

T)

\"2-

h < logq+>/6)(V5(n
that h (and

To see

2) < In for

Thus,
6. First,

<

they

(2)
are

henceH(n)) is in

and logx(7n) =
logL6(n) for n > 7.

> 1,

not

binary,

children. Second, they

common ancestoron two

since a

2)).

person

of the

Figure

5-52

human kinship terms


Of course,
case,
linguistically, even in the above

do

that V5(n
< 2 logxn, for n >

observe
logxn

may

need not be trees,since


sides

vertices

Thati8'

O(log(n)),

logx7

tree has n

binary

and heighth,

family: for

form

binary

by ignoring

more

have

a person

example,

trees

when

viewed

crossbreeding.

Paternal

Paternal

Maternal

Maternal

grandmother

grandfather

grandmother

Mother

Figure

7. (a)

Preorder:a-b-d-e-g-c-f-h-i-j

5-53

Inorder:d-b-g-e-a-f-i-h-j-c
Postorder:
d-g-e-b-i-j-h-f-c-a

7.

than two
may have a

grandfather

Father

Section

5.6

REVIEW

Binary

Trees

519

FOR SECTIONS 5.1-5.6

1.

For

the

graph

each vertex

find the

below
with

an

obtained

visitation)

integer

spanning tree (draw the tree and label


from 1 to 8 to indicate the orderof

by:

(a) BFS

(b) DFS

(c)
(In

2.

KruskaPs

each

algorithm.

problem

tree

For

the

(a)

Preorder:

(b)

Postorder:

(c) Inorder:

below

use the vertex

list the

orderingabcdefgh.)

vertices in the requiredorder:

520

Chapter

5: Graphs

possible (if not, explainwhy

3. Draw, if

the binary
1,2,3,4,5,6,7,8,9,10,11,13,18,26,52.

indices

level-order

the

with

label

and

not),

4. Draw all nonisomorphic,nondirectedtreeswith


(a)

tree

sequence

degree

(1,1,1,1,2,3,3)

(b) (1,1,1,1,1,1,1,1,3,4,5).

5.

all

Draw

6. Fill

in

forests on

nondirected

nonisomorphic,
blanks:

the

is a simple connectedgraph
number of edgesof G is between
denotes
the number
(b) Suppose that iV\302\273
(a)

If G

tree T.If

N2

Explain.

(c) The maximum

5,

in a

height
is 412

index

of a

(k)

of v

tree

of

a vertex

of v 's

a graph

's parent

v in

tree is 223,then
and v 's right child

a binary

is
height

T =

; height
and

T is.

mm

e%

|E | -

level-order

_; the level of vertex n is.

dm

G, then

graph

if the largest

left childis

tree T depictedbelow,

vertexeis
the

of

binary tree is _

index

, and

is

if

is

a simple

of

+ 5. Explain.

level-order

For the

degree

and|\302\243|*

not the degreesequence

index
(j) If the level-order

the

4 and

B-tree of order 5 and

componentsof a forestA

isthe degreesequence
(h) If (1,3,3,4,4,5)
The

of order

= 32.

(g) (1,3,3,4,5,5) is/is


because

(i)

Nt

a B-tree

of connected

24and|V|

|\302\243|

- 2, then

such that each vertexhas

a graph

4|V|-36.Then|V|

number

The

Explain.

Explain.
G is

that

and|\302\243|

(f)

= 7, N6

the

of degreei in a

of vertices

of vertices

number

minimum

1, N4

then

vertices,

and

Explain.

(d) The
height5is
Suppose

iV3

70

with

number of verticesin

height 5 is

(e)

4 vertices.

/\342\200\242

\302\243\342\200\242
\342\200\242,

the

of the

degree

of

Section

5.6

Binary

(1)
(m)

edges and KmA has


graph Wn on n vertices

Kn has
The wheel

521

Trees

edges.

has

edges.

.edges.
(n) Pn, the path graph on n verticeshas.
n
G
If
has
then
the
of
vertices,
(o)
G,the complement
simple
graph
G,

has

7.

edges.

or disprove.

Prove

(a) The following

two

are isomorphic.

graphs

with
(b) Every connected simplegraph
where n > 2 containsa cut point.

(c) If

is

graph

simple

n and | V

connected

two

with

| =

|E

+ 1

components,

\\E(G)\\>\\V(G)\\-2.

(d) Given any two

edges ex

spanning

tree

there is a
Hint:Kruskal.

(e)

\"full\"

A full

number

( f)

(g)

(h)

Every

tree is

of vertices
graph

simple

graph

simple

e2 of

connected graph G,

a simple
the

containing

two edges ex and

e2.

odd numberof vertices.(Definition:


one wherethe lastlevel has the maximum

has an

tree

binary

binary

and

possible.)

with 5 edges
with degree

and 6 verticesis connected.


sequence (3,3,3,3,3,3,3,3) is

connected.

connected

simple graph

with

> 2

vertices

contains at

least 2 verticesthat are not cut vertices.


(i) Suppose that G is a connected,
simplegraph and e is an edge of
G.If e is on no cycle of G, then e is a cut edgeofG.
(j) Suppose that G is a connected simple graph and e isa cut edge
ofG.Then for each spanning tree T of G, e is an edge of T.
(k) Each connected, simple graph G with n vertices and m edges
where3 < n < m containsa circuit.
(1) If k - 1 edges are added to a forest with k connected
then the resulting graph is a tree,
components,
If a simple
all the
contains
(m)
graph contains a circuit C which
edges and vertices of G, then |E(G)\\ = | V(G) |.
True

or False.

\342\200\224
(a)

(b)

A simple
A

complete

graph contains no cycles.


tree is a B-tree of order 2.
binary

522

Chapter

5: Graphs

has no cycles.

(c)

A tree

(d)

tree

(e)

complete

contains

always

a cut point.
of degree

tree

directed

2 is a complete
binary

tree.

( f)

Every circuit in

(g)

(h)

The

least2

vertices.

cut

sequence

(i) The

a graph is alsoa cycle.


graph with n > 3 vertices containsat

simple

connected,

(1,3,3,3,5,5) is graphic.
is

following

connected

contains

and

valid

If
argument:
then T

no circuits,

a graph T is
is a tree.If Tis

1.
atreefthen|E(T)|-|V(T)|-l.\\E(T)\\*\\V(T)\\-

not connected or T containsa circuit.


G and
H are
is
a valid argument: If graphs
following
(j)
isomorphic, then G and H have the same degree sequence.
the
same
The graphs G and H have
degree
sequence.
Therefore, the graphs G and H are isomorphic.
If the graph T is a
is a valid
(k) The following
argument:
T is quasi-strongly
then
directed
connected. The
tree,
T
T is not quasiis
not
a
tree.
directed
Therefore,
graph
T is

Therefore,

The

connected.

strongly

(1)

The

(m)

The

sequence

tree.

two

graphs

(n) The following

\342\200\242-\302\253-

(1,1,2,2,3,3,3,3) is
below are

graph

the degreesequence
ofa

isomorphic.

is quasi-strongly

connected:

Section

5.7

523

Planar Graphs

5.7

PLANAR GRAPHS
on a piece of paper,
a graph
we often find it convenient
drawing
to
to
intersect
at points
even
other than at
(or
necessary) permitedges
These
of
the
intersection
are
of
called
crossovers
vertices
points
graph.
to
are
said
cross
over
and the intersectingedges(or crossing
each
edges)
other.
For example, the graph of Figure 5-54(a)exhibitsthreecrossovers:
A graph G is
over {a,d} and {a,c},and {b,d}crossesover
{b,e} crosses
{a,c}.
said to be planar if it can be drawn on a plane without
crossovers;
any
if a graph
G is said to be nonplanar. Note that
G has been
otherwise
this does not mean that G is nonplanar\342\200\224there
drawn with crossing
edges,
to
the graph without
crossovers.
For example,
draw
be
another
may
way
in Figure
the graph in Figure 5-54 (a), can be redrawn
5-54 (b) without
crossovers. Accordingly we say that a planar graph is a plane graph if it
is already
cross
drawn in the plane so that no two edges
over. Therefore,
its depiction
in (a) is
the graph in Figure 5-54 (b) is a planegraph
while
When

not.

Example 5.7.1.
outlets

have

we

Suppose

gas, and

(electricity,

three

water) situated

houses

and three

so that eachutility

house. Is it possibleto connecteachutility


the three houses without linesor mains crossing?
to each

connected

We

to

the

can
houses

this situation
represent
and the utilities, and

to

each

is

of

by a graph whoseverticescorrespond
where an edgejoinstwo vertices
iff one

a houseand the othera utility.


complete bipartite graph X3>3. The 3 houses-3
vertex denotes

be rephrasedin

utility

outlet

The

graph is the
problem can then

resulting

utilities

theory: Is X33 a planar graph?


let us try to find a systematic
way to
draw a graph in the planewithout
We want to be able to
edges
crossing.
concludethat a graph is nonplanar if our construction fails.The method

Before

we

terms

answer

of graph

this

question

e \342\200\242

(b)

(a)

Figure

5-54

524

Chapter5: Graphs

Figure

involves two simple ideas:

we will use

1. If

have

we

a cycle in

drawn

must be eitherinsidethe

cross

over

2. The

roles

the

5-55

one
of

graph

outside the

the plane,
cycle,

then any

edge

the cycle,

outside

not

on the

or the

edges of the cycle.


inside or outside the cycleare symmetric

cycle

edge must

of the
being

can be

redrawn so that

cycleare now

inside

the

edges

cycle

and

and vice

vertices

that

is,

formerly

versa.

for the edges {a,e}


possible
configurations
Figure 5-55indicatesvarious
\342\200\224
\342\200\224
relative
to the cycle: a-b
and {c,g}
g-h-a.
c-d-e\342\200\224f
Now let us use these ideasto show
that
and hence that
X3>3 is nonplanar
the 3 houses-3utilitiesproblem
has
a negative
With K3t3 labeled
answer.
in Figure 5-56, we draw the cycleofX33: a-d-c-e-bas indicated
and
outside
the cycle are equivalent, we
f - a. Sincethe rolesof inside
can assumethat the edge {a,e} is inside the cycle. The edge{byd} then
be drawn outside the cycle sinceotherwise
must
and
{b,d} would
{a,e}
cross over. But notethereis no place to draw the edge {c,/},either inside

/
Figure

5-56

Section

525

Planar Graphs

5.7

or outside the cycle,without


KZtZ

is not

computer

\\b,d} or

either

{a,e}.Therefore,

planar.

arise in applicationsof graph


to
theory
and
electrical
especially
building
circuitry.A
board is a planar network,and so minimizing
the
amount
is a key designcriterion.

of planarity

Questions

in designing

science

circuit

printed

over

crossing

of nonplanarity

possible. Thus planarity

or

at

in such

are prepared

flowcharts

since

Furthermore,

statements
executed sequentially
is desirable that there be as few

to be placedin

least

herealso.

or

overlapping

a way

reasonable

near planarity

as

to allow

it

proximity,

flowlines

crossing

as

becomes an objective

be thought of as dividing
the
into regions
plane
are
connected
the
Intuitively
portions of the plane
regions
the
after
all
curves
and
of
the
points
plane corresponding,
remaining
been
deleted.
to edges and vertices of G have
Each plane
respectively,
G
determinesa
of
infinite
the
exterior
area
called
region of
graph
region
G. The verticesand edges of G incident with a region r make up the
of a region
boundaryof the region r. If G is connected, then the boundary
r is a closed path in which
When the
is
each
twice.
traversed
cut-edge
r
is
of
a cycle of
of
then
the
contains
no
cut
G,
boundary
boundary
edges
Of course,
a
G. In eithercase,the degree of r is the length of its boundary.
G
a
bethe
of
of
need
not
boundary
region.
cycle
in Figure
For example, in the graph shown
5-57 (a), a - 6 - c - / g - h a is a cyclebut thereareonly 4 regions determined
by this graph, namely
A

graph

plane

G can

or faces.

the

the 3 regionswith boundaries


a-b-g-h-a,b-c-f-g-b9c-d-e-fc, and the exteriorregionwhose
boundary
isa-b-c-d-e-f-g-h-a.
10 because of the 2 cut
has
In Figure 5-57(b), the exteriorregion
degree
of
the
exterior
and
the
t,u
w,x;
boundary
regionisthe closedpath t
edges

-u-v-w-x-y-z-x-u-t.
the concept
of a multigraph. We
we have not formally
used
in
in
sections
4.1 and 5.1. In the
only
passing
not
itself
be a graph in
need
the
of
a
dual
below,
graph
given

Heretofore,
to

referred

definition

its definition

\342\200\242

\342\200\242

cw

\342\200\242
i

I
z
*\342\200\242

\342\200\242

\342\200\242

(a)

r\\

V
\302\243

(b)
Figure

5-57

526

Chapter 5: Graphs

word. In fact, the dual of a 3-cycle will be a


and 3 multiple edges joining the 2 vertices.
multigraph
should
review
the
reader
the earlier definitions. The primary
Thus,
technical
fact that we need is that the \"FirstTheoremof Graph
Theory\"
holds
for multigraphs
as well as for graphs.
the

of the

sense

strictest

2 vertices

with

Given a plane graph G, we can


5.7.1.
G* as follows:Corresponding
to eachregion

Definition

another
G there is

define

a
vertex r* of G *, and corresponding
to eachedge e of G there is an edgee*
r* and s* are joined by the edgee* in G* iff their
of G*;two vertices
the
regions r and s are separated
by
corresponding
edge e in G. In
particular, a loopis addedat a vertex r* of G * for each cut-edgeof G that
G* is called the
to the boundary of the regionr. The
multigraph
belongs
dual of G.
There
is a natural way to draw G* in the plane:
Place r* in the
correspondingregionr ofG (think of r* as the capital of the regionr), and
it crosses
each e* in such a way
that
the corresponding edge e
then
draw
G exactly
is
of
once (and crosses no other edgeof G). This
procedure
in Figure 5-58, where the dual
are indicated
illustrated
edges
by dashed
Note that if e is a loopof G,thee*
lines and the dual vertices
by asterisks.
multigraph

isa cut edgeof

and

G*

conversely.

~~-s

\342\200\224.\342\200\224
.......
/,| \342\200\242
t/

f
1

\\

N.

/'\\
/'-A

\\

\342\200\242

-\342\200\242-

|, | V*

| JET* |, | fi*

regions,

vertices

and

direct

are

Forall plane

graphs

i)\\E*\\-\\E\\
\\V*\\

\\
\\
\\

Figure

ii)

*^

relations

N-

\\ I

yiQA

Let

r of

\\R\\,and

5-58

|, and | E\\, \\R |, |


of G* and G

consequences
G,

V\\ denote

the number

respectively. The the


of the definition of G*:

of edges,
following

Section

5.7

Planar

degG* (r*)

iii)

for

(r)

degG

each

region

r of

be shownthat

it can

connected,

Graphs

G. Moreover,if

527

is

|fl*|-|V|.

iv)

In (iii)

we mean that

degreeof

the

the degreeofthe vertex


region

corresponding

r*

r determined

in G*

is the

same as the

by G.

Theorem 5.7.1. If G is a plane graph, then the sum of the degrees of


determined by G is 21E|,where
of edges of
| J571 is the number

the regions
G.

for
Let us use the notation 2r\302\243/?(G)degree(r)
the sum of the
if
G*
Then
is
of
the
determined
G.
the
dual of G, let
all
by
regions
degrees
sum
of
the
of
of G*.
denote
the
the
vertices
degrees
2r*ev(G*)degree(r*)

Proof.

Then

]T

degree(r)

(iv) above.

by

verticesin any

But we

already know

is twice

graph

degree(r*)

]T
r*EV(G*)

r<ER(G)

that

the number

the sum of the degrees of all


of edges.In particular,we know

that

]T
r*EV(G*)

|E |

But
Exercises

for

1.

= | E* | by

Section
A

2.

Show

that

3.

Draw

the

(a)

= 2|E*|.

(i). Thereforethe theoremisproved.

\342\226\241

5.7
graph

plane

For

degree(r*)'

find a

K5 is
dual

self-dual if it is isomorphicto its dual.


self-dual graph on n vertices.
nonplanar by the technique used in Example5.7.1.

G is

2,3,4,5,

graph

for each

(b)

Figure 5-59

of the following

graphs:

(c)

528

5: Graphs

Chapter

4. Show

that the

graphs

following

are

planar:

1/

\\>

(c)

(b)

(a)

Figure 5-60

5. Suppose that the 3 houses-3utilitiesproblemwas instead


would
be?
the solution
houses and 2 utilities problem.What
are planar?
6. Which of the following
graphs
a

the

8i

*#C /7WO**

(a)

me
\342\200\242

(c)

(b)

a
e;

\342\200\242
c

c
(d)

(e)
Figure

(f)

5-61

Section 5.7

Planar

Show that

7. (a)
(b)

Show

A graph

8.

K5

that

KZtZ

G is

e is

Graphs

529

planar for any.edgee ofK6.


planar for any edge e of K3(3.

\342\200\224
e is

critical planar if

but any subgraph

G is nonplanar
is planar.
are critical
graphs

obtained by removing
a
(a) Which of the following
(i) #3,3

vertex

planar?

(ii) Kh

(b)

(iii)

K6

(iv)

K4tZ

Show
cannot

that

Show

9.

that
have

critical planar
a vertex whose

and
graphs must be connected
removal disconnectsthe graph.

graphs are self-dual:

the following

(a)

(c)

5-62

Figure

that the

completetripartitegraph
Show that the wheel graph Wn on n

10. Show

11.

\342\200\242

(d)

\342\200\242,

is nonplanar.

KIXZ

is isomorphic

vertices

dual.

12.
13.

Show
Let

that
G be

with 4

graph

any

a connected

spanning tree of G,
correspond

to edges of

that G and G

have

or fewer verticesis planar.

T form

those

that

the same

and let G

be its dual. If T is a
G * that do not
of
edges
tree for G*. Conclude
spanning

planar graph
show

to its

number of spanningtrees.

530

Chapter

Selected

5: Graphs

1.
n

5.7

for Section

Answers
(b)

n =

= 2

n =4

fa

.A
5-63

Figure

5.8

= 5

FORMULA

EULER'S

If G is a connectedplanar

a plane

will

graph

exterior

region,

of regions,

where

of G in the planeas
2 regions,includingthe

any drawing

|2?|-|Vr|+
V\\

the number

respectively,

denote,

edges, and verticesof G. This remarkable

by Euler in

discovered

then

graph,

form |JR| =
| R |, | E |, and |

always

was

formula

1752.

Theorem 5.8.1 (Euler's Formula). If G


|i?| = 2.

is

a connected

plane

graph,then|V|-|\302\243| +

Proof.

We

observing the

by first

this

prove

determinesonly

a tree

convention,

one

result

We know

region.

for

tree.

By

already that

the

less than the number


of vertices.
Thus,
= 2 holds. Moreover,we note that a
1 region
must be a tree since
connected
plane graph G with
only
there
would
of
a circuit
otherwise
be a circuit in G, and the existence
implies an internal region and an externalregion.
the general
result by induction on the number k of regions
We
prove
number of edges of
for a tree the formula

determined
>

+ |JR|

|V|-|2?|

Assume the result


that
suppose then that G is a connectedplane graph
1 regions. Deletean edgecommontothe boundary
of two
the
number
of
same
regions. The resulting graph G1 has
G.

by

for

is one

a tree

have

We

proved the

result

for

determines

vertices, one fewer edge, but alsoone fewer


the
removal
regions have been consolidated
by
and
for

\\R\\

ji?1!
=

2.

mathematical

are,

\\Rl\\

regions
\\E\\

= 1.

1 and
k +

separate

\\Vl\\,

\\E\\

G\\

| V1]

Therefore,
induction.

|V|

'-

\\E\\

- IE1]+

\\RX[

1, \\Rl\\
By the

\\E\\

\342\226\241

\\R\\

of the

\\R\\

inductive
2 and

1,

|Vl\\

previous

edge. Thus

of edges,

numbers

the

respectively,

two

since

region

|V|.

if

\\El\\>

vertices, and

But

then

|V\\

hypothesis, (V1! - l^1!+


the theorem is proved by

Section

531

EuLer's Formula

5.8

The above theorem

the

allows

does

corollary

following

that
number of edges in the closedpath
for graphs
holds
above theorem actually

1:

each vertex

In a

plane graph

we

particular,
that

observe

El

this section that the

throughout

the

|Jf?| <

have

deree

the

2rG/e(G) degree

regionr G R(G).

Corollary5.8.1. In

graph is

region is
polyhedral
degree (v) >

of each

degree

plane graph
if, in addition,

observe the following


fact:
is > k, then |Jf?| < 2 |JB|. In
of this fact is easy\342\200\224just
proof
k \\R\\ since
(r) > k for each
degree

In particular,
we
of each region

V(G).

G, if

the

is the

a region

forms
the boundary.
Then the
where regions may have degree

greater than or equalto 3.We call a connected


and
if degree
(r) > 3 for each regionr E i? (G);
3 for

loops (though

that the degreeof

we are assumingthat

1; thus

|E| >

and

assume

shall

we

However,

simple

have

to

graph

We recall

not).

\\E\\.

The

(r) = 2 \\E\\

connected

of

G such

>

graph G,

(simple)

plane

with

\\E\\>

1,

(1) |E|<3|V|-6and

(2) there

is a vertex v

Proof.

By

|i?|

Euler'sjormula

that degree (v)


+ |Vr|

< 5.

= |2?|+ 2, and sinceG is simple


+ |V|>:|i?| + |V| = |jB|-f 2.

3|/?|<2|JS|or|i?|<2/3|JS|.Hence,2/3|JS|
2 ^ 1/31JB | or 31 V\\| V\\since
if
then
As
each vertex has degree
for
(v) =\342\226\240\
(2)
2ur ViG) degree
<
#
Likewise
it
that
follows
|
|.
61 V\\<2\\E\\or\\
|
2/31 \302\243
2|E|,
But then since |R\\
+
+ 2, we have 2/31E\\ + 1/3|JE| => |fl|
+ | V\\ = \\E\\
> 2, an obvious contradiction. \342\226\241
| V\\ = | E | + 2 or | E \\ > |E \\ + 2 or 0

6>|JB|.
>6,
V\\<l/3\\E\\.

Thus,

The

fact

simple

problem,which

we

in (2)

Theorem 5.8.2.
Proof.
only

to show

that

K5

planar,

is

in connection

Section 5.12.

graph

Kn

Kn is

planar

is planar
for n
if n > 5, and for

this by an

We prove

|fl|\302\253|JE|-|V| +

with the

useful

in the

complete

It is easyto seethat
that Kn is nonplanar

nonplanar.

then

is very

discuss

will

2-10-5

iff

four-color

< 4.

= 1,2,3,4.Thus, we
this

it suffices

have

to show

indirect argument.If K5 were


+ 2 = 7. But since Kn is simple

and loop free, we would


in this case would
also have 31R \\ < 21E \\ which
\342\200\242
=
\342\200\242
=
<
21
2
that
3
7
an
obvious
contradiction.
10
(Note we
20,
imply
could
have
a contradiction also by appealingto the inequality
obtained
\342\226\241

|JS|<3|V|-6.)
Theorem

or n < 2.

5.8.3.

A complete

bipartite graph Kmtn

is planar

iff m

5 2

532

Chapter

5: Graphs

if m < 2 or n < 2. Now


It is easy to see that Kmtn is planar
let
that
3 and n > 3. To prove
it suffices to prove that
Xmn is nonplanar
is nonplanar.
(We did this in section 5.7,but let us give another
proof
X3>3
based on Euler's Formula.)
SinceK3t3 has six vertices and nine edges, if X33 were planar, Euler's
formula would give that | R | = |\302\243
+ 2 = 9-6 + 2 = 5.SinceX33 is
| -|V|
there
can be no cycles of odd length.
each cycle has
Hence
bipartite
length >4 and thus the degreeof each region would have to be greater
than or equal to 4. But then we would have to have 41R | < 21E| or
9 = 18, a contradiction.
\342\226\241
20 = 4 - 5 < 2 \342\200\242
Proof.

m >

method of proofby

and the

formula

Euler's

will

contradiction

solve the

following problem.

Example 5.8.1. Provethat


with

seven

exactly

were sucha polyhedral

If there

14

not exist

does

there

a polyhedral

graph

edges.
graph

|E |

with

31R| < 21E| =

= 7, then

>3. Moreover, eachvertexhas degree>3,


sothat 31 V\\ < 21E | = 14. Thus, |R \\ < 4 and | V\\ < 4. By Euler's formula,
|i?| + \\V\\ = \\E\\ + 2 = 9 and then 8 > \\R\\ + | V\\ = \\E\\ + 2 - 9, a
that
a polyhedral
contradiction.We conclude
graph with 7 edges does not
exist.
each

since

Exercises

has degree

region

for Section 5.8

1.

is no

there

that

Prove

polyhedral graph

with

and

30 edges

exactly

11 regions.

2. Provethat

for

(a) 11/1*2

graph

polyhedral

+I V|/2.

|a|*2

(b)

any

+ 1*1/2,

(c) 3|fl|-6>|\302\243|.

3. Using the resultsof Problem2 together


31

V\\ <

2\\E\\

prove

that

V\\ > 4,

with

31 * |

|JR| > 4, and

\\E\\

< 21E
>

\\

6 for

and

any

polyhedral graph.

4. (a) If G
(b)

5.

6.

is a

polyhedral

graph

with

that the degreeof eachregion


If G is a connected planegraph

prove that the degreeofeach


Show that a plane connectedgraph
vertex of degree <4.
Suppose

that

regions and

and

30 edges,

prove

6 vertices

and 12

edges,

30 edges

has a

vertices

12
is 3.

with
region
with

is 3.
less

than

less
12
G is a connected plane graph with
than
such that eachvertex of G has degree >3. Then prove

that G has a regionof degree<4.

Section

7. Show that

is a

if

8.

a direct

Give

that a plane-connected graph with


each vertexof degree>3must have

proof

>5 and

of degree

there is a regionof

graph, then

polyhedral

degree<5.

533

Formula

Euler's

5.8

each

at

region

30

least

edges.

9. Prove that a connectedplane graph


(v) = 4 for each vertex v of G must

10.

Let

a connected

G be

plane graph

denote, respectively
all

of G.

V\\ >

8(G) and A(G)


of the degreesof

3. Let

and maximum

minimum

the

vertices

the

with

Suppose that G has

3 and

of degree

8 regions

one regionof degree4.

and degree

7 vertices

with
have

of

vertices

Vk

exactly

degree k.

(a) Showthat 5^
(n - 6)Vn + 12

(b)
(c)

+ 3 Vz + 2 V4 + Vb >
= A(G).
n
when
Usethe resultin (a) to prove the existence

V1 +

4 V2

2 Vs

...

of a vertex in G of

degree <5.
that

Observe

that

Suppose
of

holds in (a)

equality

is 3. .
(d)

the

of each

degree

region

that there areat least12vertices

= 5. Prove

5(G)

iff

5.

degree

that d(G)> 3 and | V| > 4.Provethat

(e) Suppose

4 vertices of degree lessthan

or

equal

are

there

at least

to 5.

is not connected
but instead consists
of severalcomponents,
that
connected
is, disjoint
subgraphs.
of Euler's
formula
for a
(a) Find the appropriatemodification
C
with
components.
plane graph
for plane
(b) Show that Corollary 5.8.1is true even
graphs that are
not connected.
12. Draw 2 polyhedral
graphs with 6 vertices and 10edges.

11. Suppose that a plane graphG

13.

Give

an

(a)

|\302\243|

of a

example
=

connected plane

graph suchthat:

3|V|-6.

(b) \\E\\<3\\V\\-6.

14. Prove or
| E | = 31V\\

15.

Show

that

do not

Show that

(b)

part

17.

Show

that

Kn

is

connected

graph

is planar

Km>n is

that if G

if we

is false

planar

<n <

4.
<
for 1 m < 2 or 1 < n

for 1

is a simpleplanar

graph

with

<

2.

| V\\

>,11, then

the

is nonplanar.

has
G be a plane graph such that eachvertex
degree
that a dual of G will lhave an odd number of regionsof finite
Let

that

such

is simple.

complementof G
19.N

is planar. Explain.
of the corollary to Euler's formula

6, then G

assume G

16.

18. Show

disprove:If

3. Prove
area.

534

Chapter

5: Graphs

20. If G is a connectedplanegraph
the

that

show

inequality

\\E\\

all

with
<

of length

cycles

- 6 can be strengthened

3| V|

at least r,
to

|J5|<[r/(r-2)](|V|-2).

crossing numberc (G)ofa graph


all the
pairs of crossingedgesamong

21. The

Forexample, G
if

(1) K^.
(2)

(G) = 0.
for the following graphs:

of G in

the plane.

then c

is planar,

c (G)

Determine

(a)

number of

the minimum

G is

depictions

K5.

c (K6) = 3. (Hint. Introducenew vertices


at
and use the corollary
to Euler's
formula.)
22. Show that if a plane graph is self-dual (see Exercise1ofSection
5.7
for the definition),
then | E | = 21V \\ - 2.
23. Sometimes we are ableto say that
a simple
graph is nonplanar
Determine
that
each cross-over

(b)

simplybecausethereare too
proof of Euler'sformula

24. Give a
of

25.

many
by

Explain.

edges.
using

number

on the

induction

edges.

that
Suppose
(a) G has 35

G is a connectedplanar graph.Determine
|V
regions each of degree 6.

if

14 regionseachof degree4.
each of degreek.
26. A planar graph G is called maximal planar if, for each pair of
nonadjacent vertices u and v of G, the addition of the edge {uyv\\
(b)

G has

(c)

G has

| R | regions

planarity.

destroys

that

Prove

| E | = 31V

Selected

for

Answers

2. (a)

\\V\\

2 +

| >

3. then

5.8

Section

maximal planar graph and | V


degree of each regionis 3.

if G is a
6 and the

+ |i?i/2since|\302\243|>:3/2|fi|implies

(|jB|-|i?|)>2

that|E|-|rt|;>|fl|/2.

6.

>

(r)

degree

Suppose

\\R\\-\\E\\-\\V\\

Then,

5/61R | +

2. But then | R

7. Observe that in

2\\V\\
6n3

4-

|JE|>

2or6|V|

\342\200\242
\342\200\242
\342\200\242

-21JB

equality

-1

-2/3|JB|.

V|=>

- 2/3\\E\\+ 2-\\E\\/3 +

\\

>

12, a

2>

contradiction.

the dual (7* there is a vertex

31R | < 21 \302\243


| and
- Eby
\\R | + | V|
-

and

|V|<2/3|\302\243|

+ 2>\\E\\
> 2 or | R
\\/6

Hence the regionr has degree


10. | V| = 2,..!*,.and 21E\\= 2U(V(G)
Also

region r. Then 2|2?|>5|i?| or

5 for each
or

5/2\\R\\^\\E\\,2\\E\\z>3\\V\\

r*

of

degree

< 5.

- - - .

< 5.
deg

holds

= nt

(u)
iff

+ 2n2 +

each

region

3n3

has degree

3.

Euler's formula,
+
so|
1/31\302\243|
2/31E\\
V\\
- 2|JS|> 12.Write
= 6n, + 6n2 +
6|V|
- 3n3... and sum.
\342\200\224n, 2n2
=

Section

5.9

Multigraphs

11. (a)

exterior region
G, we have \\Rt\\

if the

that

Observe

of

component

over all

summing

regiongives|fl|-|\302\243|

18.

V\\

of edges

number

The

(| V\\

- 1). Thus, G

535

and Euter Circuits

is not countedthen for


=

\\Et\\

+
|V\302\243|

each

Then

1.

components and adding 1 for the


- | V| + C + 1.
of G_plus the number of edgesof

exterior

is 1/2

at least 1/41 V\\ (| V\\ - 1) edges.


\342\200\224
>
6 for | V\\*
11 (verify!), G
1)
V\\
31 V| \342\200\224
or
otherwise
the
many
edges
corollaryto Euler's
But then G violates the corollary
violated.
and
or

G has

But since1/41V|(|
cannot have

hence

5.9

MULTIGRAPHS

that

be

would

formula

is nonplanar.

AND EULER CIRCUITS

the concept of graph in mathematics


is by
Euler (1707-1782), who
in
1736
a famous unsolved problem of his day known as the Problem of
settled
the KonigsbergBridges.The East Prussian
city of Konigsberg (now
on the banks of the Pregel River. Includedin
Kaliningrad)was located
the
to the
and
city were two islands, which were linkedto eachother
banks of the river
as shown in Figure 5-64.
by seven
bridges,
The problem
to begin
was
at any of the four
land
denoted
areas,
by the
letters a, 6, c, and d, to walk across a route that crossed each bridge
to return to the starting point. In proving
that
this
and
once,
exactly
particular
problem is unsolvable, Euler replacedeachofthe areas a, b, c,
and d by a vertex and eachbridgeby an edge joining the corresponding
Swiss

use of

recorded

earliest

The

the

Leonhard

mathematician

in Figure
shown
5-65.
vertices, thereby producingthe \"graph\"
Of course, to expressthis kind of structure,the moregeneral

multigraph

notion

of

is required.

There are severalways

edges

a single

with

called

between

numbers,

of

of points.

pair
multiplicities.

a*

the existence

expressing

formally

One way
According

is

the edges
by labeling
to this convention, the

*d

Figure 5-64.

The

Konigsberg

of multiple

Bridges.

536

Chapter 5: Graphs

Figure

Euler's

5-65.

\"graph.\"

bridges could be representedby


5-66.
and
are
The edges{a,c}
{a,b\\
Figure
Konigsberg

indicating that there are two bridges


vertices, whereasthe other edgesare
since each corresponds
to a single bridge.
This

natural

convention

labeled

with

multiplicity

1,

for representing multiple edges correspondsto a


we shall
notion of adjacency matrix, which
call a

of the

extension

multiplicity

between
each

graph shown in
with multiplicity 2,
each of these pairs of

labeled

the

labeled

matrix. The

multiplicity

matrix

of

Figure 5-66is:

the

graph

0 2 2 1

2 0 0 1

2 0 0 1

1110

#\342\200\242

Figure

5-66.

The graph of Konigsberg

Bridges.

shown in

Section5.9

and

Multigraphs

Figure 5-67.

The

multigraph

of the

Euler Circuits

537

Konigsberg Bridges.

While this representation is adequatefor this problem,


and convenient
for computer manipulation,it is not adequatefor all applications,
since it
does not providefor the possibility
of there being multiple distinct edges
between
a pair
of vertices. We could put labels {\302\243,u,u,w,:x;,;y,z}
on
the
Konigsberg
bridges as shown in Figure 5-67.
Now
let
us show how Euler proved that the problemof Konigsberg
Bridges

is unsolvable.

multigraph is a path that


multigraph
exactly once and intersects each
edge
A
of
vertex
the
at
least
once.
is said
to be
multigraph
multigraph
traversable if it has an Euler path. An Euler
is an Euler path
circuit
whoseendpointsareidentical.
of
(That
is, if an Euler path is a sequence
of
the
of
vertices
to
sequence
pairs
edgeseu e2,... fek corresponding
5.9.1.

Definition

includeseach

multigraph

in a

path

the

(xk_l,xk)9

,...,
is said

(xiyX2)9(x2fX3)

Euler

An

of

to be

then the

ef-.8

are

all

distinct,

an Eulerian multigraph

if

it

and xx=xk.) A
has an Euler

circuit.
We will now prove the main theorem characterizing
that have Euler paths.
multigraphs

nondirected

Theorem 5.9.1.
connected
the two

A nondirected
has an Euler path iff it is
multigraph
Inthe latter case,
0 or exactly2 verticesofodddegree.
of every Euler path in
vertices of odd degreeare the endpoints

and has

the multigraph.
that
G have an Euler path. It isclear
multigraph
Moreover, every time theEulerpath meets a vertex
on the vertex and which have
incident
are
it traverses two edges which
of the path, the
not
been
traced
before. Except for the two endpoints
be even. If the endpoints are
degree of all other verticesmust therefore
distinct, their degreesare odd. If the two endpoints coincide, their
degreesare even and the path becomes an Euler circuit, (if) Let us

Proof,

G must

(only

if)

be connected.

Let

538

Chapter 5: Graphs

construct an Eulerpath

at one of the vertices of odd degree


by starting
each edge of G exactlyonce.If thereare no vertices
of odd
vertex
of even degree
degree we will start at an arbitrary vertex. For every
the path will enter thevertexand leave the vertex by tracing an edgethat
was
not
before. Thus the construction will terminate
traced
at a vertex
with
an odd
degree, or return to the vertexwhereit started.This tracing
will
an Euler path if all edges in G are traced
once this
produce
exactly
and traversing

way.
If not all edges in G

are

those edges that

we will remove

traced,

have

G' inducedby the remaining


edges.
The degrees of all verticesin this subgraph must be even
and
at least one
vertex must intersect with the path, since G is connected. Starting from
one
of these vertices, we can now constructa new
in this case
which
path,
will
This path will be joined into
be a cycle, since all degrees are now
even.
the previous path. The argument
can
be repeated
until a path that
traversesall edgesin G is obtained.
\342\226\241
traced

been

The

proofs

the subgraph

obtain

and

of the

following corollaries

the

from

follow

preceding

theorem.

Corollary
it

is connected

5.9.1.

and all

nondirected

has an

multigraph

of its verticesareofeven

Euler circuit

iff

degree.

iff it is
A directed multigraph G has an Eulerpath
5.9.2.
connected and the in-degreeof eachvertex
is equal
to its
of two vertices, for which
it may
out-degree, with the possible
exception
be that the in-degree of one is one largerthan
its
and the
out-degree
its out-degree.
in-degree of the otherisonelessthan

Corollary

unilaterally

Corollary
is unilaterally

A directed
5.9.3.
connected and the

its out-degree.

Example 5.9.1.
with

a penciLwithout

The

lifting

multigraph

It is

the

an Euler
vertex

circuit iff

in G

is equal

to

of drawing
a multigraph on paper
the pencil or repeating any lines is clearly a
can be
path in the multigraph. A multigraph
in
an Euler path. For example,the multigraph
problem

an Euler
problem of finding
drawn in this way iff it has
5-68 (a) can be drawn in this fashion
Figure

exactly once,while

G has

in-degreeof every

directed

multigraph

with

each

in Figure

edge

being traced

5-68 (b) cannot.

5.9.1 gives the basis of an


a nondirected multigraph
whether
algorithm
has an Eulercircuit.Assume
G is represented
that
by an n x n adjacency
matrix A. To check that all vertices of G are of even degreewe add all the
efficient

interesting

to

observe

that

for determining

Theorem

Section 5.9

(a)

539

Euier Circuits

and

Multigraphs

(b)
Figure 5-68

Ps in each row
takes

the sum

whether

check

and

there are n

steps, and since

O(n)

performedin 0(n2)steps.Tocheck

the

(This

WarshalPs

algorithm.

are not

covered in this

G is

that

A* of A,

closure

reflexive

transitive

can be

is even. For eachrow,


whole

the

rows

connected,

which takes

this

process can be
we can compute

0(n3) steps using

done in 0(n2) stepsby

that

methods

book.)

Application to ComputerScience

De

symbols. Clearly

symbols.A

de

there are nk

Bruijn

sequence,

register

Let

Sequences.

Bruijn

every sequencea in

2 =

different

the

computation

of the

this condition,

satisfies

fly+A-i

de

binary

graph
binary

of n

alphabet

k over

these

OL,

alphabet,

nk.

The

where

most

n =

if the

important

2, and

sequence

case

in

thus 2 = {0,1}.

and
are
are very useful in coding theory
sequences
it is possible to arrange 2k
that
by shift registers. To show
of k
in a circular array such that the 2k sequences

digits
with

an

Bruijn

implemented
consecutive
digits

be

indices is moduloL. Clearly

then L =

computer science is the binary


Binary

1}

of length

sequences

known also as a maximum-lengthshift


sequence,
is a circular array a0ax... aL_l
2 such that for
over
2* there
exists a unique j suchthat
ajaj+i

where

{0,1,.. ,,n -

in

the
2k~l

arrangement
vertices

which

are all distinct, we


are labeled with

the vertex bxb2

construct
the

2k~1

a directed

(fe-l)-digit

is an edge to the
bk_x
\342\200\242 and
an edge to the
vertex b2b3
is labeled bLb2 - \342\200\242
which
b^O
bk_10
\342\226\240
\342\200\242
\342\200\242
\342\200\242
is labeled bxb2 \342\226\240
vertex labeled b2bz \342\200\242
bk _xl. According
bk _xl which
to a
to Corollary 5.9.3 the graph has an Eulercircuit,
which
corresponds
circular arrangement of the 2k binary
digits.

numbers. From
\342\200\242
\342\200\242
\342\200\242

\342\200\242
\342\200\242
\342\200\242 there

540

Chapter 5: Graphs

These graphs are known


shift

register

E =

state

as

diagrams,

de Bruijn

and are

{[(bl9.. .A_i),(62,

and each edge [(bl9...A-i)\302\273(&*.

5-69illustrates

G2>4(

For

of the

example,

diagrams

or Good's diagrams,or

denoted by GnM

. .,ViA)]

is labeled

-A-iA)]

bl9b29..

(V,E)

where

.9bk.l9bk

G 2}

6lf.. -A-iA-

Figure

V,\302\243).

consider

the directed

sequence of edgeswith

the

Euler circuit of

following

labels:

G2>4( V,E)

consisting

Section 5.9

sequenceof 16binary

and the

541

Euler Circuits

and

Multigraphs

is

digits

0000101001111011,

where the

circular arrangement is obtainedby

sequence.
One applicationof this

For

example,

of the
by

one digit.

only

digits in the

on G2A(

Euler circuit

is in

concept

16 binary

the

create

V,E)

This means that

the

closing

two ends

of the

the generation of unique codes.


above sequencegeneratedby use
16 unique code words that differ

the sequenceof

16

binary

digits

given

will
16 different
above, when implementedon a rotatingdrum,
generate
In
of
the
drum
that
16
distinct
codes.
and
produce
generalit
positions
by
in
2n binary
a
such
that 2n
is possibleto arrange
circular
array
digits
n
of
in
the
distinct.
areall
consecutive
sequences
digits
arrangement

ExercisesforSection
5.9
graph that

contains an Euler circuit is

connected.

strongly

2.

a directed

that

Show

1.

a connected
to a set of
decomposed
that

Prove

graph has a Euler circuit iff it


elementary cycles that have no

can
edge

be
in

common.

3. Find an

Euler circuitin

\342\200\242

\342\200\242

Figure

5-70.

\342\200\242

\342\200\242

\342\200\242

\342\200\242

\342\200\242

LM\\./J

CIXD

(b)

(a)

Figure

4. In

present day Kaliningrad


have been constructed.One

the other
over

5.

Prove

have

all

between

bridges
or

an

is called

b and

5-70

two
(Konigsberg)
is
between
bridge

additional
bridges
regions b and c and

now possible to construct a route


without recrossing any of them?

d. Is it

of Kaliningrad

A graph which possesses an Euler circuitmay


an edge
removal disconnects the graph.(Such
whose
edge
Disprove:

a \"bridge.\

542

Chapter

5: Graphs

6. Give
as

7. In

an example of a graph with

an Euler

ten

edges

has a

that

bridge as well

path.

the definition

of

circuit

Euler

Eulercircuitintersects
8. Is it possible a knight to
with

discuss the

requirement that the


once.

at least

vertex

every

move on an 8 x 8 chessboard
sothat it
move exactly once? A move
between
two
it is made
in either
on the chessboardis completewhen
for

makes

possible

every

squares

direction.
or 2) sequence in which every
9. Builda 27-digitcircular
(0,1,
ternary
once.
appearsexactly
3-digitsubsequence
10. Let L (G) of a graph G be another
graph which has a vertex for each
edge

in G

and two of

edges
corresponding

Euler circuit

G has

if

11. Find a graph G

are adjacent

vertices

these

an Euler

which

no

has

the

iff

common end vertex.Show

have a

in G

that

circuit.
Euler circuit but

for

has an

L(G)

which

L(G)

has

one.

12. Prove that if a connected


then
graph has 2n vertices of odd degree
each
once.
(a) n Euler paths are requiredto contain
edge exactly
(b) There existsa set of n such paths.
13. Prove that for positive
and k there existsa de Bruijn
5+1
integers
sequence.

Prove

14.

that

for positive

directed Eulercircuit.

15.

Which

of the

integers 5
in Figure

multigraphs

1 and

5-71 have

n, G8+ln(V,E)
Euler

has a

circuits,

paths,

or neither?

(c)

(b)

(a)

Figure

5.10

HAMILTONIAN

roads

that

the

5-71

GRAPHS

Suppose that a
with

(d)

connecting

salesman's

traveling

certain

salesman's

pairs of

job requires

includes

territory

several

cities

these cities. Supposeadditionally

that he visit

each

city

personally.

Is it

Section 5.10

Hamiltonian

for him

possible

specifiedcity

to schedulea round trip by

exactly

car

enabling

Graphs

him to

543

visit each

once?

We can represent the salient featuresof this


problem
by a graph G
to the cities in the salesman's territory, and
whoseverticescorrespond
such that two vertices
are joined
is a road directly
by an edge iff there
connecting the two cities (that is, the road does not pass through
any
on
other
city in the territory). The solution of this
problem
depends
vertex of G.
whether G has a cycle containing
every
of Hamiltonian
Thus, we see that this problem suggeststhe concept
G is said to be Hamiltonian
if
there
exists
a cycle
graphs. A graph
to as a
containing every vertex of G. Sucha cycle is referred
Hamiltonian cycle.
a
a Hamiltonian
Thus,
graph is a graph containing
that
Hamiltonian cycle.
We
define
a Hamiltonian
path as a simple path
be distinct.
Since
contains
all vertices of G but wherethe end points
may
a graph is Hamiltonianiff its underlying
simple graph is Hamiltonian
we limit our discussionto simplegraphs.
Whereas
the Euler
circuit is a circuit that traverseseachedgeexactly
once
traverses
each vertex at least once,a Hamiltonian
and,
therefore,
traverses
each
vertex
exactly once (and hencemay miss some edges
cycle
is
there
a striking similarity
of
between
the concepts
Thus,
altogether.)
Eulerian graph and Hamiltoniangraph,
one might expect
and
therefore
an elegant characterizationof Hamiltonian
as in the case of
graphs
Eulerian graphs.Such is not the case, and, in fact, the developmentof

sucha characterization
isa major

unsolved

sure, a Hamiltonian cycle


deletionof
On the
any
upon
edge.
To be

always

problem

provides

in graph theory,
a Hamiltonian
path,

a Hamiltonian path may


on
whether or not the end
cycle (it depends
of
the
to
be
an
points
path happen
joined by
edge in the graph).
is derived
from the Irish mathematician Sir
The name \"Hamiltonian\"
Rowan
who invented a game in 1857consisting
of
William
a
Hamilton,
solid
one
each
corner
o
f
inserted
at
dodecahedron,
regular
twenty pegs,
the
was
and a supply of string. Eachcorner
marked
with
dodecahedron,
the name of an important city of the time, and the aim of the game was to
find a round trip routealong
of the dodecahedron that passed
the
edges
In
for the players to recallwhich
each
once.
order
exactly
city
through
in a route had aleady been visited, the string
was
used
to connect
cities
a graphical
the appropriate pegs in order.Lateron Hamilton
introduced
version of the gamewhere
the
was to find a Hamiltonian cycleon
object
the graph of the dodecahedron.
Try your hand at the game.
it
has
been
assumed
that Hamilton's game representedthe
Generally,
not

first

lead

to a

interest

mathematician
Thomas

other hand,

Hamiltonian

in Hamiltonian
graphs, but in fact, the English
P. Kirkman
posed a problem about Hamiltoniangraphs in a

to the
paper
Royal
of
Hamilton's
appearance
submitted

game.

Society

in 1855,

two years prior to the

544

Chapter

5: Graphs

graph illustratedin

Clearly the
a

find

Hamiltonian

by

cycle

omitting the edge{v4,vs}].

for we can
the
inspection [following
numbering and
Figure

5-72

is Hamiltonian

there are some graphs that are not Hamiltonian


and
contain a Hamiltonian path. The problem
ofproving
that
can
be very
no Hamiltonian
cycle (or path) exists in a given
graph
the
of
several
cases.
difficult\342\200\224frequently
requiring
analysis
Let us focusour attentionfor the moment on showing that a
or path does not exist, for the nonexistence
Hamiltoniancycle
problem
requires
the type of systematic
that is the essenseof most applied
analysis
logical
But,

of course,

they need not

theory.

graph

the nonexistenceof a Hamiltonian


or cycle, we must
path
of
the
a
Hamiltonian
and
show
that
path
begin buildingparts
must
we
visit
without
construction
that
cannot
all
vertices
fail,
is,
always
visiting
how
some vertices at leasttwice.The following
demonstrate
examples
us state
some basic
such contradictions can be obtained.But first
let
in building
rules that must be followed
Hamiltonian
paths. The idea
theserulesis
a
contain exactly
that
Hamiltonian
must
cycle
underlying
two edges incidentat eachvertex
and
a Hamiltonian
path must contain
at least oneofthe edges.
To prove

SomeBasicRules

for

Rule 1. If G
n

exactly

Hamiltonian

Constructing
has

1 edges,

Paths

and Cycles

then a Hamiltonian path must contain


n
and a Hamiltonian cycle must contain
exactly

n vertices,

edges.

Rule 2. If a vertex
containat least edge

one

in

G has

incident

degree k, then a Hamiltonianpath must


on v and at most two edgesincidenton

two
incident
cycle will, of course, contain exactly
edges
In particular, both edgesincidenton a vertex of degree two will be
in every Hamiltonian cycle. In sum:therecannot
be three
or
contained
more edges incident with one vertexin a Hamiltonian
cycle.
Rule 3. No cycle that doesnot contain
all the vertices of G can be
a Hamiltonian
formedwhen building
path or cycle.
v. A

Hamiltonian

on v.

\342\200\242
v*

-\342\200\242

v5

Figure

5-72

Section 5.10

Hamiltonian

the Hamiltonian cycle

4. Once

Rule

through a vertex

are

we

has passed

building

edges incident on

unused

other

all

then

only two

because

deleted

v,

edges incident on

can

545

Graphs

be

included

be

can

in a

Hamiltonian cycle.

Example 5.10.1.
5-73)

order

in the

The

of

path

appearance

Hamiltonianpath. However,

through
in

Gx has

vertices

the

of

Gx

(in

Figure

English alphabet forms a


no Hamiltonian
cycle since if so, any
the

contain the edges{a,6},


{a,e},
{c,d},
{d,e}, {/,#},
be three
and {e,g}.But then therewould
edges of the cycle incidenton the
cycle must

Hamiltonian
e.

vertex

5.10.2.

Example

Likewise

a Hamiltonian path nor a

vertex / has degree5 so that


in

included

any

Hamiltonian

cycle

at

the graph
for

G2

(in

Figure

least

following
three edges

path. The

neither
Note that the

5-73) has

reason.

the

incident on / cannot be

same is true for

the

vertices

h and

are 13verticesof degree3 and, in particular,


b, d, f, and n are
suchthat at leastoneofthe threeedges incident
on each of these vertices
in a Hamiltonian
cannot be included
path. Thus, at least9 + 4 = 13 of the
27 edges of G2 cannot
be included
in any Hamiltonian path. Hencethere
are
not
of G2.
enough
edges to form a Hamiltonianpath on the 16vertices
Thus, G2 has no Hamiltonianpath.

j. There

The appealto

the

symmetry

of the

graph often

saves some effort.

See

5-74.

Figure

If a Hamiltoniancycle exists for G3 then the cycle


5.10.3.
Example
must includethe edges{a,d}, {d,g}, {fc,e}, {e,h}, {c,/}, and {f,i}by Rule 2.
to
6. Since the graph is symmetricwith
Nextconsider
the
vertex
respect
it doesnot matter
of these two edges we
the edges {a,b} and {6,c},
which
b to be in the cycle. Suppose we
on
chooseas the other edgeincident
then
we
choose
the edge {ayb} (if we obtain a contradiction using {a,b\\,
G2

Gx

Figure 5-73

546

Chapter

5: Graphs

<?3

nm

dm

5-74

Figure

Now
obtain a contradiction
{6,c}).
by Rule 4, we can
reduces
the
deletethe other edge
\\byc\\
degree of c to 2 so
Deleting
also.But
the
then there
must
thena
include
cycle
edge fa,c}

would also

with

{fc,c}.

Hamiltonian

be three
edges incident at a. Therefore, G3 has
There
is, however, a Hamiltonian path, namely,
cycle.
order:
traverses the vertices in the following
a-d-g-h-e-b-c-f-i.

no

would

5.10.4.
The graph
Example
/ is
horizontal symmetry(thevertex
are

There

symmetrical).

so that

vertex
Rules

2 and

edges.

Vertex

once

two

no vertices

off to

5-74 has vertical and


Figure
one side but its adjacencies
are

of degree 2 in this graph so we seek a


at the vertex, then the useof

chosen

are

edges

in

G4

Hamiltonian
that
path

the

the successive deletion and inclusionof many


such a vertex. We can use two edges incident on e, 180
a 90 degree
use two edges incident on e that form
angle.

4 will force

e is

degrees

or

apart,

We examine

Case 1.

both cases.

consider
the situation where edges from
proposed Hamiltonian cycle.We choose the
edges {d,e\\ and {e,f\\ as part of our Hamiltonian cycle (the choiceof edges
and
Then
{b,e\\
{e,h\\ would
give the same conclusionby symmetry).
by
Rule 4, we^an delete {bfe} and {efh}. Then at b and h we must use both
incident
on b and h respectively. Thus, we must
choose
remaining
edges
the edges \\g,h},
choose
either {a,d} or
{hyi}, {ayb\\ and {6,c}. Now at d we may
opposite

The

{d,g\\.

we

that

Suppose

~ides

of e

two

cases

are in a

are symmetrical

with

the cyclethus far. Therefore,without


and,

consequently,

delete

subcyclea-b-c-f-e-d-awould
the other edgesincident
on
{a,n},{a,j},{i,k}> and {iym}.
contrary

to properties

have degree

2, but

{d,g}. Now
a and

at /,

so we

result,
i>

We now

of generality,
we
use
cannot

edges chosen for


we choose {afd\\
{c,/} or else the

chose {f,i}. But

respectively,

edges

Delete

situation which

cycles.Verticesj

remaining

then by Rule 4

be deleted.

must

have arrived at a

of Hamiltonian

adding their two

to the

respect

loss

forces

and

is

k currently

three edges

to

Section5.10

Hamiltonian

occursat g). We
on c (the same.discrepancy
Hamiltonian cyclein Case1.

be incident
there is no

Case2.
90

form

{dye} and

delete

choose

we

{b,e}

at d

Then

\\eyh).

choose\\gyh)

we must

symmetry we may

angle. By

edges. Suppose that

two edges

we include

that

now

Suppose

degree

and

choose

that

conclude

incident on e that
pair

any

{e,/}. Then by

we must choose \\ayd) and


at / we choose{c,/}and

{hyi}. If

and

547

Graphs

of such

Rule 4 we may
{dyg\\y and at h
b we choose

at

b-c-f-e-b. If instead we choose [fyi\\ and {ayb}


Thus, we concludethat at / and at b
we must choose {c,/}and {ayb} or {fyi} and {byc}. By symmetry either choice
is equivalent.Letus choose {c,/} and {a,6}. Then having used two edges at
we have

then

{byc}

we

get

c, and

at

leaves

only
that

with

gy

G4

we

a-b-e-f-i-h-g-d-a.

the

delete

one edge

other

edges

{ayn}y

{ayj}y

incident on n. There can

be

[gyn\\ and \\gym\\.


no Hamiltonian

This

cycle

property.

having obtained ra contradiction


cycle.

Therefore,

that

a subcycle:

a subcycle:

has

There is no Hamiltoniancycle

Example 5.10.5.
(See Figure 5-75.)

Each

in both

cases we

conclude

no Hamiltonian

for

the

graph

G5.

4. Moreover,every edge
4. No other type edge
a vertex of degree 3 with
one
of degree
connects
in
If
exists this graph.
we had a Hamiltonian cycle
it would
visit each
vertex of the graph passingalternately
a 3-vertex
and a 4-vertex.
through
This cycle would establish
a one-to-one
correspondence between the
vertex

G5 has

of

setof 3-vertices

the

and

graph had

set

six 4-vertices.

by

inspection

Therefore,

either 3 or

Then it would follow


if this
that
be exactly as many 3-vertices
see that there are eight3-vertices
and

of 4-vertices.

a Hamiltoniancycle

as 4-vertices.But

only

degree

there

we

would

there can be no Hamiltoniancycle

Figure

5-75

for

G5.

548

Chapter5: Graphs
that there is no Hamiltonian path for G5 by
for if there were sucha path
the
number
of 3-vertices
could
differ
and the numberof 4-vertices
only
by one. Since this isnot the
conclude

also

can

We

similar

reasoning,

case

Hamiltonian

is no

there

path.

one whose vertex


The above graph is a specialcaseofa bipartite
graph,
set can be partitionedinto two sets in such a way that each edgejoinsa
of coloring
vertex
of the first set to a vertex of the secondset.If we think
the vertices of the first set one color, say red, and coloringthe verticesoff
vertices
of different
the
set blue, then every edge goesbetween
second
colors. By reasoning as we did in the above example we obtain the
fact:
// a connected bipartite graph G has a
following
simple
be equal;
Hamiltoniancycle
then
the numbers of red and blue verticesmust
if G
and
vertices
can
has a Hamiltonian path, then
the
numbers
red
blue
of
by

differ

one.

most

at

The next

theorem gives

Hamiltoniangraph.To

must prevail for any


of this theorem

that

condition

statement

the

understand

plane
let us

G be a plane Hamiltonian graph with


n
C
is
that
a
fixed
Hamiltonian
in
G.
suppose
cycle
With respect to this cycle,a diagonalis an edge of G that does not lie on
C.Letr,-(i = 3,4,.. .,n) denote the number of regionsof G in the interior of
C whose boundary containsexactly
i edges
of
(that is, rt is the number
in
of
i
the
interior
of
let
denote
the
C).
regions
Similarly,
degree
r]
number of regionsof degreei in the exterior of C. To illustrate these
definitions,let G be the following graph (Figure 5-76) with Hamiltonian
some

review

vertices.

cycle

Let

terminology.

Moreover,

C: vt

Thus,

v2

r3 =

{t>4,t>9}, ta,^},

diagonal

\342\200\224
\342\200\224
\342\200\224
\342\200\224
\342\200\224
\342\200\224
\342\200\224
\342\200\224
\342\200\224

3, r\\
and

in the

vz
=

v4

2, r4

{v7,v9}y

v5

= 2,

are

vG

r\\

diagonals

exterior of C.

Theorem 5.10.1(Grinberg).
n vertices.

Suppose

v7

v8

v9

vv

= 0, and r\\ = 1. Moreover,


{vl9v3}>
in the interior of C, while
{vuv4\\ is a

1, r6

Let

G be

that C is a Hamiltoniancycle

Figure 5-76

a simple
in

plane graph with


with respect

G. Then

Section5.10

Hamiltonian

549

Graphs

cycle C,

to this

(i
\302\243
i-3

First

Proof.

occur

diagonals

- rj) -

2)(r,

the interior
consider
there. Since G is a

0.

of C. Supposethat

plane

graph,

none

exactly

of

its

edges

it passes into
intersect. Thus a diagonalsplits the region
which
through
one
two parts. Thinking of putting in the diagonals
at a time, we see that
the insertionof a diagonal increases by one the numberof regionsinside
the
d diagonals divide the interiorof C into d + 1
cycle.
Consequently
regions. Therefore,
n

ri
\302\243

- 1.
d - ]T rt\342\226\240

and

+ 1

= d

t-3

Let N

denote the sum

However,
\302\243rt.

2JJL3

of the
each diagonal

the

of

degrees

N counts

regions interiorto C.Then


twice (sinceeachdiagonal

regions interior to C) and eachedgeof


only one regioninteriorto C).Thus,

of the

two

bounds

i'-3

each bounds

C once

(since

- 2d

=Y1ir*

+ n.

\302\273-3

for

Substituting

d, we

have
n

in =

21

2 21
i-3

t-3

^ - 2+ n

so that
n

21

- 2) r,-

(i

- 2.

t-3

By

the exterior

considering

of C we concludein a similarfashion
-

(i
\302\243
t-3

Therefore,

combining

the two

(i
\302\243

2) rj

- n-

that

2.

results gives
-

2)(r,

- rj) = 0.

\342\226\241

i-3

Example

5.10.6.

Hamiltonian cycle.

Show

that the

graph

G6

(Figure

5-77)

has

no

550

Chapter

5: Graphs

5-77

Figure

indicated the degreeofeach


There
threeregions of degree 4
are
G6.
We have

if a

theorem

Grinberg's

by

in the

region

plane depiction

of

regions of degree6. Thus,


cycle existed, then we would

and six

Hamiltonian

- r\\) + 4(r6 - r\\) - 0, or (r4 - r\\) =


r\\
r\\
But
then
be
an even integer. However,
since
rl).
r4
-2(r6
=
1
and
2.
for
and
0
and
and
the
are
43,
3,
rj
r\\
only possibilities r4
>4
of the possibilities is such that their difference
is even.
Neither
for
th#t there was a Hamiltonian cycle
Therefore, the
G6 led to a
assumption
have

= 3,
r6

r4 +

= 6,

and 2(r4
r\\ must

contradiction, and G6

no Hamiltonian

has

cycle.

Example 5.10.7. The graph G7 (in


that
tonian cycles.Show,however,
any

edgese,
any

must

avoid

the other.

There are five

regions

of degree

e\\

Hamiltonian

2(r4 5, the

r\\)

cycle of
-

-3(r5

r\\)

only possible

values

we

G7

of

such

4 and two
must

have

3 divides

that

so

Figure

r4 and

r\\ are

r4

possess HamiU
cycle containing one of the
5-78) does

regions of degree5.Thus,
2(r4 - r\\) + 3(r5 - rl5) =
r}. But then since r4 +

4 and

1, making

or -3.

\\/TV/
#

Figure

a'
\342\200\242

5-78

r4

for

0 or
r\\ =

r\\ either

Section

5.10

Hamiltonian

Now each

Thus,a

edgese and

of the

Hamiltonian

el

a pair of regions of degree4.


one of e's quadrilateralsinsideand

separates

have

would

cycle

551

Graphs

a Hamiltonian cyclecontainingthe edgeel


If both e and e1belong
to a Hamiltonian
split
at
be
least
two
then
there
would
of
regions
degree 4 on the inside
cycle
and at leasttwo on the outside. This makes impossible the four-onesplit
other

the

outside.
el,s

would

guaranteed

Similarly

quadrilaterals.

theorem.

Grinberg's

by

are
not
been discussing ways to show that certaingraphs
one
Now let us reverse our point of view and mention
of a Hamiltonian cycle. The result
sufficient condition for the existence
in several
we state
was proved by Dirac in 1952;a proof can be found
that
With
books on graph theory\342\200\224for example,
Theory
Applications
Graph
are also several other
[4]. There
by J. A. Bondy and U. S. R. Murty

We have
Hamiltonian.

similar resultsthat
Dirac's
each

vertex

are

Theorem.

known.

has degree

Corollary 5.10.1. If

(n > 3),then

for Section

1. Finda

is

for

n vertices (n

with

> 3) in which

n/2 has a Hamiltoniancycle.


a complete

a Hamiltonian

G has

The corollaryis true even


Exercises

graph

simple

at least

simple

graph on

n-vertices

cycle.
directed

graphs.

5.10
Hamiltonian

cycle

in each

of the

following graphs:

(c)

The

cube

(d) The octahedron

(e) Thedodecahedron
(f)

(a)

icosahedron

(b)

(i)

(g)

The

(h)

Figure 5-79

The graph

G7

of

Fig.

5-78.

552

Chapter

5: Graphs

2. Prove

that there

is no Hamiltonian

cycle

in each

of the

following

graphs:

\342\200\242
b

</\342\200\242-

(c)

(b)

(a)

o
The Petersen

\\n

graph

(d)

(e)

<\342\200\242#.

\342\200\242
d

a.
\342\200\242
i

g*

(g)

Figure

5-80

Section 5.10

by^

Hamiltonian

553

Graphs

71
c?e-

\"

VKl

mm'

(h)

'e

\302\243

(i)

'\342\200\242^x//1^

^.^

cm

(j)
Figure

3. Prove

that there

continued

5-80.

are no Hamiltonianpaths

graphs:

(a) SeeGraph

(e)

a
m

<A

\\

each

of the

(b) See Graph (h) in

2.

in Exercise

in

>

(c)

Figure 5-81

following

Exercise

2.

554

Chapter

5: Graphs

4.(a) Show that any

Hamiltonian cycle

which contains the edge{c,d}

in

graph Hx in Fig. 5-82


contain
the edge \\g,h}.

the

also

contain
any Hamiltonian cycle in the graph H2 must
two of the edges {afh},{c,d},{ij}.
Show
that
any
that
contains
both edges {dye} and {e J} cannot also
cycle

that

Show

(b)

must

exactly
Hamiltonian

contain {a,h}.

(c)

in

cycle

(d)

(e)

results

the

Using

Using

H3 can

(c), show

5.10.7., show that no Hamiltonian


the edges {a,/}and {/i,n}.
Hamiltonian
cycle in graph H4 must

of Example
contain both

that

contain the edgee.

every

pentagon P must lie outsideany


graph H5, and that a Hamiltoniancycle
contain exactly four of the edges of P.
the

that

Show

**4

(a)

graphs

regions of

regions

showthat there areno

degree 5, 8, and

of degree

5, 8,

9 with

exactly

9, and 11with

(c) regionsof degree4 and


regions

of degree

4, 5,

5 and

only one

and 8 and only

one region

exactly

degree 9.

(d)

planar

with

9.
(b)

H5 must

5-82

Grinberg's theorem to

Hamiltonian

in

\"5

Figure

5. Use

Hamiltonian

in the

cycle

one

of degree

region

with

region of degree4.

one

region

of degree

4.

Section5.10

Hamittonian

possible, use Grinberg's theoremto


graphs have no Hamiltoniancycle:
(c) in Exercise 2.
(a)
graph

6. If

(b) graph (k) in

the

following

2.

Exercise

2.

graph (6) in Exercise

(c)

that

show

555

Graphs

(a)

(b)

5-83

Figure

colored

with

squares
a knight

place

chess, a

knight

horizontally

from

Kny

vertices?

Knight's Tour Puzzle.Consider

chessboard,
we

on n

graph

complete

8. The

Hamiltonian cycles are therein

many different

7. How

on one
moves

its

standard

the

white and

alternately

of the 64 squares.According

to

the

rules

of

squares vertically or
followed by moving one

two

proceeding

by

square,

starting

8x8

black. Suppose

Tour
Puzzle
square in a perpendiculardirection.The Knight's
asks the question: Followingthese rules, is it possible
for
the

to tour

knight

once, and
(a)

The

the chessboard,

visiting

then returnto its original

question

has an

affirmative

every

square

once and only

square?
answer.

Can

you find

such a

tour?
in terms
of graphs.
(b) Formulatethe question
(c) Investigate the Knight'sTourPuzzlefor a 4 x 4 chessboard.
Tour
for a 4 x 5 chessboard.
Puzzle
(d) Investigatethe Knight's
9. Supposethat a classroom
has 25 students seated in desks in a
square 5x5 array. The teacher wants to alter the seating by
move to an adjacent seat (just
student
ahead,
just
having
every
or on the left, or on the right).Show
(even or
behind,
by a parity
odd) argument that sucha move is impossible.
10. Suppose a set lofk verticesin a graph
G is chosen so that no pair of
v in /, degree (v) - 2ofthe
in / are adjacent. Then for each
vertices
on
v will not be used in a Hamiltonian cycle.
edges incident
(u)
2] =
Summingover all vertices in /, we have E1 = 2ue/[degree

556

Chapter5: Graphs
See

- 2k edgesthat

(v)

/degree

(a) Let

the number
that if E -

be

and

Show

respectively.
is

Why

(a)

part

only when

valid

Hamiltonian

of vertices and edges in

El <

Hamiltonian cycle.

(b)

in a

used

be

cannot

cycle.

G,

have no

G can

then

V,

/ is a set of nonadjacent

vertices?

(c)

a suitably chosen set /, use part (a)


following graphs have no Hamiltonian
cycles:
(1) the graph in Exercise2(i).
the
(2)
G2 in Example 5.10.2.
graph
With

(3) the graph

G4 in

Example

the

that

show

to

5.10.4.

directed Hamiltoniancycle of G6+lk(V,E)


Euler cycle of G^^.^V,!?). Is it true that
has a directed Hamiltonian cycle?
always
Gt+ijiiVJE)
12. Characterize
of graphs
in which an Euler path is alsoa
the
class
11. Prove that a

a directed

to

corresponds

Hamiltonian

Selected

path.

5.10

for Section

Answers

2. (b) By

{b,g},

{a,d},

{a,6},

(b).

(g) To

a and

reach

for

similarly

(h)

leaves

no way

Observe

that

be

g we

o, g, i, k,

must go c

ij and g>e. But

and

Similar

m.

- a-

-d

pasting these

subpaths

G.

of

to the

or c

in

included

proof of

- b-

a-

d\\

together

to visit j.

are 2 regions of degree 6 and 15regions


a Hamiltonian cycleexists,then
Grinberg's
give
2(r4 - rj) + (r6 - rj) = 0 and thus
= r4 - rj. But r4 - rj = even integer and r4 + rj
there

of

4. If

degree

would

Theorem
2(r6

2 we see that the edges

{e,/}, and {dfe}must

{#,/},

the vertices

Consider

of degree

cycle. But this forms a proper subcycle

Hamiltonian
(e)

vertices

the

considering

rj)

that
= 15

imply that 2r4 is odd, a contradiction.


(1) Argument is similarto Example5.10.4.
3. (a) A Hamiltonian
since
path for this graph must contain19edges
there
are 20 vertices. There are 30 edgesin G, so to show that
12 or more
no Hamiltonian path exists we must eliminate
A
n.
first
the
vertices
and
Consider
/, h, j, /,
edges.
of
Hamiltonianpath
at most 2 edges incidentwith
each
can contain
these vertices. Thus, we must eliminatea total of 10 of the
there must be at
these
vertices.
Moreover,
edges incident with
a-b-c-d-e-a
and
least oneedgeto the outer pentagon

at least oneedgeleading
to the inner
pentagon p-q-r-s\342\200\224
\342\200\224
k-lt \342\200\224
from
middle
the
h-i-j
p
subgraph f-g

Section 5.10

Hamiltonian

\342\200\224
n

(a)

edges

of at

of the

each

from

a total

giving

4.

- f. Then observethat

one of the

at least

eliminate

must

we

557

Graphs

outer and

inner pentagons,

least 12 edgeseliminated.

not used but {e,d}is used.Then


{a,h\\,
edges
and
in a Hamiltonian
{b,h}, {g,f}
{e,g}must be included
cycle.
But then {a,b}and {e,/}must
lest a triangle subcycle
be deleted
be formed.Thus,
and
must
be
included. But then
{6,c}
{c,/}
there are three edges of the cycle incident on c.
{gyh} is

Suppose

Contradiction.

(b)

and
and
{ij} are not used (suppose{c,d}
then
and
must
be
used),
{d,e},{ej}9
used,
{ij}
{dj}
of
giving a triangle subcycle; impossible.Thus, at leasttwo
and
must
three
be
used.
all
cannot
be
{a,h}, {c,d},
However,
{ij}
used, for in that case, (^) if {dj} is used, then {d,e}and {ej}are
two of the three edges at e are not
not
used,
used;
meaning
Thus
(b) {dj} cannot be used,and then
{d,e} and
impossible.
and {a,6},{6,c} are
{g,h},{g,i}
[e9j] are both included. Similarly,
a
with
nine
used, forming subcycle
Therefore,
edges.
exactly
two of the edges {a,h},
and
{c,d}9
{ij} can be used.
If a Hamiltoniancycle contains
both
{d,e} and [ej] then [dj]
cannotbe used, forcing {i,y},{c,d} to be used. But by the first
two of the three verticesmust be used,
part,
exactly

of

If two

{c,d},

{a,h}y

not

are

{a,hl
eliminating

(e)

theorem gives 2(r4 - r\\) + 3(r5 - r\\) = 0; r4 and


since r4 + r\\ = 5. Thus, r4 - r\\ J* 0 and r6 - r\\ = \302\2612.Thus,
= 2,
0.
Since
both
+
r\\
r\\ /
r5
r5
pentagons
must lie on the same sideof any
Hamiltonian
The
cycle.
infinite region lies on the exteriorof any Hamiltonian
so
cycle,
- 6 = 0
then does P. Therefore,rb - r\\= -2, giving
2(r4
r\\)
or r4 - r\\ = 3. Since r4 + r\\ = 5, it follows that r4 = 4 and r\\ = 1.
Since the edges of P all separateP from
some
of degree
region
= 4 we see that
P
of
of
and
four
the
must be
4,
r4
edges
exactly
The

Grinberg

be equal

r\\ cannot

included

in

5.

(a) 3(r5 -

6.

(a)

cycle.

7(r9

(r9 -

3 divides

Observe that r\\


gives that 2(r4
will

r\\)

that

\302\2617
implies

Hamiltonian
cycle

6(r8

9 implies

degree

rj) =

r\\)

Hamiltonian

any

1 and

rj) +

separate

r\\)

= 0

r\302\243)

\302\2611.
If

r4

r\\

Contradiction.
=
this
r\302\2471, but
contradiction.

Thus

1, then

only one
- r\\)

3(r5

region of
+

r3

- rj +

2(r4

r\\) +

3(r5

r\\)

rj) = 1.

Moreover any
4
the three regions of degree

3(r5

3(r5 -

1 inside.
=

r\302\243)

-1

Thus,

and 3

will

into either

r4

r\\

divide

- r\\ = -1, then 3(r5 - r\\) - 3 implies


= 3
fact and r6 4- r\302\247
gives that r5 = 2, no
Theorem
gives no conclusion.
Grinberg's
If r4

6(r8

\302\2617.
Contradiction.

2 inside and 1outsideor2outsideand


-

and

\302\2611.
Thus,

r5

1.
-

558

Chapter

5: Graphs

2(r4 - r}) + 4(r6 - t\\) = 0 implies 2 divides r4 - rj. But since


the external regionhas degree 6, r^ - r} = -1 and r4 - r\\ = 2.
But then r4 + r\\ = 3 implies r4 = 5/2, a contradiction.

(c)

- l)!/2

7. (n

9.

so the total number

to the right;
even.

is

right

left

E - El edgescanbeusedin a
most
a Hamiltonian cyclehas V edges.
The sum E1 counts some edges twice
and

on

bound

Let/

(1)

(c)

(2) /

hence

of edges

the number
= {ayefgyi,c}

students

number

total

nonadjacentvertices,

El

the

number

moving

moving
to the left or

forward or backwardis
must be even, but the
Hamiltonian

would

if

cycle,

but

/ is not a set of
not be the correct

that cannot be used.

= {b4,UJ,h,nl

(3) /=

{ayc,efgfifl\\.

NUMBERS

CHROMATIC

The Scheduling

Problem

Suppose the
is
Eachcommittee
that

state

legislature
to

supposed

is a

the

At

(a)

(b)

5.11

of

the total moving


of students

Similarly

even.Hence,
total is 25.

the

10.

moving to

of students

number

The

weekly schedule

different

hours

available

for

other

legislator
at the same

should
time.

needed

of

in the

committee

week as

legislative
be
The

meet

scheduled
question

has a list of 21 standing committees.


is wanted
one hour each week. What
times
that uses as few
meeting

possible so as to maximizethe time

activities. The one constraint is that no


to be in two different committee meetings
number
of hours
is: What is the minimum

for such a schedule?

this problem
with a \"committee\"graph G0 that has a
model
vertices
each committeeand has an edgebetween
to
with
a common member. But then we need
to
committees
corresponding
introduce
a new graph theoretic concept.
of colors
the assignment
of a graph G, we mean
a vertex
coloring
By
of some set) to the verticesof G,onecolor
elements
the
(which are simply
colors.
to each vertex, so that adjacent vertices are assigned different
in
as described
of labeling
is nothing more than a special kind
(This
n colors. If G has
Section 5.1.) An n-coloring
of G is a coloring of G using
an n-coloring,
G is said to be n-colorable.
then
G.
as well as a 3-coloringof the graph
Figure 5-84shows a 4-coloring

First,

we

vertex for

Section 5.11

Chromatic

Figure

The question
define

is: What

5-84

of a graph G

for which there existsan n-coloring


of the
number of G by x(G), and if

chromatic

k-chromatic.
In

the

investigating

ourselves

to

simple

then no coloringof

Figure 5-85.

We

to

be the

of a graph, we shall
is reasonable since if there
is

number

chromatic

This
graphs.
G is possible.

5.11.1.

Example

of colors required? We
minimum number n
vertices of G. We denote
the
= k we say that G is
x(G)

number

minimum

is the

number

chromatic

the

show

that

559

Numbers

x(^)

= 4

restrict
a loop,

for the graph of

of

abc requires threecolors;


the
colors
1, 2, and
assign
Then since d is adjacent to a and c, d must
be
a color different from the colorsfor a and c, color d the color 2.
assigned
e must be assigned a colordifferent
2 since e is adjacent to
But
then
from
d. Likewisee must be assigned a color different from 1 or 3 becausee is
adjacentto a and to c. Hence a fourth color must be assignedto e.Thus,
the
exhibited
we
indicates x(G) ^ 4. But, at the sametime,
4-coloring
4. Hence
have argued
that x(G) cannot be lessthan
x(G) = 4.
We now return to our scheduling
problemand the resulting graph G0.
Clearly

the triangle

3 to a, 6, and

c respectively.

am-

Figure 5-85

560

Chapter

5: Graphs

of

Theorem

5.11.1.

The

committee

meetings

in our

Proof.

scheduling problem

schedule

for the

of hours

number

minimum

is x(G0).

k and suppose that the colorsused in


1,2,.. .,&. First we assert that all committeescan be
in k one-hour
scheduled
time periods. In order to see this, consider
all
those
vertices
colored
to these
1, say, and the committees
corresponding
vertices.
Since no two vertices colored 1 are adjacent,
no
two
such
committees
contain the same member.Hence,all these committees
can
be scheduled to meet at the sametime.
all committees
Thus,
to same-colored
vertices
can meet at the sametime.Therefore,
all
corresponding
committees
can be scheduled to meet during k timeperiods.
are

G0

coloring

prove this by

committees

contradiction.

time

one-hour

in

G0 an

a legitimate

members.

these

colored

have

= k.

x(G0)

number of a
that

rigorously

that

must forcetwo
are by no

These

vertices.

of

Rule 1.
2.

extremely

this

we list

x(Kn)

some

Rule 4. If

degree

| V\\

always

triangle

generally,

Rule 3. If

where

^\\V\\>

x(G)

n> where

subgraph

(v)

adjacent to v.

= d,

number

k, we must
integer
- 1 colors. The goalis

with

we might

a few rules that

rules to

of the

some

determine

of
number. But to

a small

construct for the graph


the
have
same color.

to

vertices

process

to

difficult

with

the chromatic

guess

that

1)-coloring

of G0 gives a

m-coloring

number is a given

means all the rulesthat

verification

the vertices

to

the chromatic

adjacent

in

Rule

see that this is,in

adjacent

graph. For graphs

\342\200\224

(k

any

To assist

an

the graph cannotbecolored

also show that

more

time. To

give

which

\342\226\241

it is

vertices, it is oftennot toodifficult

show

then

can

all vertices

solve our schedulingproblemexcept

would completely
fact: Ordinarily

unfortunate

chromatic

to

same

However,

differently.

5.11.1

Theorem

verify

the

k. We

color

committeescontainingoneor morecommon
committees meet at different times, and thus the

contradictionsincewe

the

same

of G0,considertwo

m-coloring

Hence,

verticesare

one

at

the

than

correspond to two

vertices

for

where m <

periods,

m-coloring by coloring with

less

schedule the

we can

that

Suppose

correspondto committeesmeeting
fact,

cannot be scheduledin

all committees

that

show

we

Next

hours. We

x(G0)

Suppose

could

have

may

been

be

listed.

We leave the

the reader.
is the

number

of

requires

then at

k colors

of G.

vertices

three colors, that


requires
is
the
Kn
complete graph
of G

these

helpful;

is, x(K3)= 3;
on n vertices.

then x(G) > k.

most d colorsarerequired

to

color

Section

5.11

5.

Rule

= maximum{x(C) | C is a connected
component

x(G)

the chromatic number


By studying
useful to restrict oneselfto graphs
which

example,
in

fc-chromatic

studying

that although G requires k

colored

sense. For
our

restrict

so in

subgraph

be

fc-critical

is easy

to

graph has a k-criticalsubgraph.

of fc-critical

properties

following

often

it is

in some
just

only

proper

any

colors,

G}.

graphs,

we often

in general,

graphs

More precisely we definea graph G to


- v) < x(G) for each vertex v of G. It
x(G
The

critical

of

the sense

of G can

be

k colors.

than

fewer

with

arbitrary

are

that are fc-chromatic\342\200\224but

to graphs

attention

of

56 J

Numbers

Chromatic

see

if x(G)

and

a ^-chromatic

that

graphs were proven

by

G.

A.

> k

Dirac.

5.11.2.

Theorem

Let G

(i) G is connected,
(ii)

The

of each

degree

be

graph. Then

a fc-critical

vertex of G is at leastk -

1.
(iii)

be expressed

cannot

graphs

no cut

contains

in the
in

intersect

which

form

Gx

a complete

1,

that

is,

d(G)

Gx and G2 are
In
particular, G
graph.
G2, where

vertices.

Proof,
of G with
(i) If G is not connected,letCbe any component
=
and
let
v
G
C.
be
vertex
of
which
is
in
But
not
then
k,
x(C)
any
>
fact
G
is
that
t
he
/z-critical.
v)
k,
x(G
contradicting
we have
(iiX Since G is fc-critical,
x(G - v) < k - 1 for eachvertex v of
with at
G. If degree (v) < k \342\200\224
the neighbors of v will be colored
1, then
2 colors.
of G - v
But then it follows that any (k - 1)-coloring
most k \342\200\224
of G by coloring v by the color
can be extended to a (k \342\200\224
1)-coloring
of v, contradicting
the fact that
different from the colorson the neighbors

X(G)= k.
(iii)

G = Gx

If

U G2 and

Gv

G2 =

Kn then

X(G\\)

^ k

- 1 and x(G2)<

But by
of G, and G is fe-critical.
1, since Gx and
G2 are subgraphs
relabeling the colors,we can color the vertices of Gx D G2 the same way in
a (k can then be combined to give
both graphs. These two colorings
thefactthat x(G) = k. By considering the
l)-coloring of G, contradicting
G can contain no cut vertex. \342\226\241
case r = 1,it follows
that
immediately
fe

Rule

6.

Every

degree (v) > k


Proof.
subgraph

Let
of G.

fc-chromatic

graph has at

least k

vertices

v such

that

\342\200\224
1.

let H be a
and
G be a fc-chromatic
graph
By Theorem 5.11.2, each vertex of H has degree

fc-critical

at

least

562

Chapter 5: Graphs
-

and hence alsoin

1 in H,

least

vertices.

H is

Since

fe-chromatic, H

clearlyhas at

immediately from Rule 6.

rule follows

next

The

G.

\342\226\241

Rule 7.

For

degree of any

< 1+

G, x(G)

graph
of G.

any

vertex

where

A(G),

is the

A(G)

largest

Rule 8. When
a fe-coloring
of a graph G, we may delete
all
building
with their incident edges). In general,
vertices of degree lessthan k (along
when
to build a ^-coloring of a graph, it is desirable
tostart by
attempting
a

/z-coloring

These are

9.

Rule

(i)

G is

graph

Rule 10. If
> |

x(G)

V|

V|/|

follows

that

at least d(G)
of v. Hence

coloras

v.

If

we

V\\

degree

be

x(G)

classes,

d(G)

number

5-86.

d
Figure

that for any vertex v there


some color different from
vertices colored the same

> | V|since

chromatic

the

of any vertex of G, then


of vertices of G.

same class iff they


and each class will

- 5(G)]x(G)

Thus, [ | V|

Find

number

is the

in the

vertices

place

Example 5.11.2.
of Figure

the observation
colored

from

easily

5(G) vertices.

some class.

minimum

the

neighbors of v that are


there are at most | V\\

same color, there will


|

is

5(G)

has even length.

- 6(G)where| V

Thisrule
are

successively
the
forcing

thereby

colors,

2-colorable.
of G

cycle

Every

then

and

vertices

- 1 different

equivalent:

(ii) G is bipartite,
(iii)

of

subgraph

complete

finding vertices adjacent to k


color choice of such vertices.

5-86

are

colored

every

of the

the

at most

contain

vertex is in

\"wheel\"

graph

Section

Chromatic

5.11

563

Numbers

5 and all otherverticeshave degree


3, we see that
< 1 + A(G) = 6. Sincethereisa
x(G)
triangle
of G, x(G) > 3.
subgraph
We
can
see in at least three different
that
x(G) < 4. First, if
ways
>
then
Rule
6
would
that
there
would
be at least
five
5,
x(G)
imply
vertices of degreegreaterthan or equal to 4. But since this is not the case,
Since

(/) =

degree

A(G) - 5 and hencethat

x(G)<s4.

could
see Rule 8 to build a 4-coloring
as follows.
Delete
4.
In
incident
of
than
less
all
(and
edges) degree
particular,
vertices except / will be deleted.
But since the remaining graph is
that
G is 4-colorable.
we
conclude
4-colorable
it
is
while
readily apparent that 3 < x(G) < 4, we do not yet know
But;
is. Xet
us attempt
to build a
what
the
chromaticnumber
exactly
G.
We
start
the
with
the
colors
of
by coloring
triangle a,fc,/
3-coloring
c
is
b
of
2
Now
since
to
vertices
and
colors
1,2,3 respectively.
/
adjacent
d
2.
and
then
is
forced
to
be
and 3,respectively,c isjbrcedto becolored
1,
have
1.
the adjacent
vertices a and e cannotboth
color
now
However,
the
other
a
fourth
the
be
3-colored.
On
cannot
hand, using
Thus,
graph
colorfor e yields a 4-coloring of G. Therefore x(G) = 4.
we

Alternately,

all

vertices

Exercises for Section5.11

1.
2.

What

is the

What

does

chromatic

7 indicate about the chromaticnumber of (a)


(c) Xnn? Determineeachchromaticnumber.

Rule

(b) K4A, and

3.

mathematics

namely

numerical

the

and

students

analysis

real analysis
courses they

and

(A),

George:

Herman:

C,GfR

Elaine:

many

time
the

Determine

a careful

suffice.):

AfN

F,G

Ingrid:C,T

Jim:CAT
Ken:

F,N

A,R

Linda: A,T

Fred: C,G

(Give

(T), applied
(i?). The mathematics graduate
plan to take are:

Bob:

DeWitt:C,F

4.

(C),

topology

(N),

Abe:C,F,T
Carol: G,N

How

combinatorics

/f3i3,

seven graduate courses


group theory (G), field

to offer

plans

department

next semester,
theory (F),
mathematics

of (a) a cycle?(b) a tree?

number

periods
chromatic

are needed
numbers

for these 7 courses?


of each

argument to show that

of the following
fewer

colors

graphs.

will

not

564

Chapter5:Graphs

/\342\200\242;

/\342\200\242

/\342\200\242-^A^s

V-M

'I

(c)

(b)

(a)

/\\

(e) The Petersen

(d)

(n

Graph

\342\200\242

\342\200\242

-#c

\342\200\242

\342\200\242

(i) The graph G5

(g)

5. Instead

of coloringvertices,we

in

Figure

5-75.

color
edges so that edges with
different colors. The edge
number
chromatic
of colors to color all
number
the edgesof G. If A(G) is the largest degree of the vertices of G,
prove that A(G) is lessthan or equal to the edge chromatic number
common

ofG.

end

can

are colored
points
of G is the minimum

Section

Chromatic

5.11

6. Find

the edgechromaticnumber

for

the

565

Numbers

graphs:

following

(a)

9C

d*<5-88

Figure

K3.3

(b)

(c) The

(d)
7.

Petersen Graph

Kn

that

Show

of Exercise 4(f)

the graphs

and

8.

Give

9.

We

a proof
give

for Rule

an algorithm

graph G. Firstorder
dx

use

>

J. A. Welsh

by D.

vertices

the

order, each vertexwhich

Powell to color a
to decreasing degrees

M. B.

and

according

an ordering may

the first
is

not

vertex.Repeatthe process

using

vertices.

for

9.

\342\200\242
\342\200\242
> dk. (Such
d2 > \342\200\242
the first color to color

unpainted
remaining

are fc-critical

4(g)

some integer k.

Continue

vertex

and

adjacent
the

not be unique.)Then
to color, in

to a

second

the process

sequential

previously colored

color
with

and the
the

third

color,

For
on until all verticesarecolored.
in the graph in
example,
to decreasing
Figure 5-89, we order theverticesaccording
degrees:
a. Use
Use the first color to color e and
the second
e,c, g,a,6,d,/,/i.
color on verticesc, of, and h. Use the third color to colorverticesg,
G is 3-colorable. Note that G is not 2-colorable
since
Thus,
bf and/.
Hence
thereis a triangle
x(G) = 3. Use the Welshsubgraph.

and so

Figure

5-89

566

Chapter 5: Graphs

Powell algorithm to determinean


number

of

the

upper

bound

to the

chromatic

graphs:

following

Of*

^<i

(a)

a\302\273

\\l

AT

(c)
5-90

Figure

10.

restaurant has 8 different


rooms.
Each banquet
banquet
requires some subset of these 8 rooms. Suppose that there are 12
that
are to be scheduled in a given
evening
banquets
7-day
period.
Two banquets
that are scheduled the sameevening
must
use
different
banquet rooms. Model and restatethis scheduling
A local

problem

11. The

as

a graph-coloring

organizers

of

problem.
n

There

conflicts,

put in different

will
with

suffice
a graph

hotels.

to

have rooms available in six


in the conference and,
participants
various
of participants
must be
pairs
wonder
whether
six
hotels
organizers

conference

a peace

local hotels.
are
becauseof political

The

all conflicts. Model this


separate
and restate the problem in terms of

conflict problem
vertex

coloring.

a round-robin tournament where each pair of n contestants


over
each other, a major problem is schedulingplay
plays

12. In

Section

Chromatic Numbers

5.11

(each contestant plays

of days

number

minimal

at

567

one match

most

a day).

(a) Restatethis
Exercise

(b)

13.

Give

5).

this problem for


for Rule 7.
proof

Solve
a

an edge-coloring

as

problem

problem (see

n = 6.

coloring: Order the vertices in


then color them one by one:
1 if vx and v2 are not
color
color
vx the color 1, then color v2 the
adjacent, color v2 the color 2 otherwise. Continue this process
vertex
the smallest numbered color it can have
at that
each
giving
but
stage. This so-called greedy algorithm producesa coloring,

14. The

as

say

this

Figure
for

graph

2-colorable)

Given

. >un, and

vlyu2,.

more
colors
than
usually does) use many
5-91 shows a bipartite (hence,
which the greedy algorithm wastes4 colors.

may (and

coloring

necessary.
(a)

vertex

for

algorithm

greedy

someorder,

G, showthat its verticescan

a graph

way that

the greedy

it is not surprisingthat

it

pays

be

exactly

greedy algorithm in various orders of

by the

needed

colors

in such a
ordered
x(G) colors. (Thus,
to investigate
the number of

uses

algorithm

the

vertices.)

(b)

For each
for

the

which

cannot

a bipartite

3, find

>

greedy

be done if n

= 2k - 3. Can

Figure

15.

> d2 >
an order vlfv2>..
Let dj

d3

>

...

min

integer for

which

dn be

.9vn where

usesat mostmax

k <

graph

algorithm uses

{dt

it

with

vertices

k colors.Show

be done

if n

vi9v29..
that

= 2k

.9vn

this

- 2?

5-91

the degree sequenceof G. Show that in


= dh then the greedyalgorithm
and so if k is the maximal
colors,

deg(ut)
+ 1, i\\

dk +

1, then x(G) < k. (This

is the

the Welsh-Powell algorithm.)


16./Show that any graph G has at least C(x(G),2)edges.

basis

for

568,

Chapter

5: Graphs

all graphs

17. Describe

18. Analyze

the

with

possibilities

and chromatic

for the

chromatic number

of

wheel

graph

Definition 5.2.5.)

Wn. (See

19. Provethat a wheelgraph Wnf

20.

number n.

n vertices

where

n is

odd, is

a 4-criticalgraph.

graph contains a k-criticalsubgraph.


n > 3, are the only
21.
Show that the cycles of odd lengthn, where
(a)
Hint: Apply rule 9.
graphs which are 3-critical.
(b) Showthat Kx is the only 1-critical graph and K2 is the only
2-critical graph.
a counter
22. Disprove by giving
nonplanar
example: Connected
not
with
6
vertices
are
4-colorable.
graphs
that

Prove

Selected Answers for

1.

(a)

The

Section5.11
number
of
its length is even

chromatic

whether

2.

(a)

(b)

4,

k -chromatic

any

a cycle is either2or 3,depending

on

or odd.
n
1
+
(c)

5,

3. Fourtimeperiods.

4.

(a)

(c)

(d) 4

(e) 3

(f)

(g)

(h)

(i) 2

6. (a) 3
(b)

(c)

G is 2-colorable. Let M and N bethe set of


first colorand secondcolorrespectively.
\342\200\224*
G is bipartite and suppose M and N form
a
(ii)
(iii).
Suppose
of
G.If
the
vertices
of
a
at
a
vertex
bipartite
partition
cycle
begins
v G My then
it will go to a vertex in N, and back to a vertex in M
thento N and so on. Hence when the cycle returns to v it must be of
even length.
9. (a) Orderthe vertices
e
Color /color 1, color a, c, and
as/,a,6,c,d,e.
color 2, then use color 3 to color b and
d. Thus x(G) < 3.
8. (i)

\342\200\224\342\226\272

(ii).

vertices

Suppose

that

colored the

Colorh9 6, and g color ).,


(b) Orderthe verticesas /i,a,c/,/,6,c,e^.
color a and d the color2,then use 3 to color /, c, and e. Thus
X(G)

< 3.

Section 5.12

The Four-Color
X(G) =

(c)

(d)

569

Problem

4.

= 4.

X(G)

vertex = banquet, let edgesjoin banquet


vertices
with
a
room, and let color= day of the week. The question is: Is

10. Let

common

the graph 7-colorable?

5.12 THEFOUR-COLOR

PROBLEM

the

accurately,

problems

in
that

planar

One wants
map
coloring.
no two adjacent
regions

arbitrary graph cannot be

x(G) ^

5 for

graphs

came

for planar

holds

situation

opposite

that

prove

chromatic numbers for

in the
way

to

easy

of an

number

chromatic

the

Although

estimatedat all
graphs.In fact,it is

Interest

graphs.

planar

originally

to color the regions


of
(that is, regionssharing

from
in such

a map

common

some

are of the same color.Many


mathematicians
that
thought
no matter how complicated,
would
no more than four
require
as
colors.
Whether
or not this is true becameknown
the
four-color
the regionsof a planar graph
problem. However, the problem of coloring
is the same as that of coloring
of the dual graph. Hence,the
the vertices
four-color
can be reformulated in terms of chromatic
original
problem
numbers:
Is x(G) < 4 for any planar
graph G?
In 1976 Appel and Hakenanswered
the
four-color
problem
the problem into nearly two thousand casesand
then
affirmatively by
dividing
to analyze the various
cases.
The
final
computer
programs
writing
solution required more than 1,200hours of computercalculations.
Even
the solution
of the four-color problem must beclassified
though
boundary)

each map,

asa

monumental

dissatisfied
with

even

skeptical

have been

mathematicians

some

achievement,

(and

proof. Thus,this

of) the

mathematicalproof,

remains:

question

unaided
Does there exist a purely
by computers?
Recent
and past attempts at a completely
when
The most famous failure occurredin
met
with
failure.

mathematicalproof
A.
1879

have

B.

the
four-color
problem.
Kempe published a paper that purported to solve
but in
considered
was
For approximately ten years the problem
settled,
in Kempe's
error
an
1890 P. J. Heawood pointed out
argument.
Nevertheless, Heawoodwas able to show, using Kempe's ideas, that every
We give Heawood'sproof of the following
is 5-colorable.
planar
graph

theorem.

5.12.1.

Theorem

Proof.

We

use

Every simpleplanar graph is 5-colorable.


on the

induction

the theorem to

assume

number of verticesof

be true for

all

planar

graphs

the

graph,

with at

and

most n

vertices.

Let

be

a planar

graph

with

+ 1

vertices.

By the

corollaryto Euler's

570

Chapter

5: Graphs

ys:

Figure 5-92
G contains
a vertex v whose degree is at most 5.The graph
G - u
formula,
and so can be coloredwith
five colors,
is a planar graph with n vertices,
by
the inductive hypothesis. Our aim is to show
how
this
of the
coloring
v can
vertices of G \342\200\224
be modified to give a coloringof the verticesofG.
v has exactly five neighbors, and that they
We
assume
that
are
may
otherwise
would
since
there
be
at
most
four
colors
colored,
differently
to v, leaving a spare colorwhich
would
be used to color v; this
adjacent
would
the
of
the
vertices
G.So
of
the
is now
situation
complete
coloring
as in Figure 5-92, with
the
vertices
colored
a,/?,7,S,e,respectively.
vly.. .,i>5
If X and n are any two colors, we define H(X9fx) to be the two-colored
subgraph of G induced by all those vertices colored X or ia. We shall first

consider H(a,y);
(1)

possibilities:

5-93),
components ofH(\\,y) (seeFigure
the
colorsa and y of all the vertices in the
interchange
result of this recoloring is
vx. The
componentof H{a,y)containing
that Vi and v3 both have color 7, enabling v to be colored a. This
completes the proof in this case.
If vx and vs lie in the same component
of H(a,y)
(see Figure
5-94),
\342\200\224*
\342\200\224*
\342\200\224*
\342\200\242
\342\200\242
\342\200\242
then there is a circuitCofthe form v \342\200\224\302\273
v> the
vx
v3
path between Uj and v3 lying entirely in H(ayy). Since v2 lies inside

If

Vi

then

(2)

there are two

and

v3 lie

in different

we can

'7,Ni

H(a,y)

{^3j H(a,y)
Figure

5-93

Figure

5-94

Section 5.12

The Four-Color
C and
to

entirely

v4 lying

colorsof

the

all

vertices

The

C, there cannot be a two-coloredpath from


v2
in H((},5). We can therefore interchangethe
in the component of H(($,d)containing
vertices
v2.
and v4 are both now colored dy enabling
v to be

outside

lies

v4

v2

completesthe proof.

colored /3. This

The
used in the proof of
argument
looking at a two-coloredsubgraphH(a>y)
often called a Kempe-chainargument,

Kempe in his abortive

Exercises

571

Problem

theorem

5-color

that of
colors) is
by A. B.

(namely

the
interchanging
it was initiated

and
since

four-color

on the

attack

\342\226\241

problem.

for Section 5.12

1.

argument to show that a planar graph G


5 of
edges is 4-colorable.(Hint:Seeexercise

a Kempe-chain
less than 30

Use

(a)

with

section

5.8.)
of a

(b) Explain why the regions


edges can be coloredwith
2. Prove that

vertex

of

Then

<4.

degree

4.

each

iff

less than 12 vertices has a


that every such graph is 4-

that the regionsofa simpleplanar


of G has even degree.
vertex
connected

a simple

that

Show

graph

4 is nonplanar.(Hint:UseRule

7. If
(a)

is the

30

17

and

edges

8 vertices

10

and 13

be 2-colored.

cannot

edge>s

6.

with

Show
a simple
that
connected planar graph with
vertices cannot be coloredwith 2 colors.
with
Show that a simple connectedplanar
graph

5. Show

than

less

with

4 colors.

prove

colorable.

3.

planar graph

most

graph

planar

every

at

of G,

complement

x(G)

+ x(G)

G.

(b)

x(G)x(G)>\\V\\.

(c)

+
/|V|+1\\2
/|V|

(d)

x(G)

< |

V\\

of degree

each

7 vertices

with

5.11 and

section

9 of

be 2-colored

G can

graph

exercise 5.)

then showthat:

1, where

V\\

is the

number

of vertices

of

1\\2

^ rc/n

- d whered is minimum

degree

of the

vertices

of

G.
A

so
Let

of the

variation

that
the

coloring problem

is to colorthe edgesofa graph

are colored

all the edges incident on one vertex


a vertex
line graph L(G) of a graph G have
vertices are
two
of these
that

G and suppose
corresponding

edges

in G

distinctly.

for each

adjacent

have a common endpoint.

Show

edge of
iff

that

the

Chapter5: Graphs

572

G can

graph

be edge

colored with

k colors

iff the

vertices

k colors.
with
can be colored
can
be 4-colored
9. Prove that the regionsof a planegraph
Hamiltoniancycle.
has
G is a plane graph where eachregion
that
10.Suppose
G = K4.
unless
Show that G is 3-colored

Selected

if G

has a

degree

3.

for Section 5.12

Answers

1.

of L(G)

is a vertex of degree <4 by Exercise


5 of section
5.8.
5.12.1.
Follow the ideasofthe proofof Theorem

(a)

There

(b)

Take

duals.

Exercise 6 of

2. Apply

3. Let

5.8 to

section

the dual

of G.

graph
edges
Suppose that
G can be 2-colored.
Then
Rule
9
of
section
5.11
in G
each
by
cycle
of regions
has even length. By Euler's Formula,the number
for G is
of coloring
the
vertices
of G is
| JB71 - | V\\ + 2 = 9. The problem
to
of
the
of
the
the
dual
of G.
equivalent
problem coloring
regions
The dual G* contains 9 vertices, 17 edges, and the degreeof each
vertex
of G* must be even. Now
since
G is simple each region of G
has degree> 3.Thus,
vertex
each
of G* has degree >3 and since
the verticesof G* are even, in fact, their degreesare >4. Thus in
G*, 21E* | > 41 V* | or 34 > 36. This contradiction showsthat G
be

The
length

Thus,

and

17

with

we prove by Euler's Formulathat there


of regions
is | R | = | E | - | V | + 2
>4, then
4|i?|, or|\302\243|> 2|JR|
2|E|>
there is a circuit of length < 3. Since

number

there are no cyclesof length1,and

multigraph) there areno


of

10 vertices.

be 2-colored.

cannot

4. First

a plane

length

of

G.

G is

is a simple graph,
a graph (and not a

of length
2. Hence there is a cycle
3 verticesrequireexactly
3 colors.
Rule 9 to G*. Interpret this result for

cycles

3. These

exactly

the dual

5. Take

since

is a circuit of length 3.
= 7* If all circuits have
= 14. But|\302\243|
= 13.

Apply

G.

6.

If such a graph is
conclude | E | = 14and

each
are8

Euler's

Formula

sum

of

degrees

to get | R | =
9 number
is

formula

to

9. The degreeof
28. Hence there

the sum of these


3
of degree
3 and 1 of degree 4. Any
region
will
3 colors.
Hence the regions of G are not 2-colorable.
require
But
this
observation
and the hypothesis that eachvertex has even
violates
the conclusion of exercise 5.
degree
color in the same class.
the
same
Place
all vertices
of G with
(b)
vertex of G is in some
each
and
there
classes
are
Thus,
x(G)
region

7.

planar, use the

regions

is >

3 and

of

degree

Section

class. Let k bethe sizeofthe


this largest classy are nonadjacent

color.

G, these

in

Thus,

the complete
But then | V| -

(c) Let k = X(G),


have

Kk

(ft

Let

< X(G)

< x(G)k

all vertices in

have the same

are adjacent,that is,JJiereis


x(G) > k.
ofjG. Therefore,
x(G).

we
x(p)- Then from the fact that (k
> n
by 7(b). Thus, (k +, kf >:4n
+_k)2 >: Akk. Now kk
+
k)
l)2 >
(n
By 7(a), k +_k < n +
(&_+
>_2Vri.
>
4fefe or [(n + D/2]2>:fe*.
+ fe)2

k =

-k)^>0

(k

a Hamiltonian

C be

separatesthe plane

into

and

red

alternately,
say,

and

green

alternately

cycle for
the

the

interior

plane

of C

G. The

graph

and the

exteriorof

by G that are insideCcan be colored


blue while those outside C can

determined

regions

REVIEW

inside

they all

1 so

or
10.

since

k vertices

subgraph

Then

class.

largest

573

Problem

The Four-Color

5.12

cycle C
C. The

be colored

yellow.

5.7-5.12

FOR SECTIONS

1. Isit possible
to
team
exactly

a soccer

have

9 games?

plays

and justify your

multigraph

league with 15 teams in


Model the problem with

answer with

result

which each
a graph

from

or

graph

theory.

2. Fill in the blanks.


of
G has 2 verticesof degree4,4vertices
G has
2 vertices of degree
5. Then
edges.
5 regions of degree 4, 11
G has
(b) If a planar connectedgraph
of degree
of degree
8,
5, 2 regions of degree7, 2 regions
regions
G has
and 1 region of degree 9, then
edges and
vertices.
(c) If a planar graph G has 15 vertices, 19 edges, and 8 regions,
(a)

that

Suppose

then

3. For

the

a graph

3, and

degree

connected

has

following

graph

H,

components.

574

Chapter 5: Graphs

(a) UseEuler'sformula

and

planar.
(b)

4. Let G

a simple

be

graph

with

116

that H is not

of H.

number

chromatic

the

Determine

to prove

corollaries

its

chromatic

and

vertices

number

5.

(a) Provethat

in

5-coloring

any

of G, some coloris usedat least24

times.

(b)

Prove
that the complement G of
isomorphic to K24, the complete
graph

5. Prove that

if

degreeat least
6. Prove that the

is any

six,

vertices.
graph for which each vertex has

graph

7. Determine
or
(a) a Eulercircuit.
whether

obtained

(b)

a Euler

(c)

a Hamiltonian

cycle.

(d)

a Hamiltonian

path.

(a)

In

the

carefully

(b)

Also

the following

path.

G below find
that none exists.

x(G).

5 edges

from

the

or

show

graph has
-\342\200\242

#c\342\200\224

graph

determine

by removing

planar.

not

(e) chromaticnumber 3.

8.

on 24

connected
G is not planar.

Kn is not

graph

complete

then

a subgraph

contains

Vv
Vv/S.

AX^\"#

a Hamiltonian

cycle

Section

5.12

The Four-ColorProblem
Use

9.

simple
There

this

in the

cycle

determine whether or not there is a

following graphs:

n > 2, the directedcomplete


has
a
directedHamiltonian
graph
path.
are 30 different
one-hour final examinations on one day. For
uses as few
that
day we want a schedule of examinations

10. Prove by

11.

theorem to

Grinberg's

Hamiltonian

575

on n

all integers

For

induction:

vertices

different hoursas possible.Theschedulemust be arranged


so that
no student can be in different
examinations
at the same time.
Explain how to model this problem as a graph coloringproblem.
12.(a) How many different Hamiltonian cycles are there in Kl7i the
complete
(simple nondirected)
graph on 17 vertices?
there are 8 edge-disjoint Hamiltoniancycles
in
Show
that
(b)
Kl7.

(c)

If 17

mathematics professors dine togetherat a circular


a conference
and if each night each professor

table

during

sits nextto a pair of different


professors,
can the conferencelast? Explainhow
problem

as

a problem

(d) Showthat

if

be partitioned

about graphs.
odd integer,

is an

how
to

then the edgesof

into {lk){n \342\200\224


1) edge-disjoint

days

many
this

model

Kn

can

Hamiltonian

cycles.

13. (a)

Showthat a group ofn > 3 peoplecanbeseated


such that
if everyone

everyone will have


knows at least half

two
of

the

(b) Show that the completebipartite


Hamiltonian

14. Suppose

Xmm

graph

has

> 1.

cycle
that G is a planar graph with
if

a table

around

friends at his two sides


people in the group,

of his

n vertices

each

of which

degreeat most 5 and at leastonevertexof degree4.Use


to prove that G is 4-colorable.

induction

has

Chapter

5: Graphs

15. A

coloring of a

simple graph G

the

partitions

set of

disjoint subsetsofverticesofthe samecolor.


the

for

Draw

the

(b) a

with

wheel

a cycle

(f) a
(g)

cycle

Kn

18.

Determine

19.

knight

returned

chromatic number

x(G) x(G) > n.


the graph in Exercise 9(a).

Show that

x(G) > | k |.

of

chromatic

of

number

bipartite graph,

(c) a wheelwith
(d) a complete
(e)

color iriG.

of one

vertices

of

G the

n vertices,

16.
the
dual
17. Determine
(a) a

set

complement

G has

If

(b)

a maximal

k be

Let

(a)

vertices into

8 vertices
13

vertices

WSt
W13,

graph Km

graph Cn where n is odd,


Cn where n is even,
graph
e is an edge in Kn.
where
e,

are suchthat Kn has a Euler circuit.


n moves on an 8 x 8 chessboardand
made
has
has
to the square from which it started. Provethat n must be
what

values of n

an even integer.Hint:use Rule


20. Show th$t if a simple planar

9 of

Section

connected

length3,then|\302\243|<2|V|-4.

5.11.
graph has no

cycles of

Boolean

6.1

Algebras

INTRODUCTION

after the English mathematicianGeorge


the magnum opus \"An
Laws of Thought.\" The mathematical methods,astoolsto
Investigation of the
the study of logic, have made algebras one of the more interesting classes
of mathematical structures when
the
to the area of computer
application
sciencesis concerned.
The
are of special significance to
algebras
of their direct applicability to switchingtheory
scientists
because
computer
and
the logical design of digital computers.
In essencea lattice that contains the elements 0 and 1, and which is
in
both distributive
and complemented is calleda Booleahalgebra.
Since
lattice the complementof every
element
is
a distributive
complemented
over
can be regarded as a bona fide operation
unique,
complementation
the domain of such a lattice.
Boolean

algebras

are named

Boole(1815-1864) in
who

1854

published

The importanceof Boolean


algebraic systems in both pure

and

from

stems

algebras

applied

mathematics

the

fact that many


are isomorphic

to them.

\"
is the \"smallest
Boolean
Of special interestto computerscientists
whose
domain
is
the
set
of
Boolean
elements{0,1}.
expressions
algebra
Boolean
this
specific
algebra are
generated
by n Boolean variables over
in computer
realized by combinationalnetworks
and
are used extensively
design. A switching
algebra is developed in this chapter for the analysis
and synthesis of such networks.
out of binary
Sincedigital computers
are built predominantly
two
components\342\200\224that is,
which
assume only
possible distinct
components
as
in
units
functional
a digital computer can be viewed
positions,various

combinational

(or switching)

The main reasonsfor

networks.

employing

such

binary

devices are

their speedof
577

Chapter

6: Boolean

Algebras

operation, cheaper cost of manufacturing,


with

compared

nonbinary

The chapter

begins with

Boolean

We

functions.

the

discuss

and

in

of Boolean algebras and


of
develop
switchingmechanisms,
of Boolean functions. Two specific
the theory

initial
design are illustrated\342\200\224the
(ALU) of a digital computer and

computer
unit
logic

reliability

higher

discussion

a detailed

then

simplification

applications of
arithmetic

and

devices.

of the

design

the useof multiplexers

design.

logic

ALGEBRAS

BOOLEAN
A

is a
algebra
two distinct elements

Boolean

least

at
distributive, complementedlatticehaving
as well as a zeroelement
0 and a one element

the Booleanalgebracan

1. Namely,

be

by the

represented

system

JB- <B,+ ,.,\",0,1>


a set,

B is

where

+ and

(complementation)

1.

2. V a,b

(a) a
3.

b G

4-

G B,

(a) a + b

4.

=b

\342\200\242
b = b

two elements

a,

6.

Vayb>c

a +

(b)

Va

B.

a, Va G

B.

\342\200\242
1 =

=\302\243
6.

existence

of zero

existenceof unit

23,

(a) a + a = 1 and
a

laws

a + 0 = a, Va
a

(6 \342\200\242
c) = (a + 6) - (a +
c),|
\342\200\242
(6 + c) - (a \342\200\242
6) + (a \302\253
c),
J
of
B, 3 a G 23 (complement

(a)

(b)

a,b G B suchthat

commutativity

I
\342\200\242
a.
j

(b) 31 G B suchthat

5.

operation

such that

30GB

(a)

is a unary

following axiomshold:

B,
B.

\342\200\242
b G

(b)

and

operations,

G B,

(b) a
a,b

binary

that the

at least

exist

There

\342\200\242
are

such

\342\200\242
a =

existence

0.

laws

distributivity

a) such

that

of complements

The associativelaws
a +
for

(b +

c) = (a + b)

all a,6,c

23

can

Theorem6.2.9.)

be

and
derived

a - (6
from the

\342\200\242
=

c)

(a

\342\200\242
\342\200\242
c

b)

above postulates. (See

Section

Boolean

6.2

are not used,it will

When parentheses

be

that

implied

Algebras

579

\342\200\242

are

operations

before + operations. Also, we write ab for a \342\200\242


6.
performed
The reader
may have observed a similaritybetweenthe above
those of ordinary algebra. It should
and
however,

axioms

be noted,

a + (6 \342\200\242
c) = (a + b)
hold for

does not

algebra.

ordinary

example of a

The

simplest
0 and
elements,

the

only

two

addition

law over

distributive

that

1, definedto satisfy

\342\200\242
+

(a

c)

Boolean algebra consistsof

1+1=1.1=1+0=0+1=1

0+0=0-0=1.0=0.1=0

1=0

6-1.
is

It

axioms of
to verify that

of the

all

Clearly,

easy

above is
algebra
in the
postulates

a Booleanalgebraaresatisfied.

the set of postulatesdefining

the

Boolean

consistent and independent. That is, none of the


set may contradict
any other
postulate in the set, and

noneof the postulatescan be

the

from

proved

other

postulates

in the

set.

Somecommentshould
have

terminology.We

The

designers.

our notation and


concerning
notation frequently used by computer
binary operation + in our definition of Booleanalgebra
be

made

the

adopted

satisfiesthe properties:

0+0
Mathematicians,

algebra

in

the

0 +

0+1

and

0,

however,
commonly
sense:

= 1

+ 0 = 1+

use the

symbol + in Boolean

following

0 = 0,1 +

1=0

and

+ 1

= 1

= 1 + 0 = 1.

this latter
use the symbol \302\251to denote
computer
designers
binary operation of addition modulo2, sothat for them, 1 \302\2511 - 0, and,
= xxx2 + xxx2 for each xx, x2 G B.
in general, xx \302\251
x2
V and A in place of our + and use
Moreover,mathematicians
usually
The principal
reason computer designers used the symbols
+
operations.
\342\200\242
and
was
in the past commercial line printers did not
have
that
the
V and A. It is frequently
case that the terms sum, join, and
the
symbols
in a Boolean algebra as are
disjunctionareused interchangeably
Normally,

product,

meet,

and

conjunction.

580

Chapter 6: Boolean

Algebras

A partial

6rder <

can be definedon any

x <y
in

While

entire

the

fact

Booleanalgebra,

the

make

up

information
and

=
\342\200\242

iff

+,

and
\342\200\242,

the Boolean algebra,


for example, that

we will

frequently

( 23, +,-,->

say,

= y.

the domain
and the zero and

J3, called

set

system\342\200\224the

operations

as follows:

algebra

x + y

and

Boolean

-,

suppress

of the
unit\342\200\224

some

or that the setBisa Boolean

algebra.

that
It is easy to see, from the above
axioms,
they are arranged in pairs
from
the other
and that eitheraxiomcan be obtained
by interchanging
the operations of +'s and -'s, and the elements 0 and 1. This is the

principleof

For

duality.

example,

a +

(b

- (a

\342\200\242

c)

+ b) - (a

+ c)

i
a
Every

(b

that can

theorem

alsotrue.
We

sh^ll

manipulation
is
theorems

c) = (a - b)

\342\200\242
+

be provedfor

+ (a

Boolean

\342\200\242

c).

algebra

has a

dual which is

some theorems necessary for the convenient


prove
of Boolean algebra. The basic tool of proof
of
these
the use of the axioms as well as principles of substitution and
now

duality.

B,a + a = a.

Va G

6.2.1.

Theorem

Proof.
a

a =

(a -f a)

= (a

+ a)

\342\200\242
1
\342\200\242
+

(a

a)

+ aa
=a + 0
=a
= a

Proof,

Va G

6.2.2.

Theorem

(a)

By

the

Axiom

4(b)

Axiom

6(a)

Axiom 5(a)

Axiom 6(b)
Axiom

5,a . a = a.

principle

of duality

4(a).

\342\226\241

Section6.2

Boolean

(b)

aa = aa
= aa

4- aa

= a(a

+ a)

=a

4-

shown

\342\200\242
1

axioms to those usedin

6.2.2are

the

as

known

Axiom

a2

B we
ax

Let ax = 02 and

a2

= ax

laws

0 and

1 are

unique.

elements,

Ox

and

a2 4-

02

of

each

0! = 02

and

0! +

02 =

0! - 0! + 02,

and

(V

0! = 02.
reader can easily

thus

of

show that

the

proof

theorem
is by the

duality.

6.2.4.

Theorem

02. For

and

= a2.

the
By the useofthe principleof duality,
the element1isalsounique.
of fact, we shall state the dual
results
As
a matter
The
without a proof throughout the rest of this section.

principle

dual

0X. Thus,

2(a) 02 +

by Axiom

of the

use

6.2.1and
for Boolean algebra.

two zero

are

the

have, by Axiom 4(a)

4- 0!

02 +
But

there

\342\226\241

6.2.1. Theorems

of Theorem

elements

Suppose
E

6(a)

proof is obtainedby

proof

The

that

and

fl^EB

the

idempotent

Theorem 6.2.3.
Proof.

6(b)

Axiom 4(b).

the complete

here,

4(a)

Axiom

Axiom 5(b)

= a
As

Axiom

581

Algebras

Va E

B, a + 1 -

and

- 0

= 0.

Proof.

a + 1 = (a + 1) \342\200\242
1
= (a + 1) \342\200\242
(a + a)
= a4-l-a
= a

4- a

=1
a

Theorem

4(b)

Axiom 6(a)
Axiom

5(a)

Axioms 4(b) and 2(b)


Axiom

\342\200\242
0 =

6.2.5.

Axiom

6(a)

Principle
The elements

of duality.

0 and 1 aredistinct

and

\342\226\241

I =

0; 0 =1.

582

Chapter

6: Boolean

Algebras

Proof.

G B;namely,

Let a

\342\200\242
1 =

Axiom 4(b)

\342\200\242
0 =

Theorem

and
0

6.2.4.

Suppose 0 = 1. Hencethe above is satisfied only if a = 0. But we


there are at least two elementsin B and thus 0^1. Clearly,

know

that

0 =

0 +

Axioms 4(a) and 6(a)

0-1

and

Theorem

Proof.

two complements,

a has

Suppose

\342\226\241

a.
there exists a unique complement

VaGB

6.2.6.

and 6(b).

Axioms 4(b)

1-1.1-0

ax

and

a2. Thus

by Axiom

(a,b)
a + ax = 1,
= 0,
a \342\200\242
ax

a2 =

\342\200\242
=

0.

a +

a2

Hence,

ai =

1 \342\200\242
ai

= (a

+ a2)

Axioms

' ai

Axiom

6(a)

\342\200\224 \342\226\240+^2al
CLCii

Axiom

5(b)

= 0

Axiom 6(b)

4- a2ax

= aa2 +

\342\200\242

a2

\342\200\242
a\"2

Axiom

5(b)

Axiom

6(a)

Axiom 4(b).

a2

Theorem 6.2.7. (Absorptionlaws.)


-+-

\342\200\242
6 =

4(b)

Axioms 6(b) and 2(b)

aia2

= (a + a^
= 1

2(b) and

and

Let

a,b

\342\200\242
+

(a

G B.

b) =

a.

Then

Section6.2

Boolean

583

Algebras

Proof.

a-6 = a-l

a +

+ a-b

= a(l

=a
a

+ b)

(a

6.2.8.

Theorem

4(b)

Axiom 5(b)

+ b)
\342\200\242
1

6.2.4

Theorem

= a

Axiom 4(b)

= a

Principle
law.)

(Involution

Since a = (a)

Proof.

Axiom

are

we

Va

of

= a.

Bfa

for

searching

\342\226\241

duality.

a complement

of a.

However,

So

is one

thus

and

of

and
Proof.

algebra is associativeunder the


and c in 23,

for

all a,6,

+ (b

+ c)

\342\200\242
=
\342\200\242

\342\200\242;
namely,

aa = 0.

and

A Boolean

6.2.9.
+ and

= 1

a. By Theorem6.2.6the complement
isunique

of
complement
a = a.
\342\226\241

Theorem
operations

+ a

= (a + b) + c

c)

(b

(a

\342\200\242
\342\200\242
c.

b)

Let

a =

[(a + 6) + c] \342\200\242
[a +

- [(a + b)

c]

\342\200\242
a +

(b +
[(a

c)]
+ 6) + c] - (6
[(a + 6) + c]

= [(a + 6) \342\200\242
a + c \342\200\242
a] +
- a + [(a + b) + c] \342\200\242
(b + c)

- a
- a
But

+ {[(a+ 6)
+ (6 + c).

c]

\342\200\242
6 +

[(a +

b) +

+ c)

. (6

e] -

c}

also

+ 6) [a + (b + c)] + c[a + (6 + c)]


[a + (6 + c)] + c
- {a[a + (6 + c)] + 6[a + (6 + c)] + c}
- (a + b) + c.
- (a

(a + 6)

c)

584

Chapter

6: Boolean Algebras

a + (6 + c)

Thus

Similarly,
by the

= aT

Proof.

\342\200\242
\342\200\242
c

b)

\342\226\241

For

laws).

The methodof proofhereisto show


+ b)

This shows that

+ ab

=1

(a + 6) and

establish

we

(a

c)

any

Va,6

23,

\342\200\242
b and

(a

6.2.6

+ 6)

6.2.10
(DeMorgan's
a \342\200\242
6 = a + 6.

Theorem

a + b

(6

+ c.

(a

\342\200\242
\342\200\242
=

of duality.

principle

a b

+ 6)

(a

- 0.

\342\200\242
ab

and by the

are complements

Theorem

laws.

DeMorgan's

(a +

and

that

6) + a6= [(a +

b)

a]

+ 6]
(6 + 5)]

(6 +

. [(a

= [5 + (a + b)] . [a
= [(a + d) + 6] - [a
- (1 + b) \342\200\242
(a + 1)

+ 6)

5)]

(6.2.1)

-1-1

= 1.

(a +

b)

= a(o6)

4- 6(6 a)
= (aa)6 + (66)a

\342\200\242
a 6

(6.2.2)

=0 + 0
= 0.
Clearly

Theorem

Proof,

a (a + 6)
Before
observations. First,

a +

6 by the

6.2.11.

Va,6

\342\200\242
6 =

\302\24323,a

+ a6

= a

+ 6 and a(a +

ab - (a + a) (a + 6) = 1 \342\200\242
(a + 6)
by the principle of duality. \342\226\241

a +
= ab

principleof duality.

concluding
if (23,

= a

6)

- a6.

+ 6.

section, we would liketo makeseveral


,0,1) is a Booleanalgebraand Qjs a subset

this

+ ,-,

of B

and
which inclosed under the operations+, \342\200\242,
, and
0,1 G Q, then
of (23, + ,-, ,0,1) calleda Boolean subal(Q,+ ,-, ,0,1)is a subalgebra
gebra.A Boolean subalgebra is a Boolean algebra.
Second, we can observe that set theory is an example of Boolean
of set
Let A be any set and let
denotethe operation
algebra.

BooleanAlgebras

Section 6.2

C containsthose^elements

to A. Thus
relative
set but not in set C.Then

complementation

the universal

585

(P(A),U,n,

in

found

,0,A> is a

Boolean

algebrawhereP(A) isthe power set of A. This is an exampleof a Boolean


it can be replaced by
set algebra. The power set is not really
necessary;
is
of
which
closed
under
collection
sets
the
set
operations of union,
any
to
and
relative
some
set.
universal
intersection,
complementation
a
Boolean
is
Another
of
the
setof
functions
from a
all
example
algebra
set U to a two-element set, say {0, l}, where if / and g are two such
then / 4- g is the function
defined
+ g){u) = max
functions,
by (/
i

for any

f(u),g(u)}

tediousjobto
for
(w

u\302\243 U.

Likewise,

{f(u), g(u)} and f(u) = 1 -

min

each

all the

that

check

\342\200\242
and

for

f(u),

function
/ corresponds uniquely to
= l). Then it is easy to
that

see

to

Sg and

SfUSg,SfD

\342\200\242

g)(u)

U forms

a subset Sf

- g,

f + g,f

of

need not be a
L^ where

and /

the complement of Sf in

Sf =

correspond
U. Because

we know that
algebra
Boolean algebra. (It is a fact
the set of all functions from
a
that
any Boolean algebraB is also
we
not
a Boolean
but
shall
that
fact.)
algebra,
verify
setalgebra P (U) and the Boolean algebraofall functions
TheBoolean
from
U into {0, 1} are essentiallythe samein the
sense
of the following
definition.
we

know

the power

that

the set of functions

set of

by (/

axioms of a Booleanalgebraaresatisfied,

\302\243
[/|/(u)

respectively

/ are defined
u G U. It

each

Definition 6.2.1. If (A,


Boolean

algebras,
in the

operation

(1)
(2)

h(a
h(a

+ b)

h:A

and

\342\200\224*
B is

(By V, A, ~,0', 1') are two


a Boolean algebra

called

the two binary operations


A
sense:
for all a, b \302\243E
following
h

preserves

= h(a)

\342\200\242
=

b)

+ , \342\200\242,
-,0,1)

a function

homomorphismif

a Boolean

is also a
set U into

above

defined

and the unary

h(b)

A h(b)

h(a)

(3) h{a)=h{a)
A

Boolean

h:A

homomorphism

\342\200\224*
B is

a Boolean

isomorphism

if h is

one-to-oneonto J5.If suchan isomorphism


then the two Boolean
exists,
algebrasaresaidto be isomorphic.
Bn
If <23, +,-,-,
0,1) is a Boolean algebra thenthe cartesian
product
of n copies of B can bemadeinto
a Boolean
algebra by defining
(&!,b2y.. .j bn)
(bu b2f...,

+
bn)

(c\342\200\236
c2,...,

(cl9

c2,...,

cn) =

(bi +

c,, b2

cn) = (bjC!, 62c2,...,

and

(hub2,..

,,bn)

= (bub29...,

fen).

c2>...,
fcncj

bn +

cn),

Chapter

6: Boolean

Call this

Algebras

Booleanalgebrathe directsum

It is interestingto note that

therejs

of B.

n copies

of

a natural

from the
uj,

isomorphism

Booleanset algebra(P(t/), U, H, ,0, U)y where U = {ulf u2,...,


and the directsum of n copies of the Boolean algebraB2 containing
two elements {0, l}. This isomorphismis given
by

only

h:<P(U)->B%

where

H(S)

= (bu

b2

if^GS

otherwise

bn)

with

bi =

for

i =

1,2,...,

proof that h

n. For examplewhen

n =

4, h

({uu u2, uA\\)

The

(1,0,1,1).

is an isomorphismis left to the reader.

ExercisesforSection
6.2

1.

Let

least

this

in a

elements

l2 be

lx and

gib (lub) then this


2. Show that if a poset

poset L. Provethat

3. Let V = {1,2,3,4,6,8,12,24}
be
a poset

ordering|

(\"is

with

Does the

poset

A greatest

element?

a least

have

to the partial
and lub of every

respect

the gib

of\.") Determine

divisor

of elements.

pair

l2 have

and

L has a least element (greatestelement),then


element is unique.

(greatest)
a

if lt

is unique.

(lub)

gib

element?

4. Provethat

is a

gcd)

1cm,

(M;

of positive

a set

integers

lattice under
that

represents

/, wheretherelation/ on
njn2

iff

nx

is a

divisor of

n2. (1cm = least commonmultiple;gcd = greatestcommon

divisor).

5.

Prove

that if

and

lx

(lx V l2

6. Let

elements

(lx A l2

lx)

L be a poset with

that L
(ij

l2 are

forms

G {1,2}),

lattice

a least

if for

there is an

(ij G {1,2}).

of a lattice <L;V,
= l2)

element

any

(l2

and a
xlfx2fyuy2

<

A),

then

lx).

greatest element.Show
\302\243E
L,

element z G L such that

where
x,-

<

xt <
z <

yj9

y;

Section

Boolean

6.2

7.

<L; V,

lattice

<

(l2

V (I,

lx) ->(l2

all /i,/2,/3 G

if for

is modular

>

587

L,

(/2 V /3)).

= lx A

/3)

Algebras

Show that in a modular lattice


/3) -

qi9q2

any

>

that

is a

of a

subsystem

every

algebra.

10.

/3)).

Boolean algebra is a Boolean

Boolean

algebra if a

Boolean

algebra

in any

that

Show

\342\200\242
x =

0 and

a + x

= 1,then

= a.

that in any

11. Show

four equations

the following

are

equivalent:

mutually

12.

(Z2 A

on a set Q. For
relations
equivalence
define qx < q2 appropriately,
and show that
lattice under the defined operation <.

E(Q),

(2?(Q);V,A
Show

I,

E(Q) be the setof all

8. Let

9.

(^ V

>: lx) \342\200\224


(/2 A

(/2

that a

Show

b =

+ b=

a, a

Boolean algebra23

(be) = (a 4-

a +

b, 5 + 6 = l,a-6

for

6)c

the

satisfies

all a,6,c,

23

0.

law:

modular
where

a <

c.

(Hint: see exercise5 in section1.4.)

13.

from

functions

14.

Draw

a set

n elements

containing

of the

diagram

in the

of elements

number

the

Determine

Boolean algebra of
to the set {0,1}.

all

ordering relations between all


of all
functions
from the set

partial

elementsof the Boolean

algebra

{a,6,c,d}to{0,l}.

15.

(a)

the set of positivedivisors


{l,2,5,10,ll,22,55,110}_be
Show that (DUOtlcm,gcd, ,1,110) is a
x - 110/x for any x G D110.
where
element
is 1 and the
a < b mean in this algebra?
unit is 110. What
does
=

LetD110
of

110.

Thezero

(b) Showthat if
18 then
definition

Dl8

{1,2^3,6,9,18}

(Dl8ilcmygcdy ,1,18)
.
of the operation

is the set of positivedivisors


is not a Booleanalgebrafor

between
(c) The essentialdifference
that 110is square-freeand 18

square-free m2
if

Show

divides

that if Dn is the

integer n, then

x = nix for

any

the
is not.

Dn.

,/,n)

two examples
A positive integer n

divisors

is a

of
any

above

positive integer m impliesm

set ofall positive

(Dnylcmygcd>

x G

n for

Booleanalgebra

Boolean

of a

is

is

= 1.

square-free

algebra where

Chapter 6: Boolean

Algebras

B:

(a)

a_+

(b)

ab +

(c) a

Selected

b =

6
\302\251

for

Answers

the

for a,b,c

hold

following

6 \302\251
\302\251
ab,

be = ac if
< c if

a + c=6
ac = 6c iff

(d)
(e)

Boolean algebra23,

that in any

Show

16.

< a,

c < b

a <

c and fc

c iff

c <

< c,
< c,

fc
\302\251

fc.
\302\251

6.2

Section

9. Let <B;V,A, >


thus

and

preserved
Thus,

B.

be a subsystem
of the Boolean algebra <23;V,A,
)
the commutative, associative, and distributive
laws
are
in <B;V,A, ). If x G B, thenxG 23; hence
x V 3c,jc A 3c G
the elements 0 and 1 are included
in B and
)
<S;V,A,

satisfy the identity

laws.

complement

and,

FUNCTIONS

BOOLEAN

Let J8 =
an atom if

< 23,

+,

be a Boolean
for every x El

algebra.

\342\200\242,
,0,1 >

=\302\243
0 and

or
It is easy to showthat
of all atoms in 23, then B

a G

element

An

B is called

B,

\342\200\242
a =

\342\200\242
a =

0.

Boolean algebra,
to

B is a finite
is isomorphic

if

and if

R is

the set

<P(fl)fU,n/>

where ' denotesset complementation.


this section.)
An

immediate

of

finite

every

whose

domains

above is that

of the

corollary

the powerof the cardinality

exercises

(See

of

is a

Boolean

algebra

have the

same cardinality

power of 2. Also,
must

left as an exerciseto the reader).

It is

clear

from

the

above

the cardinality

of

discussion

Boolean

be isomorphic

that the

<B2,

whose

domain

is {0,1},with

the

+ ,.r,0,l>

operations

given

B is

2 to

algebras

(details

are

\"smallest\"Boolean

algebrais

j82=

end of

of the domain

the cardinality

2?. Namely,

at the

14-19

in Table

6-1.

Section6.3

0
1

0
1

0
1

1
1

In any

For
of the

elements

n-tuple

algebras

expressions
2. If ft
are

and

For example,

0
1

(xl9x29..

for

mappingthe algebra
the

are

fi2

and any

generated

expressions

\342\200\242
0 \342\200\242
+

1,

Xi

x2x3,

Boolean

finite

Boolean expressionsgeneratedby
.,xn) over B, recursively as

of the Booleanvariables
B.
elements
of 3e over
generated by
of B

element

Any

3c

and

in general,

B2 in particular, we define

algebra

1.

Boolean

\342\200\242

define functions

one may

system

algebraic

itself.

into

589

Functions

Boolean

jcx

in 3c are

by elements

xxx2

of x

are Boolean

Boolean

over

B,

so

expressions

generated by elementsof 3e over the Boolean algebra B2.


If the elementsof 3c are interpreted
as Boolean variables that can
in B, then
the Boolean expressions represent
assume only values
elementsin B. Thus, these expressions can be interpreted as functions
of
form

the

/:Bn

\342\200\224B

elements
of 3c
for any argument 3c,can be determinedusing
/(?),
. We
refer to these functions as Boolean
the operations +, \342\200\242,
functions
of n variables
over B.
For example,xY + x2 determines
the function f(xux2) = x1 + x2; thus,
/(0,0) = 1,/(0,1) = 0,/(l,0) = l,and/(l,l) = 1.
where

and

It is

clear

that

Boolean

functions.

different
For

Boolean
example,

expressions
x1

\342\200\242
+

(x2

may determine

jc3) and

(xx

\342\200\242
-f

x2)

the same
(xx

\342\200\242

jc3)

the
the same Boolean functions. DeMorgan'sLaw,
Laws, the Distributive Laws, and otheridentitiesfor Boolean
Absorption
One
expressions.
algebras
bring out forcibly the redundancy of Boolean
of the main objectivesof this section
will be to eliminate the ambiguity
which
would
otherwise
result, by developing a systematic processthat
will
to a simple
reduce
\302\253>^n)
every Boolean expression /(^Ci,^c2>\302\253 \342\200\242
canonical form
such
that
two Boolean expressions represent the same
Booleanfunction
if and
only if their canonical forms are identical.
functions fx and f2 over the same
two Boolean
Furthermore,
any
given
the
use
n-tuple 3c E B, new Boolean functions can be determinedthrough
of the following three Booleanoperations.

always

determine

590

Chapter

6: Boolean

Algebras

= 71(x1,...,*\342\200\236),

g(xl9...,xn)

. .,Xn)

h,(Xi,.

\302\253(Xlv .

.,*n)

. ;Xn)

f\\\\Xu.

= /l(*lv

\342\200\242
'j^n)

\342\200\242
\342\200\242>^n)>

l2\\x\\y

' I2\\xlf

\342\200\242
\342\200\242>*\302\253)\342\200\242

will result
in the
of this
process a finite number of times
functions
over n variables.
development of a complete classof Boolean
in {0,1 }n and
2 elements
in {0,l}, there are 22\"
Since there are 2n elements
Boolean
functions
of n variables over B2.
Let Fn be the set of all Boolean functions of n variables over B2- The
system
Iteration

7n=(Fn,

0,1)

,.,\"

is a Boolean algebra of the 2r functions


of n
algebrais calledthe free Booleanalgebraon

Definition
or its

6.3.1.

complement,

Definition
B, which

x* is

literal

6.3.2. A
form of

Boolean

has the

over B2. This


over B2-

to be a Booleanvariable

there

that

clear

Example 6.3.1.

minterms

four

The

generated
by xu... ,xn over
n
of
distinct
literals is
(product)
are 2n minterms generated by n

expression

a conjunction

variablesin B2.

in

n generators

5c.

calleda minterm.It is

x1and jc2,

defined

variables

generated

by the two

variables,

J52are

XjX2,

X\\X2y

X\\X2i

and

X\\X2*

of a disjunction
a Boolean
(sum) of n
expression of the form
distinct literals is calleda maxterm generated
by jcx,. .. ,xn.
form for any Boolean function of
The next theorem gives the canonical
like to denote a
n variables,
but before stating and proving
it, we would
minterm by
Similarly,

where

(0
11

= x{

if

xf

if

xf = xh

for

i =

1,2,.. .,n.

Section6.3
is denoted by

a maxterm

Similarly,

591

Functions

Boolean

where

I 0

if

if

Theorem 6.3.1.
written

in

the

xf =
xf =

Xi
xi9

Boolean

Every

i =

for

1,2,.. .,n.
.,xn) over

f(xu..

expression

Scan be

forms

11...1

f(xl9.. ,,xn) =

21

normal

(disjunctive

afemfe

form),

fc=00...0

11. 1
f(xi9..

.,:cn)

IX (Pk +
k=00...0

where A assumes
{0,1},and where

all

normal

(conjunctive

Mfe)

form),

configurations j\\j2..

2n possible

such
Jn\302\273

that

j( (E

ai,..i.ssft-,...y.-/0,ivJB).

Proof.

the

Using

of

definitions

mji-.Jn = ^ and Mjl..jn= 0 iff

jct

/(*!,...,*\342\200\236)

if xxx2

\342\200\242
\342\200\242
\342\200\242
=

xn

7x72

\342\200\242
\342\200\242
\342\200\242
and

Jn>

jcjjc2

\342\200\242
\342\200\242
=
\342\200\242

xn

y^'2

\342\200\242
\342\200\242
\342\200\242
and

Jn>

.>7n,

it

is clear

that

also

0 otherwise;
+

Mh...jn

1 otherwise.

is left as an exercise to the readerto show


forms of Theorem 6.3.1areunique.
Based
on the previous
discussion, we may
function
expressions represent the sameBoolean
It

M;i

1,2,.. .,n. Hence

\342\200\242
<*>,...;\342\200\236
\"*,,..,\342\200\236

f(xu...,xn) =^v.Jn
if

and

mjlmmjn

Vi,i =

= 7t

\342\226\241

the

that

conclude
iff

expanded
that

they

normal

two Boolean
have the same

canonical forms.

The

form
is a
is a sum of minterms and each minterm
form
of
literals.
is
sometimes
product
Accordingly, this canonical
referred
to as the minterm form
or as a sum-of-products
form. Likewise
the conjunctive normal form is also called the maxterm form or a
disjunctive

product'Of-sumsform.

592

Chapter

6: Boolean

Algebras

= (0

\342\200\242
\342\200\242
+

+ jc3) we
variables

(jcx

f(xlyX2yXs)

x1

For the

write the

(1

x2)

\342\200\242
\342\231\246
+

xx

\342\200\242
\342\200\242

(0

x2)

Xj

x2)

table of

Boolean expressionf(xux2,x3)= (xxx2) \342\200\242


values
for all possible values of
functional

*3

*i

x2

0.
0
0
1
1
1
1

0
1
1

0
1
0
1
0
1
0
1

0
1
1

of

form

0
1

0
1
1
1
1

/ is:

= 0 \342\200\242
(*i\302\2432*3) +

(^2*3)

+ 0

\342\200\242

+ 0

\342\200\242

\342\200\242

\342\200\242

+ 1

(*i + x2)

Xl,X2yX^,

disjunctive normal

Then the

+ x2)

-j\" XjX2\302\253

6.3.3.

Example

\342\200\242
\342\200\242
+

(1

x2)

xt

= X\\X2

= (x1

f(xux2)

is

form

normal

f(xux2)

the

The representation of

6.3.2.

Example

in disjunctive

~\\~

X^X2X3

XyX2X3

(*iX2*3)

~t~

XiX2X$

t\"

(XiX2*3)

(* 1^2*3)

(XiX&s)

(* 1*2*3)

~\\~ XiX2X\302\247,
X]X2X\302\247

normal form is nothing morethan the sum of


the disjunctive
minterms which correspond to the combination
of values
of
for
which
takes
on
the
1.
value
xux2xs
/
the product
of those three
Likewise, the conjunctive normal form
of/is
maxtermsthat correspondto thosevalues
for which / is equal
of xl9x2,x3
to 0. This is becauseif /? = 1 then /? + Mix_in = 1 and this term is
eliminated
from
the conjunctive
normal form. Therefore, the
effectively
Note

that

those five

of /

is:

(Xj +X2

form

normal

conjunctive

f(xuX2yXs)

We have used the operations


of

operationscanbe

as

defined

well.

called functionally complete

existsa form

The

FQ constructed

usual way to

test

if

X3){XY

+,

and
\342\200\242,

A set
if

X2 +

for

XgMXj

on elements

X2 +

of B.

of operations Q = {rlv
every

Boolean

*3).

function

from xl9.. .,xn,Tl9.. .,rr suchthat


set of operations is functionally
given

But other

. .,rr}

FQ

on B

is

/ there
denotes
complete

/,

Section

Boolean

6.3
is to attempt
to generate the sets {+, } or
well known that these two are functionally

} from
{\342\200\242,

(a) The

6.3.4.

set, since it is
Theorem
6.3.1
(by

complete

sheffer stroke function


= X1 I X2 =

f\\XlfX2)

is functionally

593

a given

and DeMqrgan's
laws).
Example

Functions

XxX<i

since

complete

X i I

X i \342\200\224
X ^X i \342\200\224
Xj

and

(#1

The dagger

(b)

Xj)

(#2

*2

= XjX2

X2

= Xi

-j\"

X1

Xi

X2.

function
=

/(Xi,X2)

is functionally

= ^l

#2/

Xj

\\

4-

X2

since

complete

\\

X\\

X\\ ==Xi

= Xj

and
\\x 1 j.

Exercises

for

following

the

Boolean

(x

A y) V

arguments

2.

minterm

The

x,y

\\

\\x21

is

X2)

==

Xj

4 X2

Xj

-f~

x2

\342\200\224

x^x2

6.3

Section

1. The

X\\)

over

algebra

(x

(a

expression
generated by x,y over
=
where B = {O,a,0,l}:
<J3;-,V,A,~>,
f(x,y)
V y)). Tabulate
the values of / (xyy) for all
Boolean

(x,y) G B2.
normal

the Boolean

Boolean expressiongeneratedby
is given
in Exercise1 above
described
algebra
form

of a

by

f(x,y)

= (aAx~Ay)V(l3AxAy)V(0AxAy)V{lAxAy).

Give the maxtermnormal

form

of/.

594

Chapter 6: BooleanAlgebras
3.

all 16 Boolean functions of one


Boolean algebra describedin Exercise1 above.
Which
of the following statements are always

Enumerate

4.

over

variable

true?

the
your

Justify

answer.

(a) If x(y
(b)

5.

If z

the

Obtain

Boolean

= x(y

z)
then

w,

+ w),
+ f)=

x(y

then 2 = w.
x(y + w).
of the

following

expressions:

(a)

jcj

(b)

(x1

(c)

xxx2 4-

\302\251
x2

\302\251
(Jj

\302\251
x2)

\302\251
jc3)

xs

(d) xx + [(x2 4- F3)(x2x3)]


a(xlyx29...,xn) is the

(*i

6. If

4- x2J3)
of

dual

B be a Booleanalgebrawith
number of sub-Boolean
algebras

fi(xlyx2,..

7. Let

of a

partitions

set

with

of

each

the dual

8. Write

(a) x + xy
(b)

forms

canonical

sum-of-products

(x

- x+

1)(0

that

the

the number of

n elements.

Boolean

equation:

x) =

\342\200\242 +

is equal to

that

show

Show

elements.

2n

of B

then
.,*\342\200\236),

9. Let/(:t,;y,2)= ry

4- ^cy^

4-

xyz.

Show

that

(a) f(x,yyz) 4=/(x,y,2)


4- x ^ f(x,y,z)
(b) f(x,yyz)
+ z * f(x,y,z)
(c) f(xyy,z)
X2

10. Let B bethe setof

set

a <

atoms

for someatom c.
(a)

functions

For each

from {a,6,c} to {0,1}.Determinethe


function /, determinethe subset of

/.

11. Prove that in any

12.

all

of B.

atoms

of

Booleanalgebraif

> z

and a

\302\245=
z, then

az

> c

the Booleanalgebra

{2,5,11} are the only atoms in


in exercise
15 of section 6.2.
Find all atomsin Dn when n is a square-free
that

Show

Dno

described

(b)
integer.
of Duo.
of Boolean
(c) Determinethe number
subalgebras
in the Boolean
13. Determine that the set of atoms
algebra of all
subsets of a set A is just the singletonsubsetsof A.
14. Prove that if ax and a2 are two atoms in a Booleanalgebrasuch
that
axa2

\302\245=
0, then

15. Prove that

atoms of

if

ax =

ax

a Boolean

a2.

4- a2

4-

6, where b,aua2>...,an are


B, then at = b for some i.
an >

\342\200\242
\342\200\242
\342\200\242
4-

algebra

all

Section

6.4
16. Prove

isl.

17.

that in every

Boolean

finite

sum of

the

algebra,

b is a nonzero element of a finite


that
Boolean
that a is an atom ofJ3.Thenpreciselyoneof

Suppose

Suppose

595

Mechanisms

Switching

all atoms
B.

algebra
the

following

hold:

or a < b.

a < b

18.

nonzero
element c of a finite
that
every
the sum of preciselyall the atomsa such that

Boolean

Prove

a <

other sum of atoms is equalto c.

19.

Let

Boolean algebra and let R

a finite

B be

Defineh : B -* P(R)

h(x)

as

follows:

= 1,

d>

20.

Let

minimalif a

jc

Selected

Answers

5.

= 0.

Show

if jc

6.4

algebra. An
if, for every

and

that a

(a)

=
jcx \302\251
jc2

(C)

=
XiX2Xs

jc^

is an atom

iff

a G

element
jc

a is

\302\243
J5,

jc

< a

J5 is

said to be

implies

jc

= a

or

minimal.

4- Jc\"iJc2
+

XiX2\\Xz

Xi^^

4- 2

(c) f(x,y,z)

SWITCHING

0.

for Section 6.3

9.

atoms of B.

is a Booleanalgebraisomorphism.

a Boolean

be

no

ifx-0

[{aGJ?|a<:c}

Show that h

set of

the

be

B is

algebra

c. Moreover,

~f~

= xy

+
\302\2433)
XiX2X^
4-

xyJ

(Xj

-f

#i)(#2

\"I\"

4\" \302\243;\302\2432#3
+ ^1^2^3

4- ryz

4- 2

= xy

\342\200\224

X2)XZ

4-

\"I\"

#l#2^3

f(x,y,z)

MECHANISMS

In the first
and specifically

three
the

sections,
Boolean

we discussed
algebra

of all

Boolean algebras in general,


subsets of a given set and the

algebras
algebra of all functions into a two-elementset.Boolean
in theoretical considerations, but by far the most
are
important
very
and
engineering
important
application lies in the realm of electrical
as
not
is
Such
an
surprising digital signals,
computer design.
application
mechanical
switches,
diodes, magnetic dipoles, and transistorsare all

Boolean

596

Chapter

6: Boolean

Algebras

two-state devices. These two

states

current, magnetizedor not magnetized,


and closedor open.It is easy to see

correspondence
and 1 represent

between

the

two

Boolean

be realized

may

high

that

variables

potential

as current or no
or low potential,

one may have a one-to-one


and digital signals where 0

states.

units in a digital computercan be


(combinational circuits or logic
of inputs and generatea collection
of
in the sense that it is capable
Each
outputs.
input and output is \"binary\"
of assuming only two distinct
which are designated 0 and 1 for
values,
n inputs
convenience.
More
a switching mechanism with
and m
formally,
if
is a realization of a function f:B2\342\200\224*B2
where
outputs
.,xn are the n inputs and
xux2,..
(zuz2,..
.,zm) = f(xux2,. . .,\302\243*)>then
\342\200\242
are
the m outputs. The function
a switching
Zi,z2,.
'*zm
/ is called
/ (and, hence, the switching mechanismrealizing
function, and usually
/)
is specified
by a truth table where each row of the table lists the output
.,2m) for one of the T inputs (xlyx2,..
.,xn).Two switching
(zlyz2y..
mechanisms are
said to be equivalent if they h^ve the sametruth
that
table,
is,
if they are the realizations of the same
function. A gate
is a
switching
one
mechanism with
thus, a gate realizes a
only
output;
switching
various functional
Accordingly,
mechanisms
as switching
viewed
which
a collection
networks)
accept

Boolean

function

f:B2\342\200\224^B2.

we develop an assortment of switching


mechanization
techniques
using some specific designexamples.
The first step in the design of a switchingmechanismis to define the
This is done by translating the generaldescription
of
concisely.
problem
into either logic equation or truth table form. As a specific
the
problem
consider a common output device used to display
decimal
example
This device is known as the seven-segment
numbers.
(SSD)
display
in Figure 6-1(a). The seven segmentsare labeled
shown
with
standard
from a through g. The 10displays,
decimal
letters
representing
digits 0
in Figure
6-1(b).
through 9, are shown
Let us examine the problemof designing
a logic
system that will turn
in
on
correct
the
to
coded
decimal(BCD)
response
segments
binary
The
four
wires
indicate
the
number
to
be
input.
input
displayed
by the
of
l's
and
0's
on
them.
The
seven
of
the
binary
pattern
outputs
logic
to display
the desired digit.
system must turn on in the properpattern
From the word description
and the pictured
displays in Figure 6-1(b)
we
can
tabulate
the desired outputs for each valid
of inputs.
combination
Each row on the tablerepresents
a different
number
and each
displayed,
In

this

section

column represents an input or output signal.Sincethe input


codes
are
BCD representations
of the digit displayed,
the
four input
columns are
in the BCD codes for each of the
decimal
generated by writing
digits. The
columns
in
and
in
are
the
then
filled
output
displays
filling
by inspecting

Section

Switching Mechanisms

6.4

697

LJ]
/

l\\

\\ri\\

Input

codes

(a)

(b)

a
b

Binary

coded

decimal

input

Logic

Seven

network

to be designed

segment

display

\302\273\302\273

device

r
\302\273\302\273

\342\200\224\342\226\272

(c)

Decimal
displayed

Inputs

Outputs

ABC

11110

0 0 0 0
0 0 0 1
0 0 1 0

110

10

0
1

10 0 0 0
0 110
1

11

110

11111

10 0 0 0

11111

10

11

(d)

Figure 6-1.
truth

table.

(a) Segment

identification,

(b) desired

displays, (c) logicproblem,

(d)

598

Chapter 6: Boolean

Algebras

is shownor a 0 if it is not. For example, the 7 requires


7. We can thus fill
a, 6, and c, so we write 1110000in row
table from the word and picture description
of the

the segment

a 1 if

segments

only

entire

the

out

problem.

translated the problem statement into


the
language of the truth table from
generalized
a seven-segment
display.

thus

have

We

standardized
requirement

of

driving

Actually the truth tableof Figure

possible
table

truth

four

of

combinations

columns in the

last six rows

rows and

indicate

to

indicates

generate and
once.
Another

X's

writing

we \"don't

that

rows. Their omission from


the same thing as \"don'tcare.\"The

outputs

Since there are 16


have a more complete

for these

are

very

very

equation.

for

effective

useful

logic

way

equation

concise,

is incomplete.

we could

inputs,

all 16

generating

by

6-1

the

showing

several

of expressing logic
expresses
only one

the
truth

in

the

output

care\" what
table,
table

the

however,
is easy

to

switching functions at

functions is the logic


function, so that, for

each
for
output
logic equation could be written
6-1. Since logic equations are
(a-g) in the truth table of Figure
in form to discrete gating structures, they
useful
similar
are
very
very
The logical
when the switching is to be mechanizedwith
logic
gates.
and
are used to indicate \"not,\"
\"or,\"
respectively,
symbols -, +, and \342\200\242,
d of our seven-segment
\"and.\" Looking at Figure 6-1 we see that segment
must
be on when displaying the digits 0, or 2, or 3,or 5, or 6, or 8.
display
in place of or, we can write
for the
the
logic equation
Using the + symbol
a separate

example,

function

variable d as

d-0
Thisis

+ 3

+ 5

+ 6 + 8.

in terms
want
an
of the displayed digit, but we really
equation
in
D.
and
The
code
terms
of
the
variables,
C,
A,
B,
input
input
equation
and not-J5 and not-Cand not-D\";we can therefore
write an
for
0 is \"not-A
an

equation:

digit 0 = A

\342\200\242
B \342\200\242
C \342\200\242
D.

Likewise

digit

2 =
3 =

\342\200\242
C .
B \342\200\242

digit

5 =

\342\200\242
B \342\200\242
C .

digit 6 =

\342\200\242
B \342\200\242
C .

digit

\342\200\242
B \342\200\242
C \342\200\242

Z),

D,

Dy

Z),

Section

6.4

599

Mechanisms

Switching

and

digit 8

. B

\342\200\242
C . D.

We can now substitute these expressions


for
for d as follows:
into the originalequation

D. We

equation for

can

output d as a function

similar

write

+ A-B- C-D

\342\226\240
B. \342\226\240
C \342\200\242
D +

+ A-

+
c =

\342\200\242
B- \342\226\240
D +
c- \342\200\242

D +

\342\200\242
B.
C

\342\200\242
D
jB. \342\226\240
C-

+ A

c.

\342\200\242
D +

c.

D +

\342\200\242
B~.
\342\200\242
B-

\342\226\240
D +
B- \342\226\240
c \342\200\242

/-A.

\342\200\242
B-

D +
+

equations

disjunctive

For

normal

\342\200\242
B.

\342\200\242
D +

\342\200\242
B.

\342\226\240
D

\342\200\242
D

\342\226\240
D

\342\200\242
D

\342\200\242
B.

\342\200\242
D +

\342\200\242
B-

\342\226\240
C \342\226\240
D +
\342\200\242B.

\342\200\242
B-

\342\200\242
B. \342\226\240
C \342\200\242
D

\342\200\242
B.
C

\342\200\242
D

\342\200\242
B.

\342\200\242
D

\342\200\242
\342\200\242
B. \342\226\240
D
c \342\226\240

\342\226\240
D +

\342\200\242
B. \342\200\242
C \342\200\242
D +

\342\200\242
B-

c.

\342\200\242
D +

\342\200\242
B.

D +

\342\226\240 A

\342\200\242
Bc-

c.
B<
+ A.\342\200\242
These

D+

\342\200\242
B.
C

\342\200\242
5. . c.

c .5 + 3.

\342\200\242
B>

\342\200\242
B. \342\200\242
C

A^<\342\200\242
B<
c

A-B-C.D

D + A
5- \342\226\240
c. \342\200\242
+ A. \342\226\240

e-A

A-B-C-D

c.

\342\200\242
!\342\226\240
B-

+ A.

g=A

inputs

the other

+ A.B-C-D

+ A.B.C-D

+ A-B-C-D

A-B-C.D

6 =A

the

of

for each of

equations

follows:

as

outputs

a =

C, and

of inputs

in terms

digits

+ A.B.C.Z).

A.B.C-5

a logic

have

thus

We

A9 B,

the

+ A

D +

c.

\342\200\242
D +

\342\226\240
B.

D +
\342\200\242B. \342\200\242
>B-

.c

D.

for the seven-segment display are presentedin


variables.
There are 24 - 16mintermsof four

form.

example:

m0

\342\200\242
B \342\200\242
C \342\200\242

ml

\342\200\242
B . C

m2

\342\200\242
B \342\200\242
C \342\200\242

m5

\342\200\242
\342\200\242
\302\243
C \342\200\242
D,

m14

\342\200\242
J3 \342\200\242
C \342\200\242

m16

- A

Dy

. A
Dy

Z>,

\342\200\242
D.
fi \342\200\242
C \342\200\242

600

Chapter

6: Boolean Algebras

These numberedminterms (notethat the numbers


correspond
a useful shorthand for writing
are
simply
binary weightedvalue)
For example,

form.

canonical

in

functions

a = m0 + m2 + m3 + m5 +
= Sm (0,2,3,5,7,8,9).
numbers
Sincethe
table
digits,
displayed
shorter but alsoeasierto
minterm

The other canonical form,


shown below:

directly
the

conjunctive

+ B

Mx

-A

M15

- A

+ B

in

1. A
10

of the

one

SSI

(small

These

gates.

on the truth

equation

Figure 6-1.
form, uses the

is not

only

maxterms

D,
D,

+ C + D.

for all but onecombination


of the variables,
of maxterms. For example,
as a product

and any function can be written


a = M9-Mn- M14 - n M(9,ll,14).
It is customaryto classify
the
gate

(IC)

+ C+
B + C+

= A

+ m9

to rows
the

writing

from

M0

is true

maxterm

each

form of

write

m7 + mB

correspond

directly

this

and

Clearly,

to the

three following

of an

complexity

integrated circuit

categories.

scale integration)
device has a complexityof lessthan
in one
are ICs that contain several gates or flip-flops

package.

2. A MSI

(medium scale integration)device

100gates.Theseare

ICs

registers,counters,

and

that

provide

elementary

has

of 10 to
functions
such as
logic
a complexity

decoders.

3. A LSI (large scale integration) device has a


memories,
10,000 gates. Examples of LSI ICsarelarge
and calculator chips.

4.

complexity

of

100

to

microprocessors,

of
(very
large scale integration) device has a complexity
a
half
10,000 gates. Right now a piece of siliconabout
LSI is now giving
100,000
square could contain over
gates.
memories
VLSI in all phases of design
and
including
larger

VLSI

than
centimeter

more

way to
microcomputing

devices.

Though MSI,LSI,and
functions

more

much

discretegates,

much

logic

VLSI
have made it possible to mechanize
than the method of connecting
economically
level\342\200\224even
in the
still be done at the
must

logic

gate

Section 6.4

601

Mechanisms

Switching

designs. Though the discretegatepart of the system


the minority of the logic\"work\"
in the system,
it represents
a largepart of the computer
scientist's
detail design and checkoutwork.
It is therefore
master
important that computer sciencestudents
fully
the techniques
of gate minimization.
functions
that
can be described both by switching
Logicgatesperform
most

sophisticated

may perform

equationsand by
The

block
standard

most

truth

representation of

logic

circuits

is the

in which the logicelements


are
represented
by
standard
logic symbols by IEEE Standard No. 91
are shown in Figures 6-2 to 6-7.
that
there
are two types of symbols, the
note

diagram,
The

symbols.

Y 32.14,1973)

(ANSI

tables.

common pictorial

The reader
uniform-shape

will

the

and

symbols

symbols.

distinctive-shape

The

the
International
Elecuniform-shape symbolsarethoseestablished
by
trotechnical
Commission (IEC Publication 117-15)and are widely used
in Europe. The IEEE has includedthesesymbols
in its standard,
but the
of
in the
distinctive-shape symbols remain the standard
preference
United States and have
found
wide
in other parts of the
acceptance
world.
The distinctive-shape
symbols will be used here.

Input

=o

\342\200\242

=Q-

Figure

6-2.

Output

\342\200\242

AND function.

Output

Input

=0-

=E-<

Figure

6-3.

INCLUSIVE OR function.

602

Chapter6: Boolean

Algebras

Output

Input

= A+B

A-B

=E>

Figure

6-4.

NAND

function.

Output

Input

B=

A +

+ B=

\342\200\242B

\342\200\242
\302\243

=EJ-

Figure 6-5.

NOR

/I

function.

Input

J^>o-/i

/!-]

|o-/

Figure

6-6.

Inverter.

Input

^\302\243)-A\302\256B

Output

AbZ^7]~aQb

Figure

6-7.

EXCLUSIVE-OR.

Output

Section 6.4

the

the AND function. The AND

Figure 6-2 represents


inputs are high (1).

603

Mechanisms

Switching

is high

output

all

iff

in
6-3 represents
The symbol shown
the INCLUSIVE OR
Figure
is low (0) iff all inputs
function. The OR output
are low.
a function
The NAND symbolcharacterizes
whose
is low (0) iff
output
all inputs
are high (1) (Figure 6-4).
The NOR symbol shown in Figure 6-5 characterizes a function
whose

is high

output

iff

all

are low.

inputs

Figure 6-6,is a device

The INVERTER, shown in


complement.

that

provides

the

illustrated in Figure 6-7,characterizes


an
even-odd

EXCLUSIVE-OR,
recognizer.

all the

Though

gates are shown

desired.

as

inputs

gates,

four-input

they can

inputs,

make it

have as many
standard

fairly

to

gates, three three-inputgates,two


gate per package.
between
the gate structure
and the logic
in gating
why logic equations are so useful

four two-input
or one eight-input

together

package

two

with

pin limitations

Package

The one-to-one
equationmakesit

relationship

see

to

easy

design.

Exercises

6.4

for Section

1.

digital circuit

is a

function

majority

1. The output
truth table of a three-input majority
inputs are

of the

majority

circuit of a majority

2.

Two

fx and

functions,

digital

can

function

hconditions

what

Under

variables

Tx

xTx

0 otherwise.

is

and

function

with 4

be obtained

f2, are

whose output is 1 iff


Obtain
show that

the

the
the

NAND gates.

used as controlmechanisms:

yT2.

x and
of input variables
y and timing
two digital functions be 1 at the same

T2, will the

and

time?

3. Design
generates

and
a combinational circuit that acceptsa 3-bitnumber
an output binary number equal to the squareofthe input

number.

4.

Two

2-bit numbers

four-variable

function

axa0

and B

/ (al9a0,bub0).

bxbQ

are

to be

The function

a(A) < a(B), wherea(X) = xx x


Assume that the variables A and

value

1 whenever

2-bit

number.

a
|a(4) - a(B)| < 2. Design
using as few gates as possible.

combinational

compared

by a

/ is to have

the

for a
x0 x 2\302\260
B are such that
system to implement/

21 +

604

Chapter 6: Boolean
5.

Algebras

that

patterns

binary

code.

consecutivenumbers are represented


by

code where

A number

table

truth

a Gray
differ in one bit position only
is called
for a 3-bit Gray-code to binary-codeconverteris

shown.

3-bit

Gray

Code

0
0
0

0
0

1
0
0

1
1

Selected

1
0

functions

fi,f2>fs

1
0

0
0

using

only

for Section 6.4.

Answers

1.

the three

Implement

Outputs

Code

Binary

Inputs

y I i'
X
V I zt

00

01

11

10

00

01

11

10

bxbj\\

fmin

F = xv

Fr

\342\200\224
ffiffo

bibo +
where

aob\\

x means

a\\bo +

a\\bi

0 or

1.

+ xz -f

vz

NAND

gates.

Section

6.5

Boolean Functions

Minimization of

6.5

FUNCTIONS

OF BOOLEAN

MINIMIZATION

Our aim in minimizing


which is equivalent

605

/ is

function

a switching

to / and which

to find

an

expression

cost criteria.

some

minimizes

The most

minimal
is to find an expression with
cost
popular criteriato determine
of terms in a sum-of-productexpression,
number
there
provided

minimal
is no
fewer

other
literals.

uncomplemented

same
such expression with
the
in
a
literal
is
variable
(A

with

of the function:

the minimization

J \\X-[)X2iX\302\247) ==
combination

the

Similarly,

of

==

XiX2X$

XiX2X$

the

X^X2X^*

Xi%3\302\273

second and the third


#2*3(^1

4-

XiX%\\X2

terms

yields

= *2*3>

*i)

terms yields

and fifth

fourth

4- XiX2X$

XiX2X^

~
\342\226\240
^2/

^1^3x^2

of the

combination

combination

X\\X2X\302\247 *

first and secondproducttermsyields

of the

XiX2X$ -f

Thus the

X\\X2X\302\247 '

X\\X2X\302\247~t~ X\\X2X\302\247 '

X\\X2X\302\2474\"

and the

and

complemented or

form.)

Consider

The

of terms

number

4- X2)

= X1X3.

reduced expressionis

(Xi,X2,X^)

XjX3

4-

X2X% 4-

X1X3.

in the sense
This expression is in irredundant (or irreducible)
form,
that any attempt to reduceit any further
by eliminating
any term or any
literal in any term will yield an expression which is not equivalentto /.
the
Theabove reduction
is not unique. In fact, if we combine
procedure
first and second terms of /, the third and fifth,
and
fourth
and fifth, we

obtain the expression

\\Xlyx2yX3)

X1X3

4-

XiX2

4- ^1^3,

a different irredundant expressionof/.


various terms and applying
of combining
algebraic
procedure
the rules of Boolean algebra is quite tedious.The map technique
of
here provides
a systematic method for minimization

which represents
The

them
presented

functions.
switching

to

6C6

Chapter

6: Boolean Algebras
A
A

AB

AB

ABC

ABC

ABC

ABC

AB

AB

ABC

ABC

ABC

ABC

>/-\342\200\224

Figure 6-8.

the

of

diagrams.

in 1952, is a
diagram, developed by E. W. Veitch
diagram in that circles are replacedby squares

Veitch

The
refinement

Veitch

Venn

and

form of a matrix. Figure6-8illustrates


a Veitch
diagram
for two and three variables.
the
Veitch
we represent graphically the various
diagram
By
a manner that minimization is simplified.An inspection
of
combinationsin such
a one-variable
the various cells in the matricesrevealsthat thereis only
between any two adjacent cells. Elach
cell
is identified
by a
change
minterm.
in the

arranged

Clearly minterms that can be combined


diagram for functions
inside the squaresindicatethe minterm
square. The brackets labeledA, J3, C,

are

shows a Veitch

of

the indicated

and
therefore

are

variables

top

half and

B =

function

Any

l's and

of four

the

represents

f =

set

the

as

6-10(a)

The numbers

variables.

represented
by that
D indicate the regions where
C = 0 in all the squaresin the
bottom
half, for example.
number

can be

variables

O's to indicate the function,

Figure6-10(b)

Universal

true;

1 in the squaresin

Figure

adjacent.

four

represented by

with

a truth

filling

simply

table. For

function

+ A-B-C-D.

A-B'C.D

B
(a)

Figure 6-9.

(c)

(b)
Development

of Karnaugh

maps

by

Venn

diagram

in

example,

approach.

Section 6.5

607

Functions

of Boolean

Minimization

to the above idea was represented by M. Karnaugh


in
who
on
the
1953,
rearranged the alphabeticalassignments
map.
Since there must be a square for each
we can begin with
a
minterm,
set and divide it into 2n squares
universal
by using the Veitch diagram
An

improvement

approach as seenin
decimal

The

6-9.

Figure

of the minterms is

representation

in

given

Figure

6-

10(a).

to be the most valuable tool


The Karnaugh map techniqueis thought
with Boolean
available for dealing
functions. It provides instant
can be used to obtainall possible
recognition
of basic
and
combinations
patterns,
minimal
and
is
to
all
of
varieties
terms,
easily applied
complex
problems.

map is accomplished through recognitionof


of l's in adjacent cells immediately
patterns.
appearance
the presence
of a redundant variable.
identifies
the
of one, two, and four
on a
cells
Figure6-11illustrates
grouping
It
all
of
a
four-variable
takes
four
variables
to
define
cell
a
map.
single
the
of
one
the
two
cells
eliminates
four-variable
variable,
map:
grouping
two variables, and the groupingof eight
grouping of four cells eliminates
the

with

Minimization

The

basic

cells

three

eliminates

variables.

of l's in the

given grouping

Any

product term. That is, the


The

ABCD.

ABD.

grouping

Minimization

map

Karnaugh

is

single

by a

identified

is defined as

6-ll(a)
cells, as in Figure 6-ll(b), is identified
involves the gathering of the various
groups
cell

in Figure

of two

by

in the

in a \"ring\"
where the variables
are
arranged
if the map
would
these
be
squares
adjacent
pattern
If
were inscribed on a torus (a doughnut-shaped
form).
you have
in
the
on
a
remember
that
torus,just
squares
map
difficulty visualizing
be
the same row or column, but on oppositeedgesof the map,
may

most

efficient manner,
of symmetry,

so that

combined.

AB

AB

00

CD\\

00||o
01 1

11 3
10 2

01 11

12
5 13
7 15
6 14

10

00

CD\\

12

13

11

15

11

10

14

>D

10

01

11 10

ooj
01

11
10

-*

B
(a)
Figure

6-10.

\342\200\242
D +

Mapping a

4-variable function:

\342\200\242
B \342\200\242
C \342\200\242
D.

(b)

(a)

minterm

numbers/(b)

= A \342\200\242
B

D\\

00

ABD

ABCD

c^ \\B

11 10

01

C\\

00

00

01

01

11

00

TTT

11

10

10

(71
(b)

(a)
A

ACD

00

01

00 111

ll

C\\B

BD

II

10

00

C^\\

01

11

11

10

10

1 i

[Tj

[7]

(c)

DN

(d)

BD

00

11

01

00

C\\B

10

D>

AD

00

01

ll

01

01

11

11 ll

10

11

(f)

(e)

AB

C\\B

DN

00

00

01

11 10

C\\B

DN

171

01

01

11

11

10

ill

10

Figure 6-11.

00

01

11

00

11

(h)

(g)

608

10

10

11

11

11

00

11

11

11 10

01

ll

00

01

C\\B

11 10

01

Minimization

on a

4-variable

Karnaugh map.

11

11

Section6.5

of Boolean

Minimization

Functions

609

\\B

p\\

01

11

11

i|

00

hi

11
Figure

10

ITJI

11

6-12.

is minimized
/(A,J3,C,D) = 2 m(2,3,4,7,10,ll,12,15)
map shown in Figure 6-12.

The function
the

Karnaugh

BCD
/ = 2 m(2,3,4,7,10,ll,12,15)
=

Quite

of the

some

often

occur.In this

we \"don't

case

+ BC

possible combinations
care\" what the function

on

+ CD.

of input values never


does

if these

input

combinations appear. Diagrammingmakesit easy to take advantage


of
these \"don't care\"conditionsby letting
the \"don't care\" minterms be 1or
on which
value results in a simpler expression.
0, depending
Figure6-13shows an example of the use of \"don't cares\"to simplify
functions
for segments a to g previously
the
seven-segment
display
10 through 15 will never occur, we put 0's on
referred
to. Since minterms
in
We
then
l's on the diagram for the
the diagram thosepositions.
put
minimized
functions
of
the
minterms.
The
seven-segment
appropriate
in
6-13.
display are shown
Figure
Fiveand six-variable
mapsareshown below in Figure 6-14 and Figure

6-15,respectively.

The

side.

by

1, the other

eachmap.In

has two four-variable maps


five-variables
in
identical
are
BCDE, but one
They
= 0. The standard
four-variable adjacencies apply in
in the same relative position on the two
squares

map

Karnaugh

placed side

to

addition,

4 and

20, are

maps,

e.g.,

to the

six-variablemap.

for

correspondsto

also logically

Similar

adjacent.

Exercises for Section6.5

1.

Simplify

the

following

acde +

Boolean

acd +

eh

expression^
+ acfgh

+ acde.

arguments

apply

\302\273

xl

x|

lx

11

\302\243<

[x\"1 TxT

frT

m1

ll

)D

?\302\243>
1

i|

lx
X

|llJ
0 =

/I +

]_jlJ

\342\200\242

C- D

\302\243\342\200\242
D +

b=

\342\200\242
\302\243D

11

|x

~|7|*

Mx]

||x

c=

in

YD

111 |x

11

1)

X
f =

[fxf

xl

x|

[x~

~T| J|7|

IT]

C- D

f=C

[fxT

\"^

+ A +

)D

g= B-

610

Figure

lx

lx

D + B-C+

B-C

11

rn

Tfjl

PI

xl

#<

x|

>\302\243>

B - D+

+ B-C+B-D

>/>

e =

i|

+ B-C-D

d=C-D

|X

11

\342\200\224\342\226\240

B
X

ll

lx

-K\302\243>

|x1

d =

' [7|

11

|x

\"'

\302\243

\"

(TT

>D

*--

B+

rrfl

fl<

i|

c =

/4
r

11

D + C- D +
C \342\200\242

ll

\342\200\242A

C+

6-13. Seven-segment display driver

minimization.

B- D

Section

Minimization of

6.5
A =

.BC

DE\\

00

01

Boolean Functions
=

611

BC

II

10

00

01

11

10 /DE

001

12

| 16

20

28

24

01

13

17

21

29

25 01

11

15

11

19

23

31

27

10

14

10

18

22

30

26 10

Figure

Five-variable

6-14.

Karnaugh

00

11

map.

B
*^

\\

12

16

20

28

24

13

17

21

29

25

15

11

19

23

31

27

14

10

18

22

30

26

32

36

44

40

48

52

60

56

33

37

45

41

49

53

61

57

35

39

47

43

51

55

63

59

34

38

46

42

50

54

62

58

\\F

E(
'

A<

)F

E{

Figure

6-15. Six-variable Karnaugh

map.

612

Chapter 6: BooleanAlgebras
2.

the

Reduce

expression

following

to a minimal sum-of-products

expression.

/the

3. Minimize

(x

\302\251
yz)

(xy

\302\256
w)

using

expressions

following

+ xyw.

table or

a truth

map

technique.
+ ABCD+ BCD + ABCD.
=
ABCD + ACD + ABCD + ABCD.
(b) /
=
ABC
+ ABC
+ ABC + ABC.
(c) f
/

(a)

- ABCD

(d) / = BCD+ ACD jh


+ B + C)(A

(e) /=(A

ABCD.
+ C).

ABCDjh
+ J3

4. Prove or disprove the following

equalities

a truth

using

table or

map technique.
+ ABC = (B + C)(B +
= (A + J3)(A + B)(B + C +
(b) AC + AB + ACD
+ D)(A
+ B + C).
(c) ABC + (A + B)D = (AB
=
(d) ABD + BC + CD ABD + CD + BC.
5.

+ ABC

ABC

(a)

+ ABC

C).
D).

(POS) forms, select setsofthe O's of the


as a sum term, with variables
the
being
of those that would be usedif this same set were being

To design product-of-sums
function.
Realize each set

complements

realized as a productto produceTs.

Obtain

minimal

realization

POS

of

f(A,B,CyD)

2m(0,2,10,ll,12,14) = nM(l,3,4,5,6,7,8,9,13,15).

6.

the

Minimize

following

functions.

switching

(a) 2m(l,2,3,13,15).

(b) 2m(0,2,10,ll,12,14).
(c) 2m(0,2,8,12,13).
(d)

2m(l,5,6,7,ll,12,13,15).

(e)

2 m(0,l,4,5,6,ll,12,14,16,20,22,28,30,31).

(f) 2m(6,7,10,14,19,27,37,42,43,45,46).

7.

Simplify

each

Boolean

algebra.

of

the

+ w)
xyz -f xyz + xy(z
(b) x +yz + w(x + yz).
(c) xy(z + w) + xy(z + w)

(a)

(d)

xyz +

xyw

xyw

expressions by using

following
+ (z
+

+ yzw.

xyz.

+ w).

the rules of

Section 6.6

to Digital

Applications

8. Minimizethe following
functions,
+
(a) / = 2 m(0,5,10,15)
2,(1,7,11,13)

using

Computer

the map

613

technique.
don't care

20 denotes

where

minterms.

2m(0,l,4,5,8,9)

(b) /-

2,(7,10,12,13).

+ 2,(2,5,7).

2m(l,3,4,6,9,ll)

/-

(c)

Design

Selected Answers for Section6.5


KAB

3.

C\\

(c)

00

01

11

10

00

01

11

10

0
1

6. (c)

wzX

00

01

11

10

or

6.6

of

Anin

- xyz

+ ww

+ xwz

Anin

- xyz

xyw

y wz

TO DIGITAL COMPUTERDESIGN

APPLICATIONS

InitialDesign

Arithmetic

the

Logic

Unit of

a Digital Computer

computercan be

unit (ALU) of a digital


For
one for each pair of bits of the input
operands.
each
where
operands with m bits, the ALU consists of m identical
A and B which are designated
as inputs the bits of inputs
receives
stage
6-16
shows
the
from 1 (low order bit) to
numbers
Figure
subscript
by
An

partitioned

arithmetic
into

logic

stages,

stages,

block diagram
The

Ck_i is

of an ALUstagek.

are

carries

the input

function

designated

selection

connected

in a

carry to stagek and


lines

as selectors

m.

chain through the


Ck is

the output

ALU

stages,

where

carry of stage k.The

are
and
to all stages of the ALU
are identical
to be
of the arithmeticor logicmicro-operation

614

Chapter

6: Boolean

Algebras
Bk

Ak

1'

1'

Function

selector

Stage

i'

Fk

Figure

performed by the
the

of

function

6-16.

frth

ALU.TerminalsFY

ALU.

In many

from

ALUs

4-bit

one

IC package

the

next

the required

Fm generate

a package
for

ALU.

J3,

and

is

enclosed

will contain
four outputs

selector
determines
the
A
m-bit
ALU
can
be
perform.

function
can

to

cases, a 4-bit ALU

integrated circuit (IC) package.Such


for A, four inputs
four
with
inputs

number of lines for the


operationsthat the ALU

of an

stage

output

within

number of

constructed

by cascading several packages. The output carry


of the package
must be connectedto the input
carry

higher-order

one

four stages
for F. The

from
with

bits.

on the micro-operations
The internal constructionof the ALU depends
that it implements. In any case, it always needs full-adders to perform
are sometimes
Additional
included for
the arithmeticoperations.
gates
I
n
to
minimize
number
of
terminals
for
order
the
logic micro-operations.
k
2k
IC
to
ALUs
use
selection
lines
the function
selection,
specify
micro-operations.

The most basic digital arithmetic function


is
the
circuit
that performs the
binary digits. A combinational
arithmetic addition of two bits is called a half-adder.
One that
of three
bits (two significant bits and a previous
performs the addition
is called a full-adder.
The name of the former stems from the fact
carry)
a full-adder.
to implement
that two half-adderscanbeemployed
are called the augend and addend
The input variablesof a half-adder
bits.The output variables are called the sum and carry. It is necessary
to
two output variables because the sumof 1 -f 1 is binary 10, which
specify
has two digits. We assign symbols At and J3, to the two input variables,
and Ft (for the sum function) and C,- (for carry) to the two output
in Fig. 6-17(a).
The
variables.
The truth table for the half-adderis shown
are 1.
Ci output is 0 unlessboth inputs
of the sum. The
bit
The Fi output represents the leastsignificant
Half-Adder.

addition

of two

Section6.6

to Digital

Applications

Bi

Ci

Ft

Logicdiagram

(b)

functions for the two


Ft

Half-adder.

6-17.

Figure

Boolean

615

Design

Br

table

Truth

(a)

Computer

- Aft

+ Aft

directly from

be obtained

can

outputs

Ai

Bh

Ct - Aft.

The logic

an AND

and

gate

Full-Adder.

arithmetic

sum

of

6-17(b). It

in Figure

is shown

diagram

OR

is a

full-adder

third

The

input,

It consists

Ct-_i, represents

the carry

denoted

3, and
are

outputs

from

three
and

Bi9 represent
the

sum of

three binary

3 need
by the symbols Ft (for
C, gives the output carry.
in Table 6-2. The eight rows
2 and

shown

combinationsof l's

input variables designate all possible


and
O's for the output
these variables may have. The
sum of the input bits. When
determined from the arithmetic

is equal

l's

O's the output is 0.TheFt output


to 1. The C, output has a carry

is equal
of 1 if two

tol.

Thus

lower

previous

designated

the

bits are

the
two
the

and

inputs

the decimalnumbers
variable

is

that

are

At

arithmetic

the

because

0 to

and C, (for carry). The binary


sum)
The truth tableofthe full-adder
O's

by

of

position.

Two outputs are necessary


digits rangesin value from
two binary digits. The two
under

circuit that forms

combinational

input bits.
variables,
input

three

outputs. Two of the


two significant bits to be added.
significant

consistsof an exclusive-

gate.

the two functions

for the full-adder are


Fi-Ai\302\256Bi\302\256Ci.1

and

Ci =

APi +

Afin

BA-i.

and

variables
all

input

to 1 when only one input

or three

inputs areequal

616

Chapter 6: BooleanAlgebras
6-2.

Table

Truth Table.for

Full-Adder

Inputs

Outputs

W,.i

CfF;

0 0

0
0
0
1
1
1
1

Clearly,we

also

can

d =

Aft + (Aft

gates

25

with

of

0 1
10

0 1
10
10
1 1

Aft)

- Aft

C.-.x

(Ai

\302\256Bi)

C-.l

functions require a total of nine


to generate Ct_j. A NAND circuit

6-18.
Figure
is of basic importance

in

form

The

realization.

gone into the

has

effort

0 0

0 1

of these two
one inverter

plus

inputs

for this form is shown


Since the full adder

deal

0
1
0
1
0
1
0
1

write

realizations

Two-level

0
1
1
0
0
1
1

leading

in digital computers,a great


problem of producingthemosteconomical
of
the
to best economy is a function

used.

technology

as IC,as pointed out before, the


Since today full-adders are realized
scale
forms of interest arethosesuitablefor medium
(MSI)
integration
form.
are shown below in Figures 6-19and 6-20.
Two of these realizations
of
realization
the
Figure 6-20 appears to be moreexpensive,
Although
in full-adder
is used
and
this
form
is better suited for IC realization
chips
such as SN7480and

SN7482.

A popular

realization

Using this

design we

more

perform

with
shown

the three
in

Control

Figure

of a
also

will

full-adder is by
add

control

utilizing

bits so

two

half-adders.

that the circuitwill

than just addition. The circuitof the full-adder


control bits S0,Si, and S2, as well as the mode bit M is

operations
6-21.

line S0 controls input At.

modelineMcontrolsthe
1, the terminalsmarked

carry

input
jc,

y,

and

Sx and
C,-_i. When

Lines

z have

S2 control input Bh The


S0 Sx S2 = 101and M =

the values of

Ah

Bi9

and

Cif

respectively.

Control lines S2 Sx S0 may


each combinationprovides
a

have

different

eight

bit
possible
for Ft
function

combinations and
and Ct, The mode

=r>

=o

Q-,

Br

c,-r

Cm

^BO

o
SO
AJ

B>

BO

Figure

6-18.

Two-level

FO

realization

of a full-adder.

c,

B>t\342\202\254>^=!D

to

M>

o
Figure

6-19.

Full-adder

realization

with

8 gates

and 19

inputs.

Ci-x

>\342\226\240

Bi~+

o-

=D-

Figure 6-20.

Full-adder

realization

with

10 gates

and

22

inputs.

A,-

rf>

On

^O

pD

l~

)E>*

CM

t=Q
Figure

618

6-21.

Controlled

full-adder.

Section 6.6

to Digital

Applications

Table6-3. Effect
X

s1

A,

0
0
1
1

So

lines on

of Control

s2
0
1
0
1

controlM enables input carry


betweenan arithmeticand logic
the
propagates
gate making

619

Design

Full-Adder.

0
1

c,.,

B,

B,
1

and

C^

the

When

function.

through

Computer

is used to differentiate
M - 1, input carry C,_!

- C^. Thisallows

the

propagation

for
an arithmetic
microcarry through all the ALU
stages
M - 0, the input carry is inhibited,
z - 0. This is
operation. When
making
a necessaryconditionfor a logic micro-operation.
Hence, the ALU can

the

of

provideup to eightarithmetic
operations
Table 6-3 showshow the control lines

and
eight
logic operations.
control inputs Ah Bh and C,. The
value of jc may be 0 or At depending
on whether
S0 is 0 or l^Controllines
z
Si and S2 control the value of y which may be 0, 1, J3, or J3t. Terminal
M is 0 or 1.
on whether
may be equal to 0 or Ci_x depending
Table6-4 shows a list of the Boolean functions for each of the eight

positive combinations of the controllines:w

0, output Ft
xy since

is the

2=

higher

F, (with

under

this

terminalof the next


listed

as

same

0. However,

ALU.

since

F{:

signal
stage

- 0) provide

of
Thearithmeticoperations

Boolean

listed

the

of

functions

are

- w;

the

are

when

and output carry

functions

for one

Boolean

functions

functions

of the

- 1.The
operations in the one-stage
when M

generated

stage of the

ALU.

l=i
X

SqSiS2

M-0

M-

C, for M

B,

0 1
0 1
10
10
1 1
1 1

B,

B,

B, \302\256
C,.,

Bt

CQ

B,

B,
1

A,

A,

A,

B,

A,\302\256B,

A\302\256 B,

A,\302\256B,\302\256 C,.,

A,B, +

A,

B,
1

A,\302\256B,

A,\302\256B,

A,

\302\256
C,_i
B, \302\256

A,B,

A,

A,

A,\302\256C/_1

A,

0
1
0
1
0
1

A,

C/.,

\302\256
Cf_i
c\342\200\236

a,\302\256c\342\200\236

- 1

0 0 1

0 0

Ct

propagate to the z

logic

eight

\302\256
y;

6-4.

in Table

Table6-4. Boolean

0
\302\256

arithmetic

eight

represents

is not allowed to
when
M - 0. The

ALU

the

ALU

- w

B/C/_1

BjCj.i

c,_,

AC/-i

AC/-1+ BtC,^

+ AC/_,
C/-i

+ S/C,.,

620

Chapter 6: BooleanAlgebras
6-5.

Table

S0S^S2

0
0
0
0

0
0
0
0
0
0

Logic Micro-Operations

0 0
0 1
10

F=0

Clear

F=B

Transfer

F=B

Complement B

F- 1
F=A

Transfer

A\302\256B

arithmetic

The
conditions

control

of

OR

operations

B
bits

Complements

F=A

and

AND

bits

Exclusive-OR
Exclusive-NOR

F-A@B

F =

all

Set all

are

stages in cascade.

m identical

are listed in

ALU

the

for M = 0.
These arethe F functions
Note that there are 16possible
micro-operations
in the
ALU.
and only 8 of them are available

a fourth

ALU.
Description

The ALUis constructedby connecting


The logicmicro-operations
performedby

logic operations

the

Micro-Operation

11
10 0
10 1
1 10
111

providing

in

for

two

Table 6-5.

logic operands

the two important


not generated in this ALU. By
In fact,

line it is possibleto includethesefunctions.


are derived from Table 6-3and the

6-4.

Table

of full-adder
circuits is
adder
In each case, a parallel binary
composed
lines
are either
used, but someof the input
missing or complemented.
Thus, in row 001, input A is missing because all the x inputs of the
function
for
to zero by selection line S0.The output
full-adders
change
= 1. In row
= 0 and F = B + 1 when
this condition is F = B when
Cx
C0
soF =
010, input A is changed to zero and all B inputs are complemented
=
=
=
0 and F B + 1 when C0 1. In row 110,all bits of input B
B when
C0

so
are complemented

that

the arithmetic

F generates

operation of A

plus

for
row 111 represents
Boolean
one stage of a decrementmicro-operation.
the
ALU
is
The
C0 that enters the first low-orderstage
carry
in
four
Hence,
micro-operations.
employed for adding 1 to the

l's

the

of J3. The

complement

function

of

input

sum

arithmetic micro-operations

1.Thethreecontrol
set to 0 or 1 for
functions

generate

require five

M must

lines.

control

an operation
lines
specify
micro-operation.
particular
as the
the same operation

and input carry


Some of the

logicfunctions

always be

C0

must

be

arithmetic

when

C0 =

0.

Others have no useful application.

Thearithmeticmicro-operationsthe ALU are shown in Table 6-6.


the input carry C0= 1,a oneisadded
It shouldbenoted
by making
in

that

to

B when

M =

1 and S0Sx

S2

= 110

is equal to
the
complement
plus
subtractionoperation,sincethe output
A

2's

and the

result is A

of J3. This
logic

function

+ B

+ 1 which

is equivalent to a
for a full

subtractor

Section6.6

to Digital

Computer

Micro-Operations

in the

Applications

Table6-6. Useful
M

S0S)S2

Arithmetic

Micro-operation

C0

0 0 1

F-B+1

0 10

F=\302\243+

F =

10
10
1 1
1 1
1 1

1
1
1
1
1

0
1
0
0
1

Increment B

+ B

F-A

0
1

F=A + B

F = yi

B+i

F=

the same as the output

ALU

Description

2's complement

y\302\273+i

621

Design

Increment

Add A

and

A plus 1's complement


A plus 2's complement
Decrement A

of B
of B

and the next


carry in the full-adder
the minuend
that
is complemented. Thus by creating
2's
the
except
of
the
and
subtrahend
it
to
the
minuend
we
achieve
complement
adding
the operation of arithmetic subtraction.
In conclusion,
we
have
used a simple full-adder stage to achievea
of
arithmetic
and
variety
logic operations in the digital computer.
is exactly

function

borrow

resembles

the

of a

function

function

full-adder,

for the

Multiplexers
A

is a

multiplexer

2n lines

digital system

and transmits

information

line

that receivesbinary
on

a single

output

from

information

line. The

one input

is determined
selected
from the bit combinationof n selection
It is analogous to a mechanicalor electricalswitch,
such
as the
selector switch of a stereo araplifer,which
the input that will
selects
drive
The input can come from
the speakers.
either
tape, AM, FM, or
phono,
AUX linesworked
of the switch. An example
of a 4 x 1
by the
position
in Figure
6-22. The four input lines are applied
to
multiplexeris shown
the
circuit
but only one input line has a path to the output
at any given
time.
The selection lines Wx and W2 determine
which input is selectedto
have
a direct
is also known as a data
path to the output. A multiplexer
selector sinceit selectsone of multiple input data lines and steers the
to the output
is specified by
information
line. The size of the multiplexer
the number of its inputs,
2n. It is also impliedthat it has n selection
lines
being

lines.

one

and

output

Clearly
come

the

from

4x1

line.

the function of the multiplexer


is in gating of
a number of different sources.The logicfunction
multiplexer is

F-WlW2I0+WlW2Il

+ WxW2h+

WXW2I3.

data that
describing

may

622

Chapter

6: Boolean

Algebras

4XI

fO

i
\342\200\242

MUX

Inputs

Ouiput

/.\342\200\224*-

O-i
m>~

/,\342\200\224*-

^2

FK,

Select

Block diagram

(c)

\342\202\254>

wx

w2

/o

/2

/3

(a) Logicdiagram

(b)
Figure

In general

for a 2n

6-22.

by

table

Function

1 multiplexer.

1 multiplexer
2\"-l

t-0

where

m^ represents

ith input

the minterm i

of the selectionvariables,

Thus when

- 3,

the multiplexer

F, where

F-

and

It is

the

line.

ro</,

\302\243

- Wx W2 W3/0

Wt

W2

logicfunction

W3/1

+ Wx

will

be represented

by

W2W3/2

'+ ^1^2^3/7.
wants to load a 16-bitdata registerfrom
16 four-input
with
can be accomplished
this
sources,
come in eight IC packages.
Now,

if one

distinct
that
multiplexers

one

to four

Section

Applications

6.6

*1

x2

x3

\\

to

623

Design

Computer

Digital

*1

x2

\302\260)

*3

*3

o]

\302\260)

ij

')

l]

']

o)

MUX

Figure

6-23.

Multiplexer

implementation of a

logicfunction.

useful as basic elementsfor implementing


table of Figure
F defined
function
a
by the truth
logic
as shown
6-23.It canberepresented
by factoring out the variablesxY and
to
of xx and x2, the function F corresponds
x2. Note that for each valuation
of using
a
oneof four terms: 0, 1, jc3 or x3. This suggeststhe possibility
multiplexer circuit, where xx and x2 are the two select inputs
four-input
if the data inputs are
that choose one of the four data inputs.
Then,
of
connectedto 0, 1,jc3, or 3c3, as required by the truth table, the output
is
F.
The
the
will correspond to the function
approach
multiplexer
a
of three variables can be realizedwith
completely general. Any function
variables
of four
Similarly, any function
multiplexer.
single
four-input
etc.
an eight-input
can be implemented with
multiplexer,
is a straightforward
approach, which
Using multiplexers in this fashion
function.
to realize a given
of ICs needed
often reduces the total number
If the function
of Figure 6-23is constructedwith AND,
OR, and NOT
gates, its minimal form is
Multiplexers

functions.

are

also very

Consider

xx

x2

+ xx

x3 +

x2
\302\243i

x3

624

Chapter 6: BooleanAlgebras
which

a network of three AND gates and oneOR


for this
than one IC areneeded
implementation.

implies

of more

for
multiplexer approachis moreattractive
Of
course,
expressions.
simplesum-of-products
two

implementa

We

will

its sum

the

parts

In general, the
that do not yield
relative
merits of the

number of ICs neededto

function.

given

6.6.1

Example

by the

be judged

should

approaches

functions

Thus

gate.

LetF(xlyx2yx3)

-2m

(1,3,5,6).

F with a 4 by 1 multiplexer.
First,we
implement
of minterms form. The next step is to connect
the

variables(x2y x3) to the


selection line and x3

selection

lines

with

x2 connected

to

the

lowest-order

selection

line

to

F in

express

- 1
the high-order
W2.

last

The

first

connected to the input linesin both complemented


(xi)
and uncomplemented form (xj as needed.
Fromthe truth table of F shown in Figure 6-24it is clearthat x1 is 1 for
1 and 3, and thus I2 should be
minterms 5 and 6 and 0 for minterms
connectedto xY and 73 to xly where J0 = 0 and IY = 1.
in
It is not necessary to choose the leftmostvariable
the
ordered
to the multiplexer. In fact, we
sequence of a variable list for the inputs
can chooseany one of the variables for the inputs of the multiplexer,
we modify the multiplexer implementation
table.Suppose
we
provided
with
want
to implement
a multiplexer,
the same function
but using
variables xY and x2 for selection lines WY and W2 and variable x3 for the
Variable
inputs of the multiplexer.
x3 is complemented in the evenvariable

xx will be

numberedminterms

and

uncomplemented

in

the

odd-numbered

variable in the sequenceof listedvariables.


is shown in Figure 6-25.
This
implementation
MultiplexerICsmay have an enable input to control the operationof
the
unit.
When the enable input is in a given
the outputs are
state,
binary
disabled, and when it is in the other state (the enablestate),the circuit
functions
The enable input (sometimes
called
as a normal
multiplexer.
can
be used to expand two or more multiplexer
ICsto a digital
strobe)
with a larger number of inputs.
multiplexer
In somecases two or more multiplexers are enclosed within
one
IC
in
The
I
Cs
selection
and
enable
inputs multiple-unit may be
package.
common
to all multiplexers, as illustrated in Figure6-26in which
we
show a quadruple two-line to one-line multiplexerIC, similar
to
IC
each
of
74157.
has
four
This
unit
capable
multiplexers,
selecting
package
to be equal to either
one of two input channels;namely,
Ft can be selected
in state
1 and
Ii or Jh 1 < i < 4. The enable E disablesthe multiplexers
enables them in state 0.
It is very important
science student to be familiar
for the computer

minterms,

since

it is

the last

Section

Applications

6.6

to

Minterm

(a)

Multiplexer

Figure

6-24.

with

X\\

*2

*3

(b)

Implementation
Implementing F

With

architecture

- 2/n (1,

with

a 4

by

1 multiplexer.

the advent
has taken on

to create systemsthat were previously


this reason, the materialintroduced

illustrated

3, 5, 6)

table

Truth

digital functions encountered in computerhardware


of MSI, LSI, and VLSIfunctions,
computer
a new dimension,giving the designer the ability

the various

design.

x2, x3)

(x1f

625

Design

Computer

Digital

with

two

key

matter
subject
an essential
prerequisite
organization
of digital
computers
of the
characteristic

For
is being

or impractical.

uneconomical

this

throughout

chapter

that explain the typical


covered in Chapter 6. This material
represents
to the understanding of the internal
architecture.
and the design of computer

applications

\342\226\272F

Figure

6-25.

Another implementation of

Figure

6-24(a).

626

Chapter

6: Boolean Algebras

k>

ten

Function

\\e

6-26.

Exercises

Quadruple

all O's

0
0 1

select /

Figure

Output

(enable)

table

selectJ

2-to-1 line multiplexers.

for Section 6.6

1.

Show

and

that

a full-adder

a three-input

2. Obtain the simplified

of-productsform

circuit consists

majority

Boolean
and

draw

OR
of a three-input exclusive

function.
function

the logic

of the

full-adder in sum-

diagram using NAND gates.

Section

to

Applications

6.6

are 16 logicfunctions
lists 8 of thesefunctions.
4. The OR and AND logic
3. There

= A

B
\302\251

operations

of

the

OR

that when

modification

this

with

of

logic functions.

of the ALU are altered.What

be implemented

values

the

determine

AB,

by

S3 as

identities

Boolean

two

the

and AND

4 show

Exercise

can be includedin the ALU


selection
line
using a fourth

= 0 +

and AB

AB

S^SxSq for M for

5. Forthe S3

remaining

functions

Figure 6-27.Using

shown in the
B

two

the

Table 6-6

variables.
8 functions.

Boolean

for

circuit and

the output

modifying

List

627

Design

Computer

Digital

S3 = 0, none
other

and what

the

of

other

operations

logic

are their

can

selection

values?

(Original

output)

(Modified

6-27.

Figure

6. Let
full

us denote AtJ5t

by

now be

can

adder

G, and

output)

At

\302\251
JBt

by P,.

expressed as C, =

Gt

The output
P, C^.

carry of the
G, is called a

are
Ts,
carry-generateand producesan output when both At and \302\243,
is
of
the
called
a
because
irrespective
input carry.Pt
carry-propagate
with
the
of the carry from Ct_j
it is the term associated
propagation
be
as
to C;.Any output
expressed
carry
may

Ck

Gk +

PkC0

where
Gk

+ Pk-iGk-2

Gk_x

Pk = Pk-lPk-2
This

part

(a)
(b)

Show that
Show that
function A,

7. Draw

of

the

\342\200\242
\342\200\242
\342\200\242
+

Pk-iPk-2

P2G1

P2P1'

ALU

the carry propagation time in the


look-ahead
is known as the carry

the technique reducesthe carry


P, in a full-adder can be expressed
+

*
\342\200\242
\342\200\242

\342\200\242

for reducing

technique

parallel-adder
technique.

time.

propagation
by

the

Boolean

J5t.

the logic diagram of a 4-bit adderwith

look-ahead

carry.

List

628

Chapter

6: Boolean

Algebras

the Boolean functions


and

the

draw

and

for outputs

logic diagram

G5

P5.

the following two functions using multiplexers


and
gating as possible.

8. Realize
external

as

little

(a) fi(xy*,w) = 2^(2,4,6,10,12,15)


= 2ro(3,5,9,H,13,14,15).

f2(x,y,z,w)

(b)

9. Given the function


(a) Realize this

for Section 6.6

Answers
=

plus

multiplexers

four-input

using

as required.

externalgates

1. F

= 2m(l,2,4,5,6,7,8,9,l(UU4,15).
an eight-input
using
multiplexer.

this function

(b) Realize

Selected

f(x,y,z,w)
function

is identicalto the carry.Hence,

+ yz

+ xz

xy

o
MAJ

5.

When

s3
1
1
1
1
1
1
1
1
REVIEW

S3 =

0 then S3AtJ3;

s2
0
0
0
0
1
1
1
1

Si
0
0
1
1
0
0
1
1

FOR CHAPTER

= 0

So

-carry

and

Fx

Ft +

Fi

Bi

Bi
1
A

0
1

A&
B, +
B{ +

1+
A,+

B,
A, \302\256
At 0 Bs

0
1

For M

Gr

AiBi

Gi

AiBi

A, +

A, B,
A,

AiB,

A,

A +

Ai +

Ai +

Ai

Bi

B.t

Bi

\302\256
Bi

(AND)

Bi

B,

A,

+ A,Bi
Bi + AiBi
Ai \302\256
Ai

A,

=0

B,(OR)

A,\302\256B,(EQ)

Bi

1. The
variables.

is

following

the

Without

deduce the

values

variablesxux2,x
3.

truth
formally
for

the

table

for several

deriving

functions

functions of 3 input

Boolean expressions,
in terms of the
A/2/3/4
any

Section

6.6

2.

*1

x2

0
0
0
1
1
1
1

0
1
1

0
1
1

*3

0
1
0
1
0
1
0
1

0
0
0
0
0

the

Simplify

Applications

to

f*

1
1

0
1
1
1
1

0
1
1
0
0

0
0
0
Boolean

following

Digital

Computer

629

Design

using laws of

expressions

Boolean

algebra:

(a)

xy 4 xy

(b) (x + y)(x + y)
(c)

3.

xz

+ xyz

(d) (TVy) + J5c + y)


(e) x + xy + xy
/\342\226\240
Prove
the following using the
(a)

xy

lawsof Booleanalgebra:

= x

+^xy

(b) (x + y) (x + y) - x
(c) x(x +y) =xy_
+ xy + xyz = y
(d)
xy2

(e)

(f)

3cyz 4-

+
(w\302\243

a;2)

+ xy
4- xyz

3cyz

- y(a; +

4-

xy2

jc)

= z

4. Give the canonicalsum of products(or disjunctive


for the following functions:

(a) f(x,y,z) = (x 4-

(b)

/ (x,y,z)

y)

(x,y,z)

M2M3M5,

form)

(z 4- 5c)

where / = 1 iff

an

of input

number

odd

equals 1.

(c) /

normal

M, are

where

variables

maxterms.

5. Using Karnaugh maps, minimize the

function

f(a,b,c,d)

2 m(0,l,2,3,4,5,8,10,12,13,14).

6. Minimize
\"don't-cares\"

the

function

is the

whose

f(a,b,cyd)

following:

\\cd

ab\\

00 01 11

1
1

10

Karnaugh

map

with

630

Chapter6: Boolean
7.

Algebras

Implement

the function

/ (a,fe,c,d)= 2 m(4,10,13,15)
using

an

8 x

multiplexer.

8. (a) Constructa 32 x 1multiplexer


(b) Construct a 16 x 1multiplexer
an enable input, and an OR
9.
10.

11.

12.

Design
Using

a full-adder
full-adders

using
using

five
two

8x1 multiplexers,
8x1
multiplexers,

gate.

using half-addersand an OR
only design a circuitthat will

the switching variablesxux2,x3,and x4.


(a) Show that the set {F,G}is functionally
= x\342\200\224*
= 3c + y is the implication
F(x,y)
y
x is the negationfunction,

gate.
output

the

of

where

complete
function

sum

and

G(x)

(b) Showthat {HyK} is not functionally


complete where H(x,y) x *-* y is the function that outputs 1 iff x and y have the same
= x +y\\s the inclusiveOR function.
value
and
K(xyy)
= ABCD
Draw the logic diagram of the function/(A, J3,C,D)
+ AC
+ BCDusing only NAND
gates.

Flows

Network

7.1

AS

GRAPHS

OF

MODELS

Many systems

OF COMMODITIES

FLOW

involve

the

flow

such as

oil drums, automobiles,


manufactured

be somethingintangiblesuch

systemsof telephonesand
and
factories,warehouses,

as

lines;
retail

The modeling of such physical


directed graphs, with
the
edges
telephone

may

be

goods,

something
or money;

tangible

or it may

or heredity. Thus,
disease,
or interconnections of
networks;
all involve the flow of

information,
railway
outlets

a network.

commodities
through

in

transmission,

communication,

The commodity

of commodities.

or
transportation,

railway

lines,

channels

general,

systems

is frequently

accomplished

by

graph representing roads,


airline routes, oil pipelines,or power
lines\342\200\224
tracks,
The
vertices
of
through which the commodityflows.
of the

can represent highway


intersections,
outlets,
telephone
railway
airline terminals, oil reservoirs,or power
stations\342\200\224in
relay
where the flow of the commodityoriginates,
is relayed,
or
points

the graph

stations,
general,

terminates.

The

information conveyed by a graph is basically


vertices
are adjacent and which vertices
directed
Two models of physical systems may
paths.

structural

which

information indicating

connected
by

structurally

similar\342\200\224may

significantly

different

interconnections

of

an

even

be

isomorphic

as

graphs\342\200\224but

For instance, the


physical interpretations.
can
a
electric
network and
telephone system

are
be

have

be

be
might
by a graph, but edgesof the electric
whereas
the
interpreted
by parameters such as resistanceor voltage
be interpreted
by
edges of the telephone network modelmight
parameterssuch
as cost per unit length or maximum
of calls per unit of
number
and
we
time. We must account for these parameters as part of the model,
of
a
wecan
for
each
do so by either edge or vertex labels.Thus,
graph
edge
specified

network

model

631

632

Chapter

Flows

7: Network

a number of parameters that representnatural


and
limitations
do the same for the verticesof the
of the edges. (We could
in this chapter we shall restrictour attention
in our discussion

associate
capabilities
but

graph,

to edge

labelings.)

7.1.1.

Example

representa
third city.
A

the

per

highway

doesn't

of a graph
is a

there

through

pass

the two

between

the speed limit, while a third label


of cars that can travel along the

number

maximum

each vertex
by an edge if

distance

the

denote

indicate

could

label

second

connected

correspondingcitiesthat

One edgelabelcould

couldrepresent

Let

System.

are

vertices

between the

highway

cities.

Traffic

Two

city.

of time.

unit

7.1.2. An Economic Model.


Example
of production centers, warehouses,
and
set of highways, railways,and waterways.
This

Suppose

transportation per unit


transport vehicles.

Example 7.1.3.

of

markets.

unit

vertices

and

channels

edge

Typical

of
of available
the cost

time,

number

We

Model.

Dynamic

modeled by

can be

system

the

or

commodity,

connected

markets

a graph where edges representtransportation


and
represent the production centers, warehouses,
labels could include the maximum volume
per

a
by a

have

we

that

system

may incorporate a

dynamicfeature into eitherthe traffic model or the economic model. For


instance, we may have several cities located on a road map, and edge
the maximum
number of units shipped per day.
capacities
may
represent
it takes
we may also know the number of days
to ship the
Moreover,
commodity betweencities.If we wish to find out the number of units of
from city A to city B, say, over a period of 3 days, we
shipped
commodity
can add the dimension
of time
to the network by replacing each city
vertex

v by

four vertices

(Of course,v0
(u,v)

which

represents

can be

(Vi,vi+i)

commodity to
Let us

vlf

each

v2, v3,

v on

city

takes k days to

\342\200\242
\342\200\242
(u3_kyv3),
(^l^fc+i)*\342\200\242

edges

v0,

traverse, we
with

be storedtemporarily

the

vt

infinitely

at

following

any

city

represents

day.) Then for


make

can

the same

assigned an

be more precisein

where

the starting

the

capacity as (u9v).
large

v on

day i.

each

road

(u0,vk)t

edges

capacity

Finally,

to

the

allow

vertex.

example.

Suppose that oil is beingtransportedfrom


that there are
markets at g, h, and L Suppose,
moreover,
four
stations
or reservoirs denoted by vertices c, d, e, and
/. Each
relay
week there are 20,000 and 60,000
to a and 6, while
barrelsofoilavailable
20,000, 30,000,and 20,000barrelsare needed
respectively
by g9 h, and L
Example

refineries
at

a and

7.1.4.

b to

Section7.1

as

Graphs

Models

(a)

of Flow

633

of Commodities

(b)

7-1.

Figure

are
markets
pipelines connecting the refineries,reservoirs,and
with
is labeled
by edges in the graph of Figure7-l(a).Each
edge
a number indicatingthe maximum
amount
of oil in thousands of barrels
that canbetransported
via that
pipeline
per week.
In cases where there are multiple
sources
as a and b) and
(such
them
combine
multiple terminals(such as g, h, and i) we can artificially
to a single source vertex and a singleterminalvertex
two extra
by adding
S and D, represent
vertices as we did in Figure7-l(b).Thesetwo vertices,
the total supply and demand.Eachedge(S,x) is labeled with a number
x can supply each week.
representing the total amountof oilthat refinery

The

denoted

Likewiseeach edgeof the

edge

for

(h,D),

of

barrels

these

With

instance,

week; the edge


of oil each week.

oil each

barrels

20,000

form
is labeled with
a number
(xjl)
of oil demanded by market x eachweek.The
is labeled 30 because market h requires30,000

amount

total

the

representing

examples

preliminary

as defined

network

(transport)

Definition

7.1.1.

and containsno

loops

directed

is called

it can
(S,a) is labeled20because

we see
below.
graph

a (transport)

of
the essentialcharacteristics
is (weakly) connected
network if and only if

G that

are two distinguished verticesS


and
source and sink of G, respectively;
function
(ii) there is a nonnegative real valued
(i) there

supply

and

G, called

of

k defined

on the

the

edges

ofG.

The
edge of

function

G, the value

is called
k(e)

function of
the capacity
of e. We
the capacity

is called

G and if
think

e is

of k(e)

any

as

634

Chapter7: Network

Flows

maximum
rate at
vertices, distinct

the

representing
along

transported

e. The

Frequently it is the casethat

in-degree0

the source

network

a transport

in

S has

this is not always

out-degree 0, but

D has

sink

the

and

D,

vertices.

intermediate

are called

which a commodity can be


from the sourceS and the sink

the

case.

We generally

that (G,k) is a transportnetwork,


and
by this we
k is the capacity function
is the directedgraph
and

will say

indicate that G

definedon the edgesofG.

If

such

that

could be

any

Similarly,let B(v)
are

that

For

example,

= 0,

{y E

Thus

in

the empty

V(G)

\\ (y,v)

denote
- {y

A(v)

that

vertex

with

(v)

and edge

V(G)

of ally

E V(G)

\\ (v,y)

E V(G)

E(G)}

are \"after v\"


Then B(v) is the set of

\"follow

E(G)}.

set

the set

v\" or

i>.\"

\"before

- {ajbj},while

jB(S)

from v.

is incident

graph

called the set ofverticesof G

vertices
B(c)

is a directed
vE
V(G),let

(V(G)MG))

set E(G)ythen for

the
A(e)

set.

graph of Figure 7-l(b), A(c) = \\dye) and


and B(e) = {c}.
Notethat A(D) - 0 and

= {g,h,i}

Exercises for Section7.1

1.

The

in
and

accompanying

which
c.

graph

(Figure

oil for 3 cities, j\\ fe,


Vertices
d, e, /, g, ft,

and
and

a pipeline system
from
3 refineries,a, fe,
delivered

7-2) represents
m is

i represent

stations. The capacitiesofthe pipelines


are

intermediate
shown

on the

pumping
edges.

as a transport
network.
(a) Model this system
that
refineries
Add
to
model
the
additional
facts
(b)
a, fe, and
your
can produce at most 2,10, and 5 units respectively.
in
model
the facts that cities j, k, and
(c) Incorporate
your
and
7
units
4, 3,
require
respectively.

Figure

7-2.

Section

Graphs as

7.1

Modelsof

Flow

is possibleto go from city A to city C either directly


to5:00
through city B. Duringthe period4:00
p.m.,the

2. It

times

are 30

minutes

toJ3,

15 minutes

or

by

average

from B to

going
trip

C, and 30

maximum capacities of the routesare


B route, 3000vehicleson the B to C route,
and 6000vehicleson the A to C route. Represent the flow of traffic
to 5:00 p.m. as a transport network.(Hint:let
from A to C from
4:00
vertices
cities
at a particular time.)
represent
Suppose3 applicantsAu A2, A3 apply for 4 jobs Jl9 J2, J3,</4, where
for Jx and J3; A2 is qualified
for J2 and J4, and A3 is
Ax is qualified
for Jx and J4. Represent this information
in a transport
qualified

minutes

from

4000

on

vehicles

3.

from

635

of Commodities

C. The

to

A to

the

network.

there are 5 girls

Gl9 G2> ...,


Gb and 5 boysBu J32, ..., J35.
further, that Gx dates Bl9 J32, and J34; G2 dates B2and J33; G3
dates
B2; G4 dates J33 and J35; and G5 dates J33, J34, and J35.
in a transport
network.
(a) Represent this information
(b) Is it possiblefor all 5 girls to go to a party with a boy she usually
dates?

4. Suppose
Suppose,

5. Suppose5 personsA,

J3, C, D, E belong to 4 committeesClf C2, C3, C4


- {A,C,Z>}, C3 - {C,D^B},
where Cx - {J3,C},
and C4 = {A,D}.
C2
this information in a transport network.
(a) Represent
for the committees
where
toselect4 chairpersons
(b) Isit possible

no person chairsmorethan

6. A

manufacturing

that

firm

forecastthe demandfor

The task of

each
the

producing

one

committee?

product
various

of articles can
certain period of time.
can be assigned to

a variety

produces

over a
articles

take varying amounts of time to producethe


for
number of articles and d, be the demand
each article
for i = 1, 2,.. .,n;letm be the number of workers and ^;
Assume
the timerequired
worker to produce the Ith article.
by the/h
also that the 7th worker
can produce
for at most c; units of time.
for producing
article i by
(a) At first ignore the time ty required
worker j and designa transportnetwork
for the case n = 3 and
different

who

workers,

articles.

Let

be

the

m = 2.

(b)

how

Describe

(c) Discuss

how

to design
the

time

transport network.

7. From

a transport
ti}-

could

networkin general.
be

incorporated

into

your

to a single
run
a
of n cities,
Cl9 C2, ..., Cn buses
group
destination Cn+1.If thereis a roadfrom C, to C;, let ttj be the time
required to go from
Ct to C; by this road, and let fy; be the maximum
number of buses which can usethe road from
C, to C; per unit of
time (bij - 0 if there is no road from Ct to C;). Let bu be the maximum
number of buses that can be stationedat Ch and let A, be the

636

Chapter

Flows

7: Network

Figure 7-3.

number

is:

question

many

of

buses

at

stationed

buses

the buses

should

How

arrive at

as possible

Draw a transport network


(Ci(t), C{(t +
capacity bu for

and times of
shown

7.2

of

tij))

i =

(at time t = 0). The

be scheduledin orderto have


in a given time interval 0?
=

vertices

b^ and

C,-(\302\243)

are

them

labeled

edges
of

(Ciyt)9

edges (C.-(*),Ctf*

3, 4, 5 and t = 0, 1,2,3,4

between

as

Cn+1

with

capacity

1, 2,

travel

Q originally

the

where

on the

1))

5 cities

road

map

7-3.

in Figure

FLOWS
to ask about a system suchasthe onepicturedin
of oil so that the
possible to organizethe shipment
demands of marketsg,h, and i are met? The total amount of oil available
of Figure
to a is 20,000 barrels per week. (Thisis indicatedin the
graph
of
7-l(b) that a has only one incoming
edge (B(a) = {S})and the capacity
of a's oil.
this edge is 20.) Since A (a) = {c,/}, c and /are the only
recipients
the
barrels
to c and 0 barrels to /, exceptfor
Thus, a could sendall 20,000
a can send a
fact that the edge (a,c) has a 12,000
barrelcapacity.
Thus,
a can
send a maximum of
maximum of 12,000barrelsto c.Butlikewise
a could
send 16,000 barrels to/and 4,000to c;
16,000barrelsto/. Hence,
or 8,000to/ and 12,000 to c; or 10,000 to / and 10,000to c;and so on.
we have not begun to considerhow b could distribute
its oil,
Although
we alreadyseea largenumber
of potential
plans. Let us begin to organize
our thoughts concerning
this
and as we proceed we will beginto
problem,
A

Figure

question

practical

7-1 (b)

is: Is it

seethe basic
of the
Let us labeledges
ideas

with

second

the

amount

concept
two

of flow.

numbers,

of flow through

first the

that edge.We

(1) The amount of oil transported along any


capacity of that edge.

capacity of the edgeand


will

edge

make

cannot

two rules:
exceed

the

Section

7.2

637

Flows

at the sourceS and the sink D, the amount of oil flowing


v must be equal to the amountofoil flowing
of the
out
at an intermediatevertex.)
vertex. (Thus, no oil gets \"stored\"

(2) Except

a vertex

into

Of

the

send

edges

(c,e)

16,000 barrels to

to send

decide

could

a could distribute its oil,supposewe

ways refinery

possible

arbitrarily

20,000 to
and (c,d)

c from fe, but since


are 10 and 7 respectively,

maximum of 17,000barrels.Thus,

A(c)

/ and 4,000barrelsto c.We


= {e>d}and the capacities
of

c can send out a


be stored at c, c can
been chosen to receive4,000
we

no

since

see that

oil can

Since
c has
receiveat most 17,000
b. Let
barrels
us make
a, c can receive at most 13,000barrels
the choice to send 13,000barrelsto from b. Likewise we choose to send
sent from S to b.
b to d. Thus, there must be
13,000
26,000
barrels.

from

from

from

We

only

continue

making

choices

to the above

subject

7-4.
in the diagram shown Figure
indicated
market
We see that, for this choiceof flow,
i received

as

constraints

two

jn

and h did not. The following

a summary

is

of the

but g

its demand

schedule we

have

developed:

a sends

16,000 to/

4,000 to c

b sends 13,000toc

tod
13,000

Total

g receives

16,000

h receives

10,000

i receives20,000

Total

46,000

46,000

a and b are capable of producinga total of


is only 70,000, the capacity
total
demand
not
restrictions have
the flow to the extent that
affected
until
later
to see whether or
demand.
We will have to wait
receive
their
not this flow is the best possible schedule.
Thus,

even

barrelsof oil

80,000

though

and

the

somemarketsdid

a% 06,16)^/08.16^

(12,0)/

(17,

0)y

(20,

1^(10,

10), ttXd5, 10)r

(30,

16)

10)^

(20, 20)

(13,

13)

-\342\226\272\342\200\242 *\342\226\240\342\200\242
,
<

Figure

(30, 20)

7-4.

638

Chapter 7: Network

Flows

Let (G,k) be a transport network


S
source
with
7.2.1.
k is defined on the edgesof G.
function
D. Assumethe capacity
F defined
on the edges
in G is a nonnegative real-valuedfunction

Definition

and sink
A

flow

of G suchthat

(i) 0 < F(e) <

(ii) If x is any

k(e)

for

each
of G,

vertex

edge e E E(G).
different from the

sourceor the sink,

then

values F(xyy) such that y E. A(x) must equal the


sum of all values F(z,x) suchthat z E B(x), and
from
(iii) F(e) = 0 for any edge e incident to the source S or incident
of all

the

sum

the

sink D.

called the capacity constraint,and it insures


an edge does not exceed the capacity
for
along
that
the
sum
of
all
flows
at
(ii) requires
incoming
to the sum of all outgoingflows at x. In symbols, (ii) becomes

Condition (i) is
the amount of
edge. Condition
equal

flow

E V(G)

for every x

Thus,

is the

2yEMx)F(x9y)

the net

x. Moreover,

flow out

flow

x is

- {SM

of x and 2zE~B{x)F(z,x)
of

out

that

(i.Z.I)

z<=B{x)

yGA(x)

that

a vertex

x is

flow into

is the

defined to be

net flow into x is, of course,


conditions
(ii) and (ii')assurethat
2zeb(x)F(z>x)
2yeA(x)F(jc,y). Thus,
for an intermediate
vertex x the net flow out of x equals the net flow into
no flow is either created
x, and this common value is zero.In otherwords,
or destroyedat an intermediatevertex.
condition
(ii) or (ii') is referred to as the conversation
Frequently,
-

2yeA(x)F(jc,y)

2zEBix)F(z,x),

while the

equation.
Condition

not in

(iii)

that

insures

the flow moves

from sourceS to sink

and

the reverse direction.

Note that
zero flow,

every

transport

where F(e)

= 0 for

has at least
edge e E E(G).

network
each

one flow, namely,


the
Another exampleof a

in Figure 7-5. We still follow


of labeling
is depicted
the
convention
e
each edge e as (k(e),F(e))where
is
the
of
and
k(e)
F(e) is the
capacity
flow

flow

along

e.

Example

7.2.1.

Consider the

example of a network

flow

shown

in

Figure 7-5.

Note the zeroflow into the source S along the edge (6,S).While
it is
that for each intermediate vertex x> the flow into x equals the flow
of x, we only illustrate this fact for the
out
vertex
e. The flow into e is

true

Section

Flows

7.2

639

Figure 7-5.

F(a,e) +

F(cye)

2 + 2 = 4.

The
Such

flow

edges

along

2 +

edges

are said

2 =

4, while the flow

out

of e

is F(eyD)

+ F(eyd)=

and (aye) is actually equal to the capacity.


saturated; all other edgesof Figure 7-5

(S,a)

to be

are

If an edge e is unsaturated,
then
we define the slack of e
in a flow F to be s(e) = k(e) - F(e).Therefore,
the
slack
of edge (eyD) in
Figure 7-5is 8 while the slack of edge (d,D) is 2.
in this example the flow out of the sourceS is equal
Note further
that
in turn, is equal to the flow
into
to F(S,a)
+ F(SyC) = 4 + 2 = 6, and
this,
the sink D. That this is always
the
we
case will be proved later, but first
need
some additional
notation and terminology.
In general,
if X and
Y are any subsets of V(G),we shall
write
(X, Y) for
the set of all edgeswhich
a vertex x E X to a vertex y E Y. In
go from
we shall write (x,Y) for ({jc},Y)
and
(Y,jc) for (Y,M). Let us
particular,
of all edges incident to x, and sincethese
note that (V(G)yx)
consists
=
from a vertex y E B(x), we have
all incident
are
(V(G),x)
edges
=
(J3(jc),jc). Similarly (x, V(G)) (xyA(x)).
into
the real numbers (g
Now
E(G)
g is any function from
suppose
We shall
a capacity
function or a flow function).
might be, for example,
x E X, y E Y, and
where
write g(Xy Y) for the sum of all values
g(xyy)
is the sum of all values
Y) = 2(xo,)e(x,Y)g0t,y)
(xyy) E E(G). Thus, g(Xy
x E X to a y E Y. We
the
an
adopt
g(e) where e is an edge from
convention that g(XyY) = 0 if (X, Y) is the empty set. Likewise,g(X,<t>)
set.
if <f> denotes
the empty
a sum of no values of the function
will
mean
=
=
=
X
and
{S,c,e}
Thus}g(X,</>) 0 g(<t>, Y). For example, in Figure 7-5 let
Note that while
Y = {a,6,d,D},
then (X,Y) = {(S,a),(c,d),(e,d),(e,D)}.
the
there
are edges
G, nevertheless,
(a,e), (6,S), and (6,c) in the graph
in
but
directions of these edges are such
these
that
(X, Y)
edges are not
then
insteadarein (Y,X). Moreover,
if g is the indicated flow
function,
=
=
=
2
2
X=
4
9.
If
+ 1+ +
+ g(eyd)
+ g(eyD)
g(Xy Y)
g(Sya) + g(cyd)
=
=
in
{a}and Y {D}, then g(X, Y) 0 sincethereareno edges in (X, Y) this
= 0 for X = {S,a,6,c,d,e}and Y = {D}, while
case. Likewise,g(YyX)
=
6.
g(X,Y)
unsaturated.

640

Chapter

7: Network

Flows

for X C

sum of all values g(xyy),


for
which
any
(x,y) is an edgein
=
=
E(G).
Thus,
g(X,V(G))
2xexg(x,V(G))
Moreover,
2x\302\243Xg(x,A(x)).
= 2xeJrf(V(G),x)
= 2xEXg(B(x),x). Thus, if g is a flow
g(V(G),X)
function, then g(V(G),x) is the flow into x arid g(:t, V(G)) is the flow out
In particular,

wherex G X and y

is the

V(G))

g(X,

V(G),

in V(G)

vertex

is

of x.

In general if X,
+ g(X,Z)
g(X,Y)

Y,

exclusion. In particular,if
#(X,Y) + g(XtZ).

Theorem 7.2.1. LetS and


a

of

network

F(S,V(G))-F(V(G),D)We first

Proof.

by

UZ)

respectively,
of S -

the flow out

Then

D.

into

flow

the

and sink,

and

of inclusion

sets, theng(X,

source
G.

in

flow

then g(X,Y U Z)

principle

disjoint

the

be

be a

Let F

(Gtk).

the

Z are

Yand

of V(G),

subsets

are

and

- g(X,Y D Z)

observethat

F(V(G),V(G))-

\302\243

F(x,V(G))

(7.2.2)

\302\243 F(V(G),x)
x\302\243V(G)

by condition

However,

x E

each

V(G)\\{S,D}. Thus,

in

F(SfV(G))=

D.

S, and

Thus,

A(S)

out

flow

the

and

F(V(G)JD)

a2,...,

let bu b2,...,
=

sum

{ax, a2,

fet

- 0 = F(D,V(G))

defined

the transport

on

the verticesthat are incident

denote

a3,.. .,aj

all the

vertices

and B(D) =

{6lf

incident to
fe2, b3,...,

quantity
\\F\\

- F^aJ

+ F(S,a2)

\342\200\242
\342\200\242
\342\200\242
+

F(S,am)

-F(S,V(G))

= F(bl9D)

+ F(62,D) +

= F(V(G),D)

is called the value

ofthe

flow

F.

since

D. Thus, equation (7.2.3)


theorem
is proved.
\342\226\241
of

flow

for

becomes

- F(V(G),S)+ F(V(G),D)

Let F be a
am denote all

7.2.2.

Definition

(G,fc).Let ai9
source

S and no

7.2.1,F(x,V(G))- F(V(G),jc)

that F(V(G),S)

we know

addition,

no flow into

the above

+ F(D,V(G))

F(S,V(G))

But,

(ii) of Definition

\342\200\242
\342\200\242
\342\200\242
+

F(btfD)

(7.2.3)
there

is

becomes
network
from

the

the sink
fej. The

Section

641

Flows

7.2

The

flow

in

7-5 has

Figure

value 6, while

the

flow

in

7-4 has

Figure

value 46.

Definition 7.2.3.

A flow
F in a network (G,k) is
>
if | F\\
flow
| F | for every flow F in (G,k).
Thus, a flow F is maximal if the value of F is
F is maximal if there
of any flow. In other words, a flow

calleda maximal

the largestpossible

value

is no flow

F*

such

that|F|<|F*|.

We should hasten to remark that, at this stage,it is not clear that a


a maximal
flow at all. It is at least
given network (G,k) must have
that
the
set of values of flows
set of
conceivable
could
be an infinite
in
a maximal
that set. Our
numbers that does not contain
number
will
to
show
then
be
that there always is a maximalflow,
and
objective
in a
flow
our major concern will be to determine
the value of a maximal
a
flow.
such
given network and to discussa method for constructing

7.2.2.

Example

maximal.

The

value

of

any

Let us explain why


on the

flow defined

|F|

flow

the

Not every examplewill

= F(S,a)+

be

easy to

this

techniques

for

Figure

7-6 is

networkis suchthat
F(S,b)

SinceF(S,6) <k(S,b) <2andF(S,a) =F(a,d)+ F(ayc)


= 1 + 2 = 3,|F| = F(S,a) + F(S,b) < 5.Then,
without
that the indicated flow is a maximal flow.

more sophisticated

in

analyze.

determining

(2, 1)

Figure 7-6.

W&will

maximal

< k(ayd)
question,

have

flows.

+ k(a,c)
it follows

to develop

642

Flows

7: Network

Chapter

Definition 7.2.1and Theorem7.2.1combine

In summary,
the following

F(x,V(G)) -

F(V{GU)-

ifx

|F|

if:c=D
if

x*S,D

7.2

for Section

1. Determinewhich

the

of

networks.Explain

graphs

in Figure

7-7 are transport

answer.

your

(c)

produce

= S

\\F\\

0
Exercises

to

fact:

>D

Figure 7-7.

2. Considerthe flow

In

the

graph

F in

the transport network shownin Figure7-8.


to label edges as (m,n)to indicatethat

continue

we

is m and the flow is n.


Find
the
(a)
capacity of the edges(S,a) and
(b) Find k(a,D) and k(b9d).
(c) Find F(S,a), F(a,c), F(a,D), and F(fe,d).

the

capacity

are saturated.
(d) Determinewhich
edges
(e) Determine the slackof edges(ayD)

(f)

Find|F|.

(g) Determine
(h) Determine

(a),

A (6),

B(D).

and A (d).

and

(a,c).

(S,6).

7.2

Section

Flows

643

7-8, determine

which

(5,2)

\342\200\242
D

the capacities in the network


of the following
are
flows.
Explain.

3. Using

(a)

(c)

Figure

(b)

>D

(d)

Si

(e)

of

'\342\200\242D

\342\200\242
D

S<

\342\200\242D

4.

Consider

the network

(a) Find two


(b) Find the

value

with

of

each

as in

capacities

maximal

different

flows.

of these

flows.

Figure 7-8.

644

Chapter

7: Network

Flows

kinds of military

5. Seven

are

equipment

by five cargo planes. Thereare4

units

to be

flown

of each

a battlefield

to

kind of

equipment

and the five planes can carry 9, 8, 6, 4, and 3 units, respectively.


in such a way that no 2
cannot
be loaded
Showthat the equipment
units of the same kind are on the same plane. Hint: draw a graph
14
5 vertices representing
vertices:
the planes, 7 vertices
with
2 vertices S and D
kinds
the
of
and
equipment,
representing
of
t
otal
number
of
units
equipment and total loading
representing
capacity.
and flow F in Figure 7-5, computeF(X,Y) where
6. Forthe network
X =

(a)

Y={dye]

{a,fe,c}

(b) X = {S,c}

(c)

{S,c}

Y-1M

{fe}

Y=lS,c}

{a}

Y-{6}

= {a4A

Y=\\D)

(d) X

y={a,fe}

(e)

X =

(g)

(i)

(f) X = {S,a,fe,c}

Y={L>}

(h) X = {d,e}
7. In
value

the
of

possible.

Y={a,M
Y={a,d,e,Z>}

{S,fe,c}

the

with

networks

following

flow

and a way

(If it is not

indicated

possible to increasethe value,

not.)

(2,2)

S.JL2U.;

,JL\302\260\302\261.D

(b)

(3,3)

(d)

(3,3)

the

flows, determine

to increase the value

(4,3)

of

the
explain

flow
why

if

Section7.3
8. In the following
of

value

each

the

in

the missing edge flows


Determine the

fill in

networks,

transport

result is a flow
of the flows.

the

that

so

645

Cuts

and Minimal

Flows

Maximal

network.

given

(4,3)

(5,4)
S^J^

(b)

(5, )

Selected

for Section 7.2

Answers

Label

the
Plf P2> P& P* and P5 whose
planes
and 3 respectively.Thennotethat no plane

units of equipmentsinceno
same

the

plane.

units, the
planes can

maximum

most

equipment. Sincethere

are

(b) 8, maximal

requires

Other problemsaremore

Px

are

there

Obviously

of a

CUTS

flow. For
and

be

a network.

for

found

many

practical

Sometimes,

quite easily by

certain

the transport

as in

inspection.

limiting

networkin Figure7-9(a).

of

any

flow. Let

the possibilitiesof

values on

instance,thetotal capacity

source S limits the value


source

can

the solution of

difficult.

Consider

7.3.1.

Example

the

7.1 and 7.2 that


finding a maximal flow

Example 7.2.2,a maximal flow

from

9 and 8
is
7
units.
Thus,the 5
carry,
+ 7 + 6 + 4 + 3 = 27 units of
of 4 x 7 = 28 units, no such
total

Sections

in

saw

problems

value

are to be in

P2 can carry

flow

MINIMAL

AND

FLOWS
We

same kind
and

(a)

MAXIMAL

more than 7

is possible.

loading

7.3

can have

in fact,

can

they
at

carry

of the

2 units

even though

Therefore

are 9,8,6,4,

capacities

7\\

of
be

T2 be the total capacityof

incident

edges

the
edges

total
into

the

from the

capacity of edges
the sink. Then,

646

Chapter

Flows

7: Network

a%

-\\
<l

(8,4)/'

>

\\

ar

<

7\\

\\
b

\342\200\224

\342\200\224\342\226\272

y\302\260

<7'5)\\

W-W (I
\342\200\224S

4)

\\(7,

yC(>,5)

b%

\302\273
\342\200\242d

(5,5)

(a)

7-9.

Figure

in

Figure

7-9(a),

Tx =

k(S,a) + k(S,b)

- 8+

15

+AW,D)

T2-*(c,D)

-7 + 6-13.

Isis

patent

two

values.

that

< 13

|F|

limitations on the values

edgesare

and

unreliable,

be able to
network

of

for

flow

any

a.flow.

if \"enough\"

transmit the desiredflow.

(a,c) and (b,d) in


no

Figure

7-9.

for

Consider,

If these

of flow from

amount

cannot exceedthe smallerofthese


F. There are, however, other
For example, it may be that some
of these edges fail, then we will not

of any flow

value

the

Thus,

the edges

example,

removed from

edges were

S could reachthe

sink.

limit
the
capacitiesof theseedgeslikewise
= 4 + 5 = 9. If we
find
flow; therefore, |F| < k(a,c) + k(b,d)
value 9, then we know that that flow would be a maximal flow.
in Figure 7-9(b) is, therefore, maximal.

conclude

that the

Example7.3.2.

Consider

the

example

shown

The flow out of the source and the flow into


edge
capacity. Nevertheless,the \"bottleneck''
therefore the

of

flows

transport

shown

illustrated

flow

in

network.

Figure

is a

maximal

7-11 are

the

sink

we
value of a
a flow of
The

are nowhere
is

flow

7-10.

in Figure

(c,d)

the

Thus,

saturated,

near
and

flow. Of course,the examples

also maximal

flows

in

the

same

Section7.3

647

Cuts

and Minimal

Flows

Maximal

(7, 1)

(20, 1).

1)

(4,

7-10.

Figure

These

following definition.

suggest the

examples

d (5, 1)

(2,2)

Definition 7.3.1.
source

S and

sinkD.

but^D

X,
(\302\243

Let

(XyX) of

all

is a transport network with


that
(G,k)
Suppose
X,
Suppose that X is a setofverticessuch that S \302\243
denote the complement of X in V(G). Then the set
from a vertex in X to a vertex in X is calledan S-D

edges

cut.

7-9, the

In Figure
examples

sets Xx

such

sets

of

that

X2 =

jS},

{S,a,b}9and X3 -

are
{S,a,fe,c,d}

cuts.

S-D

are
(X\342\200\236Xt)

of network
flow. For
concept of a cut is centralto the study
if
a
river
is
a
X can
north-south
viewed
as
the
set
be
screen
line,
example,
chosen as the set of vertices eastofthe river,
then
and
the cut (XyX) is
the setofall westbound
on bridges
roads
crossing the river. Then we can

The

across these
of

capacity

east to west by

total trafficjrom

the

calculate

roads in (X,X). We

are

led,

notion of the

to the

therefore,

traffic

the

counting

just

a cut.

7.3.2.

Definition
the
(G,k),
C. Thus,the
then

If C is
of C

capacity
k(C)

capacity

set

any

is defined

k(C)

of

sum of

is the

transport network
of the edges of

edges

in a

the

capacities

by:

Z k(e).
e\302\243C

In

particular,

write k(X,X)

we are
for

the

interested in the capacitiesof S-D cuts


X
of all capacities of edges from

sum

We
(X,X).
to X. We

(7,0)
(20, 2)

(4, 2) c

(2, 2) d

\342\226\272
\342\200\242D

(5, 2)

(20,

0)

(4, 0)

c (2, 2)
(b)'

(a)

Figure

7-11.

+\302\273*D

(5, 0)

Chapter

7:

Flows

Network

caution

the

that

there may
of

computation

an S-Dcut (X,X)

to X

do not enter into

but they

k(X,X).

the cuts

Specifically,

be_edgesfrom
with

smallest

a minimal

cut

are critical.

capacities

if there

is no S-D cut (YtY)

Thus, we call
such

that

k(Y,Y)<k(X,X).
there
are 4 vertices
following example of a transportnetwork,
=
24
are
16 S-Dcuts
sink.
there
and
the
source
than
Therefore,
other^
S
a possible
with
forms
of
subset
since
{a,6,c,d} together
(X9X)
any
choice for X.

In the

Example 7.3.3.

Refer

7-12and thelistof S-Dcuts

to

the

in

Table

Table 7-1.

transport
7-1.

Possible S-DCuts.

shown in Figure

network

Capacity

{s}

{a,b,c,d,D\\

{S,a}

{b,c,d,D}

11

{S,b}

{atc,d,D}

10

\\S,c]

{a,b,d,D}

16

{S,d}

{a,b,ctD\\

{S,a,b}

\\c,d,D\\

{S,a,cj

\\b,d,D}

{S,a,d}

\\b,c,D]

{SAc}

{a,d,D}

{S.b.d}

{a,c,D}

{S,c,d}
{S,a,b,c}

{a,b,D}
{d,D}

19

12
22
20

15
17

21
17

{S,a,bfd\\

{c,D}

14

{S.a.c.d}

\\b,D\\

22

{S,btctd\\

\\a,D]

13

{S,a,b,c,d}

\\D\\

10

Figure 7-12.

Section7.3

Maximal

Flows

and Minimal

Cuts

649

= 12 = k(ayd)
+ k(b,d)
not enter into the
computationof the capacity of X becausejbhe edge (c,6) is in the wrong
that
X to X and not from X to X.
direction,
is, (c,6) is an-edge from
- 7+
of (Y,Y),
Likewisethe capacity
where Y = {S,M,is k(byd)
+ k(S,a)
=
3-10 since (Y,Y)
The edges (c,6) and (a,fe)
not
do
{(fe,d),(S,a)}.
contribute
of (Y, Y).
any value to the capacity
We have seen in Example7.3.1that
the
value
of any flow is limited by
the capacitiesofthe cuts.That this is true in general is part of the content
We emphasize that if X
5 + 7. Note that the capacity

of

the

7.3.1.

is any

k(X,X)

the

of

edge

(c,6) does

theorem.

following

Theorem
(X,X)

- {S,a,b},

S-D cut,

If F is a
then

(a) |F| = F(X,X) -

in

flow

F(X,X),

and

(G,k) and

network

a transport

if

consequently

\\F\\^k(X,X).

(b)

If (XyX) is an

Proof.

S-D cut,then

- F(V(G),X)

F(X,V(G))

- Y. F(x,V(G))-

F(V(G),x\\

xEX

- F(S,V(G))

- F(V(G),S)

+ J2 F(x,V(G))-

F(V(G),x)

x\302\243X\\S

Butforx${SJ)}

F(x,V(G))-F(V(G),x)=0

so that

the above equation simplifies

to

F(S,V(G))-F(V(G),S)=\\F\\.

Thm,F(X,V(G))-F(V(G),X)=\\F\\._

Moreover, F(X,V(G)) - F(X,X U X) =_F(X,X)


= 0. SimilarlyF(V(G),X) - F(X U X,X)
Xf1X
to
Therefore, F(X,V(G)) - F(V(G),X)
simplifies
define

If_we

F(X,X),
across

any

the

net

flow

across

then we see that the value


S-D cut (X,X). We may

andF(X,X)

Now|F| -

astheflowintoX.
F(X,X)

F(X,X)

of

+
= FiXJC)

F(X,X)

F(X,X)jiiice

+ F(X,X).

- F(X,X).

the cut (XJC) as F(X,X)


any flow is_equal to the net flow

think of F{X,X)asthe
_

< F(X,X)

flow

sinceF(y,x) > Ofor

out

anyy

of X
G

650

Chapter 7: Network

Flows

x E

X and

in the definition

< A
(x,y) by the capacity constraint
that F(X9X) < fe(X,X)
so that,
in
than or equal to the capacity
of any

we see

a flow,

of

the value of any

general,
cut.

X. But also,sinceF(x,y)
is less

flow

\342\226\241

In

computedin severalapparently
(1) | F

|=

that the

established

we have

summary,

the total flow

different

be

F can

a flow

ways:

source S,

of the

out

(2) | F | - thetotal flow


(3) | F | = the net flow

of

value

sink D,
any S-D cut.

the

into
across

In truth, methods (1) and (2)arenothing


but
cases of_(3), for in
special
(1) the total flow out of S equals the net flow across the cut (X,X), where
X ==JS}.
Moreover,thetotal flow into D equals the net flow across the cut
Y),

(Y,

where

Y ={!>}.

From this theorem we


is a minimal cut,
(MM)
Corollary

that|F| =
cut.

can

be a

Let F

7^3.1.

Then

fe(X,X).

if F*

see that

readily

then | F* | < k

and

flow

maximal

flow.

all

makes

that\\F\\=k(X9X)

Thus,|F| = |F*|for

any

that|F|

Y) = k (X,X)

than or equal to k (X,X).Therefore,


(X,X)
Corollary

7.3.2.

that F

Suppose

that_(X,X) is an S-D cut.Then


(X9X)

if and

(i) F(e)
and

for

is

cut of

any

But the

in fact equalities.
< \\F* |. Hence F is a
cut with capacity less
any
\342\226\241
a minimal
cut.

is a flow
value

the

be

and_(Y9Y)

k(X,X).

in

of F

a network

and suppose

equals the

capacity of

is, F(XyX)

= k

only if

- k (e)for

(ii) F(e^) = 0
F(X,X)

S-D cut such


(X,X) is a minimal

inequalities

such

flow_F*

k (Y,

Moreover,

and

be an

(X,X)

maximal flow and

is a

Proof. Let F* be any flow of larger jyalue


<
smaller capacity.ThenJF\\< |F* | <; k(Y,Y)
assumption

is a maximal flow

(M,M).

for

each

each

edge

e E

edge

(X,X)f (that
_
e' E (X,X)

(or in other

(X,X)),
words,

= 0).

(If these conditions prevail, then F


minimal cut.)

is

maximal

flow

and

(X,X)

is a

Section

Flows and

Maximal

7.3

Proof.

651

Cuts

Minimal

conditions (i) and (ii)hold.Then

Suppose
|

F | =

net flow across

F(e)-

(X,X)

e\302\243(X,X~)

\302\243 F(e')
e'\302\243(X~,X)

\302\243 F(e)e\302\243(X,X\")

\302\243 *(e)
e\302\243(X,X~)

-A(X,X)

the edgesjn
of (X,X).

since

capacity

(X,X) do not contributeto the computation


__
_

Conversely,if|F|^

*V)

^e(Xx)

since F(e) < fe(e)


the

from

above

each edgee' by
and

F(e')

2cG(X^

for

each

inequality
definition

for each
k (e) implies

= 0

conclude

7.3.3

F(e')

the

2,eex.*> F(e) JV)


S^^,

-|Fl-

k(XyX)

2e<=ix,X)k(e)
S,^,

fe(X,X)

edge of (X,X). But then subtracting k(X,X)


> 0 for
But sinceF(e')
F(e').
gives 0 > 2Ve{x~,x)
of a flow, we conclude that
F(e') - 0
2^e(x;X)

edge e'E (X,X).But


F(e) = k (e)for each

Example 7.3.4. Theflow


Example

then

k(X,X),

of

we observed

in

then

7-13

Figure

fe(X,X)_=

e E

edge

flow

by

5, and sincein

has value

that the minimal

that this flow is a maximal

Sc\302\243(x^F(e)

(X,X).

cut had

Corollary

capacity

we

7.3.1.

Figure 7-13.

Example 7.3.5. Considerthe flow


This flow is maximal
conditions

of

Corollary

since for
7.3.2.

shown

in Figure

{S,a,fe}, the

7-14.

cut (X,X)

satisfiesthe

652

Chapter 7: Network

Flows

7-14.

Figure

Exercises

for Section

1.

7.3

7-15
a transport
network with
shows
Figure
their capacities. Find all S-Dcutsand their
cut

minimum

2. Suppose that

D. Showthat
of a

edges

capacities.

labeled with
What is the

capacity?

7-15.

Figure

value

the

(G,k) is a transportnetwork
if

there

directed

is no

with

S and

source

path from S to D, then

maximal flow in G and the capacity

of a

minimal

sink
the

cut in G

are both zero.

3.

Let

(G,k)

be

the

network

Figure7-16,where

(a)

Give

(b)

Determine|F\\.

an

example

the

label

with

source

on each

of a flow

S and sink D illustrated in


edge is the capacity.

F in G suchthat

Listthe edgesof(X,X),
(c) Let Xj= {S,a,d}.
of(X,X).

\\F\\

>

5.

__
and

find

the capacity

Section7.3

and Minimal

Flows

Maximal

653

Cuts

\342\200\242
D

Figure

4. In

the networkshown

in

7-16.

7-17, find

Figure

at least 7 cuts of

capacity

6.

5. (a)

Consider 4
jobs\342\200\224jj

andy3.

Baker,

people\342\200\224Allen,

Allen has

and./V

j*2 J3>

and

Case,

Baker can do jobsjx andj2.Case

while Dunn can only

peopleto

do

job

can

j4. We wish

Dunn\342\200\224and

the skillto perform


do jobs

to either

jobs

j itj2t

j2 and

j3,

assign the

so that all jobs can be donesimultaneously


jobs
the assignment is impossible.It is assumed
that
at
a
time.
each
can
do
one
Formulate
this
person
only
job
a
what
as
flow
Determine
the
value
of
the
problem
problem.
must
be for all 4 people to be assigned.Determine
a
flow
or

state

maximal

(b)

flow,
and
people, 2 carpenters,a plumber,
and
as
a
as
a
plumber,
carpenter
qualified

that 4

Suppose
person

the

that

who is

for 4 job openings,onein

(1) Explain why

the

(2) Formulate

this

maximal

carpentry

4 jobs will
a flow

as

and

three

apply
in plumbing.

be filled.
problem as in (a) and
not all

flow.

>D

Figure 7-17.

one

find

654

Chapter

7: Network

Flows

Figure 7-18.

.(c) The verticesin


students

and

that

indicates

(1)

Draw a

7-18

Figure

transport networkthat

the 5 teachers canbeassigned

per student,so that


that he or shewants.
(2)

S be

Let

teachers

represent

and

tiyt2ftZytAy

Si,s2,s3,s4>and s5 at an academy.The edge(tifsj)


the student s; would liketo be taught
by teacher

1 teacher
a
teacher
by

5 students,

the

is taught

student

each

the source and D the,sink.Statewhat

k(s2,D) = 1 and

= 1

k(ti,s2)

(3) Find a maximal flow in


(4) Use the maximal flow

this
to

or not

whether

answer

will

to

t5,

k (S,t

i) =

means.

network.
the

arrange

required

teacher-

student assignment.
6. A set of edges in a directed graph G is called an (edge)
if its removal from G breaks all directedpaths
set
from
disconnecting
set C is an a-b
at least one vertex of G. We say that
a disconnecting
set if every directed
path from a to b is brokenby the
disconnecting
of C.

removal

(a) Prove

S-D

every

cut.

7,

A set

of edges

removal from
of

G to

C in a
G breaks

at least

is an

cut

(b) Showthat the set Y


in Figure7-9is an

S-D disconnecting set.


(S,b), (a,c)} for the directed graph
set but is not an S-D
disconnecting

{(S,a),

S-D

directed graph G
all directed

is

an

(edge)

paths from at

one other vertex of G

and

no

cut-set

if its

least onevertex

proper

subset

of C

Section7.3

Flows

Maximal

and Minimal

655

Cuts

\342\226\272
\342\200\242D

7-19.

Figure

paths betweenthe samepair of vertices. Thus, a


a cut-set if C is a disconnecting
set and no
proper subsetof C is a disconnecting set. We say that C is an a-b
cut-setif every directed path from a to b has beenbroken
by the
of C. In Figure 7-19the sets {(S,a),(S,fe)},
removal
{(S,6),(a,c)},
S-D
and {(g,D)} all form
{(c,d)},
{(dye),(d,g),(f,g)l
edge cut-sets.
in a transport
cut-sets
(a) Prove that the class of S-D
edge
all directed

breaks

set C of

in

edges

G is

networkis containedin

the

(b) In the transportnetwork

of

not an S-Dedgecut-set.

Figure

of cuts.
7-19 find

S-D cut

a minimal

that

Prove

(c)

class

cut-set.

8.

an S-D cut that

is

is necessarily an S-D edge

is the set of all edge S-D cut-setsin a network


D arethe sourceand sink. Suppose, moreover,
and
(G,k)
that C is the setof S-Dcuts.We know that E C C and thus, mx =
of
all
min{& (Y) \\ Y is an edge S-D cut-set} = the minimum
>
S-D
of
S-D
cut-sets
is
an
min{fc(X,X)
| (X9X)
capacities
edge
over a larger set is always
the minimum
smaller
cut} = m2 because
in fact,
over a subset of that set. Prove
than
the minimum
that,
E

that

Suppose

where S

rrti

\342\200\224

m2.

F of Example 7.3.5and X = {S,d}, compute F(XyX)


and F(X,X). Do the samefor X = {S,a,c}.
10. (a) If k(e) = 1 for each edge e in a transport network (G,k),find
for the capacity of a cut (X,X).
another
description
If k (e) = 1 for each edgee in (G,k),
(b)
description of
give another
the value of a flow and of a maximal flow.
11.
For
each of the_following examples in Figure 7-20,determine
and (c) k(X,X) whereX = {S,a}.
(a)
(b) F(X,X),
|F|,
9.

For thejlow

In eachof

the

see

how to

maximal flow.

examples,

it is

increase the

to increase the

possible

flow?

If

so,

determine

flow.

Can

the value

you

of a

656

Chapter

7: Network Flows

(2, 0)

(8,6)

Figure

12. Disprove

(4,
\342\200\242

0)
\342\226\272\342\200\242D

7-20.

the following:

network
have the same capacity,
(a) If all the edgesofa transport
then all S-Dcutshave the same capacity.
(b) If F is a flow such that | F | = 0, then F isthe zeroflow.
If all edges in a transport network from
the
source
S are
(c)
then
all
sink
D
into
the
are
saturated.
saturated,
edges
then
(d) If (X,X) is a minimal S-Dcut in a transport
network,
there are no edges in G with capacity
smaller
than C - min

{k(e)\\eG(X,X)l

is a maximal flow, then there are no


than max{F (e)| e is an edge from S}.
in Figure
(f) In the transportjietwork shown
(e)

13.

If F

edges

with

7-21, with

larger

flow

indicated

X = {S,a,fe,c,d}.
capacities, (X,X) is a minimalcut where
to
A
is to be transmitted as messages.We want
set
of words
one
of
word
the
each
of
the
by
representing
possibility
investigate
letters of that word chosensuch that the words can be represented
transmit
is possible,
we
can
a
uniquely. If sucha representation
we
a
want
to
for
word
of
a
instead
letter
message
complete
single
of words,
sets
send. For the following
design a network modeland
is possible.
or not such a representation
determinewhether

(a) {bcd,aef,abef,abdf,abc}
(b)

{ace,bc,dab,df,fe}

(c)

{abc,bde,ac,bc,c}

\342\200\242

Section

Maximal Flows

7.3

657

Cuts

Minimal

and

Figure 7-21.

14.

Let
n elements,
both of
ici and ir2 be two partitions of a set with
which contain exactly r disjoint nonempty
State
a
subsets.
of
necessary and sufficient conditionfor the possibility
n elements such that the r disjoint subsetsin irx as
selectingr of the
well as the r disjoint subsets of tt2 are represented,
4 disjoint
into
(b) The integers 2,3,.. .,20,21are partitioned
subsets according
are
to their remainders
upon division by 4. They
also partitioned
into 4 disjoint subsets according
to the
number of
factors
prime
they contain (counting multiplicity),
(&)

{{2,3,5,7,11,13,17,19},

namely

{16}}. Is it

possible to select 4

representative for
representativefor

each
each

{4,6,9,10,14,15,21},
such
integers

remainder
of
number

possible
possible

{8,12,18,20},

is a
4 and a

there

that

modulo

prime factors?

15. A company
for a carpenter, a mechanic,a plumber,and
advertises
an electrician*The company
The first
four applicants.
interviews
and
an
is a plumber and a carpenter,the seconda mechanic
and
an
a
fourth
electrician, the third a mechanic,and the
carpenter
four
electrician. Can the jobsbefilled by these
applicants?
16. At a party, there are 6 girls and 6 boys. Girl Gx know boys BuB2,Be;
girl G2 knows B2 and B5; girl G3 knows B2fB3,B4;girl G4 knows
while

BUB3,B5;
respectively.

During

girls G5 and G6 know


dance, can

a single

Bl9B6

and B2yB3yB4yB5

each girl dance with

she

a boy

knows?

17. Let

E bea setand

not be
where

are n

.,An

AlfA2y..

disjoint). If we can choosen

at

\302\243
At

for

each

i>

we

then

distinct representatives.

For

different clubs,and it may


precisely
question

be

that

subsets of \302\243
(these
distinct

say that
instance,

all of

the

sets

the members

need

cii,a2t..

we have a

one representative from each club to a


When
is this possible? In the following,

is:

sets

elements

.,a\342\200\236

system of
At may

want

to

be

send

convention.The
use

network

658

Chapter 7: Network

Flows

indicatedsubsetsof E
If so,list

to determine
whether or not the
have
a
{a,6,c,d,e}
system of distinct representatives.

flows

a system.

Ax =

(a)

{a,fa},A2

(b) A! = {a,d},
A2

Az

{a,c,d},

{fe,c},

A4

- {c,d}

{a,fe,c}, A3 - {c,d,e},A4 - {c,d,e}


=
=
(c) Ax
{a,d}, A2
{a,6,c,d,e}, A3 = {d}, A4 - {a,d}
=
(d) Ax
{a,6,c}, A2
[bfd>e},A3 - {a,c}, A4 - {6,c},
A5
=
(e) Ax
{6,d,e},A2
{a,e}, A3 = {c,d},A4 = {cyd\\

Selected

1. The 16

cuts

{c}

7.3

for Section

Answers

\302\253

such

have

8,8,8,9,9,10,11,11,12,13,14,16,

capacities

17,18,19,21.

3. (a)

(4,3)

Figure

value of

The

(b)

6. First,

this

flow

7-22.

is 8.

define
remove all edgesof C to obtain a graph if. Then
S
v of G such
that there is a directed path from

X of vertices

if. The
reached

S-D

a set
to v

in

complement X of X is all verticesof G that cannot be


via a directed path from S in if. Thus^D E X sinceCis an

set of edges (X9X) is_ therefore


a cut.
disconnecting
set^The
Now observe that (X9X)C C.For if (x9y) E (X,X) and (*,y) \302\243
C,
S to y. This directed path is
then
in if, there is a directed path from
the
formed
a directed
by
edge (x,y).
by
path S to x, followed

However, by definition of X> this impliesy\302\243X,a


(x,y) E C and (X,X) C C.

contradiction.

Hence,
7.

(a)

By

C is

6, any S-D disconnectingset


If C is, in fact, an edgecut-setthen_no

Exercise

(X,X).

a disconnectingset. But

set. Thus,C -

(X,X).

the

cut

(X,X)

contains

proper

is a

subset

cut

of

disconnecting

Section

The Max

7.4

Figure 7-16let X

(b) In

a cut

an

not

but

{Sye}. Then

cut-set

edge

{(S,a),(S,6)} disconnecting

Cut

Flow-Min

(X9X) =

659

Theorem

is
{(Sya)y(Syb)y(e,g)}

since the

proper subset,

set.

is_a

of
(X,X) is a minimal cut. If somepropersubset
set
C
then
cut
contains
another
C,
disconnecting
The capacity of ( Y,Y) must be lessthan
the
of
(YyY).
capacity
C (XyX)
and the capacity is the sum of a
(XyX) since (YyY)
subset
of the same numbers. This contradictsthe
fact
that
has
no proper
(XyX) was a minimal cut. Thus, (X,X)
and therefore
must be an edgecut-set.
subsets,
disconnecting
8. Ingeneral,
of a set of numbersis lessthan
to
the
minimum
or_equal
the minimum
of a subset of those
numbers.
Let (X0,X0) be a
minimal S-D cut. By Exercise
is also an S-D edge
7(c)
(X0,X0)
cut-set.Hence,
minimal
cut is contained in E. Thus, m2 >
any

(c)

Supjpose

is a

(X,X)

7.4

THE

CUT THEOREM

FLOW-MIN

MAX

Theorem7.3.1

of any flow, in particular the value


of a minimal
cut. Corollary 7.3.1
revealsthat if^ver thereis a flow F with value equal to the capacity
of
is a minimal cut.
some
cut (XyX)y then F is a maximal flow
and
(X,X)
must
be
|F| = k(X9X)9 then edgesin (X9X)
Corollary7.3.2shows
that

asserts

of a

flow, is at

maximal

value

the

most the capacity

thatjf

must have zero flow. All of these results


reveal properties about maximal flows but do not show how to find a
maximal flow, and, for that matter, they do not guaranteethat a maximal
exists.
All we know at this point is that if certain
conditions
even
flow
these
we
not
know
whether
we
maximal
but
then
have
a
do
flow,
prevail
and edges in (XyX)

saturated

conditions

must

The

prevail

well-known

comes to

always.

Max Flow-Min

Cut theoremof

Theorem 7.4.1. The Max Flow-Min


Cut

transport network, the value


of

and

Fulkerson

of

any

maximal

In

Theorem.

flow is equal

any

to the capacity

cut.

a minimal

This theorem

asserts the following:

(1)

the

existence

(2)

the

existence

(3) the

equality

minimal

In other words,
equality

Ford

our rescue.

for

of a minimal cut (X,X),


of a maximal flow F, and
for any
of
|_F| and k(X,X)

maximal

flow

and

any

cut (XyX).
the

a maximal

inequality

flow and

in Theorem 7.3.1 becomesan


stated
a minimal cut. Moreover,the conditions

660

Chapter

7: Network Flows

stated in Corollary
a minimal

and

flow

7.3.1and 7.3.2do,in

us clearthe deckofthe first two


of a minimal cut is an easy

First, let

essentiallythe ideaexpressed
intermediate

maximal

assertions.

The existence
with

for a

hold

always

fact,

cut.

in

are

there

vertices,

For a

7.3.3.

Example

2n

the proof is
transport network

to observe;

thing

of these

subsets

possible

eachofthese sets with the source S


vertices. By combining
we have 2n possible sets X not containing the sink D.Thereare, therefore,
2n S-D cuts (X,X). Each of these cutshas
an associated
and the
capacity,
of all S-D cuts obviously contains a smallestnumber.
set of capacities
cut with this minimum capacity is a minimal cut. Of course,
it is
Any
minimal
cuts.
possible that there are severaldifferent
of a flow with maximal
The existence
value is only slightly more
the proof requires a few morefacts suchasthe following:
but
difficult,
intermediate

A of numbers

A set

(i)

an

with

(ii) If

{bn} are
a +
then
limn_\342\200\236
bn,
and

{an}

facts are not

If these

existenceofa maximal
Here will sketch the
than or equal to the

and

FlyF2y^

of

{an}

and

bn).

take for

must

granted the

proof of (3).

(2). Since the value of all flows is less


of
any cut in G, the set 7 of all values
capacity
the
least
bound
of
in (G,k) is bounded above.Let Vhe
7.
Let
upper
\342\200\242
\342\200\242
of flows so that the limit of the values
be a sequence
| Fn \\
./n>\302\253\342\200\242
we

flows

and a = lim,,.^ an

to the

proceed

upper boundL

a sequence

L, and

reader

the

familiar,

of

value

two sequences
b = limn_0O(an
+

flow

has a least

bound

upper

and this numberL is the limiting


in A, that is, linv^ an =
numbers

proof of
of

isV.

We

how to

indicate

considerthe
{Fn{x,y)}
Since

flows

may
are

there

construct a flow
for

Fn(x,y)

not approach
only finitely

V. For

value

with

n. The

all possible

each edge

sequence of

(x,y)

numbers

a limit, but a subsequenceof them does.


one
many edges in (G,k), we can choose

has a limiting value


such that the set of numbers
{Fn(xty)}
for
an edge (x,y) let F(x,y) equal to the
for all edges (x,y) in G. Then
limitof Fn(x9y) as n approaches infinity,
where
Fn ranges over the flowsin
the chosensubsequence.
Itisfairly easy to see that F is a flow whose value
is V. Thus, F is a maximalflow.

subsequence

Two

Basic

Ways
Before

to Increase
proceeding

flow-min cut
clearer.

the Value of Flows


to

the

theorem, let us

proof
discuss

of the
some

final

ideas

of

assertion

that

will

make

the
the

max
proof

Section 7.4

There are two


basic ways to

(i) If

an

more

of the commodity
If an edge is working

(ii)

edge

and redirect in

illustrate

us by

against

try

to send

more

some of the commodity


reduce the flow along

sending

we could try to

the source,

toward

could

is, two

that

it.

through

back

us

Let

to capacity,we

being used

is not

edge

the value of flows,


toward the sink.

to increase
ways
of a commodity

basic

move

661

Cut Theorem

Flow-Min

Max

The

this

a more practicaldirection.
an example.

by considering

Example 7.4.1. Considerthe network


shown in Figure 7-23.

indicated

with

capacities

and

flow F

Suppose

that

and

(d,D).

by a
We

we

In other

to increase the flow along the edges(S,a),(a,d)


words, we are increasingthe flow in the path S-a-d-D

decide

certain amount t.
decide

must

most the capacity,

how
the

large this number


of (S,a) cannot

flow

k(S,a)
Similarly,

the

flow

from

a to

be.

can

Since

be increasedby

the flow is
more

at

than

- F(S,a) = 5-3 = 2.
d and from

to D

cannot

morethan

k(a,d) -

F(ayd)

= 6

6-0

and

= 3,

k(dyD) -F(d,D)=6-3
a
\342\200\242

(3,

(3, 3)

3)

Figure 7-23.

c
\342\226\272
\342\200\242

be increased by

662

Chapter

7: Network

Flows

(3, 3)

Figure

7-24.

Since we wish to increasethe flows


all three
along
edges by
the same amount t, the largestpossible
value
for t is the smallest of these
that
threenumbers,
the flow of each edge
is, t = min{2,6,3} = 2. Increasing
in the path S-a-d-D by 2 yields the flow Fx shown in Figure 7-24.
Noticethat the value of Fx is 8 while the value of F was 6. We know
flow? We answer this
then that F was not a maximal flow. Is Fx a maximal
respectively.

by attempting to increasethe flow along unsaturated


edges.
Consider the path S-b-c-D.Eachedgealong
this
is unsaturated,
path
or in other words,eachedgealong
this
has
slack.
path
positive
The slackof (S,6),(6,c)and (c,d) is respectively:
k(S,b)

- Fx(S9b)= 5-3 = 2

1-0
k(b,c)-Ffac)
=
k(c9D)
FfaD) 6-3

= 1

Increasing

the

flow of

then yieldsthe flow

F2

each edge on the path


indicated

in Figure

Figure 7-25.

S-b-c-D

7-25.

by

min{2,l,3}

= 1

Section7.4

Max

The

of

capacity

cut

the

impliesthat F2

to D

from

is a

this

fact,

is a

flow.

maximal

This example suggeststhe following


the value of the flow F:
(1) Choose any

simple directed path P = {elfe2,..


,,ek}

(3) Increasethe value

of

the

for increasing

method

\"greedy\"

the sink D whereeachedgeex is


Calculate the slack of each edge
these numbers.

(2)

663

Cut Theorem

that does not traverse a saturated


maximal
flow since |jF2| = 9 and the
last_flow
(X,X), where X = {S,b}y is also 9. Thus, Corollary 7.3.1

Now there is no path

edge.In

Flow-Min

from

source

the

minimum

S to

unsaturated.

e, in

flow of

P, and

let t

each edge ev

of

be

the

path

of

P by t.

this
method
produced a maximal
\"greedy\"
But unfortunately this technique doesnot always
In fact, in
a maximal flow, as indicated in the following
example.
produce
the next example,thereareno S-D paths made up of unsaturated edges,
soin this case,we take an alternative approach at increasing the value of
certain
the flow by actually decreasing the flows
along
edges that may be

Repeated application of
in

flow

7.4.1.

Example

working against thetotal flow.


7.4.2.

Example

shown in Figure
We

should

because

is, it

doing
would

Let

F denote

the

flow

indicated

in

the

network

7-26.

of
not,
so would
decrease

course, decrease
decrease the flow
the value
of F).

Figure

F(S,a)y F(S,b)y F(a,D), F(b,D)


out
of S or the flow into D (that
Our only choice, therefore,is to

7-26.

664

Chapter

7:

Flows

Network

F(a,b) by some amount

to decrease

attempt

F{S,b)+ F(a,6)
=

- F(a,b)

F{S,a)
if

to

we

decrease

avoid

A(S,6) -

by t.

F(S,b)-

and (a9D)

so (S,6)

cannot

choose t =

follows

that

decreasing

t,

and F(S,b) by
of

F(afb)

\302\243

flow can

the

by

and

tt

Now
-

and A(a,D) -

- 2

can be increasedby

Moreover,sinceF(a,b)

F(a,b)

and

+ F(a,D),

increasing F(S,b) by

F(a,D)

increasing

F(b,D)

we must
also increase F(ayD)
by \302\243,
F(b,D) and F(S,a). Hence, the value

F(a,b)

decreasing

be increased by

t. Since

the

minimum

F(a,D)=6-3

of {2,3}. Hence,

3,

t < 2.

a flow cannot take on negative values,


we can
by more than 1. Thus, we see that
1.
the new flow Fx indicated in Figure 7-27.
we
obtain
where
Fx is a maximal flow because \\FX\\ = 7 = k(X,X)
be

1 and

decreased

Then

It

X = {S,M.

In orderto

the

generalize

the

reconsider

edges

process

whose flows

in the last example,let us


illustrated
were changed. Noticethat the edges
a directed
path from S to D. But, of

(a,D) do not form


do form a nondirectedS-Dpath. In particular,
notice
if we reverse the direction of the edgewhose
that
flow
we decreased,
we
would obtain a new edge that togetherwith
and
(S,b)
(a9D) form a
directed S-D path.
(S,6),

course,

(a,6), and
these

edges

Perhaps

another

example

will

be instructive.

Figure 7-27.

Section7.4

The

Max

Cut Theorem

Flow-Min

665

Figure 7-28.

Example 7.4.3. Considerthe indicatedflow

shown

in Figure

7-28.

Consider the path


respectively

the

flowFx

Now
could

and 5.

(Figure

7-29).

directed

every

nondirected
be

S-a-c-D;

2,1,

path
reversed

the

slacks

Increase the

flow

by

of (S,a), (a>c)>and (c,D) are,


1 along these edges to obtain

S-D path containsa saturated edge.But the


that the directionof the edge(c,6)

S-b-c-D is such
to form a directed

S-D path with

the

other

2 edges

(S,b)

and (c,D). The2 units of flow along (c,b) we view as working


the
against
total flow. Note that 2 is the minimum
of the
of
slack of (S,6), the flow
the flow along (S9b) and (c,D)
(c,6), and the slack of (c,D), sowe increase
2 units
and decrease the flow along_(c,fe)by 2 units to obtain the flow
by
X = {S,a,M so that F2 is a
7-30). Now| F21 = 9 = k(X,X),where
F2 (Figure
maximal flow.

Figure

7-29.

666

Chapter 7: Network

Flows

(5,5)

>D

Figure 7-30.

These examplessuggestthe following

7.4.1.
Suppose that (G,k)
sink D. Suppose,moreover,
that

Definition

S and

source

definition.

is a transportnetwork

Recall that a nondirectedpath

eue2,..

.,en

et in

G is

a sequence

and

directed

from

Vi_x

F is

P from S to D
of vertices S = vQ,vly..
to i;, or from v( to Vi_x.
is directed
from Vi_Y

a flow in the

is a sequenceof edges

path

The

each

edge

i;,;

path (or a

flow-

for F) if

(i) for each forward

(ii) for

where the edge


e, is called a
otherwise,
e, is a

= D

.9un

forward edge of P if it
to
reverse or backward edge ofP.
A
P is defined
to be an F-augmenting
path
augmenting

with

network.

edge

backward

P, F(e) < k(e)yand


e of P, F(e) > 0.

e of

edge

In otherwords, a path P is an F-augmenting path


are unsaturated and all backwardedgeshave
positive
In order to state the next lemma
let us formulate
augmenting path in yet
For any path P, let
k(ei)

the

definition

of an

= the slacks(e{)

- F(et)
j

F(e,)

edges

flow.

form.

another

\342\202\254,-(P)

forward

all

iff

if e,
if

is a

ex is

forward edge of P.
backward edge of P.

Then
note
that e(P) is
associate
the number e(P) = min \342\202\254t(P).
P
In
the
is an
a
number.
path
always
particular,
nonnegative
iff
>
0.
e(P)
F-augmenting path
For example, if F is the first
flow
of Example
7.4.1, then the path P^
= 0 since
the edge (ayc) is
S-a-c-Dis not F-augmenting
because
\342\202\254(Pj)
saturated.But,on the other hand, the path P2: S-b-c-Dis F-augmenting
of
becausee(P2) = 1 (here each edge was an unsaturated forward
edge
With

p2).

P,

The Max

Section 7.4

is the

If F

in

flow

F-augmenting

unsaturated and the backward

the path P: S-b-a-Dis


edges (Syb) and (ayD) are
has positive flow. The number

forward
(a,b)

edge

667

then

7.4.2,

Example
two
the

because

Cut Theorem

Flow-Min

\342\202\254(P)

{s(Syb),F(ayb)ys(ayD)}

= min

{2,1,3}= 1.

in Example
7.4.3 was F-augmenting because
S-a-c-D,
= 2.
\342\202\254(PX)
path Px: S-b-c-D is Fraugmentingbecause
to state
and prove the
Now we have the machinery and terminology

The
e(P)

= min

P:

path

1. The

following lemma.

Lemma 7.4.1.
is an
defined by
If P

F.

that

Suppose

F(e) =

F(e)

F(e)

- e(P)

if e

e(P)

F(e)
is a flow

with

is a

(G,k)

F-augmentingpath in G

value

|F |

is a

transport network
S to

from

Dy

then

forward edge of

if

e is

a backward

if

e is

an edge

with

function

the

flow

edge of P

of G not in P

+ e(P).

Note that F is obtainedby

the flow by e(P) along forward


increasing
decreasing the flow along backwardedgesofP, and leaving
flow unchanged
on all other edgesof G.
edges

of P,

Proof.
Let P be the sequence of edges elye2>-.
.,en
= D.
vertices S = v0yvu..
.9vn
To prove F is a flow with value | F \\ + e(P)y we must show

(a) 0 < F(e) < k(e) for

all

e in

edges

(b)

P(x,V(G))-P(V(G),x)

|F|

G and
+

the

that

GY

ifx
\342\202\254(P)

|P|-\342\202\254(P)

through

the

= S

ifjC=D

ifx^SorD.

that (a) holds,note that F(e,-) 4- e(P) < /e(et) for each forward
P since by definition e(P) < s(et) = fe(ej)
P(ei). Likewise,
e(P)> 0 for each backward edge et since e(P) < P(et).
F(ei)
To prove (b), observe that we need only check for vertices x on P
if x = vt is
because for all other verticesF and F are equal. Furthermore,
To see

edge

ei of

668

Chapter

7:

Flows

Network

recall that
the flow. If the
on P,

only on the two

edgeeM =

e, and

ei+x touching vt do we change


forward
edge of P, then
of
ei+l
(^+1,1;,) is a backward

edges

F(ei+1)=

is a

(viyvi+1)

other hand, if
edge
F(ei+l)
=
then
P,
F(el+1) - e(P).In eithercase, the result of replacing F
F(ei+1)
by F on this edgeel+1 is to increase the net flow out of i;,by c(P).
with regard to the edgee,joining
to i\\- end up
the
v^i
changes
Similarly,
flow
of
the
net
flow
out
of v{ is 0 +
the
net
out
c(P).
Thus,
v( by
decreasing
if i ^ 0 or n; the net flow out of u0 = S is | F\\ +
is zero,
e(P) - e(P), which
- \\F\\ - e(P). Thus, F is a flow and its value is
e(P) and out of un = D is
n
+
\342\202\254(p).
ifi
On the

e(P).

from Lemma

It follows

path, then F is
converseholds.

The

(3)

7.4.2.

Lemma

the

that

such

(X,X)

If a transport network
has a flow F with
value
(G,k)
either contains an F-augmenting path or a cut
capacity k (X,X) - | F |.

network

the

|F|,_then

theoremand containsa proofofassertion

before.

we mentioned

that

of this

proof

F admits an augmenting
a flow
The next lemma showsthat the
lemma contains the main idea of the
if

flow.

max-flow min-cut

of the

proof

7.4.1that

maximal

not

Proof. First,
=

XQ

there

a collection
we
construct
Then
define
as
the
set of all
{S}.
Xx
is a directed edge (S,y) in
such

E(G)

that in the definition

other words, Xx
S,y could be the

is the

Supposenext
set of

the

F(x,y) <
^o>^i>This
vertices

set of

is no

that

edge (y,S)

vertices y such that

that

Xlf..

.,Xk_x

k(x,y) or elsethereis an

been defined.

have

edge

Xk_x and such that y

with

(y,x)

has not

such

In

flow.

positive

the sequenceof

such that eitherthereis an

Recall

< k(S,y).

F(S,y)

start of an F-augmentingpath.

all vertices y

some

there

flow

of

of subsets of V(G). Define


vertices y G V(G)such that

vertices

Then define Xk

edge

(xyy)

such

>0

that F(y,x)

already

been

as

that

chosen

for

in

\342\200\242
->Xk-i*

becausethe

of construction must terminate


process
D belongs
is finite. Either we will find
to Xn
n or we will not.

number

for some

of

positive

integer

Case 1. If D E Xny then D arose from some xn_x E Xn_lt because


in the
of flow there can
definition
f(xn_l9D) < k(xn_uD). (Recallthat
be no outgoing edge from D with positive flow.) Similarly jcn_j arose
< k(xn_2,xn_l) or
from
some xn_2 E Xn_2
where
either
F(xn_2,xn_l)
S = x0.
reach
>
in
we
0.
this
manner,
eventually
F(xn_l9xn_2)
Continuing
=
D
the
of
of
Then the sequenceof verticesS = x0,Xi,..
is
set
\\ertices
.,xn
an

F-augmenting

path.

The Max

Section 7.4

Flow-Min

669

Cut Theorem

If D doesnot belong to Xn for any positive integern, let X =


S G X and Dj\302\243 X, the set of edges (X,X) form
an S-D
U^xXn.
cut. Moreover, if (x,y) E (X,X), thenF(:c,y)=_fe(jc,y)
otherwise
(since
;y
of (X,X),
would
be in X). If__(y9x)
then F(y,x) = 0.
edge
is_any
- F(X,X) = fc(X,X).But Theorem7.3.1
F(X,X)
Consequently,
implies
7.3.1
that F
F(X,X)
|F|
gives the conclusion
F(X,X),_andCorollary
is a maximalflow and (X,X) is a minimal cut. \342\226\241
Case 2.

Since

Now
we have all the machinery to make the proofof assertion
(3) of the
max flow-min cut theoremof Fordand Fulkerson
easy.
F is a maximal flow. By Lemma
7.4.1, F admits no_augmenting
Suppose
the network
cut (X,X) such that
7.4.2,
path, so by_Lemma
contains^
=
which
of
that
is
means,
course,
(X,X) a minimalcut.This
|F| k(X,X),
and
the
concludesthe proof of assertion
(3),
proof of the theoremis

complete. D

In

Theorem 7.4.1 we proved two lemmas


of proving
that
of
maximal
We
characterization
flows.
state
the
another
together
give
combination of Lemmas7.4.1and 7.4.2 as a corollary to Theorem 7.4.1.
the

course

Corollary 7.4.1.

flow

F is

maximal

iff

there

is no

F-augmenting

path from StoD.

If F isa maximalflow,
to

D. Nevertheless,

then

there

there may be

are no

flow-augmenting paths

intermediate verticesv

and

from

paths

such that e(P) > 0.In otherwords,


while
it is not possible to
the
flow
from
S
to
it
is
to
D>
possible augment the flow from S to
augment
in Case 2 in the proof of Lemma
v. In fact, the set X defined
7.4.2 is the
set of all such verticesv ^ D for which the flow can be augmented
from S
to v. The proof concludes that for this definition of X, the set (X,X) is a
minimal cut.
the maximal
flow in Example 7.4.3. The set X
Consider,for example,
in
defined
above
this
f
or
the
case, {S,a},
is,
(S,a) is unsaturated and
edge
S
a.
constitutesa flow-augmenting
from
to
For the maximalflow of
path
the
set
X
is
. Example
7.3.4,
{S,a,6}.
7.4.1
is of fundamental
Corollary
importance in the study of network
flow because
of a
it says, in essence, that in order to increasethe value
kinds
flow we need only look for improvements
of the two restricted
mentioned earlierin the section or in the definition of an augmenting
7.3.2
The combination of Theorem 7.4.1and
path.
Corollary
gives a
useful characterization of minimal cuts.
from Stov

670

Chapter

7: Network

Flows

Figure 7-31.

Corollary 7.4.2.
is such that

cut

is a

(X,X)

minimal cut

iff

every

maximal

flow F

an

(i) F(e) = k(e) for each edge e G_(X,X),


(ii) F(e) - 0 for each edge e E (X,X).

and

Suppose that (X,X) is a minimal cut and


(xyy) has positive slack and positive
edge

F is

are in the same^half\"


in X or both in X.

of

Example 7.4.4. In
7-31,

find

a maximal

Considerthe
along all
edge

(c,b)

the

to obtain

edges

all minimal

path

and

flow,

cut (X,X),

with

network

flow and

augmenting

forward

minimal

any

a maximal flow. Then if


it must be that x and y

that is, x and y

indicated

cuts.

the flow shown in Figure 7-32.

Figure

flow shown in

both

Figure

We increase the flow by


the flow by 1 along the backward

S-a-d-c-b-D.

decrease

are

7-32.

Section

The Max Flow-Min

7.4

of
Clearly this flow F ismaximalbecausethe value
of the cut (X,X)
where X = {S}isalso6.

this

671

Theorem

Cut

flow is

6 and the

capacity

To

cuts

minimum

all

find

Corollary 7.4.2. If

wejuse

of

(Y,Y) is

any

by the maximal
flow
F and all edges of (YyY)
must
have
none of the
Onflow. Therefore,
in
in
can
be
either
or
(YyY)
(y,y).
Thus, if a G Y,
edges(a,d),(d,c),(fa,c)
in
and
d
also
Y.
then
must
be
if
fa
E
so are_a,d, c in
then
fa, c,
Y,
Similarly,
for
d.
likewise
in
Y
is
or Y for any
either
Y;
Therefore, {a,fa,c,d}
cjmd
minimal

cut,

minimal cut

all edges

then

only two

are

there

Thus,

(YyY).

(YtY)

saturated

be

must

possibilities

for

minimal

cuts:

({S,a,fa,c,d},{D})and

(i)

(ii) ({S},{a,fa,c,d,L>})..

Sinceeachcut has

these

the

are

only

capacity

6, each

minimal

cuts.

of these

of a Maximal Flow

Construction
The

proof

7.'4.1as
algorithm

well

for

cut theorem, and especiallyLemma


7.4.1, 7.4.2, and 7.4.3, suggests the following
the value of the flow in a network.

max flow-min

of

the

as

Examples

increasing

7.4.1.

Algorithm

with
a given flow F.
Input: a transport network
a
maximal
flow.
Output:
1 and 2 below until step 1 finds
no
steps
Repeat

augmenting

1. Choose an F-augmentingpath
Form a new flow of higher value

the augmenting

if

2.

paths,

augmenting

then the output

whetheror not the algorithm


In their book,Flows in
an exampleof a network
algorithm

does

not

of

terminates even for


flow

even

in the

in

fact,

be

a maximal
then

terminates

with

irrational

more general

if the

flow. The
is a crucial

we shall
of
each
edgeis an
capacity
7.4.1,

capacities

case.

due

does

question as to

show

integer.

that

the
There

and Karp, that


thus constructs a maximal

to Edmonds
and

algorithm

one.
Fulkerson produced
for which the above

Nevertheless,

if the

Algorithm

are no more flowthe


above
algorithm will
by

[48], Ford and


irrational capacities

Networks

path.

there

7.4.2. In otherwords,

will

terminate.

does terminate

algorithm
is a modification

F and

the flow constructed

flow by Lemma

a maximal

terminate

then

path.

possible.
using

If there is ever a stage where,


be

two cuts is minimal,therefore

672

Chapter

7: Network

Flows

Theorem
is

(Gyk)

an

7.4.2.

If the capacity

integer,

then

edge in a transport network


7.4.1 terminates after at most

each

of

Algorithm

2\342\202\254<=E(G)k(e)steps.

a sequenceof flows F0,Flf...,


such that
is
an
and
the
integer
integer,
sequenceof
|P;|
is strictly
values
we
let
be
the
zero
First,
flow, that is,
increasing.
F0
=
0
for
each
e.
next
we
that
have
constructed
F0(e)
edge
Suppose
Fk. If
there is an Fk-augmentingpath P, then
minimum
of
a set
the
e(P)y
being
is
a
of positive
The
new
flow
integers,
positive integer.
by
Fk+1 guaranteed
Lemma 7.4.1 has value
and Fk+l(e) is an integer for each edge
| Fk | + e(P),
e since Fk+1(e) is definedto be eitherFk(e)
+ e(P),
Fk(e) - e(P), or Fk(e)
to
whether
e
is
a
forward
or
backward
according
edge of P or an edge not
Start

Proof.

by constructing

Fi(e) is an

in P.

each

for

flow,

Since
+

\\Fh\\<\\Fk\\+l*\\FM\\-\\Fk\\

(X,X) and k(X,X)

any cut

for

2e<=E{G)k(e)

neW

floWS.

of this

A corollary

<

e(P)*k(XJ[)

find

can

we

2ee\302\243(G)&(e),

proof follows.

If
Theorem 7.4.3. (Integrality of FlowsTheorem).

of a

transport

maximalflow

network

(Gyk)

that F(e)

F such

Let us apply

at most

\342\226\241

Algorithm

7.4.1

has

an

capacity,

integer

is an integer for
to the

each

edge

each

edge

then there
e of G.

is a

following example.

Example 7.4.5. Find a maximalflow

the

for

shown

network

in

Figure 7-33.

First we

look

for

an augmenting
path where,
have
to be unsaturated).

forward edges (and they

Figure

7-33.

if

possible,

The path

all

edges

are

Px:S-c-d-Dis

Section

The Max

7.4

a path;
flow by

the

the

of the

slack

minimum

673

Theorem

7-34.

Figure

such

(7,6)

Cut

Flow-Min

edges along Px is

3 units along the edgesof Ply

we

3. By

increasing

the flow Fx

obtain

shown in

Figure 7-34.
Thus,

no other directed S-D paths


for augmenting paths with some

are

there

Now

we look

edgesmust have
be
must
unsaturated.)
edges

that backward

backward

and,

flow,

positive

unsaturated

with

edges.

edges.

of course,

(Recall

the forward

the flow by 1 along the path S-c-d-b-e-D,


by
and
to obtain
S-a-f-e-D,
by 2 alongthe path S-a-f-b-e-D
the flows shown in Figures 7-35,7-36,
and
7-37
respectively.
Note the decrease in the flow
1
unit
by
along edge (fe,d) in Figure
we augment

Sequentially

2 along

the path

7-35.

Note

in the

decrease

the

units along the edge(e,/)in

flow by 2

Figure

7-36.

Note

the decrease in

7-37.
There

are

no

more

the

flow

by

2 units

along the

paths from

augmenting

(7,

Figure

7)

7-35.

edge (b,f) in Figure

S to D because(S,a) is

674

Chapter7: Network

Flows

Figure

7-36.

(7. 7)

7-37.

Figure

the
saturated and both edges out of c are saturated.
last indicated
Thus,
flow is maximal. Of course,we could
also argue that this flow is maximal
the
of this final flow is 29 and that the capacity
value
of
by observing_that
the cut (X,X)f where X = {S,c}
is also
us
determine
all minimal
If
cuts as we did in Example7.4.6.
is a minimal
(XyX)
cut, thenjione of the edges(a,/),
(e,-D),

29.

Infact,let

are

(b,d)AS,c)

e G_X, b

U (X,X)i. In fact, sinceD G X,

G_X, / G X, and a G X. Moreover,

(X,X) U
the
minimal
(X,X),

only

A Labeling

(bj), (6,e),

in (XJf)

it follows

that

<E

X.

Thus,

S E

since

if X

it

follows

X and

= {S,c},then

that

(S,c) $

(X,X) is

cut.

Algorithm*

To establishthat a given flow F is maximal, we must verify


that
there
For graphs
(Gyk).
flow-augmenting paths in the transportnetwork
with few vertices and edgeswe usually
can determine
by inspection that
are no

*The

discussion

from

here to

the end of

the

section

may be

omitted.

Section7.4

Max

The

675

Cut Theorem

Flow-Min

exist.
But for larger graphs, inspectionaloneis
reason, we introduce a labelingalgorithm.
in agreement with
vertices
we label
the
definition
of the sets
Basically,
7.4.2.
In other words, first we
.,Xk used in the proof of Lemma
X0f
Xl9..
label the source and then we label other vertices recursively according

no flow-augmenting

paths

this

For

sufficient.

not

to the following

is an

thereare

edge e in

the

network

transport

where

is unlabeled

y. Then

x and

connecting

we follow:

rules

two

been labeledand a vertexy

x has

a vertex

Suppose

there

scheme.

If e = (x,y) (sothat e is directed from x to y),


then a labelingfor y is possible if F(e) < k(e). In otherwords, y receives a
in a flow augmenting path.
label if the edge e is a forward
edge
Backward Labeling: If, on the other hand, e = (y,x) and F(e) > 0
(sothat (y,x) is a backward edge), then y receivesa label.
Forward

Labeling:

In either
label

for

label x,

y the

assign

case,

vertex to

which y is adjacent.(Other
as an

such

the name of

indicator signifying whether

edge, but we shall becontentwith


in
The information this labelingsucceeds

backward

been labeledthereisa F-augmenting


the
that a
vertex
y indicates

constructedby
the

using

first

case may

indicatethat

been

has

as a

x and y
In

be.

labeled

We

with the

or

forward

label.)

since x has

is this:

x, and the labelx on


from
S to y can be
path
S
from
to x and then
path
or

forward

use

e is a

simpler

the

a backward

a predecessorof

words, x is

other

in the

be included

S to

from

path

labeled

previously

conveying

flow-augmenting

path from S to y.

flow-augmenting

the

the flow-augmenting

using

e between

edge

whatever the

the

could

information

edge
y

on

Pred(y) = x to

notation

label x and a flow-augmenting

through x.

to the proof of
back
By
referring
x is labeled, x belongsto somesetXk_x for
k and then the possibilityof labeling
that y G Xk.
some
y means
As in the proofof Lemma7.4.2
two
cases
themselves:
either the
present
a label,
sink D receivesa labelor not. If D receives
then a flowaugmentingpath from S to D is possible and the labelon D indicates the
can be found by
predecessor of D on sucha path.A flow-augmenting
path
=
- Pred
= D,
the
vertices
Pred(D), W2
Wly
Pred(Wi)
using
W0
=
=
S
soon
until
we
find
and
Pred( W*_i) as the
(Pred(D)),
Wk
eventually
exists

path

from

Lemma7.4.2,we

predecessor

S to y

see

of some

that

vertex

discovera flow-augmenting

e(P)

by

which

is

we augment

Wk_x

path

in

the

P we

the flow F

sequence.

can easily

Of course, should we
determine the amount

to producea flow

of

larger

the other hand, it is impossible


to give
maximal and the set X of all labeledverticesis such
a minimal cut.
If, on

flow

since

F is

a label,

then the
that

value.

present
(X,X)

676

Chapter

Flows

7: Network

The

algorithm

as presently describedwill

discover

successfully

path or determine that F is a maximalflow, but the


flow-augmenting
an indexing
is nondeterministic as it stands. Let us incorporate
algorithm
deterministic.
of the vertices soas to make the labeling
algorithm
Say S =
= D is an
S is first and D is last
indexing of the verticeswhere
v0,Vi,...,vn

in the ordering.This
vertices order to label
Now let

us give

them.

a formal

of the

description

labeling algorithm.

Algorithm 7.4.2. Determining

Whether

Input: a transport

network

indexingofthe verticesS

(G,k)
=

Output: a flow-augmenting

labeled,

the

source

S with

the

sink

4.

<t>

(to

go to

S and

source
=
Dt and
.,vn
with

a given

that

indicate

S has

Step 5.

be

until

label

the

Pred(D) =
Wk

no predecessor).

If no

examined.)

But if

continue.

is labeled,
Vj

with

5. If

(G9k).

exists.

v0; otherwise,

no unexaminedverticesareavailable,
stop.
of a vertex.) For j = 1 to
(Examination
If

F in

that none

conclusion

or the

sink D and an

flow

vertices have been


choose the vertex vt of smallest
which has not been examined.
Seti\\ = x and go to Step 4. If
to

vertex

choose

index

v0,vu..
path

1. Label source
D is
2. If the
3. (Choosea
examined,

Flow-

Exists.

Path

Augmenting

we examinethe

by which

a priority

establish

will

in

jc. Set
u,

let

is not
Uj

Pred(u;) = x. Return

W0 =

for some

D,

Wx

k. Then a

n,

labeled

v, W2

to

Step

do

the

and can

following:

be, label vj

2.

- Pred(u). Continue
path

flow-augmenting

is

WkfWk-l9...fWuW0-D.

Example 7.4.6. Let us


whether or not a flow-augmenting
Figure 7-38.

apply

the

labeling

path

exists

to determine
network shown in

algorithm
in the

Letus order the vertices v0 = Su vx = a, v2 = bt vs = c, v4 = d, v5 = D.


at Step 3 of the labelingalgorithm,
First we label S with </>. Then
we
see
S is the lowest labeled vertex not yet
At Step
that
examined.
4, we
consider verticesa and c. We cannot
label
can
c
but
we
label
with
the
a,
S. Thus, Pred(c) = S.
label
Returning to Step2, sincethe sink D is not labeled we proceedto Step
3.The labeled vertex with smallest index not yet examinedis c.At Step 4,
we consider the vertices a, fe, and d. The vertices a and d cannotreceive
labels,but b can; label b with the label c sothat Pred(6) = c.
is not
labeled,
again we proceed to
Returning to Step 2, sincethe sink
b. At Step
3.
The
not
examinedis
labeled
vertex
of lowest index
Step
yet

Section

The Max

7.4

\342\226\272
o.

7-38.

Figure

4, we

observe that a, d, and D are unlabeled

be labeledby

backward

receivelabels.

We

with

labelihg
to Step

return

and

2.

and

receive

d can

Choose d

W0 = D,
V^4

Step

4, label

2, D
Step
- Pred(D)
= ctW5 =

at

Now

the forward

as the labeledvertex

vertices.At
W,

Pred(6)

Onlyx d

examine.

to

vertex

to b. Now a can
but d and D cannot

adjacent

the label b,

Again, since the sink is not labeled,we

chosenas the

677

Theorem

(4, 2)

\342\200\242

Cut

Flow-Min

go

to

Step

is unlabeled

this case, a is
and adjacentto a,

3. In

label a. Return to Step2 and


of

with

smallest
the

then
to Step 3.
with unlabeled adjacent
label d. Return to Step 2.

index

forward

has received a
= d, W2 = Pred(d)

label d and
= a, Wz

by

5,

Step

- Pred(a) = 6,

a flow-augmenting
Pred(c) = S determine

path

P:S-c-b-a-d-D.

Of course, we can now

determine

the present
augment
all
over
process
again.
can

Exercises

flow and

that e(P) = 1, and we


by inspection
erase all labelsand start the labeling

for Section 7.4

1.

Find

(a)

a maximal

flow and

a minimal

cut in the following

networks:

678

Chapter 7: Network

Flows

(b)

(3,0)

(4. 0)

(c)

>D

(d)

\342\200\242D

(e)

<D

*-\342\200\242

d.O)

\\D

The Max

Section 7.4

Cut Theorem

679

(g)

(f)

Flow-Min

(5,0)

*->D

\342\200\242
D

(4, 0)

(h)

2. Findtwo
indicated

maximal

flows

for the

network shown in Figure 7-39with

capacities.

Figure

7-39.

680

Chapter7: Network
3.

Flows

a, 6,

Vertices

units respectively,

and

a flow

Find

units.

and c in Figure 7-40have


satisfying

Cities
while

a, 6,
cities

Transportation

(a)
(b)

Draw

supplies

i and

7-40.

Figure

4.

of 30, 30, and 20


30 and 50
have
demands
j
the demands (if possible).

vertices

and c can supply

15, 25, and 45 units of merchandise,


h
and
require 20, 25, and 15 units,
/, g,
respectively.
links are illustrated in Figure 7-41.
a transport
that reflects total supply and
network

demand.
Find

a maximal

(c) How many


and cities

flow.
of merchandise

units

/,

g>

and

h receive

should cities
so that as much

a,

fe,

and

c send

merchandiseas

possibleis transported?

5.

Use

Corollary

7.4.2

to show

that

(a) (X9X),whereX = {S,c},


isthe only
of Example7.4.5.

minimal

cut

in the

network

Section

The Max

7.4

Flow-Min

Cut

681

Theorem

Figure 7-41.

isthe only
(b) (X,X), whereX = {Stb,d},
7.4.
Section
l(a)jn
(c)

(X,X)

and

(7,7),

where

minimal

cut

of Exercise

= {S,a,fe,c,d,e,/}, and

are the only minimal cuts of


1(b) of Section_7.4.
and
(Z,Z) are the only minimal
(X,X),
(YyY),
network of Exercise 1(e) of Section7.4,where
{S,a,b9cfd},

network

the

of

Exercise

(d)

Y={Syayc},Z={S,a\\.

6. Find all minimal

(a)

cuts

in the

following networks:

of the
= {S,a,6,c},

cuts
X

682

Chapter

7: Network

Flows

(b)

(4, 4)

(c)

7. Supposethat 7 kinds of equipmentaretobeflown to a destination


of each kind of equipment
by 5 cargo planes. There are 4 units
and the 5 planescan carry 7, 7, 6, 4, and 4 units, respectively.
Determinea loading
so that no 2 units of the samekind
are on
plan
the same plane. Hint: see Exercise5 of Section7.2;use
the
a maximal flow.
to determine
algorithm
8. Use
7.4.2 to prove that if (X,X)
and (Y,Y) are minimal
Corollary
U
X
U
H
H Y) are also minimal
then
and
X
(X Y,
Y)
(X
cuts,
Y,

cuts.

9. Suppose

F is a maximal flow in a transport network


that
Let
(G,k).
in
be
minimal
cut
and
X
2
let
be
the
set
defined
Case
of
(Y,Y)
any
the
of
7.4.2.
X
Y.
Lemma
Prove
that
C
Hint:
use
Exercise
8
proof

and Corollary 7.4.2.

10.

X of residents
set
belong to various clubs Cu C2, C3, C4, and to
four disjoint politicalpartiesPl9 P2, P3, and PA as depicted
by
Figure 7-42. Suppose that each club must chooseone of its
membersto represent
no person can represent more than
it, and
oneclub,no matter how many clubs he belongs to. How should one
A so that
choose a system of distinct representatives
| A C\\ Pj \\ = 1
for eachy = 1, 2, 3? Hint:setup a flow problem.
11. Let (G,k) be a transport network
that (X,X)
is a
and
suppose
minimal cut in G.Prove
or disprove:
(a) If Ft and F2 are flowsjn
(G,k) such that Fx(e) = F2(e)for each
flows.
F2 are maximal
edge e in (XfX) U (X,X), then F1and
A

Section7.4

The

Flow-Min

Max

683

Cut Theorem

Figure 7-42.

(b) If Fx

and

maximal

F2 are

edgee\302\243(X,X)

12.

Suppose

that

is

(Gyk)

capacities.
Suppose
(vk-uvk) is a directed

flows, then

(e)

network

transport
where

fc-cycle

F in

ex

ufc

G where

(iV->i)>
=

with

v0. Prove

F(et) = 0 for

edge

integer

^2 = (vi9v2)9

=
\342\200\242
\342\200\242
^k

or disprove
some

that

i.

or disprove. If F is a flow in a transport_network


(Gyk) and
(X,X) is a cut such that k(X,X)
>\\F\\y then (X,X) is not a minimal
cut
and F is not a maximal flow.
four
Four
instructors
for
A, B, C, and D are available
teaching
A is
Instructor
courses: algebra, biology, chemistry, and physics.
trained in biology and chemistry;B is qualified
to teach
algebra
and D
and physics; C can teach algebra,
and
chemistry;
biology,
can teach chemistry.

13. Prove

14.

for each

= F2(e)

(X,X).

further that

there is a maximalflow

Fx

(a) Modelthe

conditions

as

a transport

network.

684

Chapter7: Network

Flows

(b)

Use the

concept of maximal

the

instructors

four

15. True or false?SupposeF is a

(a) If F is

then

maximal,

flow along

nonzero

have

flow

so that

courses

four

he is

which

is an S-D cut.
with nonzero capacity

and

(X9X)

edge

every

or not

whether

determine

to the

obligedto teacha subjectfor

will be

no instructor
not trained.

to

flow

be assigned

can

will

it.

then
(b) If F(X,X) is equalto k(X,X),
for
a cut (X,X),
(c) If |F| = k(XyX)

(X,X)

cut.

is a_minimal

is a

then (X,X)

minimal

cut.
if the
along an edge can be negative
edge goes
_
__
= k{XyX), thenF(X,X) = 0.
If F(X,X)
(e)
_ =
If | F\\ = k(X,X) for a cut (X,X),then
0.
( f)
F(XyX)
one
maximal
flow in a network, then
(g) If there is more than

(d)

flow F(e)

The

backward.

there isjnore
one
minimal
cut.
If F(X,X) = F(X,X),
F is a maximal flow.
= 0 for all
(i) If |F\\= 0,
F(e)
edges e.
S to D, then F(e)
from
whenever
directly
(j) Ife
k(e)
than

(h)

then

then

F is

\302\253

runs

maximal.

(k)

cut

(X,X)

for some flows

be minimal

may

but

for

not

others.
of the cut
(1) The flow across a cut can be larger than the capacity
if there is someflow back fromX
to X.
(m) If F is a maximalflow and (X,X) is any cut, then F(e) = 0 for
any
edge e E (X,X).
network
have the same capacity,
(n) If all the edgesof a transport

thenall S-D
e = (a,b) is

have

cuts

(o) If

(p)

same

ayb

are

capacity,

and F(e) > 0 for some


edge
in X for any minimal
both

S-D

(X,X).

all edges
maximal.
If

(q) If

the

unsaturated

F, then

maximal_flow

cut

an

of a

network are saturated,then

(X,X) is a minimal cut,

then

all

is

(X,X)

a minimal

cut, then

in

edges

saturated.

(r) If

the

is

flow

(X,X)

are

all edges in (X,X) have

zero

flow.

Selected

Answers

1.

(a)

for Section
Use
shown

the
in

cut is (X9X)

7.4

paths S-a-c-D,
augmenting
7-43. The value of the
Figure
where

- {S,fe,d}.

S-b-d-D, and S-b-c-D


flow

is 9

and

a minimal

Section7.4

Max

The

Using

the

d-f-Dy

and

augmenting

7-44.The
(c)

by

7-43.

paths S-a-c-e-D, S-a-b-d-f-DfS-b-

= {S,a,6,c,d,e,/}.

Increase the flow


and
the
flow
decrease
edges
by 1 along
A
to
obtain
a
of
value
flow
8.
minimal
cut is
edge (a,d)
the

Consider

the

685

we obtain the flow shown in Figure


of (XyX)
is
flow is 8, and the capacity

S-a-c-e-f-D,
value
of this

also 8, where X

Cut Theorem

(6, 4)

Figure

(b)

Flow-Min

1 along

augmenting

path S-b-d-a-c-D.

the forward

determined

by

(d) Augment the flow


S-a-d-b-e
along

= {S,a,6,c,d}.
2 units

by

along S-c-e-D

to obtain a

then (XfX)
{S,a,6,c,d,e},

is a

flow

minimal

of

and then by

value

16.

Let

1 unit

X =

cut.

(e) Augment by 1 unit along the path S-a-c-Dand then by 1 unit


along S-b-d-D to obtain a flow of value 2. A minimal cut is

determined

by

3. Not

= {S,a,6,c}.

possible, a maximal flow

S-a-d-f-i-Dy

S-a-d-g-i-Dy

has

value

S-a-d-e-g-i-D,

S-b-a-d-e-h-j-D.

Figure 7-44.

50. For

example, use paths

S-b-e-h-j-D,

S-c-e-h-j-Dy

686

Chapter

Flows

7: Network

If (Y,Y) is a minimal cut,

5. (b)

then

flow

maximal

the

using

indicated in answer 1(a), notejthat none


of the
edges (a,c),
(b9d), (c,D), (S,b) can be in (YyY) or in (Y^). Since S G Y, it
D G Y, c G Yand a G Y
that b E Yand_d G Y Since
follows
Y =

Thus,

(d) Using

Y-

and

{Sybyd\\

{a,c,D}.

the maximal flow


a

of

(since S

cut (Y,Y)

minimal

answer

that

we see

1(d),

G Yand^S,a)is not

for

any

it

saturated),

Yand (dyD) unsaturated


impliesthat d G Y. The cut (ZyZ) where Z = {S,a}satisfiesthe
of Corollary
conclusion
7.4.2, so it must be a minimal cut. We
determine
the other
minimal cuts by considering the 2 cases
b or c is in Y If b G Y, then
c must also be in Y since
whether
6 G Yis the only
the edge (6,c) is unsaturated. Then c G Yand
be that

must

D G

\302\243_Y-Likewise,

other case.

9. See

Ford

10.

Fulkerson's

and

Find a maximal

a sink;

and

a source

Introduce

book,

7.5 APPLICATIONS:

of

capacity

is such

each

1.

edge

a set.

HALLS

AND

MATCHING

make the

= {aua3,a6,a9}

flow.

[48] page 13.

Flows in Networks

THEOREM

MARRIAGE

In the exercisesand examplesof Chapter


several problemslike the onesthat follow.
The

Problem.

Assignment
certain

for

to

position

has a

Each applicant

applicants.

suitable

which

assignments

The

Committee

company
of

list*

he or
be

has

Is it possible to
she is suited? If not,what
to

the

have

n positions
which
qualifications

positions.

people that can be assigned

these

7 we

positions?

encountered

to

fill

and

make him

assign eachapplicantto a
is the

largest

And finally:

number

of

How should

made?

Problem

(or System of

Distinct

there are n people


{CUC2,.. .,Cm}.(The committees
{p!,p2,..
.,pj belonging
neednot be disjoint.) When is it possible to selecta chairpersonfor each
In other
committee?
one
committee
so that no member chairs morethan
m
of
distinct
a
when
is
it
select
to
words,
representatives
system
possible
for the different
of distinct representatives is a
committees?
(A system
set of m distinct people {pj^Pj2,Pjz^ . .,P;J whereph E Ct.)
Representatives

Problem).

In

to

These problems

certain

organization

m committees

can be given

another

twist.

This

version is known

as

Section7.5

m girls
The Marriage Problem. Given
can all the girls be married provided
she doesnot know?

and
no

conditions

of these

All

problems can

of
get at the essence

the

each edgeof G

property

another

way:

In

is a

directed graph G
B such that

A and

of B.

vertices

other
of

A0

(i) for

M is

matching

words, the set


A and a subset

each vertex a E

the edge

(a,6)

M with

for G

equals the numberof verticesin


subset

to

costumes,

Let us attempt to

definitions.

subsets

two

what

a boy

no vertices in common. A
edges
is a matching M with a maximal
number
of
for
G
M
is
a
the
complete
matching
matching
having
E M for some b E B. Or to put it
that for each a E Ay(ayb)

matching
maximal
matching

edges.

of

different

many

of them.

graph

bipartite

set of

is a

n boys, under
girl is married to

the following

disjointunion of

vertices

is from

for G

with

directed

is the

of vertices

set

in

in all

elements

problems

Definition 7.5.1.
whose

be dressedup

are certaincommon

but there

687

Marriage Theorem

and Hall's

Matching

Applications:

of

of

M
B such

there

E B0,

Then,

a complete

course,

M is

is a
that

of edges

matching for G

is exactly

M. Moreover,

(ii) for eachvertex b


(a,b) E M.
of

number

the

iff

in M

A.

edges

B0

A0

complete

there is exactly

matching

one vertex

if

there

6EB0 suchthat

onevertexa E A0

iff

A0

is a

such

that

= A.

a directed
The assignment problem can be modeledwith
bipartite
in
in
A
the applicants and the vertices
representing
graph G with vertices
B representing
an
that
the positions. Furthermore,
edge (a,6)signifies
calls for
a is qualified for position 6.The assignment
problem
applicant

whether or not there is a completematching.


determining
of edges
we
are
asked to determine the number
that,

But

in a

failing

maximal

matching. Finally, we are to exhibita maximalmatching.


The
other
can also be modeledby a bipartite
graph. For the
problems
and
the committees
committee problemwe let the vertices of A represent
b
that
the vertices of B the people. Then an edge (a,6) signifies
person
of
distinct
In
committee
a.
a
to
this
context, system
belongs
representatives
is nothing
more than a complete matching.
the girls,
Of
in the marriage problem the verticesof A represent
course,
the vertices of B representthe boys,
and
an edge
(a,6) conveys the
6.
information
that
a
knows
boy
girl

688

Chapter

Basic

Flows

7: Network

for Solutions of the Problems

Strategy

have

we

While

directed

bipartite

them. Of

course,

exercises, we

been able to model each of these problems


with
a
for any of
graph, we have not yet determineda solution
solved
versions
of these problems in the
having
simpler

have

insight into how we will


to extendour bipartitegraph
to a

gained

already

will be

our strategy

Basically,

and then apply the maximal


flow-minimal
the transport networkas follows:

network

We design

sink D and edges (S,a) and


Moreover, we assignthe capacity
network.

a matching

call

| A | = 4 and |
The next theorem

where

B| = 5

the disjoint union

from

vertices

matching

(a)

in

is

(b)

(c)

A flow

matched

and

be a directed bipartitegraph
whose
vertex
A and B such that each edgeof G is
in J3. Let (G*,k) denote the associated

gives

matching
the
flow

a maximal matching for G.


matching
| is a complete

whose value is | A

Proof. Let F be
oGA

network

networksand flows.

network (G*,k) gives a


to a vertex b E B iff

flow

maximal

matching

7-45).

Then

A flow in the

a E
isl.

a source S and a
a E A and each b E B.
This resulting networkwe
adjoin

subsets

vertices

to

of

theorem.

cut
We

Let us illustrate onesuch

(Figure

Let G

set is

network.

for each
to all edges.

relates matching

7.5.1.

Theorem

(b,D)

proceed.

transport

flow

b E B~ Then

in

(G*,fc).

the only

Figure

edge

Suppose that
a is (S,a)

into

7-45.

for G. A vertex
across edge (a,fc)

for G.

F(a,b) = 1, where
and it must be that

Section

7.5

Applications:

F(S,a) = 1,or in
out of a is 1 and
which

other
F(a,b)

= 1.

F(afx)

and Hall's

Matching

the flow
words,
= 1, (a,b) is

Similarly the

Marriage Theorem

into a is 1.Moreover,
since
the only edge of the form

only

of the

edge

form (x,b)

689

the

flow

(a,x)

for

such that

F(x,b) = 1isthe edge(a,6).Thus, if M = {edges (a,6) where a E A and b


(E B and F(a>b) = l}, thenthe edges
of M have
no vertices in common and
M is a matchingfor G.
the
fact that the number of
Parts
(b) and (c) follow immediatelyfrom
verticesof A matched with vertices of B is the value of the flow F.
a maximal
Of course, sincea maximalflow produces
matching, we can
to
the
network and
the
path
matching
apply
algorithm
flow-augmenting

determinea maximal

matching.

Complete

\342\226\241

Matchings

matching in a directed bipartite graph is obtainedprecisely


of the flow in the associated matching networkis | A |. Let
us show how to use this fact to producea proofof a famous
theorem
known as Hall's Marriage Theorem.Firstwe need some terminology.
with
vertex
set equal to the
Suppose G is a directed bipartitegraph
disjoint union of A and B where each edge of G is from vertices of A to
of J3. Then if C C A, let R(C)
be the subset of B of all vertices
vertices
in C, that is, R(C) = {b G B | (a,6) is an edge in G
incident
from
vertices
for
some
a E C|. Of course,if G has a complete
matching, then we must
< | R(C) | for all subsets C C A. In other
have
words, each subset of k
| C |
elementsof A is incident to at least k elementsof B if G has a complete
C of A, as
|, for all subsets
matching. We refer to the condition|C| < | R(C)
the matching
condition.
For the assignment problem,the matching
that for all m applicants to be assigned,then
condition
for
each
says
of k applicants there must be at leastk job positions
for which
subset
they collectively qualify.
in 1935. Later it was discovered
P. Hall proved
the
theorem
marriage
that Konig and Egervary
had
an equivalent
version in 1931, but
proved
an earlier theorem that Menger
both theoremswere immediate
from
in 1927.
others had priority, we continueto refer to the
proved
Though
A complete

when

value

the

theorem
by

its

familiar

name.

HalPs
7.5.2.
graph whose vertex

Theorem
bipartite

whereeachedgeof G is from
completematchingfor G ifF|
We have

Proof.
matchingthen

the

matching

Marriage Theorem. LetG be


union
of subsets
set is the disjoint
in
vertices
C | < | R(C)

vertices

to

in B.

A and B
There exists a

| for each subsetC of

already observed that


condition holds.

if

there

is a

a directed

A.

complete

690

Chapter

Flows

7: Network

C of A. Let A
Suppose that | C | < | R(C)| for each subset
B = l^!,.. .,6j, and_let (G*,k) be the
associated
matching

.,am},
network.
the value of
{aly..

Finally, assume (XyX) is a minimal cut in (G *yk). Obviously,


any flow cannot exceed m. Thus,if we can show that k(XyX) > my then a
maximal
flow will have value m and the matching correspondingto this
will

flow

be a

(consult

I
II

matching.

complete

After a changeof

7-46),

Figure

write X = {Syaiy..
.,as,6x,...,6J.Then
three types of edges.

we may

notation

(XyX) has

m-s edges from S


t edges from bly..

to as+ly...,am,
.,bt to Dy

and

III

We

edges
need

{alv . .,aj.

from aly..

estimate

only

Then

.,as to 6t+1,...,6n.

by

the

the disjoint union of

Wx

the number

matching
and W2,

condition

where

Wx

of edges of type
s = | C \\ < | R(C)
= R(C)

C\\

III.
Let C
|. Now 7?(C)
.,fcj and W^2

{bly..

Cut(X,

X)

of type

edges

type
Figure

of
III

7-46.

_^

/ edges
of type

m-5 edges

is

II

Section

7.5

Applications:

R(C)

Pi

\\W1\\^tand\\W1\\

\\

W2\\

equal to (m -

than or

The

s)

t +

gives a

corollary

following

a complete

Marriage

691

Theorem

= \\R(C) | > s
of the number

k(XyX)> m sincethe sum

greater

Hall's

of edges of type III is just | W2 |. Note


implies| W2\\ > s - t. Therefore,
of edges of types I, II,and III is

number

The

.,fej.

{bt+l9..

and

Matching

(s

- t) = m.

\342\226\241

sufficient conditionfor

existence

the

of

matching.

G whose
vertex
set is the
Corollary 7.5.1. In a bipartitegraph
B
of
A
where
each
of
G
union
and
is
from
vertices
of A to
edge
disjoint
for
G
if
is
vertices of B, thereexistsa complete
there
an
matching
integer

that

such

vertex in A
vertex in B

every

(i)

every

(ii)

is adjacent
to k or more verticesin B and
is adjacent to k or lessverticesin A.

Given a subset C of A, there


are at least k \\ C | edges
Proof.
from C to
J3.Sinceat most k edgesgo to any element of J3, the number of elements
= |C|. Thus, |R(C) \\ >
C is at least k\\C\\
of B can be reached from
(1/k)
\342\226\241

\\C\\.

committee
problem, if each committee has at least k
k
is permitted to belong to more than
individual
find
then
is
to
a
for
it
committees,
separate
chairperson
always possible
if every
each committee. Likewise,in the marriageproblem,
girl knows at
the

in

Thus,

no

and

members

is
least k boys and every
boy
be married to a boy she knows.
Exercises

1.

each

girl

can

6 partners and 6 important clients.Each partner


with two of the clients,and each client has
relationship

a good

a good

relationship

with

eachpartnerto a
relationship?Explain.
different

2.

most k girls,then

has

firm

law

has

by at

7.5

Section

for

known

David,

Cindy,

Bob,

Andy,

2 of

the

client

partners.

and Myrtie

children to school.Andy

drive their

whom

with

can

Is it possible to assign
he or she has a good

wish to
drive!

form

a car

Mondays

pool

to

or

Mondays or Wednesdays, Cindy can drive


or
David can drive Wednesdaysor Fridays,
Tuesdays
Thursdays,
and
can
drive
Thursdays or Fridays.
Myrtie
Draw
a
this situation.
to
model
(a)
graph
Use
show
that a complete matching exists.
7.5.1
to
(b)
Corollary

Tuesdays,

(c)

Bob

Find

can

one

drive

such

compleie

matching.

692

Chapter7: Network
3.

Flows

A is qualified for jobs Jl9 J2, and J6; B is qualified


Applicant
J6; C is qualified for jobsJx and
J4,
</5, and
J3,
jobs
qualified
for
for
Jl9 J29 </4, J6> and J7;
Jl9 </3, and J6; E is qualified
for J4 and J6; and G is qualified
for J3, Jb9 and J7.
qualified

J5;Dis

(a) Model this problemasa matching


(b) Find a maximal matching.

(c) Is therea

project. The house

agreed to fix

Brian

curtains;

can clean
that
Assuming
match

will

5.

Anna

can paint
can paint,

as a

house

old

and move furniture;


wallpaper, and move

made.
Jody canmakenew

and

words {bcd,aefg,abef,abdf,abc,cdeg}
to represent each word by one
will

be uniquely

Myrtie

furniture;

wallpaper.

assignment
that
jobs

it possible

word so that the words

church charity
cleaned. In

and
wallpapered,
and new curtains

and wallpaper; and Joecanpaint


each does a different job, give
an
as many people as possible with

of code

set

transmitted.
Is

an

painted,
be moved

must

furniture

that

network.

be

must

addition,
Suppose

F is

matching?

complete

students have

4. Five

for

of tasks
they

that

can do.

is to be
of the

represented?

in the
If so, how?

letters

6. Five students,Sl9

S29 S3> S49 and S5, are members of four


and
C2, C3,
C4. The membersof Cx are Sl9 S3, and S4;C2 has
and
S3
S5; Sl9S4,and S5belongto C3; and Sl9 S29 S3, and S5

committees,Cu

members

belong to C4. Each committeeis to send a representativeto a

banquet.No

can

student

represent

two committees.

network.
(a) Model this problemasa matching
is
the
of
What
a
maximal
(b)
interpretation
matching?
of a complete matching?
(c) What is the interpretation

(d) Find a maximalmatching.


(e)

Is

there

a complete

7. Six senators,Si,S2,

S3,

The committees

are

S4, S5, and S6, are


=
C\\
{S2,S3,o4},

C4

~ {Sl9S29Si9S6}9

each committee

are to be reviewed

committee.

5 distinct

{Sl9S29S59S6}9

Can

tasks?

If so,

and C5 -

senators

membersof5 committees.
^2 = t*Si,S5,og}, C3 =
{Sl9S29S3l

The

activities

a senator

who is

be selected

for the

by

of

not on the
reviewing

how?

are mn couplesat a dance.The men are divided into m


to their
according
ages. The
groups with n men in each group
n groups
with m women in each group
into
women are alsodivided
m couples can be chosenso
Show
that
accordingto their heights.
that every age and every height will be represented.
The prison
Six persons Pi,P2>.. .,P6 are held in a foreign
prison.
into
cells so that
warden wishesto keep the prisoners
separated
that
inmates cannot understand each other.Suppose
Px speaks

8. There

9.

matching?

Section 7.5

Chinese, French,and Hebrew;


and
Italian; P3 speaks
English

Spanish;

P5

P2

be lockedin 2 cellssuch

6 prisoners

these

same cell would

in the

inmates

German, Hebrew, and


speaks
French; P4 speaks Chinese and
and German; and P6 speaks Italianand

English

speaks

Could

Spanish.

be

able

11.

Suppose

knowing

anything

apply

applicants

about

the

for n jobs

of his

where m > n. Without


can you determine

qualifications,

whether or not thereisa complete


matching?
If every girl in school has k boyfriends
and
k girlfriends,is it possiblefor each girl to
with
of her boyfriends
one
and for each boy
one

Explain.

go to the
to

or

disprove.

go to

school has

schooldance

the dance

with

Explain.

girlfriends?

Corollary7.5.1.

Prove

boy in

every

12. Give an exampleof a directedbipartitegraph


the
conditions
matching but does not satisfy

13.

no

that

a language

to understand

the othersspeak?

10.

693

Marriage Theorem

and Hail's

Matching

Applications:

Any

matching

that

a complete
and
(ii) of
(i)
has

is contained in a maximal

matching.

14. There

are

compatible

with

15.

of the

with

with

a compatible

computers
m disk

and
drives

n disk drives.
and each disk

Is it possible
computers.
*
disk drive?

Each computeris

drive is compatible

to match each computer

Latin rectangle, where r < n, is an r x n matrix that has


the numbers1,2,...,nas entries such that no number appears more
than oncein the same row or the same column.A Latin square is an
n x n Latin rectangle. If r < n show that it is always possible to
r rows
L to form ann x n
to an r x n Latin rectangle
append n \342\200\224
Latin square. Hint: do the following:
of L and let B =
Let A = {alv . .,an}denote the setofcolumns
(a)
a directed
{l,.. .,n}.Design
(at,fc)
edges
bipartite
graph G with
where k does not appear in columna; of L.
that there is a complete matching for the matching
(b) Show
Anrxn

network

determined

(c) Interpret what

by G.

a complete

matching

means in this

context.

16. Let G be a directed bipartite graph with vertex set V equal to the
disjoint union of subset A and B where each edge of G is from
=
vertices
of A to vertices of B. Definethe deficiency
of G as d(G)
max {|C | - |jR(C) | such that C C A}.
(a) Showthat G has a complete matching iff d(G) = 0.
for G. Show that the
(b) Obtain the matching network
(G*,k)
or equalto | A \\ than
is
of
in
cut
(G *,k)
greater
capacity any
d(G).

694

Chapter 7: Network

Flows

that the maximum number of vertices


of A that can
of B is | A \\ \342\200\224
be matched with vertices
d(G).
whose
vertex
Let G be a directed bipartitegraph
set is the disjoint
A and B where each edge of G is from vertices of A
union of subsets
of B. Suppose that there are 4 or more edges incident
to vertices
from each vertex of A and, moreover,
suppose that there are 7 or
incident
to each vertex in B. Prove that the deficiency
fewer
edges
Conclude

(c)

17.

14.

< 6if|A|<

d(G)

18. Let G be a directedbipartitegraph

Exercise17.

of A and 5 or fewer edges incidentto eachvertex


that d(G) < 2 if | A | < 10.

Prove
A

telephone
incoming

through

are

line is

3 groups

connected so that it

trunks.

trunks,

and a

II

group

that

lines

trunks

can be

most 6.
(a)

Describe

(b)

Determine

a directed

definition
(c)

(d)

of

in all.

outgoing

outgoing
the number

Moreover,

model for G for

bound for

d(G).

See

this

problem.

15 for

problem

the

d(G).

How many of the 60


outgoing trunks?
At
least
how many calls

incominglines
will

be

routed

to

connected

be

will

to outgoing

there are callsat all 6ft incoming lines?


20. Thirty manufacturers use a certain type
of
their microcomputers. There are 24 electronics
make this type of circuit. Becausetransportation
the computer manufacturers would like to buy
nearby

outgoing

of two

one

to

group

switched to an outgoing trunk is at

bipartite

an upper

of eight

one

to

switched to one of four

line canbeswitched

trunks. There are48outgoing


incoming

and III of 20 lineseach.A

can be switched

can be

line

group III

I, II,

B.

in

to route phone calls


The 60 incominglines

was built
network
to outgoing trunks.

switching
lines
into

partitioned

of

sets A and B as in
edges incidentfrom

vertex

or more

vertex

each

19.

with

are 4

there

that

Suppose

trunks when

that

companies
costs
their

in

circuit

miniature

are

circuits

high,
from

electronics companies.

The computermanufacturers

are
into 3
partitioned
10 members each. Manufacturers in category
within
50 miles
of 4 electronics companies, category
manufacturers
are
within
50 miles of 2 electronics
and
1
HI
of
within
50
miles
electronics
manufacturers
are
only
category
50 miles of more than
is within
company.No
company
is able
to supply
3 manufacturers and no
company

with

transportation
categories

are

more
(a)

II
companies,

electronics
electronics
than 1 manufacturer.
a directed

Describe

(b) Show that

bipartite

d(G)< 10.

graph model for

this

problem.

Section

7.5

695

Theorem

Conclude that at least 20 supply


contracts
can
be signed
between the computer manufacturersand electronics
are within
50 miles of each other.
companiesthat

(c)

21.

and Hall's Marriage

Matching

Applications:

Let

network

a transport

be

(G,k)

ofG.

with

k(e)

each edge

1 for

that
the value of a maximal flow
is
to the
equal
maximum number of edge-disjointdirectedS-Dpaths
in G.
Show that the capacityofa minimalcut in (Gyk) is equal to the
minimum
of edges
number
whose deletion destroys all
Show

(a)

(b)

directed S-Dpaths.

in a directed
Let x and y be two vertices
Theorem,)
(Menger's
number
of edge-disjoint
graph G. Prove that the maximum
directed x-y paths in G is equalto the minimum
of
number
in G.
edges whose deletion destroys all directed x-y paths
(d) (Konig's Theorem,) Let G be a directed
bipartite graph whose
A and B where each
vertex set is the disjoint
of subsets
union
edgeof G is from vertices of A to vertices of B. Then the
number of edgesin a maximum
is equal to the
matching
minimum
of vertices
that cover all edges. (A set of
number
cover all the edgesof G if each edge is incident with at
vertices
as a
least
one of them.) Hint: Obtain Konig'sTheorem
(c)

restatement

of

aua29..

.,tfm in

bub2,..

of B
.,6\342\200\236

let

be an

there

column of M
(a)

(c).

part

an m x n matrix, M, constructa

22. Given

corresponding

edge

from

is nonzero.

a, to 6;

a matching

what

Interpret

to the

corresponding

Prove
maximum

graph

of M

and

with
with

G,

in the

jth

entry

means in this

(b) Expand to a matchingnetwork


meaning of a minimal cut in (G *,&).
(c)

rows

columns of M. Inthe graph


the

iff

bipartite

the

to

ith

and

row

context.
and

(G*,k)

the

interpret

the

Theorem: In any matrix,


the Konig-Egervary
of nonzero
entries such that no two are in
row
or column
is equal to the minimum
number
of rows
columns that between
contain
all
the
nonzero

the

number

same

them

and
entries.

Selected

for Section 7.5

Answers

5.

Design

{a,b,c,d,eyf,g}yand
in the
11. Apply

15. See

Liu

network

matching

edgesfrom

code word. Obtain

Corollary 7.5.1.
[26]

p. 286.

with
a code

a maximal

word
flow.

{code

to a

letter

words},
if

the

B
letter

=is

696

Chapter 7: Network

Flows

consider the subgraph


For any CCA
vertices in C, those in R(C) and edgesbetween

18.

number of

in this

edges

of

the

of

consisting

two.

Let e

the

= the

Then 41C | < e < 51R(C)


|. Thus,
= max{|C|-

subgraph.

|C|-|/?(C)|<l/5|C|<2since|C|<10.Sinced(G)

\\R(C)\\},d(G)*2.

19. SeeLiu
21. See
REVIEW

p. 289.

[26]

Bondy and Murty

FOR CHAPTER

1. In the

[4]

203-204.

pp.

7
with

network

flow shown

indicated

in Figure

7-47,

determine:

(a)

(b) F(X9X)
(c) the value
2. There
,

and

traffic,

and k(X,X)for
a maximal

of

= {S9a}9 and

flow.

to city D, onepassesthrough
passes through city C. During the lunch
average trip times are:

are two

routes

from

city A

the other
the

to

B: 15

to

C: 30

city
hour

minutes
minutes

B to D: 15minutes
C to D: 15 minutes

The

maximum

to

B: 1000

to

C: 2000

capacities

of the

routes are:

vehicles
vehicles

B to D: 3000vehicles
C to D: 2000 vehicles

**\342\200\242\302\243>

Figure

7-47.

Section

7.5

and Hail's

Matching

Applications:

697

Marriage Theorem

(15,15)
7-48.

Figure

the flow

Represent

of traffic from

A to

the lunch hour as a

D during

transport

network.

3.

If a transport
network has
sink D, how many
S-D
cuts

4. In the transportnetwork
(a) Find a maximal flow.
List

(c)

Find

paths P that you find to increase


the value e(P) for each path.

that

common

is jin

(X,X)

(X,X)
with

any

the

cut (X,X).

a minimal

that

S and

source

7-48:

in Figure

shown

(d) Determine all minimal

5. Suppose

the

are there?

all flow-augmenting
value of the flow, showing

(b)

Prove

10 verticesincluding

cuts.
(G,k).

edges

in

in G.

circuit

directed

6. There are 50 girlsand

a transport network
of
containan equalnumber

S-D cut in

and (X,X)

Leon High
and
each
has
boys
boy
girl
exactly
4
dated
is
determine
whether
or
not
it
possiblefor
exactly
girls,
to
each
to
school
dated and
the
with
a
she
has
girl
go
banquet
boy
each boy to go with a girl he has dated.
7. Foreach of the following collection of sets, determinewhether or
not thereisa system
of distinct
If no such system
representatives.

School.If each

has

exists,explain

boys

Cx = {a,fe,c},C2 -

{a,d},
C3

8. The six stateuniversities

graduates
training
state corporations
with

wish

but

dictates

that

same

no

university.

senior class at

5 of the

(b) ^ = ^ = 03= M,e},C4

qualifications,

in the

not.

why

(a)

50

dated

have,

in
to

=
=

= {a,d}.
- {a,fe,c,d,e}.

{a}, C4
C5

respectively,

science
computer
hire a total of 48

13, 7, 7, 7, 7, and 7
and economics. Ten

graduates with

these

company policy at-each of the corporations


the
newly hired professionals may be hired from
Explain in terms of Hall's Marriage Theorem

698

Chapter

7: Network

Flows

whether

or not all

48 graduateswill

be

hired

by the

10

corporations.

9.

G be a directed bipartite graph whose


set is the disjoint
vertex
in A to
union of subsets A and B where edge? in G are from vertices
from
vertices in B. Supposethat thereare3ormore
incident
edges
that there are 7 or fewer
each vertex in A, and moreover,
suppose
in B. If | A | < 50, find
an upper
bound
edgesincidentto eachvertex
for the deficiency of G.
Let

and

Representation

of

Manipulation

Imprecision

8.1

FUZZY

8.1.1

SETS

Fuzzy

and

Sets\342\200\224Notation

Fuzzy

set theory,

Terminology

introduced by Zadeh in 1965,is a generalization

of

set theory.

abstract

set consistsof objectsand their respective


grades of
grade of membership of an objectin the fuzzy set
The value of
is given by a subjectivelydefined
function.
membership
0 to 1 where the
the grade of membership
of an object can range from
is to 0, the
and the closerthe value
value of 1 denotes
full membership,
in
weaker is the object'smembership
the
set.
fuzzy
sets
we
In our discussion of representation and manipulationof fuzzy
follow
closely the excellent presentations in Zemankova-Leechand
A fuzzy

in
membership

the

set. The

Kandel[51]

and

Zadeh

[50],

as well

Approximate ReasoningInferenceEngine
Ruspini [46].

Definition 8.1.1. Let U


generic
by

element
membership

the

example

interesting
(ARIES)

by

Appelbaum

of an
and

the
of discourse, with
characterized
F
is
of
U
fuzzy
with each
which
associates
mF: U \342\200\224\342\226\272
[0,1],

of U denoted
function

as^

be

the

by u. A

universe

subset

element u of U a number mF(u)representingthe gradeof


u in F. Fis denotedas {(u,mF(u))
U\\*
\\ u G

membership

of

699

700

Chapter8: Representation

and

Other widely

of Imprecision

Manipulation

used notations are:

F= I

F = mF(wi)/t/i

when

U is

a finite

or

elements.
set of

is the

points in U at

is positive.

mF(u)

The height

8.1.3.

Definition
mF(u)

(8.1.1)

mF(un)/un

set of n

countable

a continuum

\342\200\242
\342\200\242
\342\200\242
+

8.1.2. The support of

Definition
which

U is

when

mF(u)/u

over

of

is the

least upper

bound of

Uy

- lubmF(u).
uGU

hgt(F)

A fuzzy

8.1.4.

Definition

set F

(8.1.3)

is said to be normal if

its

height

is

unity, that is, if


= 1.

lubmF(u)

uEU

Otherwise

F may

be

F is subnormal.
normalized

or

nonfuzzy

contained

in

iff

may

be

be

noted

a subnormal fuzzy

that

a fuzzy

subset of

U, and let Bbeanother


of B or is

subset of U. A is a subset
(ordinary)
mA(u) < mB(u) for all elementsu of U> that
A C

Example 8.1.1.

\302\253-

set

mF by hgt(F).)

by dividing

Definition 8.1.5. LetA


fuzzy

(It

mA{u)

< mB(u),

u E

U.

is,

(8.1.4)

U be the interval
Let
universe
of discourse
the
in
u
as
[-20,110]
interpreted
temperature degreesFahrenheit.To
a fuzzy
to be able to
define
it is convenient
subset A of U labeled WARM,
whose
the
function
as
a
standard
function
express
mA
membership
of
the
be
the
to
reflect
parameters may
subjectivity
adjusted
of
characteristic
A standard
subset
function.
function of this type that maps a fuzzy
a real line onto the interval
is
which
a
is
the
S-function,
piecewise
[0,1]
with

Section

8.1

quadratic function

701

Sets

Fuzzy

definedas follows:
= 0

S(u;a,b,c)

for

\\c

< a

for a

<u<b

a]

(8.1.5)
for

b <

u <

for

w >

\342\200\224(H)1

= 1

and
where the parameters a and c are the lower
upper
fuzzy subset
interval bounds, respectively,and the parameterb = (a + c)/2 is the
crossover point, that is,the value of u at which S(u; aybyc) = 0.5.
subset
WARM
can be subjectively
Using the S-function, the fuzzy
= S(u;
characterized by the membershipfunction
60,70,80) or
mAl(u)
= S(u;
where
was
a
from
Florida
45,60,75)
by
person
given
mA2(w)
mAl(u)
Maine
the concept
of \"warm\"
whereas a person from
expressed
by
functions
and
Figure 8-1 shows the graphs of membership
mA2(u).
mAl(u)
mA2(u).
= 0.5 whereas
Notice that mAl(70)
mAa(70) = 0.9 with the interpretation

the degree of agreement with


be 0.5 for the personfrom
Florida
that

the

statement

as compared

\"70\302\260F

to 0.9

is

would

warm\"

for the personfrom

Maine.

crossover

The

points

for

mAl(u)

and

mA2(u)

are

70 and

60,

respectively.

The

(60,110] whereasA2 has mM(u)


since hgt(A^ = hgt(A2)
<
for all u in U, hence Ax
general, mAi(u) mA2(u)
support

Both Ax
In

and

of Ax is

A2 are

normal

> 0
=

on (45,110].

1.

is a

subset

wwurm(w)

Figure

8-1.

Membership

function of

a fuzzy

subset

WARM.

of A2.

702

Chapter 8: Representationand

8.1.2.

Example
8.1.1)

below

of imprecision

Manipulation

B of

subset

fuzzy

the universe

mB(u)

- S(u;

that is,
to)

for

C labeled

subset

fuzzy

by a

be characterized

30

45 <

for

8.1.3.

Example

given

for 30 < u < 45

-w
(temperature)can

u <

for

-i-W
=

Example

S-function

30,45,60)

mB(u) = 1

equal

U (from

defined in terms of the


labeled
and the correspondinggraph in Figure8-2.
can be

COLD

membership

\302\253
C = {setof temperatures
t\\

u <
u

60

> 60.

PLEASANT
of

function

the

\302\253
means

(where

normal

class,

approximately

with

= exp

mc(u)

(~((u

- t)/b)2)

all

for

real

u.

(8.1.6)

of \302\253.
The parameter b providesthe degree
of fuzziness
Let
us consider
functions given by a Floridian and
membership
which are graphed in Figure 8-3:
personfrom Maine, respectively

mCl(u)
mC2(u)

It can

be observed

from

- 74)/6)2)

exp

exp(-(U/-68)/12)2).

Figure

(-((u

8-3

that

and

the Floridian

not only likes

Wcold(w)

Figure

8-2.

Membership

function of

a fuzzy

subset

COLD.

Section

8.1

Fuzzy

Sets

703

Wpleasan\302\253(w)

1.0

8-3.

Figure

Membership

fuzzy subset

of a

function

PLEASANT.

but also has a low tolerance for the deviation


the person
\"pleasant\" temperature of 74\302\260F, whereas
F as ideal
Maine considers 68\302\260
and accepts a broader rangeof
warmer

temperatures

the preferred
temperaturesas

+ e.

.6/6

from

\"pleasant.\"

Let U = \\a,bycyd,e},

8.1.4.

Example
d

from

case a fuzzy

In this

+ .9/c

A of

subset

+ .5/d. Herethe support

or equivalently
[/ = a + 6 + c +
U may be representedas A \302\253
+
.3/a
of A = {a,6,c,d}, hgt(A) = .9, henceA

is subnormal.

It is

convenient to

represent a fuzzy
u

integers;

fuzzy

set

.6

.9

.5

labeled

\342\200\2423

Let U =

8.1.5.
a

tabular form:

Ma(u)

Example

in a

definition

set

{u\\u

u >

/,

SMALL

may

0} where / is the set of


be expressed using a

function

mA(u)

Here

the

function
decreasing

support

with

is the

mA(a)

]T

1 +

(8.1.7)

fcfjr/*

interval [ayc]. mA(u)


= 1, linv.^mA(c)

is a

monotonically

= 0, and

the

crossover

point

being 6.

Letting a = 0, c = oo

and

b =

10 yields

the

following

definition

of the

704

Chapter 8: Representation
fuzzy set

and

of Imprecision

Manipulation

SMALL:

SMALL=
with

sample

E[l

(^)2]\"7\302\273'

below:

values given

SMALL

.99

.91

.80

Example 8.1.6.
years. In this caseUisa

Let

terms

be expressed in

of

= {u | 0

.67

<u <

100}with
a fuzzy

and

continuum,

10

12

15

.50

.41

.31

u representing

set

labeled

OLD

age in
may

a function

(8.1.8)
(BUT/-

-*<\302\273>-/\342\200\242[>\342\231\246

mA(u) is a
[a,c] with
u = 6.

monotonicallyincreasingfunction
=

mA(a)

0, linv^mA(c)

= 1

over

Letting the supportbethe interval


[50,100]
at u = 55,the definition
of OLD
becomes

We can find
advantageous

8.1.2

in

and the

various types of membershipfunctions

other

the

interval

support

and the crossoverpoint

is

crossover point

which

at

be

are

of fuzzy sets.

applications

Operations on Fuzzy Sets


the

Throughout

for

max

and min,

a # b

the symbols

discussion,

forthcoming

respectively; thus, for

any

= max (a,6) = a
= 6

real

if

# and

&

stand

a9b
a

> b

if a

<b

if

< b

(8.1.9)

and

&

b =

min

(a,6) =

= 6

Consistent

with

this

notation,

the symbol

if a

>b

(8.1.10)

#z means \"leastupperbound

Section

705

Fuzzy Sets

8.1

over the values

basic

the

Among

and &x should

of z\"

of z\" where z

the values

E Z.

be read as \"greatest
lower

that can

operations

over

bound

be performedon fuzzy

the

are

sets

following:

Definition 8.1.6. The complement ofa fuzzy


~A (or by A) and is defined
by
=

~A

The

label for

B (or

by

The

union

of fuzzy

The

J3) and

A OR

sets,

8.1.8.

Definition

denoted by

B and

Pi

The intersection

interpreted as A
Comment.

operators used
respectively.

In

represents

A and

B is

(8.1.13)

Hence

AND.

It should be pointed out that # and


as interpretationsofthe union and

\"hard\"

when

A AND

B is

&

the

Definition
8.1.9.
and is defined by

as

OR and AND

The product

AB=

not

an AND that is interpretedin


\"soft\"

appropriate

in which

are

the only

intersection,

&
is identified with
(i.e.,
min),
sense that no trade-off is allowed

AND
in

AND

operands,acts a
these or other possibleinterpretationsis more

AB

and

& mB(u)]/u.

[mA(u)

Ju

between
its operands.
By contrast,
the arithmetic
product of the

the applications

labels

sets

fuzzy

B are

J5.

particular,

of

if

by

is defined by

correspondsto the connective


Pi

(8.1.12)

mB(u)]/u.

connective OR. Thus,


B is expressedas A + B.

AC\\B=
The intersection

denoted

B is

and

to the

corresponds

then

[mA(u) #

[
Ju

negation.Hence,if

be interpreted as ~A.

union
of fuzzy sets
is defined by

B=

A would

by

(8.1.11)

is equivalent to

a fuzzy

Definition 8.1.7.
A

- mA(u)]/u.

fu [1

of complementation
NOT
then
set,

operation

is a

denoted

A is

set

mA(u)

are

of

AND.

it
of

terms

Which of

depends

on

used.

fuzzy

\342\200\242

mB(u)/u.

sets

A and

B is denoted by

(8.1.14)

706

Chapter 8: Representationand
Thus, Ap, where

of Imprecision

Manipulation

p is any

Ap=
if w

Similarly,

is any

is defined

number,

positive

by

(8.1.15)

f [mA(u)]p/u.

nonnegative real

number suchthat

< 1,

\342\200\242

hgt(A)

then
-

wA

Ju

(8.1.16)

mA(u)/u.

Two operations that are definedas specialcasesof


the representation of linguistichedges.

The operationof concentration is

denoted

are

(8.1.15)

CON(A)

by

useful

in

and

is

defined by

(8.1.17)

CON(A)=A2.

The
fuzzy

set,

interpretation

of VERY.

A corresponds

to CON(A).

is an

concentration

VERY

then

The operationof dilationis

denoted

Thus,
and

DIL(A)

by

if

A is

a label

is expressed by

(8.1.18)

DIL(A)=A05.

If A

is a

label

of a fuzzy

of a

set, then APPROXIMATELY

A is

interpreted

as

DIL(A).

Example 8.1.7.

the

Given

+ 2+...+8,

C/-1
and

fuzzy

of discourse

universe

subsets

A =

.8/3 +

1/5 +

and

.6/6

- .7/3

+ 1/4 +

.5/6,

(8.1.19)

then

~A

- 1/1 +

+ .2/3

1/2

+ 1/4

A + B = .8/3+ 1/4+ 1/5+


A H B = .7/3 + .5/6
\" -56/3
ABa
A3

.65 - .42/3 .6/4


+

CON(A)

= .64/3

DIL(5)

.84/3

+ .216/6

+ 1/5

+ .3/6

+ 1/5+ .36/6
+

1/4 +

.71/7

1/7

+ 1/8

.6/6

+ -3/6

.512/3

+ .4/6 +

(8.1.20)'

Section8.1
If Alf.. .,An

8.1.10.

Definition

are

Cartesian
product
\342\200\242
\342\200\242
is defined as a
x An and
Ax x \342\200\242
is expressed by
function
membership
mAl

Thus

\342\200\242
\342\200\242
\342\200\242
x

Al x

An can

\342\200\242
\342\200\242
\342\200\242
x

f
The concept of

discussion of fuzzy
Example

be written

UXy..

by

whose
.,\302\243/\342\200\236

& mAn(un).

(8.1.21)

as
.,un)

mAn(un)]/(uly..

the Cartesianproductwill

...

&

roAl(wi)

.,\302\243/\342\200\236

denoted

is

\342\200\242
\342\200\242
\342\200\242
&

&

\\mAx(ui)

referenced

further

be

(8.1.22)
in the

relations.

Given

8.1.8.

Ax

.,iO

mAn(ul9..

.,An

of

subset

fuzzy

of Uu..

subsets

fuzzy

of Alv.

the

respectively,

707

Sets

Fuzzy

+ .6/3

+ 1./2

.5/1

U2 =

Ux

1 +

and

2 + 3,
=

A2

l./l

+ .6/2,

then
Ax

A2 =
+

.5/(1,1)

+ 17(2,1)

+ M3,l)

.5/(1,2)

+ .6/(2,2)

+ .6/(3.2)

8.1.11. If Alv

. .,An are fuzzy subsets of Ul9...,[/\342\200\236


(not
and
are
such that
distinct),
wu.. .,\302\253;\342\200\236
nonnegative
weights
necessarily
combination
of Au.. .,A\342\200\236
is a fuzzy set A
^?-iwi = 1> then the convex
whose
is
defined
function
by
membership

Definition

mA

wxmAl

\342\200\242
\342\200\242
\342\200\242
+

(8.1.24)

wnmAn

of a convex
denotes the arithmeticsum.The concept
in the representation of linguistichedgessuch
as
which
the
associated
with
essentially*
etc.,
modify
typically,
components
weights
of a fuzzy set. The weights can alsobe interpreted
as coefficients
of the components of a fuzzy set A \"built\"
from
importance
fuzzy

where +
combination
is

useful

of
sets

Alv . .,An.

Example

8.1.9. Let Ux

weight in kilograms. A
as

fuzzy

set

{ux: 10 <
Ax labeled

ux

<

250}

as

HEAVY

with

ux representing
be expressed

may

708

Chapter8: Representation
with

and

mHEAVY(70)

centimeters.

of Imprecision

Manipulation

U2 =

Let

0.5.

50 < u2 < 220} with


u2 as
TALL may be definedas

<\302\253\342\226\240\302\2

\342\204\242L-rhN^n~7with

- 0.5.

raTALL(170)

Then a fuzzy

a convexcombinationof

set A labeled
BIG may be
HEAVY
and TALL, that

sets

fuzzy

in

height

\\u2:

A2 labeled

set

fuzzy

definedas
is, A1 and

A2:

BIG

mA(uuu2)

For example, if

= 0.6
/*200

/*100

we

the product

denote

- 0.6

mBiG(70,180) -

Notice

variations

that

the

membership

This is due to
determining the
and

0.64 +

0.5

fuzzy

0.4

fuzzy

of

using

- 0.584
mTALL(180)

= 0.556

influence on the values


than

BIG

set

\"importance\"

BIG

0.4 mTALL(170)
0.5

have stronger

of the

- 05

0.4 * 0.64

greater
set

0.4 *

mHEAWY(70)

in weight

function

0.4 mTALL(170)

0.6

= 0.6

m^^)]/^,^).

0.4 * 0.5

mHEAVY(80) +

0.6 *

.4

(8.1.27)

by *,

\"Ibig(70,170)- 0.6mHEAWY(70)
- 0.6 * 0.5 +
mBiG(80,170)

0.4 TALL

[.6mAl(u!)+

/
^140

JA0

HEAVY

the

the convex

variations

component

of

in height.
HEAVY in

combination of HEAVY

TALL.

t-level set

If A is a fuzzy subset of U, then a


Definition
8.1.12.
is a nonfuzzy
set denoted by At which
all elements
comprises

whosegradeof membershipin
A,-

fuzzy

resolution

set

A may

A is

greater

or equal

\\u:mA(u)>

be decomposed into

of

of U

to t. In symbols,

t).

its level-setsthrough

(8.1.28)
the

identity

A-

fltAt

(8.1.29)

Sets

Fuzzy

709

or

- ]T

(8.1.30)

tAt

where

tAt is
and

(8.1.16)],

from

0 to

the product of a scalart with


/J (or 2,) is the unionof the At

set

the
of

the

At [in

At sets,

the sense

with

of

t ranging

1.

be interpreted
Since (8.1.1)or (8.1.2)
as a representation of a fuzzy
may
it follows from
as a union of its constituent fuzzy
{mjui),
singletons
of A we
the definition of the union (8.1.12)that if in the representation
=
we
can
have Ui
then
make the substitution expressedby
ujf
set

+ rrtj/uj

rrti/ui

(8.1.31)

# m;)A/,.

(mi

For example, given

may

la + .6/6+ .3/6,

as

be rewritten

+ J

- A/a

(.4 #

.7)/a +

(.6 # .3)/6-

.6/6.

.7/a

Or conversely,

mjui =

<
(# ro,-)/ui, 0 < \302\243
m;.

(8.1.32)

For example,

.4/a - (.1# .2#


Thus

the resolution

identity may

together those terms

in

level-set.
More

specifically,
A

Then

by

using

suppose

that

- .1/a

+ .3/6

(8.1.32),
A

(8.1.1)

A can
.1/a

.3

# .4)/a,

be

viewed

or

(8.1.2)

A is

\302\243

.1.

as the result of
which fall into

represented in the form

+ .5/c+ .9/d+ 1/e.

be rewrittenas

+ .1/6

+ .1/c + .lid +

+ .3/6+ .3/c
+

+ .5/c

.3/d

.1/e

+ .3/e

+ .5/d + .5/e

+ .9/d+ .9/e

+ lie

combining
the same

710

Chapter

8: Representation

and

of Imprecision

Manipulation

or

A =

.1 (1/a +
.3

(1/6

1/6

l/c

+ lid

+ l/c

\\ld

.5 (l/c

+ 1/d + 1/e) +

.9

+ 1/e)

(lid

+ lie)

1/e)

1 (1/e).
which

is in

the form

(8.1.30). Using

are
(8.1.28),the level-sets

+c+

A.! =

a + 6

A3 =
A5 =

6+c+

by

+ e

+ e

d +

c +

= d
9

given

4- e

= e.

Ax

As will be seen later, the resolution


a convenient
identity
provides
way
of generalizing various concepts associatedwith, nonfuzzy
sets to fuzzy
sets. The level-setsof a fuzzy
set will be used as the basisin establishing
the responseset to a given query given a threshold of acceptance, or
\302\243-level.

Definition
transforming

operation
set into a fuzzy

membership to its elements.Thus,


subset

A of

U produces

a fuzzy

subset

the fuzzy set K(u)


to a singleton1/u:

by assigning
proper grades
F applied
fuzzifier
to a fuzzy

F(A;K)

which

is expressed

F(l/u;K).

of

by
(8.1.33)

mA(u)K(u),

the
is the kernel ofF,i.e.,

K(u)

can be used in

set

F(A;K) - f
where

of fuzzification

The

8.1.13.
a nonfuzzy

result

of applying

(8.1.34)

the
and
Here, mA(u)K(u) represents the productof a scalarmA(u)
of
the
of
sets
isthe
union
set
K(u) [see (8.1.16)],and/
family
fuzzy
fuzzy
w \302\243[/.
In effect,
(8.1.33) can be viewed as an integral
mA(u)K(u)y
of a linear operator, with K(u) being the counterpart of
representation

the

impulse

response.

Section

711

Fuzzy Sets

8.1

Let

Example 8.1.10.

A and

Uy

be defined by

K(u)

U=a+b+c+d
=

+ .6/6

.8/a

tf(l)-l/a+..4/6

K(2) = 1/6 + Ala

.4/c.

Then

F(A;K)

= .8 (1/a

Ala + .4/c)
+ .24/a + .24/c
(1/6 +

+ .6

.4/6)

= .8/a .32/6 + .6/6


= (.8# .24)/a+ (.32
- .8/a + .6/6 .24/c.
+

+ .24/c

.6)/6

The
definition

of fuzzification finds an
operation
of linguistic hedges such as MORE

MUCH, etc.

SLIGHTLY,

labeledas POSITIVE,

For example,if

of the

subset

OR

A of

a set

In this case,SLIGHTLY

real line.

POSITIVE.

is

the

SOMEWHAT,

LESS,

POSITIVE

SLIGHTLY

then

important applicationin

positive numbers is
is a label for a fuzzy
fuzzifier
of the term

8.1.3 Fuzzy Relations

Definition8.1.14.
Uu..

.,\302\243/n,then

U. R

can be

discourse

of

subset

is a

If

an

n-ary

expressed as the union

singletons mR(ulf.. .,w\342\200\236)/(wi,..


R=
where

mR

is the

function

link

between

u and

Vy respectively.

v,

Common

GREATER
THAN, IS
TO, IS INFLUENCED

Example 8.1.11.
MUCH

8-1).

GREATER

will be restricted to
measure of the strengthof the
of universes of discourseU and

discussion

mR(u,v)
are elements

Let\302\243/\302\253V-l

may

fuzzy

(8.1.35)

..,un)

of binary

fuzzy

SIMILARTO, IS RELEVANT
BY, etc.

THAN

constituent

is,

is a

examples

universes of
U is a fuzzy

ofR.

further

case,
which

its

of

..,un)l(uu.

mR(ul9.

membership
this

that

.,wn),

For the sake of simplicity,

binary relations.In

product of n
fuzzy relation, R, in

Cartesian

2 +

be defined by

are

relations
TO,

IS

MUCH
CLOSE

4. Then the relation


a relation matrix (Table

3 +

712

Chapter

and Manipulation of

8: Representation

Imprecision

Not

Young

. Very

young

very

young

Old

<

More or less old

Age

mathematical

Rigorous

Given

the sets

\"very

young,\"

or less

young\"

young,\"

\"very

rules define relationships


\"old\" one can construct

among
oth&r

sets.

fuzzy

such

sets,

as

the membership function


for \"young,\"
or \"more
for old.
taking the square root of the membership function
is obtained
for \"young,\"
as in
by squaring the function
and then subtracting
the
result
from one, to represent

by squaring
by

old,\"

\"Not very

and

\"young\"

\"not.\"

Figure

of fuzzy

Construction

8-4.

from given fuzzy

sets

sets.

Table 8-1.
R

0
0
0

0.3
0

0.8
0
0
0

Example

TO may

be

8.1.12.
defined

If U =

a >

(-00,00),

0.8

0.3

the fuzzy relation

as

IS CLOSE

where

,0
0

TO = f

0 is a scale factor.

\342\200\224\342\200\224-

(u,v),

IS CLOSE

Section

8.1

Fuzzy

Fuzzy relations generalizeordinary


in the following
composed as shown

therefore,

relations;

Sets

713

they

can be

definition.

Definition 8.1.15. If R and S are fuzzy relations on U x V and V


of R and
S is a fuzzy relation on V
W respectively, then the composition
\302\260

by R

W denoted

R\302\260S=

If

V and

Uy

defined

S and

W are

addition
product (i.e., operations
replaced by min and max, respectively)of
andS.

min-max

operation

\302\260

S is

& in

the

are
for R

multiplication
relation
matrices

the

can be min or a
of the

(8.1.36)

definition

in the

used

and

It shouldbe mentionedthat

product orthe algebraic


intersection
of

(8.1.36)

finite sets, then the relationalmatrixfor


of

Comment.

by

#v[mR(u,v)&ms(vyw)]/(u,w)

sets.

fuzzy

8.1.16.

Definition
be:

reflexive

iffmR(u,u) = 1, Vu\302\243(/

symmetrical

iff mR(u,u')

= mR(u\\u),

\\f\302\243mR(u,u')

>

anti-symmetrical

@-transitive

iff

where @

u,u'

m^(w,w\")
'
w
V u,u
,

R on

relation

binary

fuzzy

0 and

U x

u,u'

(8.1.38)

= 0,

mR(u',u)

> mR(u,u')
u

can be replacedby

(o.i.oy)

@ mR(u',u\

(8.1.40)

u
U
a

min,

to

(8.1.37)
V

u*u!
\302\243/,

o a
tz

said

is

or other

product

algebraic

operation.
is transitive,

When

R+ =R
in the
exists

+ #2+

sense of
and

its transitive
\342\200\242
\342\200\242
\342\200\242
+ Rm

+ .

closure,
.

\342\226\240
where

max-min composition.Due

to

+, is

Rm =
the

defined

R\302\260
R\"1\"1

reflexivity

(8.1.41)

of R, R +

is min-transitive.

Reflexive and
relations.

symmetrical fuzzy

relations

are

Reflexive, symmetrical and min-transitive fuzzy


relations.
similarity
They are obtainedas

called
relations

Reflexive,
are

symmetrical and product-transitive fuzzy


weaker than similarity relations.

proximity
are
closures

transitive

proximities.
8.1.12)
(Example

by

relations

called
of

714

Chapter

8.1.4

and Manipulation of

8: Representation

Cardinality of a Fuzzy

Set

Let U be a finite

8.1.17.

Definition

U. Its fuzzy

Imprecision

cardinality,

A be

and

universe

by c(A), is definedby

denoted

c(A)=

a fuzzy set on

(8.1.42)

t/\\At\\

number
of elements in the t-levelset of A, At, as defined
In other words,c(A) canbe defined
as a fuzzy
set of natural

| A t\\ is the

where

in (8.1.28).

numbers,N, suchthat

of a fuzzy

The concept

questionofthe
some

8.1.5

states

mc{A)(n) = lub{* E

E N,

V n

type

set

(0,1]:|

At

(8.1.43)

n).

can be applied when answeripga


streets
are there?\" or \"Are there
long

cardinality

\"How

many

climate?\"

with pleasant

The ExtensionPrinciple
fuzzy

of the most important conceptsin


this
of
Application
principletransforms
any
between
elements
to deal with fuzzy
entities.
nonfuzzy

extension

The

is one

principle

the

set theory.

relation
mathematical

over

sets

fuzzy

Extension

The

8.1.18.

Definition

Ulf..

.,\302\243/\342\200\236
respectively,

defined by (8.1.22).Let /
fuzzy image B of Al9...,An

be

from

function

/ has

through

their

Cartesian

Ux x

\342\200\242
\342\200\242
\342\200\242
x

the constraint y

= f(ul9.. ,,un)

mB(y) = 0 when/

and

~\\y) = {ul9...,un

Un to

be

product
Y. The

a membership function:

min mA(wt),
mB(y) = (uu...,un) lub
n
\302\243
t/i x... x Un i-l
under

Let Alv. .,An

Principle.
with

the

: y

(8.1.44)

VyEY

condition

additional

f{u\302\273..

.,aB)}

= 0

(8.1.45)

in the composition
of fuzzy sets
The extension principlecanbeapplied
in defining
the fuzzy
of functions, in the algebraof fuzzy
numbers,
a fuzzy domain, in multivalued logic,
maximum value of a function
over

and in otherimportant

8.1.6

of Fuzzy

Applications
Fuzzy

modeling.

areas.

set

theory

It

has

is being

Set Theory
gained

its importance

applied in the

fields

as a tool for
of

fuzzy

vagueness

systems,

fuzzy

Section 8.2

and

and languages,

grammars

other areas of

artificial

applications in the field

(ES)

be

will

8.2

of

artificial

intelligence

medical

control,

science.

computer

(AI) and

and

theory

game

retrieval,

intelligence

operations

economics,
system

and

in Section

discussed

in

of natural

models

in

algorithms;

fuzzy

and
language and approximatereasoning;
research, decision analysis,pattern recognition,
diagnosis, theory of learning, information

715

Theory

Possibility

Specific

expert systems

8.3.

POSSIBILITY THEORY

The

Consider a nonfuzzy

8.2.1.
p =

it is

and

(ii) it is

X is an integerin

the

not

for

possible

words,

any integer

a possibility

induces

E [0,5]the possibility

each integer u

p):

(or proposition

interval

[0,5].

that:

possible for any integer in the interval

value of X.

In other

statement

of the propositionp asserts

The interpretation

with

the relation between fuzzi-

possibility.

Example

(i)

to explain

is used

example

following

and

ness

to be

[0,5]

a value

outside of the interval

distribution

Ylx

u could

that

to be

[0,5]

which

be a

of X,

associates

value of

X.

Hence,

u} =
[Poss {X \302\253=

<u <5
for u < 0 or u

for \"The

possibility that X

{X =

JPoss

where Poss {X
value

u] stands
the

\"fuzzify\"

\"small

may

assume

the

integer\"

X is a small integer

is a fuzzy

set defined in

the universe of

positive

as

SMALL
where

>5

p:

proposition

pF =

integers

for 0

of u.\"

Now,

where

u\\

INTEGER

.7/3 signifies

= 1/0 +

that the

1/1

+ .9/2

+ .7/3

+ .5/4 +

.2/5

grade of membershipofthe integer3 in

the

716

Chapter

8: Representation

and

of imprecision

Manipulation

SMALL INTEGER\342\200\224or,
the compatibility
equivalently,
INTEGER\342\200\224is 0.7.
statement that 3 is a SMALL
the interpretation of the proposition
be
Consequently,
q can
fuzzy set

It is
the

possible for

of membershipof u
In otherwords,
each

with

pF

integer

taking a value
in

the

a SMALL

to be

integer

any

of X

possibility

fuzzy

of

grade of membershipof u in the fuzzy

= 3}

{X

INTEGER.

distribution

IIx which associates


of

to the
Thus,

X equal

INTEGER.

SMALL

Poss {X = 0}= Poss{X = l} =


Poss
{X - 2} - .9

Poss

INTEGER with
the grade

could be a value
set

fuzzified:

equal to

u being

set SMALL

induces
a possibility
the possibility that u

of the

= .7

Poss {X = 4} = .5
Poss {X = 5} = .2

Poss

{X

More

stated

above

the

generally,

in the

= u)

for u < 0 or u > 5.

= 0

of a fuzzy

interpretation

can

proposition

Definition 8.2.1. PossibilityPostulate.

X is a variable
U characterized

If

subset
takes values in U and F is a fuzzy
then
the proposition
mF,
membership function

q =

of

XisF

inducesa possibilitydistributionII

is equal

which

to F,

that is,

In essence,

the

It is

(8.2.2)

that

Poss

which

that
by a

(8.2.1)

nx = F
implying

be

following postulate.

serves

{X

possibility

to define

u\\

for all u

mF(u)

of X

distribution

G U.

engenders a

the possibilitythat X couldtakeany

important to note that

since

II x

Fy

the

(8.2.3)

possibility

value

fuzzy

u in

distribution
in nature.

set

U.

subjective
depends on the definition of F and henceis purely
the possibility distribution function associated
Correspondingly,
X (or the possibility
with
distribution function of II x) is denotedby px
function
of F,
and is defined to be numericallyequalto the membership

Section

8.2
that

717

Theory

Possibility

is,

the

PxMy

Thus,

possibility

Px

- mP.

that

X =

(8.2.4)

u, is postulatedto be equal

to

mF(u).

referred to as a possibility assignment


that the proposition \"Xis F\"translatesinto
a fuzzy set F to the possibility
distribution
of X, or

(8.2.2) is

Equation
equation

it signifies

because

of

assignment

g =

XisF\342\200\224

for \"translates
where \342\200\224*
stands
More generally, the possibility
proposition of the form

nx

= F

(8.2.5)

into.\"

of

F is

be

a fuzzy

(i) a variable,
as
expressed

subset

universe

of a

(ii) a fuzzy

(iii)

set,

IW)

to a

corresponding

equation

assignment

\"ATisF\"

where

the

(8.2.6)

of discourse
a proposition,

(/, and N isthe name


object,may

or (iv) an

=F

(8.2.7)

or,more

simply,

nx

X is either N itself(when

implicit

in

N,

with

is a

variable)

values in

taking

propositions can be translatedinto


Consider

8.2.2.

Example

= F.

or a variable that
\302\243/.
Note

is explicitor

also

that

\"nested\"

(8.2.7).

the proposition

q = Tom is old.

Here

{u:0 <

function

Tom,

<

100} with

- Age(Tom),
u signifying

and \"old\"

is

a fuzzy

set defined

Age and characterizedby

on U =

a membership

m0LD. Hence,

q = Tom is old \342\200\224


IIAge(Tom)
It is clear that

the conceptof

a possibility

= OLD.

distribution

is closely

related

718

Chapter

and Manipulation of

8: Representation

to

rules

to fuzzy sets.

applicable

The notion of

concept
of

restriction.
the calculus

restrictions,

fuzzy
the

for

bears also a closerelationtothe


Hence the mathematical apparatus for

of fuzzy restrictions, can be usedasa basis


distributions.

of possibility

manipulations

ofa
First, let us definethe concept

of

u is

where

by

Then F

U and

discourse

characterized

be a

Let X

8.2.2.

Definition

universe of

function

a membership

on

other

of a

a fuzzy

mF.
that may

value of u to

X) if F

with

associated

(or

value

the

in a
the
value
assigned
subset
of U which is
values

takes

X is

that

U. Let F be

an element of

assignment

which

variable

= u signify

let X

acts as an elasticconstraint
the

restriction.

fuzzy

is a fuzzy restriction on X

words,

manipulated by

distribution

a possibility

a fuzzy

can be

distributions

possibility

therefore,

sets;

fuzzy

the

Imprecision

be assignedto X. In

X has the form

= u:mF(u)

(8.2.8)

is interpreted as the degreeto which


the
constraint
F
u
is
to
is
satisfied
when
or
X,
assigned
mF(u) can be
by
F. It follows
as a degree
of compatibility of u with
that [1 -

where mF(u)
represented

thought of

the
constraint
represented
mF(u)]is the degreeto
by F is not
it
or
is
the
t
o
the
constraint
must
be
stretched
so
satisfied,
degree
that the assignment u to X is possible.
a fuzzy
It is important to note
set per se is not a
restriction.
To be a fuzzy restriction, it must be actingasa
on the values
of
X can assume values in [/depending
a variable. In other
a variable
on the
on the fuzzy set F.
which

which

of

that

fuzzy

constraint

words,

definition

8.2.1

Relationship

Possibility-Probability

of possibility
uncertainty
manipulating

the

Both
representing

is used

concepts

and

to illustrate

Example

Now let

and probability are


or imprecision. A

the differencebetweenprobability

passengers

many

with

in

by

U =

{1,2,.. .,7}.

interpreting

We

Poss{X

can

associate

= u) as

can
ride

values

of

example

simple

and

possibility.

Suppose that a 7-memberfamily

8.2.3.

us considerhow

correspondstothe statement\" passengers


on

means

owns
a 4-seat
car.
ride in the car. This
in a car\" where X takes

a possibility

the degreeof

ease

distribution
with

which

a probability
passengers can ride in a car.Letus also associate
= u] stands for the probability
that u people
distributionwith
X where Prob{X
= u) and Prob{X = u) are
will
in the car. The values of Poss{X
ride
assessedsubjectively
and
are shown in Table 8-2.

Section8.2
Table 8-2.

and

Possibility

Poss{X=

u)

Prob{X-

u]

Associated

Distributions

Probability

.8

.3

.4

.2

.1

719

Theory

Possibility

5
.4
0

with

X.
7

.1
0

intrinsic difference between possibility and probability


can
be
from this table. While
the
have
to
sum
probabilities
up to 1 over
the
values are not so restricted.Also
notice
that
the
U,
possibility
that
3
will
in
ride
the
car
is
while
the
1,
possibility
passengers
probability
is quite
does
not imply a high
small, that is, 0.2. Thus, a high possibility
Some
observed

nor does a

probability,

its

but

probability,

imply a low degree of


an
of event tends to lessen

of probability

degree

the possibility
lessening
the converse
is not true.

However,

possibility.

low

Furthermore, if

bound to be improbable.This heuristic


and probabilities is called the
possibilities
it is

impossible,
between

an

As another example of the difference


8.2.4.
Example
and
possibility, consider again the statement\"Tom
probability
with the translation having the form
Tom

is old

Hence

<100}.

#(Age(Tom))

nA{x){u)

To associate

Let us

20

25

30

35

40

50

60

.2

.3

.5

.8

.9

a probability distribution with


\"old\"

adopt the definition

into

that

assume
\"old.\"Then,the probabilities

Table

u
ProbA{x)(u)

with OLD.

Associated

Distribution

Possibility

concept

8-4.

old\"

defined on U = {u:
is subjectively
in Table
8-3.
values
have
maY
sample
given

10

translate the fuzzy


concept.

is

OLD

set

UAiX)(u)

Table 8-3.

between

= OLD.

\342\200\224

assume that the fuzzy

Let us

is

principle.

possibility/probability
consistency

0<

event

relationship

Probability

the

Distribution

\"hard\"

(nonfuzzy

any age
as
values

Associated

necessary to

it is

A (X),

or nonelastic)

over or equal to 60 is
shown in Table 8-4.
with

OLD.

40

50

60

70

80

90

.2

.2

.2

.2

100
.2

720

Chapter

and

8: Representation

tables demonstrate

These

of

application

SET

FUZZY

OF

APPLICATION

intrinsic

is

that

some differencesbetween the concepts


and
probability, where it appears that the
in natural
languages is possibilistic in

and

possibility

imprecision
nature.

8.3

of imprecision

Manipulation

SYSTEMS

TO EXPERT

THEORY

8.3.1 Soft Expert

Systems\342\200\224Introduction

The

is on,

blitz

media

intelligence

and hype, is comingfrom

all

Artificial

sides.

of Knowledge-Based

form

the

in

(AI)\342\200\224especially

Expert

systems (ES) are the


item in today's high-tech boom. A new
hottest
glamour
programming
has been created, based upon\"productionrules\"and
technology
The
result is a new class of enormously
powerful
\"knowledgerepresentation.\"
(HOLs) implemented through \"inferenceengines\"
languages
high-order
form
the heart
of \"knowledge engineering tools.\"
which
These new HOLs make it easier to create, debug, and maintain
a practical

now

Systems\342\200\224is

complexprograms

the

through

statements,

of English-like

use

Expert

and expert

of explicit

suppression

syntax,
also

(sometimes

Systems

reality,

and other
called

control

notational devices.
Consultant

Knowledge-Based

of
data,
inferences,
Systems) are structuredrepresentations
experience,
draw
and rules that are implicit in the human
Expert
systems
expert.
conclusions from a store of task-specific
principally
through
knowledge,
logical or plausible inference, not by calculation.
The objectiveof an expert system is to help the user chooseamong
a
a specific
within
set of options, actions, conclusions,or decisions,
limited
on the basis of information
that
is likely to be qualitative rather
context,

than qpantitative.

The creationof

an

restofthe
The

system

everyday

into
usage

system

expert

putting specificdomain
support this task by explicitly

primarily

knowledge

what
of an

into

separating

is commonly

expert system

revolves around

the task of
systems
from the

the system.
Expert
the domain knowledge

called the

knowledgebase.

requires accessby

the

end

user

a software
system called
by
knowledge base. Thisis accomplished
the inference engine. It interactswith the user through a user-interface
in Figure
8-5.
subsystem as shown
an autonomous
Each production rule in an expert system
implements
of
modified
and
chunk of expertise that can be developed
independently
the
other rules. When thrown together and fed to the inferenceengine,

to the

Section

Application of Fuzzy

8.3

set of
the

behaves

rules

sum

of its

reliable.

by

For

this

system

reason, the

system is

of the

much

expertise,
expert

typical

an expert

effects that

yielding

synergistically,

to Expert

Theory

Systems

721

are \"greater
than

parts.\"

Reflecting human

baseof a

Set

information in the knowledge


incomplete, or not totally

is imprecise,

answer to a question or the advice

usually qualified

a \"certainty

with

rendered

factor\" (CF),

which gives the user an indication


of the degree of confidence that the
at the
system has in its conclusion.To arrive
factor, existing
certainty
of
infectious
blood
expert systems suchas MYCIN\342\200\224medical
diagnosis
diseases (Stanford University), PROSPECTOR\342\200\224location
of
mineral

Domain

Expert

\\

1r

Knowledge

Engineer

J)
i

Domain

Inference

Knowledge

Engine

Base

h*

X
User

Figure

8-5.

Diagram

of Expert

System.

722

Chapter8: Representation

and

Manipulation

of Imprecision

Research Institute), and others employ


what
are
methods. However, since much of the
in the
base of a typical expertderives
from
the
uncertainty
knowledge
and incompleteness of data rather than
fuzziness
from
its randomness,
the computed values of the certainty
factor
are frequently lacking in
deposits

(Stanford

essentially

probability-based

reliability.
By

inferential
and randomness

a single

providing

incompleteness,

system for dealingwith

of information

the

fuzziness,

the

base,
knowledge
of certainty
computation
in

fuzzy logic furnishes a systematic basis for the


factors in the form of fuzzy numbers.
The numbers may be expressedas
or
for example, \"likely/' \"very
quantifiers,
fuzzy
linguisticprobabilities
\"almost
\"most,\" \"almost all,\" \"frequently.\" In this
certain,\"
unlikely,\"
perspective,fuzzy set theory is an effective tool in the developmentof a
\"soft\" expert
system (SES).
A number
of SESs have been implemented, especiallyin the context
of
medical
decision
support
systems. Indeed, the design of expertsystems
offuzzy logic
well prove to be one of the most important applications
may
in knowledge
and information technology.Although
engineering
fuzziness is usually
viewed
as undesirable, the elasticity of fuzzy
sets
gives
avoid
them a number of advantages over conventionalsets. First,they
of conventional mathematical reasoningand computer
the rigidity
between
sets simplify the task of translating
Second,
fuzzy
programming.
of
human
reasoning, which is inherently elastic,and the rigid operation
humans
reasoning,
digital computers. In particular,in common-sense
to describe
numbers
how systems behave.
tend to use words rather than
to use the type of human
Finally, fuzzy sets allow computers
knowledge
in the
called common sense. Common-sense knowledgeexists mainly
that are usually,
but
not
true. Such a
form of statements
always,
A disposition
a disposition.
contains an implicit
statement canbetermed
and
so on.
such as \"most,\" \"almost always,\"\"usually,\"
quantifier,
fuzzy
In fuzzy logic, fuzzy quantifiers are treated as fuzzy
numbers
that
in a
the absolute or relative count of elements
represent,
imprecisely,
As
are
J3s\" means that the
fuzzy set. Thus the proposition\"Most

proportion of these elementsis represented


\"most\" (see Figure 8-6).

Oncethe

fuzzy

logic

quantifiers

fuzzy

can

be

employed

are

made

in order

by

explicit,

to

arrive

the

fuzzy

quantifier

various syllogisms in
at

conclusion.

For

and
students
are undergraduates\"
example, from the statements,\"Most
deduce
that \"most2
one
could
\"Most undergraduates are young,\"
of the
students
are
In this case, \"most2\"
the
product
represents
young.\"
fuzzy quantifier \"most\"with itself. As should be expected, the quantifier
in
\"most\"
in the
\"most2\"
is less specific than the quantifier
conclusion

Section

8.3

of Fuzzy

Application

Set Theory to

723

Systems

Expert

m
1

Mosr
(5
\302\243
(L)

Most

\342\226\240^Prr\302\273r\\r\302\273rtir\302\273n

be represented
such as \"most\" may
as a fuzzy
that defines the degree
to which any given
proportion
the definition of \"most.\"
matches
The fuzzy quantifier \"most\" acts by
the degree to which
a proportion
fits into \"most\" and then finding
finding
the degree
to which
that
fits into \"most.\" Thus,
the
value of
degree
\"most\" for a given
will be equal to the value of \"most\"
for the
proportion

quantifier

fuzzy

number\342\200\224a

set

fuzzy

root of that

square

proportion.

Figure

8-6.

The

fuzzy

\"most.\"

quantifier

Most kinds of common-sense


can be processed
knowledge
in a similar fashion
through
fuzzy
reasoning.
A key problem in the application
of fuzzy
set theory
to SESs is devising
effective
methods
of reasoning
with chains of fuzzy
For
syllogisms.
to derive conclusions from
common-sense
example,
a
knowledge,
must
be able to deduce from the information
computer
that
most
students
are undergraduates and most undergraduates
areyoung, the conclusion
that \"most2\" students are young.
If we could take advantage of the tolerance for imprecision
and devise
solve
such problems, we
programs that could quickly, if approximately,
the premises.

could perhaps achieve algorithms that approachthe easeand


in their everyday communication.
humans

In the

existing

of these

shortcoming

grips with

expert

of predicate

combination
the

pervasive

systems,

is dealt

uncertainty

logic and probability-based

methods is that
fuzziness

they

with

methods.
are

not

of information

capable

in the

of

speed

through

A serious

of coming

to

knowledgebase,

724

Chapter

8: Representation

and

of Imprecision

Manipulation

ad hoc in nature.
and, as a result, are mostly
the management of uncertainty is basedon the

the logic
management

of

framework

subsumes

logic which is

in
uncertainty
for dealing

both

conceptual

with

logic and

different

fuzzy reasoning.
to the

theory

of uncertainty

types

logic, which is

it provides a systematic
In this way fuzzy

probability

to

approach

of fuzzy

importance

particular

expert systems is that


with fuzzy quantifiers.

predicate

possible to deal

of

use

equivalently,

or,

approximate

underlying

of fuzzy

feature

alternative

An

and
within

logic

makes
a

it

single

framework.

As a simple illustrationof this


duodenal ulcer(CF = 0.8),\"where

\"Jim has
factor
of
0.8.
certainty
\"has duodenal ulcer\" is a fuzzy
so
that
Jim
have
it
Since
to
predicate,
may
of the
factor
a degree,the meaning
becomes
More
certainty
ambiguous.
CF = 0.8 mean (a) that Jim has duodenalulcerto the
does
specifically,
event
\"Jim
has
0.8; or (b) that the probability of the fuzzy
degree
duodenal ulcer\" is 0.8?Note that in orderto makethe latter
it is necessary
to be able to define the probability
of a
interpretation
meaningful,
in
in
event.
This
can
done
be
but
not
classical
fuzzy
fuzzy
logic,
probability theory.
of certainty
in nonfuzzy ES is carriedout
The computation
factors
two or more rules are combinedthrough conjunction,
when
disjunction,
In the case of chaining,in particular,the standard
or chaining.
inference
of its validity and must be replaced
rule\342\200\224modus
ponens\342\200\224loses much
by
more
rule of inference. Furthermore,the
the
compositional
general
of implication,
which forms the basis for both
forward
and
transitivity
is a brittle
which
backward chaining in most expert systems,
property
must be applied with great caution.
for
However,
fuzzy logic provides a natural conceptual framework
and
from
inference
bases
which
are
representation
knowledge
knowledge
or not totally reliable. Generally,
use of fuzzy
the
incomplete,
imprecise,
the
of
a nonlinear
reduces
inferenceto
that
of
problem
solving
logic
to
and
leads
conclusions
w
hose
is
a
cumulation
of
uncertainty
program
the uncertaintiesin the premises
from
which
the conclusions
are derived.
as well
as the certainty factor, are
As a consequence,the conclusions,
which
sets
are characterized
fuzzy
by their possibilitydistributions.

8.3.2

Fuzzy

Relational

Knowledge

point,

CF

consider

of 0.8

the

fact

is a

Base

or vague
Much of human reasoningdealswith imprecise,
incomplete,
information. Therefore, there is a need for information
that
systems
in order
allow representation and manipulationof imprecise
information
to model human reasoning.
The Fuzzy Relational
Base (FRKB) model, based on the
Knowledge
researchin the fields of relational data bases and theoriesof fuzzy sets

Section

Application of

8.3

and possibility,

is

of

and

individualization

for

725

the

addresses

following:

of impreciseinformation.

1. Representation
Derivation

Systems

processing.

The FRKB modeldesign

2.

to Expert

Theory

the need

to satisfy

designed

information

imprecise

Set

Fuzzy

3. Linguisticapproximations
of

4. Development of

of acceptance.

measures

possibility/certainty

terms

fuzzy

relational

fuzzy

in the
operators

query language.
(IS,AS...
AS,

GREATER,...).

5. Processingof queries
6. Null value handling

with

using

connectors and truth quantifiers.


the concept of the possibilistic
expected

fuzzy

value.

fuzzy term

of the

Modification

7.

definitions to suit the

individual

user.

base, in the

a knowledge

Such

thereof, is the basicunit


A

relational

fuzzy

manipulated by

The

1.

organization

Value

3.

of

form

base is

a collectionof

be characterizedby

base

knowledge

or a modified version
system (SES).

FRKB

an

\"soft\" expert

(retrieval)
algorithms
of the FRKB
can be

recognition

2. Explanatory

the

knowledge

which may

relations

of

tables

fuzzy,

or functions

time-varying

and

rules.
divided into three parts:
or translation

(VKB),

knowledge base (EKB),and


rules.

Translation

is usedto storeactualdata values,


whereas
the EKB consists of
a collectionof relationsor functions
(similarity,
proximity,
general fuzzy
set
that \"explain\" how to compute the
relations, and fuzzy
definitions)
of a given data value with the user's query. This
degreeof compliance
part of the knowledge base definition can be usedto reflectthe subjective

The VKB

profile

knowledge

Data Types

of a

user.

The domains

in

the

FRKB

can

be of

the

following

types:

Discrete
2. Discrete
1.

3.

scalar set (e.g., COLOR= green,yellow,


number sets, finite or infinite
(limited

computer word sizeand precision).


The

interval

unit

The attribute

1.

Single

scalars

[0,1].

values are:
or numbers.

blue).

by

the

maximum

726

Chapter 8: Representation
2.

3.
4.

and

possibilistic

real

or numbers.
of scalar or numeric domainvalues.
the unit interval [0,1] (membershipor

of scalars

(list)

sequence

of Imprecision

Manipulation

distribution

from

number

function

distribution
possibility

value).

5. Null value.

In general, if A,attribute value can

is an
be a

imprecise
possibilistic

attribute with a domain


Di9 then an
distribution specified on D,, denoted

bynA.

operators on

(i)

In

used in translationof

fuzzy

relax the dependence of relational algebra


relational operators (=,^,<,>,<,>). These include:

they

essence,
the

EKB are

in the

defined

Relations
propositions.

regular

Let Dt

relation:

Similarity

Then

s(xyy)

\302\243=[0,1] is

be a scalar domain,xty
relation

a similarity

with

Dx.
the

following

properties:

s(x,x) =

Reflexivity:
^-transitivity:
transitivity.

= s(yyx)

s(x,y)

Symmetry:

If jc, y,

where 0 is most commonly


U, then

specified

as max-min

z G

s(x,z) > max {min(s(x,y),


s(y,z))}.
(ii)

Let D, be a numericaldomainand xyyyz G Diy


a
is
G[0,1]
proximity relationthat is reflexive, symmetric
p(x,y)
with transitivity of the form
Proximity

Relation:

>: max

p(x,y)

{p(x,y)

p(yfz)l

y&Di

The

p(x,y)

This form

points.
A

general

link may

fuzzy

equal

assigns

nonreflexive:g(:c,Jt)

degrees

(link) can

relation

have any of

the proximityrelationis
e^*'y\\ where 0 > 0.

form of

used

generally

the

following

of proximity

be definedin eitherVKB

properties:

=0

e-reflexive:g(x,x) = ey
reflexive: g(x,x) = 1

>

to equally distant

nonsymmetric:3 x,y such that g(:t,;y) ^ g(yyx)


^-transitive: generalizedmax-mintransitivity.

or

EKB.

Section

of

Application

8.3

be used

can

link

and

reflexive

friendship

More

Set

Theory

to Expert

727

Systems

to express relationships that are not necessarily


but may obey a specific transitivity,
Typical relations that can be represented
by

symmetrical,

improvement.

transitivity
link are

Fuzzy

complex

or influence among the membersofa group.


in the FRKB system are evaluated
queries

by

or
a

applying

of:

rules

1. Fuzzy modifiers.

2.

relational

Fuzzy

operators.

3. Composition.

4. Qualified propositions.

The

Relational

Base

Knowledge

combined

structure

with

the

theory

of

and possibilityprovidesthe solidtheoretical


foundation.
The
permits \"natural-language-like\"
query
language
expressions that are
understood
easily
by users and can be further developedto incorporate
inferences
or production
rules. The Value KnowledgeBaseappears
fuzzy
tobean adequate
schema
for imprecise data representation. The
Base provides
Explanation Knowledge
the means of individualization, and may
in
used
to extend the query vocabulary by defining new fuzzy
sets
be
terms of previously defined sets. This feature
can
become
very useful in
the
that
compounding knowledge, and it can be projected
underlying
can be utilized in knowledgeextrapolation,
structure
or learning.
Hence,
it can be concluded that the FRKBsystem
can
serve
as the data base in
fuzzy sets

of such
the implementation
8.3.3

an

for

section we present an exampleof

In this
Appelbaum

as

defined

of either

definition
function

purpose

used in an

ARIES

has facilities

for

the

proposition/operation-specifictruth
been implemented primarily as a general

default or

ARIES

formulas.

Further,

etc.).

preference,

desirability,

a general

SES and developed


and
provides mechanismsfor the
and manipulation
of multiple degreesof truth of
by several criteria of truth, belief, or likelihood(or
engine (ARIES)
Ruspini
[46]. ARIES

inference

representation
propositions,

systems.

SES

approximatereasoning
by

expert

of an ApproximateReasoningInference

An Example
Engine

\"soft\"

has

purposeapproximate

of being easily
capable
subsystem
or
other information
of
variety
expert systems
on automated deductive reasoning to a substantial
inference

wide

incorporated

into

systems

that

rely

degree.

Degreesof

in several ways, are


be interpreted
intervals
of the
classical
or
as
either
fuzzy
typically
represented
on
the
interval
of
constraints
the
real
line.
T
hese
intervals
represent
[0,1]
truth,

which

in ARIES

may

728

Chapter

and Manipulation of

8: Representation

Imprecision

possible truth values of propositions(facts) or conditionalpropositions


inference
Truth
values
are combined using userrules).
(approximate
formulas
truth-functional
functional formulas
defined
(i.e., quasi-truth
on truth
constraints
that propagate interval
values). Such formulas can
for eacri fact or rule) for
be defined
the
(and
independently
logical
and
of
operations
implication.
negation, conjunction, disjunction,
In the contextof ARIES deductive
inference consists of the
processes,
determinationof optimal
or near-optimal
hyperedge that link vertices
evidence
representing available
in
AND-OR
the
propositions
rule system (ruledomain).
The

understood
rule domains.

representations
of

hypothetical

representing
describes

that

hypergraph

a propositional

as an approximatereasoninginferenceengine

of ARIES

operation

is better

those

with

when described in

terms

of

hypergraph

also called AND/ORgraphs are generalizations


of
the
are
used
to
b
etween
relationships
represent
graphs
propositions in a rule
domain. In AND/OR graphs, suchastheoneillustratedin
vertex represents a different proposition in the rule
8-7, each
Figure
domain
described.
Directed
to
edges in the graph (usually drawn
being
in
as
arrows
a
their direction
indicate
or,
8-7,
Figure by assuming
using
bottom
to top direction of edges) are usedto connectpropositions
that
Hypergraphs,

that

standard

with
the
antecedents
consequent
corresponding
of the logical connectives joining propositionsin the
at the end of the
is also indicated by means of symbolsdrawn
An arc drawn across
vertex.
edges incidenton the consequent

in rule

appear
proposition. The

antecedent

directed

nature

severaledges
the logical
such
the

an arc
logical

the

that

indicates

connective

Figure 8-7) are

also

at

the

of

in the

arrive

approximate

associated

estimates

real

with
values

world) to

reasoning,
vertices

are joined by
absence

of

assigned

leading

(not shown in
edges to indicate,
by users (on the basis of
values

and

the propositionsand

can
rule domain. These values
of the a posteriori truth value

In the hypergraph,eachpath
about
combinationof knowledge

rules

rule, while

OR.

used for

respectively,the a prioritruth
relations

of the

antecedent

indicates that the corresponding


propositionsarejoinedby

In hypergraphs

observations

propositions

corresponding

in the

AND

connective

of

inferential

by ARIES
goal proposition.

be combined

to

goal represents a possible


of propositions and inference

to the

the truth

a certain
amount of support to the truth of the goal
all such
discussed below,to its logicalnegation.
Among
certain
optimal
possible paths, ARIES usually seekstwo paths
having
properties which are further discussedbelow.
The
examined
paths
by ARIES in this optimization processare not
classical
as conventionally
defined in graph theory. Rather,they
paths
are
as several edges (rather than one) incidentat the same
hyperpaths,
that

proposition

provides

or, as

Section

8.3

of Fuzzy

Application

Figure

Set Theory to

8-7. Example of AND/OR

Expert

Systems

729

graph.

of the subgraph(hyperedge)that must be considered


truth
value. As discussed below, at any ANDcompute
VERTEX
arcs correspond
to
(i.e., a vertex where some of the incident
in
AND
the
of
that
are
the
connective
antecedent
propositions
joinedby
the
all of those edges (and their predecessors)
of
the
are
rule),
part
that must be evaluated.Depending
on
the
numerical
hyperedge
formalism
of evidence)
used to propagate truth values along the
(calculus
at
an
OR-VERTEX
some or all of the edgescorresponding
hypergraph,
to propositions
that are connected by the logical connectiveOR
(and
in
the
their
inclusion
also
require
hyperedge,
predecessors)
might
in many formalisms
only one of them requiressuch inclusion.
although
is a backward-chaining
ARIES
inference engine, that is, hyperedges
and evaluated backward
are searched
leadingto the goal proposition
starting from the known final vertex (i.e., the goal) and establishing
at each
predecessor
step of the search.
subgoals
The numericalvalues
that
combines
ARIES
during its search and
vertex

to

may

be part
the

desired

the
optimizationprocessrepresent
bodies of evidence for the truth

correct statements

about

the

of support
provided by certain
degree
in the rule domain as
of propositions
of a real world system. A priori
state

730

Chapter

8: Representation

and

of Imprecision

Manipulation

users for facts and propositions


are an
support provided by externalobservations
Rules in the knowledge base, on the other hand,
of
the
world.
real
values that may be attained by factual
the truth
constrain
statements
on
of related
statements.
Information
the basis of the truth values
about
system behavior providedby rules can therefore be used by systems such
as ARIES
determine
the support provided by the a prioritruth
to further
values
of the propositional
of the
system, as a whole,to the truth
goal
values provided by

support

indication

of the

extent

the

of

proposition.

The actual

interpretation of the word support and the rationale for the


formulas to combine evidencedependson the particular
and needs of the approximate
reasoning
application
being

of certain
characteristics
considered.
use

is an exampleof

Fuzzy logic
\"soft\"

an

excellent

of evidential truth
as ARIES falls
system

this

of
manipulation

type

expert

rules, and a set of combination


fact is usually given as

list of
for

for the

formalism

quantification. The input to sucha


into three categories:
a list of facts, a
For example, the format
functions.

(((PROPOSITION)(TRUTH-VAL))SUPPORT-PLAUSIBILITY).
in the base rule domain (i.e., a
is any statement
The PROPOSITION
propositionalstatementor a clause in the antecedent or consequentof a
term is either an interval
which
The TRUTH-VAL
rule).
[b,B]
represents the
a priori evidential
lower and upper bounds for the truth values
of the proposition or a call to a function, with
that
optional
arguments,
generates those bounds. For example:

((Jimis

assign^ the interval


of people much

((Jimis
on the other

than

older

much

30) (0.6,0.8))

to the

[0.6,0.8]

degree of

membership

than

older

much

the

computes

hand,

30) (age-factor

as a function
which has the

interval

the results producedby

the degree

plausibility

of

body

and

support

estimate

bound

lower

(support)

confirm

domain

measures

the

extent

(((Jim is

term,
and

upper

bounds

provided

ARIES

of an

of

Jim's

same

age.

The

format

as

(if available).

interval indicating
of the

by consideration

has been computed,is therefore


values for PROPOSITION. Its
in
measures
the extent by which the propositions
the truth of PROPOSITION, while its upperbound
it. For example:
by which the same evidencerefutes

This

evidence.

thea posteriori
the

set

to the

Jim

Jim-age))

SUPPORT-PLAUSIBILITY
is bound to
TRUTH-VAL,
These results are the lower
of

of

olderthan 30.The proposition

interval,
of

possible

if any

truth

much olderthan 30)(age-factor


Jim-age))

(0.5,0.9))

Section

Application of

8.3

asserts that the evidence


that

possible

may range from

Set

Theory

to Expert

731

Systems

in the
base domain (facts and rules) indicates
for the proposition \" Jim is much older than 30\"
value of 0.5 to a highest (nearcertainty)
value
of

values

truth

Fuzzy

a lowest

0.9.

The INFERENCE-FUNCTION
requires
in the antecedent of
the clauses
representing
value
(produced
by the conjunctive formula

as input the AND-VERTEX


a rule

and the

interval

truth

of

the truth value of the conclusion.


by the user of ARIES is usedto
supplied
controlthe optimalpath search process. When more than one rule has
as conclusion,
a strategy must be chosento
the samePROPOSITION
antecedents
will
determinewhich
be expanded.
The input to these
is always
an OR-VERTEX
functions
specification, while their outputs
of their
CONJUNCTION-FUNCTION)

are

AND-VERTICES.

of predecessor

sets

two

returning

conjunction

of input functions

final set

The

is an interval
hypergraphpaths) lower bound
ARIES output

the

The
(plausibility).

for

and where

hypothesis,

goal

(6,B),

also produces

program

b equals
where
the greatest (among
the possible truth value (support) of

B equalsthe leastupper
bound
the solution (i.e.,optimizing)

for

graphs

the
(WHY)
explanation
graphs can be retrievedusing
of
ARIES.
such
as
ARIES
also
capability
Systems
provide
graphics
capabilities that allow displayof portionsofthe hypergraph
representing
- the
rule domain,
or of specific nodes and their predecessors/successors
of a PROPOSITION
On
identifier along one of the optimal
input
paths,
are
also
as a
of
PROPOSITION
rules
capable displaying
they
having
t
heir
and
their
truth
conclusion,
antecedents,
values.,
While many applications of fuzzy set theory are still in an earlystageof
it seems
will
development,
probable that in the next decadefuzzy
logic

B. These

b and

applied in many areas

become

routinely
communication
involved.

This

flexible

thinking

with

may

or

people

help

to bridge

of humans

of

artificial

intelligence

where

thought processesis
and
the gap between the analogic

imitation

of their

and the rigid framework

of

present

computers.

Exercises

for

Chapter

A and B is the smallestfuzzy


set containing
sets
both A and J3,\" which
is also equivalent
to \"If D is any fuzzy set
which contains both A and J5, then it also contains the union of A
and J3.\" Prove the above statement.

1. \"Theunion of fuzzy

2.

that

Prove

equivalent

sets

and

definition

the

to the
B is

following

of intersection
definition:

the largest fuzzy

\"The

of

two

fuzzy

set which is containedin

sets

is

of fuzzy

intersection
both

A and

732

Chapter 8: Representation

and

B\" which

contained

is also equivalent to

intersectionof

A and

any fuzzy

(a)

(b)

A H

and
J3.\"

both

in

3. For

of Imprecision

Manipulation

is

it

is

fuzzy set

any

also

contained

which is
in the

that

A prove

set

\"If

then

By

= A
cj>

0 =0

(c)AU(/=(/
(7 =
A =

(d)

(e)

A U

(f) AH

0.

that the

4. Show

(a) 0-A
- B

(b)

=0
=

(c) A - (A - B) - A n B
(d) C n D = A - [(A - C) U (A
(e) C U D = A - [(A - C] n (A

5. The

symmetrical differenceof

membership function
Uaab =

to

changed

do the
6. Let

IuA

B be

7. Definition:

following are
functions.

the
set

+ (1

^[Axj
The

be

Prove that

and B with

of

operation

^ min

A)x2]

fu(x) = \\/a [u(x -

a)

A B

(xx),

[wA

defined

= (A

U B) A

\342\200\224

- a

- a)]

TheNormal

Distribution

(2^eXP

above,

(J3

Pi A).

aA(x2)J.

continuous

well-known

u(x

~(x-u)\\
2a2

by

sets?

fuzzy

set of n-tuples (yl9 y2,...,


yn) where y,
X is convex if xly x2 E X, V X E [0,1],

some of the

complement operationsare

The Uniform Distribution

and

density

Wx)

set whose

is a fuzzy

to those

related

is

A J3,

(problem4) hold for

fuzzy sets.

fuzzy

sets A

fuzzy

difference

symmetrical

Let UR

real number.A

D)]
D)].

all the relative

above relations
and

uAAB

uB\\. If

the

two

uB, denoted by

uA and

membershipfunctions

sets.

for ordinary

hold

relations

following

co
)\342\226\240

< X < oo

probability

is a

Section

8.3

of

Application

Set

Fuzzy

Theory

to Expert

Systems

733

The GammaDistribution

-jlTT^exp(-^),0<,

fyto

0 elsewhere

wherea > 77ie Beta

0.

0 >

and

Distribution

{(a +

ff + 1)!
\342\200\224

a!

a and /? must

The

\342\200\236
- *)*,
0<x

both be greaterthan

-1.

Density Function

Cauchy

fcto
Show that any

7T

1 +

fuzzy

set

C(2(X

\342\200\224
oo <

X <

by one

of these functions

SelectedAnswers for Chapter8


uAAB

\\uA

uB\\

\\max(uA,UB)

oo

Uf

described

convex.

6.

<1

elsewhere

[0

where

xa(l

~ min(wA,wB)

|.

is

Bibliography

1.

Aho,

V., J.

A.

Beckenbach,
John

and J. D. Ullman,

and

Design

Analysis

Algorithms, Reading,Mass.,Addison-Wesley,
E., Applied Combinatorial Mathematics, New
and Sons, 1964.

of Computer
2.

E. Hopcroft,

Wiley

1974.
York,

L. Lesniak-Foster,
3. Behzad,M.,G.Chartrand,
and
Graphs and
Boston:
and
1979.
Prindle,Weber
Schmidt,
Digraphs,
4. Bondy, J. A. and U.S.R. Murty,
Graph
Theory with Applications,
New York:North-Holland,
1976.
5. Berman,
K. D. Fryer, Introduction to Combinatorics,New
G. and
York:

Academic

1972.

Press,

6. Brualdi, R. A., IntroductoryCombinatorics,


New
and
R. C, Mathematical
Induction
Recursive
Mat.
American
Monthly, 70,128-135,1963.

7. Buck,

8. Capobianco,
M.,

J.

and

in Graph
Counterexample

9.

North-

York:

1977.

Holland,

Theory,
G.,

Chartrand,

and

Weber

Graphs

D. I. A.,
York:John Wiley

C. Mollezzo,
Examples and
New York, North-Holland, 1978.
as Mathematical
Models, Boston,

Basic

Sons,

1978.

M., Elementary CombinatorialAnalysis,


Breach,

New

York,

1969.

S., Algorithmic Combinatorics, New

13. Even,

York,

1964.

Appleton-Century-Crofts,
Gordon and

Theory, New

of Combinatorial

Techniques

and

F., Introduction to MathematicalLogic,New

11. Dinkines,
12. Eisen,

Prindle,

1977.

Schmidt,

10. Cohen,

Definitions,

York,

Macmillan,

1973.

14. Gill, A.,


Cliffs,

Englewood
Applied Algebrafor the ComputerSciences.

New

Jersey,

Prentice-Hall,

1976,

15. Hayden, S. and J. Kennison,


Zermelo-Fraenkel
Charles
Merrill,1968.
Columbus, Ohio,

16.

Henkin,

L.,

On Mathematical

Induction,

Set

Theory,

American Math.

67,323-337,1960.
Monthly,

17.

to Automata
Introduction
and J. D. Ullman,
Theory, Languages, and Computation,ReadingsMass.,Addison-

Hopcroft,
Wesley,

J. E.

1979.

735

E. and S. Sahni,

18. Horowitz,

Fundamentals

Data

of

Structures,

Woodland Hills, Calif.,ComputerScience


Press,1976.
E.
and
S. Sahni, Fundamentals
Horowitz,
of Computer
Woodland
Science Press, 1978.
Hills,
Calif., Computer
Algorithms,

19.

20. Honsberger,
R.,

Mathematical

John

21. Kenelly,

Allyn

and Bacon,

Structures,

New York,

Boston,

Logic,

Informal

W.,

American

The

Gems,

1973.

of America,

Association
Mathematical

1967.

22.
23.

R.
Press,

1974.

D. E.,

The Art

Knuth,
Fundamental

24.

Discrete

Korfhage,
Academic

R.,

of

Computational

ed. 1973).
F. Lessman,
1961.

and

H.

Levy,

Macmillan,

Finite Difference Equations, New

C. L., Elements of

25. Liu,

Discrete

1968.

McGraw-Hill,

York,

27. Mano, M. M., ComputerSystem


Architecture,
New Jersey, Prentice-Hall, 1976.
Their
and
28. Ore, Graphs
Uses, New York,

Random House,

1963.

S. and

E.

Page,

Combinatorics,
30. Prather,
R.,

L. B. Wilson, An Introduction
New York, CambridgeUniversity
Houghton

F. P,

Reading,

Structures,

32. Polya,

to Computational
1979.
Press,

Discrete Mathematical Structures for Computer

Science,Boston,
Preparata,

Cliffs,

Englewood

O.,

G., How

1976.

Mifflin,

and P. T. Yeh,

Addison-Wesley,
Solve
It, Garden

Mass.,
to

to Discrete

Introduction

1973.

City, N.Y.,

Doubleday and

1957.

Company,

33.

York:

New

Mathematics,

C. L., Introductionto CombinatorialMathematics,


New

26. Liu,

31.

York,

1977.

McGraw-Hill,

29.

1968 (2nd

Addison-Wesley,

Mass.,

Reading,

Algorithms,

Vol. I:

Programming,

Computer

G., Mathematics and Plausible Reasoning,Vol. I.


Vol. II., Patterns of Plausible
in Mathematics,
Analogy
Princeton
New
Press,
Jersey,
University
Inference,Princeton,
Polya,
Induction

and

1954.

34. Polya,
Sons,

G.,

35. Reingold,
Algorithms,

Mathematical

New York,

Discovery,

John

Wiley

and

1962.

E., J. Nievergelt,and

Englewood

Cliffs,

N.

New Jersey,

Deo,

Combinatorial

1977.

Prentice-Hall,

36. Riordan,J., Combinatorial


Identities,New

York,

John

Wiley

and

Sons, 1968.

37. Stanat, D. F. and D. F. McAllister,


Computer Science,EnglewoodCliffs,
1977.

Discrete
New

Jersey,

Mathematics
Prentice-Hall,

in

737

Bibliography

38.

T. A.,

Standish,

Data Structure Techniques,Reading,

Mass.,

1980.

Addison-Wesly,

P.

J. T. and R.

39. Tremblay,

Mathematical

Discrete

Manohar,

to Computer Science,New

with Applications

Structures

York,

1975.

McGraw-Hill,

Applied Combinatorics,New

40. Tucker, A.,

John

York,

and

Wiley

Sons, 1980.

41. Tutte, W. T., Non-Hamiltonian


Planar
Maps, in Graph Theory
and Computing,editedby R. Read, Academic Press, 1972.
42. Welsh, D. J. A. and M. B. Powell, An upper bound to the
chromaticnumber of a graph and its applications
to time tabling
W.

Hafner

A.,

D. R. and

Four-Color

Problem,

L. W.

10, 85-86,1967.
and Chance,

Choice

5th ed. (1901),New

York,

1965.

Press,

44. Woodall,
by

Journal

Comput.

problems,

43. Whitworth,

J.

R.

Wilson,

in Selected

Beinke and

R. J.

The Appel-Haken Proof of the


edited
Topics in Graph Theory,

Wilson,

New

York,

Academic

Press,

1978.

45. Youse, B. K., Mathematical


Jersey, Prentice-Hall, 1964.

46.

Induction,

E. H. Ruspini,
and
Reasoning Inference

L.

Appelbaum,

Englewood
ARIES\342\200\224An

Cliffs,
Example

New
of

an

Engine, in Approximate
edited by M. M. Gupta, A. Kandel,
in Expert
Reasoning
Systems,
and J. B. Kiszka,North Holland,1985.
W. Bandler,
L. R. Jr. and D. R. Fulkerson,
Flows
47.
in Networks,
Princeton,
Ford,
N.J., Princeton University Press, 1962.
to Difference
Introduction
48. Goldberg,
S.,
Equations, New York,
Approximate

John

Wiley

49. Zadeh,

1965.
50.
Zadeh,

and

1958.

Sons,

L. A., Fuzzy Sets, Information and Control,8, 338-353,


L.

A.,

Uncertainty

The Role
in Expert

199-227,1983.

51.

M.

Zemankova-Leech,

Bases\342\200\224A

1984.

Key

to Expert

of Fuzzy Logic in the Management


of
Systems, Fuzzy Sets and Systems, 11,
A. Kandel,
Fuzzy Relational Data
Rheinland,
Systems, Koln, Verlag Tiiv

and

Index

table, 38-39

truth

Abbreviated

Absolute complement of a set, 4


582-583

laws,

Absorption

Abstract set theory,


see also Sets

language,

programming

428
Addend

251

614-615

49
Addition rule of inference,
Adjacency matrix, 396-402, 450
536-537
matrix,
multiplicity

Warshall's algorithm, 407-412,

539

76

Adjacent

primes,

Adjacent

vertices,

Adjacent to edge, 333


intelligence

415-418

297,419,423

of, 407

complexity

64

division,

greedy, 486-487
for vertex
406

greedy,
inefficient,

518

sort,

interchange

path,

676

coloring, 567

418-423

minimal

282-284, 425-426

spanning

tree, 494

correctness

polynomial-bounded, 406
postorder

traversal

518

preorder

traversal

515,518

Prim's,494
run

times

Shell sort,

of, 347
419

(LRN),
(NLR),

514,

620

series,

in an

systems;

\"Soft\"

539-

sequences,

on a set,

operation
relations

16

matrix, 396-402
339,

340

asymmetry, 339, 340


396-402

operations on, 398-400


382-383

inner product,

397-398

381-382

inverse,

339, 340

reflexivity,

339,

340

symmetry,

339,

340

set, 10

intelligence (AI), 720,


Expert

Binary

irreflexivity,

110,115

expert systems

596

Bruijn

fuzzy, 713

Permutations

seealso

of sorting

composition,

Arrangement, see Combinations;

731

de
541

Binary

balanced

coded decimal (BCD)

Boolean

Boolean
functions,
of; Switching

Arithmetic

404-

347

Boolean matrix,

619-621

micro-operations

37

efficiency,

antisymmetry,

Arithmetic

search

Biconditional
proposition,
344-346
Big O notation,

of,

multiplexers, 621-626

Artificial

733

adjacency
of,

675

BFS,seeBreadth-first

Binary

615-621

ALU, 619-621

515,

labeling,

representation,

mechanisms

of, 404

Backward

Binary

technique, 627

table

expert

Basis of induction,
103, 111
coded decimal
BCD, see Binary
29-30
Begging the question,
Beta probability density function,

engine

half-adder, 614-615

seealso

edge, 666

algorithms,

621

operations,

Backward

performance

Arithmetic logic unit (ALU)


arithmetic
operations, table
614,

in

performance of height
binary trees, 511

377-378

. full-adder,

chaining
724

407

19-20

carry look-ahead

26-27

and algorithm

minimization

nondeterministic, 419
partial

K., 569

micro-operations,

674-675

merge sort,

35

implication,

see Approximate

logic

Kruskal's, 486-489

labeling,

for

of a binary relation, 339, 340


of a fuzzy binary relation, 713
11
of a set relation,

inference
reasoning

traversal (LNR), 515,

inorder

1973

Antisymmetry

ARIES,

Euclidean, 78, 117


flow-augmenting

systems,

729-731

k, 503-504

of order

Backward

Kempe-chain, 569-571

of, 404-407

efficiency

B-tree

Backtracking,

705

\"soft,\"

graph, 728-731

diagonal,

hashing,\" 357-358

\"double

and

\"hard\"

Argument
basic elements of,

485

DFS, 482,

614

24-26

Approximate reasoning inference


(ARIES), 727-731
engine

419

deterministic,

relation,

binary

Atom of a Boolean algebra,


588
values in the FRKB,
Attribute
725-726

Augend bit,

Ancestor
of a vertex, 482
AND
Boolean
operator, 398-400

Appel,

correctness of, 404

fuzzy

@-transitive
713

reasoning,

*
.\"Analysis-synthesis\"

Antecedent of an

performance of, 405

bubble sort,

28

ANSI Standard Y 32.14,


logic symbols, 601

BFS,482-485
search,

of,

unit

fallacy of, 28

Amphiboly,

AND-VERTEX,

mechanisms

binary

logic

fallacy

Ambiguity,

AND/OR

Boolean, see Boolean algebras


see Switching
switching,

asymptotic

see Arithmetic

ALU,

AND,

Algebra

Algorithms

series, 250-

of

performance
405

algorithms,

AND function, 601, 603

439

AI, see Artificial

339,340

Asymptotic

514

tree,

geometric

Alternating

full-adder, 614,615-621,

Asymmetry

539

407-412,

sets, 5
relation,

of
property
of a binary

Associative

Welsh-Powell, 565-566

^-balancedbinary

Assignment

set, 16

518

514-515,

Alphabet, 373

Adder

half-adder,

404

of,

sort, 428-432

Warshall's,

378,

614

bit,

termination
topological

The

419

vertex labeling, 674-675

function, 326

Ackerman's

Aspects

successive minima,
tree traversal,

38

Absurdity,
Ada

of discovery,
21-22
686
Problem,
on a
Associative binary
operation

(Contd.)

Algorithms

transitive (reflexive)closure,
339-340
transitivity,

383

see also Relations


Binary

search

algorithm, 415-4] 8

739

740

Index

binary

search

Binary

trees

514

a-balanced,

tree, 512-514

search

binary

Boolean algebras

tree, 512-514

complete, 509-510

for drawing,

conventions

508

left

edge, subtree, 507


of vertex, 509

child,

level-order index
parent, 507
518

traversal

preorder

515,

(LRN),

traversal

postorder

514,

(NLR),

515,518
right
traversal

child,

518

edge, subtree, 507


514-515,
algorithms,

Binomial, 201
197-198

189-190

as combinations,

196

summation,

diagonal

as factorials, 191
Newton's

identity, 192-194

Pascal'striangle,
row

193-194

summation, 197

row square

196

summation,

secondary conditions, 194-195


191

property,

symmetry

table of, 195


Vandermonde's

identity,

see also Multinomial


coefficients

theorem, 201-205

Binomial

seealsoTheMultinomial

modular law,

stroke

588-589

subalgebra,

584

graph,

see alsoDirected

457, 547-548
bipartite

graphs

Block diagrams of logic

593

form, 591,605

circuits,

612

forms,

sum-of-products

forms, 605

Veitch

606

see also Arithmetic


logic unit;
Switching mechanisms

601-602

398-400

Boolean subalgebra, 584


sum of sets, 5
Boolean
Bound,
gib, lower, lub, upper, 364
of a
268

search (BFS),482-

485

edge, 472, 541


sort algorithm,
297, 419,

423
Buck, R. C,

canonical

Canonical
form, 591-

normal

592

function,

593

defined, 578

592

expressions

finite, 588

569-

Problem,

571
for vertex

greedy algorithm
567

coloring,

argument, 569-

Kempe-chain

571

for

569-571

graphs,

planar

rules for determining,


560-563
The Scheduling Problem, 558-

560

Welsh-Powell

565-

algorithm,

566

Circuits

combinatorial, see Switching


mechanisms

537-539

Eulerian,

full-adder, 614,615-621
in

388, 442

graphs,

half-adder, 614-615

Circular

representative

equivalence class,

cycle,

543-551

388, 442

function

Capacity

584

normal

form, 591-

Capacity

of a

for sets, 7

of an

of a directed

of a

for, 588-593

Carry

bit,

614

equivalence,

Closedpath,
Closure

Problem,

361

Code

647-648
fuzzy set, 714

Carry look-ahead technique,

350-351, 354-358
442

property, 383-384

The Coconut

633-634,

edge,

481
150-151

12

congruence,

638

cut, 647-648

Cardinality

permutations,

Class

Cantor, Georg, 1,377

Cantor'sparadox

rank of a graph,

Circular reasoning, 29-30


Circumference
of a graph, 465-466

of

356

graph,633
laws,

direct sum, 585-586


disjunctive

The Four-Color

Circuit

589-591

Capacity constraint,

DeMorgan's

558

Theorem, 569-571

logic, see Logic gates

for Boolean

form

Canonical

expressions,

589-591
dagger

Problem,

mechanisms

laws, 582-583

form of expressions,

conjunctive

Number

switching, see Switching

578

axioms,

Theorem,

360

simple,

Boolean algebras
atom, 588

The ChineseRemainder

Hamiltonian

110

Boole, George, 577


absorption

of,

482

Child of a vertex,

5-Color

611

Bubble

method

roots,

defined,

Boolean functions,
minimization
of
Karnaugh maps, 607-609,610-

Bridge

Characteristic

Chromatic numbers

135

2-valued,

conditions
Boundary
recurrence relation,

301-302

roots,

406

for, 580-585

operators,

function of a set, 2

The Chromatic

Boolean functions

diagrams,

373-375

in IHR solutions,
310-319
multiple roots, 302-304

see

Switching mechanisms

Boolean

strings,

300-304

mechanisms,

product-of-sums

systems, 724

in expert

distinct

function,

\"smallest,\"

theorems

Character

defined,301

form, 591,612

produet-of-sums
sheffer

Chaining

Characteristic

587

notation for, 579


partial order on, 580
of duality, 580
principle

Breadth-first

theorem

Bipartite

expressions,

590-592

Boolean matrices, 396-402


204-

205

The

Chain, 363

minterm

maxterm,

722, 724

factor,

Certainty

literal, 590

2-valued, 134-136

191-192

identity,

Cellsofa set, 178

as, 578

lattice

formula, 497

Cayley's

isomorphism, 585

self-dual

204

additional,

identities,

function, 733

583

law,

switching

summation,

Pascal's

idempotent laws, 580-581


involution

707

sets,

8,10,128

of strings, 373
Catenation
Cauchy probability density

585

homomorphism,

conditions, 194-195

boundary
column

functionally complete

of sets,

sum-of-products

coefficients

Binomial

product

of fuzzy

operations,592-593

defined,507
height balanced, 510-512
%
traversal (LNR), 515,
inorder

518

Cartesian

(Contd.)

free, 590

627

generation using
541
Gray, 604
Prufer,

495-497

shift

registers,

741

Index

Coefficients
of generating
247-251
functions,
in power series,239
of a graph, see Chromatic
Coloring
numbers

defined,143

177-181,

ordered partitions,

182-184

Constructive

summary of use, 182-184


unlimited

repetition,

169
unordered

88

164-

172-177

repetitions, 151-154

110

110,249,

Common ratio,
Commutative

a set,

16

Commutative

of sets,

property

Complement
absolute,

of a

set, 4

set,

705

of a fuzzy

of a relation,

of a subgraph,

bipartite

Countable

Completegraph,

Components of a graph,
Composite integer, 120

472

of set relations,
Compound

382-383

complexity theory,

Concentration
Conclusion,

of a fuzzy

set, 706

Conditional proof, 62-63,72


35
Conditional
proposition,

Congruence classofa set, 12


Congruence

modulo

Congruence modulo
relation, 12
Conjecture, 23-24
Conjunction

in Boolean
in

expert

of propositions,
Conjunction

rule

724

34

of inference,

49

of, 693

matching

adjacency matrices, 396-402

654-655

Cycles

connected

bipartite

633

function,

component,

391-392

cut-set, 654-655

388

cycle, 388

442

defined,

332,

directed

path,

437

\"degree spectrum,\" 334

457
593

seeMultiplexers
Data selector,
diagrams, 540

sequences,

Directed

circuit, 388

Hamiltonian, 543-551

de Bruijn

340

graphs
Boolean matrices, 396-402
capacity

de Bruijn

see

bipartite,

net, 649

function,

339,

asymmetric, 339, 340

minimal, 645-652

Dagger

500-501

graphs

antisymmetric,

S-D,647-651
Cut-set,654-655

nondirected,

693

688-689

687,

for,

maximal matching for, 687

of, 647-648
across,

695

Theorem,

Konig's

Latin rectangle, square,

701

edge cut-set,

for, 687,

689-691

Directed

Cycle graph,

algebras, 591-592
systems,

534

472

directed,

m, 354
n equivalence

bipartite graphs

completematching

Cut

edge,

551
61, 63-64

585-586

Directed

Directed forest,

flow

35, 47

proof,

Cubic graph, 439,464-465

capacity

407

A., 561

691

of a graph,

number

Cut vertex, 472


Cuts

14-15

Direct

and

49

Hall's Marriage Theorem,689-

of a graph, 523
Cube,edgegraph of, 458

713

fuzzy set, 706

of a

deficiency

529

Crossovers

274

Computational

Cross edges, 483

Crossoverpoint,

interest as a recurrence

relation,

128-132

graph,

planar

graphs

Direct sum of Boolean algebra,

Covering of edges,695
Crossing

systems, 724

of relations,

126-132

counting,

379

of relations,
see Directed

Digraphs,
Dilation

Dirac'sTheorem,

134

Critical

equations, see

Dirac, G.

of

one-to-one correspondence, 133sequential

ordering of strings,

373-375

Dilemma, constructive

132-133

counting,

377-

362

\"Dictionary\"

destructive,

counting,

indirect

457,
531

452-453,

relations,

sets, 367

factorials, defined, 136

509-510

proofs,

378
Diagonal edge, 548
Diameter
of a graph, 465

Difference

algorithm, 404

principles

in

Recurrencerelations

406

Counterexample, 87

search

argument

Diagonal

Difference
set, 732

applications, 134-136

467
Complete ^-partite graph,
Complete matching, 687, 689-691
of algorithms,
407
Complexity

of fuzzy

sets,

of fuzzy

of an

226-228, 274

of a vertex, 482
49
dilemma,

Descendant

Diaphantus,

seeFunctions
Correspondence,
Counting,

graph,

531-532

in expert

Cook, Stephen,
Correctness

455-456

Complete

Composition

fuzzy

disjunctive

binary tree,

638

707-708

379

Complete

equation,

Convex

on

operation

binary

Converse, 37, 41-42

Problem, 686,691

difference,

Depth-first

DFS, see Depth-first

settheory,

combination

of a proposition, 34
search
(DFS), 482, 485

Denial

Deterministic algorithms, 419


of, 21-22
Development,
stages

law of, 40, 41-42

.Convex

Laws, 6, 40-41,49,50,
584

Destructive

38

Conversation

see

61,86,

Derangements,
87-

edge, 494

see also Sets

mechanisms
Switching
Common

38

Conventional

of; Permutations

The Committee

Contingency,

Contrapositive,

see alsoInclusion-exclusion
principle

of sets, 3-4

Contradiction,

repetitions,

Combinatorial circuits,

Containment
Contracted

181-184

partitions,

with constrained

49

dilemma,

Constructive existence proof,

144, 146

numbers,

repetition

333, 439
Degree of a vertex,
439
Degree sequence of a graph,
\"Degree spectrum\" of a directed

DeMorgan's

35
Consequent
Consistent postulates, 579
Constant
term in power series, 239

bipartite

693

graph,

graph,334

34-38
logical,
of an implication,

Connectives,

coefficients

without

472

391-392,

binomial coefficients,see

with

Connected biparite graph,


548
Connected
components of a graph,
Connected vertices, 388, 472

Combinations
Binomial

Deficiency of a directed

form for
591-592

normal
Conjunctive
Boolean expressions,

539-541

'

388

disconnecting set, 654

edges,seeEdges

endpoints, 388
invariant,

irreflexive,

of graphs

334

339, 340

742

Index

Directed

Double negation,

(Contd.)

graphs

isomorphic, 334-335

of a plane

636

632-633,

labeling,

loop-free, 333

nontrivial path,

Elements

438

339, 340,

transitive, 339-340
connected

unilaterally

adjacent

to, 333

between

vertices,

391-392
vertices, see Vertices
viewed as nondirected

bridge, 472, 541


vertices,

of graphs
graphs,

392

Directed

388

spanning tree, 480

cut

Directedtrees,468-470,
498-504
full,

ordered, 517

506

aspects

Disjunction

algebras, 591-592

in Boolean

in expert
systems, 724
of propositions, 34
126-132
Disjunctive
counting,

incident

591-592

joining

Distinct
of,

representatives,
686

657,

Distinctive-shape

system

logic symbols,

possibility, 715-720
for sets, 5

laws

Distributive

relations,

Divide-and-conquer

321-322
Divisibility

285,

359-360

247-251

458

from, on, to
437
vertices,

of,

333, 439

matching, 687, 688-689


687

matching,

minimal cut, 645-652


333

535-536

multiplicities,

nondirected

388

path,

game, 543

reverse, 666

in binary
639
saturated,
right,

tree, 507

slack of, 639


458
tetrahedron,

Domain

of relation on a set,
in the FRKB,
725

10-11

\"Don't care\" conditions,


609
\"Double hashing\"
algorithms,
358

tree, 483
unsaturated,

357-

11

of expressions,

functions,

switching mechanisms,

596

of, 28

fallacy

(Sieveof), 224-225

ES,seeExpert

systems

20

15

plane,

Euclidean prime,
Euclid's

118
20

Elements,

Euclid's Lemma, 360


535

Leonhard,

Euler,

Eulerian circuit, multigraph,

path,

537\342\200\224539

Euler's

Euler's

formula,

530-532
225-226

0-function,

function, 602,

EXCLUSIVE-OR

603
Existence

proofs,

87-88

Existential generalization, 99
quantifier,

91
Existential

83-87, 8998

specification,

Experimentation

stage of

21
development,

Expert

systems (ES), 720,722,

723-724
721

diagram,

see also

\"Soft\"

systems

expert

Explanatory knowledge base


725-727

(EKB),

639

vertex covering of, 695


Thomas
A., 18
Edison,

Edmonds, 671

85-86

38

Equivalent

Existential

platonic solids, 458

647-651
self-loop, 437
simple path, 388

458

354-358

integers,

Euclidean

333, 437

multiple,

class, 350-351

on

Euclidean algorithm, 78,117

S-D cut,

Dodecahedron

graph
Hamilton's

loop,

350

equivalence

Euclid,

octahedron,458

tests,

The Division Algorithm, 64


Division
of formal power series,
edge

in

666

maximal

601-602

Distribution,

see Flows

labeling, 632-633, 636


in binary tree, 507
left,

722

354-358

integers,

Eratosthenes

Networks

icosahedron,

Disjunctive syllogism,49
Disposition,

flow across,
forward,

for

Equivalence relations, 340

Equivocation,

hyperedges, 728-731

Disjunctive normal form for


Boolean expressions,

654-655

388

endpoints,

350-351

class,

canonical representative, 356

458

edge cut-set,

240

functions,

Equivalent propositional

disconnecting set, 654

dodecahedron,

21-22

of,

sets, 5, 211

Disjoint

^of generating
of sets, 4

on sets,

548

diagonal,

relation,

fuzzy

Equality

Equivalences

332

defined,

Disconnecting set of edges,654


Discovery,

472

edge,

cycle, 388

505

regular,

general

defined,

cut-set, 654-655

506

thin,

equation, 638

cross,483
crossovers,523
cube,458

multigraph, 333

(-reflexive
726

Equivalence

494

contracted,

conversation
Graphs

Directed path,
Directed

matching, 687, 689-

691

438-439

seealso

388

complete

weakly connected vertices, 391-

638

375

428-432

topological,

capacity of, 633-634,647-648


circuit,

388

ordering of strings,
of sets, 367-368

437

constraint,

capacity

set,

Empty

Enumeration

backward, 666

see

networks,

transport
Networks

Edges of graphs

of a set, 1

Endpoints of a path,

paths,

Edge-disjoint

391-392

444

of a graph,
442

labeling

Edge

argument, 19-20

of an

Edge cut-set, 654-655

388

symmetric,

tree, 486

Economy

connected vertices,

strongly

knowledge

Elements (Euclid's), 20

graphs

simple, 333

simple path,

404-407

of algorithms,

Efficiency

base

388-389

see. Paths in
reflexive,
339, 340
paths,

of development,

stage

Egervary, 689
EKB, see Explanatory

Dualofaposet, 370

Networks

see

526-527

graph,

Education

21

vertices of, 569

Menger's Theorem,695
networks,

40

law of,

Dual graph

The Extension
Exterior

525

region

\"Extraordinary\"

Principle, 714
of a plane graph,
sets,

743

Index

Facesofa plane,

525

minimal

binomial coefficients as, 191


136

-defined,

Fallacies
affirming

the consequent, 50
28

ambiguity,

29-30
begging the question,
circular reasoning, 29-30
the antecedent,
50-51
denying

30

cause,

30

generalization,

hasty

non sequitur, 51
post hoc ergo propter hoc, 30
unwarranted assumptions, 2930
\"vicious

29

circle,\"

46

Fermat primes,
Fibonacci

(Leonardo
numbers,

Fibonacci

116
for

120

of Pisa), 269
111, 113-114,
271-273
273

sums of, 270-271


for vertices in height

balanced

binary tree, 511-512

269-270

Fibonacci relation,

of, 271-273

solution

general

Fibonacci
sequence,111,270-273,
^
278

Finite

Boolean algebra, 588

Finite

graph,

First order

437

logic,

see

Logic, first

order

\"The

569-571

Flow-augmenting

path,

Flow-augmenting

path

666
algorithm,

Networks, 671

Forward

labeling,

in networks

capacity

constraint,

defined,

638

638

638

out of a vertex,

638,

663

Integrality

of Flows

The Max

increasing,

Theorem,

Cut
667-669

maximal, 641, 645-652


construction

functions

noncomputable,

on integers

of, 671-

700

subnormal,

700

systems

expert

^-transitive general fuzzy

relation,

726

37-40

Gambler's Ruin, 277

Theorem

of

Gamma probability

density

function, 733

118

of logic,

see Logic,

of

fuzzifier, 710-711

(FRKB), 724-727

Base

Gates,

596

logic, see Logic gates


minimization
of, 600-601

see also Arithmetic


logic
Boolean functions,
Greatest

fuzzy binary
general fuzzy
link, 726-727

relation,

General fuzzy
727
713
726-727

relation

(link), 726-

22

Generalization,

Petersen graph, 464

Generalized

functions

Generating

711-713

calculating

coefficients, 247-251

proximity

relations,

713, 726

defined,

239

division

similarity

relations,

713, 726

equality

of power
of, 240

reflexive, 713

common

divisor

713

of, 713
relation,
relation,

common

Greatest

denominator;

@-transitive, 713

unit;

minimization
of

GCD, see

relations

fuzzy

difference, 732

377-378

modulo m, 355-358

relation, 713
binary
Relational
Knowledge

n-ary

Fuzzy set

subset, 700

see also\"Soft\"

under Sets

Fuzzification,

699-704

function,

on, see

operations
operations

support,

449-457

TheFundamental

Fuzzy

normal, 700

symmetrical

anti-symmetrical,

Flow-Min

Theorem,659-630,

membership

see Boolean
318

composition

672

height, 700

functions

Fuzzy

676

\"greedy\" method for

The Extension Principle, 714


of membership,
699-704
grade

generating, see Generating

Fuzzy

point, 701

699-700
examples of, 701-704

306,

set, see

732

defined,

Functions

forcing,

conventional

sets, 2
crossover

Functionally complete operations


on Boolean algebras, 592-593
Boolean,

700

with

convex,

615-621

fundamentals

flow-augmenting
path
'
algorithm,

an

for

D. R.,659,671
614,

of, 714

contrasted

Knowledge Base

Fundamentals

conversation equation,
flow into,
640

675

Free Boolean algebra, 590


.see Fuzzy Relational
FRKB,

Full-adder,

731

Fuzzy sets
cardinality

of reference
19-20

Fulkerson,

708

705,

union,

708-710

identity,

Mevelset,

containment,

The Four-Color Problem, 569-571

Arithmetic,

across a cut, 649

677

edge, 666

propositional,

676

maximal,

Forward

monotone increasing, 346

5-Color Theorem,

Flows

in expert

chaining
systems, 724

isomorphisms,

First Theorem of Graph


440-441
Theory,\"

Flows in

inverse, 247-251

multiplicative
Forward

intersection, 705, 731-732


kernel
of a fuzzifier, 710-711
max
(#) symbol, 704-705
min
(&) symbol, 704-705
resolution

of, 247-251

Full directed tree, 506

270

Quarterly,

710-711
fuzzifier,
\"soft\"
AND, 705

product, 705-706

Formal power series,239

argument,

for,
general solution
and Pascal's triangle,

Fibonacci

to IHR,

solutions

L.R. Jr., 659, 671


478, 500-501

Forest,

707-708

Principle, 714

The Extension
\"hard\" and

OIQ

Ford,

706

fuzzification,

defined,306
and particular

Frame

n, 273

large

674-

algorithm,

functions

Forcing

706

convex combination,
dilation,

labeling
N

675

707

product,

concentration,

639

value of, 640

division

False cause, fallacy


of, 30
of, 29-30,
Faulty inference, fallacy

edge, 639
edge,

vertex

Cartesian

complement, 705

647-651

unsaturated

718

restriction,

Fuzzy set operations

saturated edge, 639

S-Dcuts,

closure, 713

transitive
Fuzzy

640

638,

(Contd.)
713

symmetrical,

net, 638, 640,668


net
flow into, out of a vertex,

equivocation, 28

faulty inference, 29-30,46

Fuzzy relations

(Contd.)
645-652

cuts,

slack of an

28

amphiboly,

false

in networks

Flows

Factorials

series, 247-251

Index

744

functions

Generating

linearity of, 257


models, 241-244
fraction

partial

shifting
solutions

scalar, 240

decomposition,

252-257

product

290

240-241

of,

properties of, 285-290


to recurrence
relations,

290-296
sum

of, 240

relations

rule, 110

Geometricseries,110,116,
249-251
gib,

of a graph, 465
see Greatest
lower

Goals of an

bound
19

argument,

Goldbach conjecture, 119

Good'sdiagrams,

540

Grade of membership, 699-704


With Applications,
Graph
Theory

551

444

sequences,

fc-critical,

561

fc-partite,

467

labelings,

444

457,

bipartite,

547-548

541

\"bridge\" edge,

see

chromatic

numbers,
Chromatic numbers

circuit

nondirected

graphs,

nontrivial

path,

null, 457

481

rank,

closedpath,

442

see Chromatic numbers


of subgraph, 455-

coloring,
complement

456

531

452-453,

complete,

457,531-532
467
components, 391-

complete bipartite,
fc-partite,

complete

(connected)

392,472

critical

planar,

442, 457,524

degree sequence,
465

diameter,

graphs

edges, see Edgesof graphs


388

Theory,\"

Theorem of Graph
440-441

girth, 465
graphic

464

Petersen,

sequence,

444

Hamiltonian, see Hamiltonian


graphs

simple path,

388,442

size of, 437


spanning subgraph,
star,

543

subgraph,

directed,

452

Havel-Hakimi

Height balanced binary

of graphs
438-

graphs,

Warshairs algorithm, 407-412,

539

Greatest

562-563
.

common denominator
common

divisor (GCD),

356
Greatest element of a set, 364
Greatest

lower

Greedy algorithm,

tree,

510-

Height
of a fuzzy

700

set,

of a tree,

501
500-501

Henkin,

Leon, 110

High-order

languages

(HOLs),

Homogeneous recurrence
266, 306-311
(HR),

(gib), 364
567
486-487,

bound

720

relations

see also Inhomogeneous

Recurrence

relations

for Boolean

Homomorphism
algebras, 585

How to

Solve It, 18

see

Homogeneous

recurrence

relations

457

vertex,

Hyperedges, 728-731

vertices, see Vertices


viewed as directed

Greatest

447

result,

Head of a sequence,282
P. J., 569
Heawood,

\"Hub\"

467

457

604

fallacy of, 30

generalization,

Hasty

HR,

trees, see Trees

converter),

Poset

see

recurrence relations;

339, 340,

458

457,

algorithms, 357-358

diagrams

334, 452

tetrahedron,

set

for fuzzy

AND

\"hard\"

457-458

(GCD),78

forest, 478
generalized

437,438

Gray-code (to binary-code

437

\"The First

527

simple,

543-548

path,

Hamilton's dodecahedron game,

of a vertex,

self-dual,

wheel,

Eulerian, 537-539

551
Hamiltonian

500

439

dual, 569
endpoints,

334-335

subgraph,

proper

Hamiltonian

512

quasi-strongly connected, 498-

union,

458

dodecahedron,

458

solids,

tripartite,

439

see Directed

directed,

457

in graphs
paths, see Paths
Petersen, 463, 464
see Planar graphs
planar,

Sum of Degrees
Theorem,\"440-441

437

defined,

molecules as, 446-447

graph,

551

theorem, 548-551
circuit,
cycle. 543-

Hassediagrams,

\"The

439,464-465

Dirac'stheorem,

Hashing

442

437

438

529

cube, 458

cycle, 388,

organic

graphs

operations,705

458

symmetric

crossing number, 534

cubic,

388-389

406

Grinberg's

388

523,524-525

nonsimple, 438

689-691

Theorem,

Marriage

defined, 543

449-457

nonplanar,

689

Hamiltonian

333

nondirected path,
nonisomorphic,

614-615

Half-adder,

ra-colorable, 558

polyhedral, 531, 532

circumference, 465-466

548-551
an argument,
19

for

Haken, W., 569

multiplicity

path

increasing

543
Hamilton, Sir William
Rowan,
The Hamiltonian Cycle Problem,

of edges, 535-536
536-537
matrix,

of platonic

388, 442

circuit,

Grounds

Hall's

437

multiplicities

order of,

450
396-402,
adjacency matrix,
AND/OR graphs, 728-731

for

Grinberg's theorem,

Hall, P.,

fc-regular, 439

open path,

Graphs

finite,

334,449-457

^-chromatic, 559,561

octahedron,

Graphic

\"Greedy\" method
flow, 663

334

invariant,

isomorphic,

multigraphs, 333,437,438

see alsoRecurrence
Girth

458

intersection, 456-457

loop-free,

table of, 289

Generating

728-731

hypergraphs,

icosahedron,

by a

multiplication

result, 447

Havel-Hakimi

(Contd.)

equivalent expressions for,

728-731

Hypergraphs,

728-731

Hyperpaths,

Hypothesis

of, 23

formulation

inductive, 103

of a proposition,
35, 47
strong inductive, 111
syllogism,

Hypothetical

IC, see Integrated


Icosahedron,
Idempotent
algebras,

48,49

circuit

edge graph of, 458


laws for Boolean

580-581

Idempotent

property of sets, 5

IEC,seeInternational
technical

Electro-

Commission

745

Index
No. 91 for

Standard

IEEE

IHR, see

logic

Inhomogeneous recurrence

601

symbols,

relations

example solutions, 306-311


of particular
solutions,
summary

Inhomogeneous

recurrence relations

elements, 13

of set

Images

318

35

Implication,

law of, 40
logical, 45-46
proof of, see Proof, methods of
Incident
from, on, to edge, 333, 439
of
Inclusion-exclusion,
principle
Euler's

226-228

formulation and

statement

218-219
proofs, 220-222

224-225
Sieve of Eratosthenes,
for three sets, 213-218

sets, 212-213

two

for

601,

603

Incubation stage of development,


\"21-22

579

postulates,

132-133

Indirect counting,
Indirect

333, 439

of a vertex,

In-degree

61, 65-66

proof,

Induction

103-108

strong

mathematical;

and Analogy
Mathematics, 18

see alsoStrong

Inductive

406

423

Intermediate

contraposition,

50,61,86

dilemma,

49

disjunctive

syllogism,

49

specification,

98

47-48, 49

modus tollens, 49
simplification,

transitive
universal

605

form of Boolean
605

expression,

of a binary

Irreflexivity

339,340
Isolatedvertex,

Inference

engine, 720, 721,727-731

Inhomogeneous
relations

(IHR),

recurrence

Leaf of a tree, 482

Leastelement
Least upper
Left child,

40
Middle,

of a set, 364
bound
(lub), 364
507
edge, subtree,

of a path, 388, 391


LeonardoofPisa (Fibonacci),
Level of a vertex, 469, 501
Level-orderindex of binary
Lexicographic

373-375

Linear

of strings,

ordering

permutation,

148-151

257

approximations,

Fuzzy relations; Fuzzy

of relations,

operations;
systems

368
380

Link

368

tree

266
Linear recurrence relation,
Linearity of generating functions,
Linguistic

Join-semilattice,

269

vertex, 509

281-285

Join
of elements,

34

Length

relation,

graph,334,406,449-457
Iteration,

of implication,
Excluded

Law of the

439

Proof,

methods
of

266

the Laws of

form of a Boolean

Boolean, 585

98

generalization,

Reasoning;

602, 603

of contradiction, 34
of contrapositive,
40, 49, 50
of double negation, 40
of hypothetical
syllogism, 48,

49
Law

Isomorphisms

49

rule, 48, 49

universal specification, 97-98

seealso

Law

583

Irredundant

Law

381-382

law for Boolean

expression,

hypothetical syllogism,48, 49
ponens,

41

function,
of
Investigation
577
Thought.\"
algebras,

existential generalization, 99
existential

Law

247-251

(LSI), 600

Latin square, 96-97,693

Lattice,368,578

Irreducible

47-48, 49

detachment,

Large scale integration


Latin
693
rectangle,
Law

Involution

of

Equations

334

\"An

Laws, 6, 40-41,49,

DeMorgan's

The Lancaster

Invariant of graphs,

14

formula,

interpolation

88

426

INVERTER

49, 50

444

Invariant

of a set

45

destructive

sets, 14

for
function
assertion,

636

675

Combat,275

379

of a relation,
49

675

vertex, 674-675

456-457

of a proposition,

dilemma,

algorithm, 674-675

graph,

symbols,

sets, 705, 731-732

multiplicative,

of

constructive

Labeling

forward,

(IEC)
for logic

535-538

486-489

algorithm,

Lagrange's

of sets, 5

49

conjunction, 49

Kruskal's

backward,

Electrotechnical

of relations,

695

Theorem,

Konig's

The Konigsberg Bridges,


Kruskal, J. B. Jr., 486

edge, 632-633,

Inverse

Inference, rules

defined,

418-

vertex, 482

of graphs,
Into

689

600

634

vertex,

601

46

addition,

large scale,
algorithm,

very

of fuzzy

algorithms,

Knowledge-Based Consultant
see Expert
(Expert) Systems,

Intersection

valid, 46-47

modus

and

Interchange sort

103,111

569-571

of a fuzzifier, 710-711
Thomas
Kirkman,
P., 543
The Knight's
Tour Puzzle, 555

large,

medium,

small,

117-15
Publication

Inference
faulty,

Integration:

Commission

22-24

Inefficient

Primes

see

111-115

reasoning,

Inductive step,

571

Konig-Egervary Theorem, 695

relatively prime, 356


of Flows Theorem, 672
Integrality
circuit
(IC), 600
Integrated

inductive

hypothesis

610-611

607-609,

map,

A. B., 569,

Kempe,

Konig,

modulo m, 354-358

in

hypothesis, 103

Inductive

Karnaugh

Karp, 671

systems

of, 359-360

divisibility

International

Induction

503-504

B-tree,

Karnaugh, M., 607

Integers

Internal

mathematical,

graph, 439

fc-regular

Kernel

Inner product of operators,


397
Inorder traversal (LNR) 515,518

prime,

INCLUSIVE-OR function,

Independent

condition,
110, 268
term of a series, 110
442
vertex,

Initial

of,

467

graph,

fc-partite

559

Kempe-chain argument,

relations
Initial

225-226

0-function,

coefficients,
of, 311-319

method
see also homogeneous
recurrence relations;
Recurrence
Initial

fc-chromaticgraph, 56,
^-critical graph, 561
fc-way

undetermined

derangements,

(Contd.)

(IHR)

(general
727

\"Soft\"

see
set

expert

fuzzy relation), 726-

Index

746

Literal for a Boolean variable,


Literal variable, 605
see Inorder traversal
LNR,

Logic, first

590

quantifier, 83-87, 89-

87, 89
by counterexample,
proof by example, 87
87, 89
proof by exhaustion,

quantifiers, defined, 82-83


analysis,

91

abbreviated
basic

truth table, 38-39


34-38
of two

propositional
variables, 39-42
Logic, predicate,

in

602,603

INCLUSIVE-OR,601,603

of, 600-601

an ALU,

601-603

Logical

connectives, 34-38

Logical

implication,

consequence,

trees, 494
spanning
Minimization of Boolean
functions,
functions, see Boolean

Minimal

471

Many-to-one

96
function

Mapping, see Functions

for sets,

14

Networks
capacity function, 633

completematching,

cuts in,

see Cuts

defined,633

capacity,

edge

matching,

687,

coefficients, 191-192

NLR,

traversal

see Preorder

Non sequitur

fallacy,

51

functions, 377-

378

Nondirected

functions,

Nondirected

increasing

existence

Nondeterministic

47-48, 4S, 724

Modus tollens, 49
346

688-689

maximal matching, 687


source
sink,
vertex, 633, 638, 640
Newton's
for binomial
identity

Nonconstructive
87,88

Monotone

633-634

636
632-633,
edge labeling,
in networks
flows in, see Flows
intermediate vertex, 634

354-358
arithmetic,
law for Boolean
algebras,

ponens,

689-

687,

691

Modular

Modus

638,

640

Noncomputable

587

cut, 649

out of a vertex,

flow into,

Boolean expressions,

Modular

439

vertices,
across
a

Neighbor
flow

Net

Minterm

590-592

278

Lukasiewicz, Jan,

of

minimization

LSI, see Largescaleintegration


lub, see Least upper bound

Square,

deposit
expert system, 722
cuts in networks,-645-652

Minimal

333

graph, 437
of a set, 364
bound
see Postorder
traversal
sequence,

in an ALU, 619-

621

Mineral

Loop-free

Magic

of

Micro-operations

Loop, 333, 437

Lucas

coefficients, method of
of Proof, see Proof,
Methods

propositional

Loop-freedigraph,

Undetermined

coefficients, see

methods

functions, 38

LRN,

of undetermined

Method

46

46-47

equivalent

roots,

558

function, 602, 603


of a proposition, 34

NAND

Net

lists, 282-284
423-424
sequences,

711-713

relation,

fuzzy

127

events,

system, 722

expert

Negation

282-284,

300-304

of

valid inference,

699-704

function,

of characteristic

Method

logical implication, 45-46


rules
of inference,
see Inference,

Lower

Merging

sorted

exclusive

MUX, see Multiplexers

n-ary

425-426

sorted

of a graph,

matrix

536-537

n-colorable graph,

algorithm,

Merging

Fallacies

see

faulty inference, 46

Logically

sort

536

Multiplicity

MYCIN

Mersenne primes, 120

45-46

Logical inferences
fallacies,

Merge

power series, 247-251


of graph edges, 535-

(MSI),

Menger's Theorem,695

603

Logic micro-operations in
619-621

of generating
a scalar, 240
of formal
inverse,

Multiplicities

integration
368

Menger, 689

Multiplicative

Mutually

368

89-91

621-626

functionby

system,

Meetof elements,

333

edges,

Multiplication

expert

Meet-semilattice,
Membership

NAND, 602, 603

Logic symbols,

register

Members of a set, 1

INVERTER, 602, 603


602,

scale

600

EXCLUSIVE-OR,

minimization

shift
539-541

The Binomial theorem

see also

Multiplexers,

Boolean expressions,

Medium

theorem,

Multiple quantifiers,

667-669

diagnosis

coefficients
205-

Binomial

Multinomial

Multiple

of, 671-677
Cut
Flow-Min

Maximum-length

722

seealso

The

\342\200\242207

Maximal matching, 687


Maximal
graph, 534
planar
Maximal spanning tree, 493

Medical

expert

205

Multinomial coefficients,205-207

networks, 641,

590-592

AND, 601,603

rules

The Max

Maxterm

Logic gates

logical

construction

723-724

systems,

NOR,

645-652

sequence,

and

inferences
33-34
propositions,

valid

537

traversable,

536-537

flows in

Theorem,659-660,

connectives,
functions

396-402, 450

Boolean, 396-402

81-82

of discourse,
of

universe

graphs, 526-527

Multinomial,

adjacency,
Maximal

537-538

nondirected,

of plane

mathematical

Matrix

multiplicity,

80-

81
universal quantifier, 83-87, 89-

Logic, fundamentals

18

induction

proof

subject-predicate

538

Discovery,

in,

Bridges, 535-

The Konigsberg

induction, 103-108

see alsoStrong

89-91

quantifiers,

multiple

five

Mathematical
Mathematical

open propositions, 81-86

537-539

688-689

network,

integration

paths and circuits

Eulerian

687

maximal,

87-88

scale

538

directed,

condition, 689

equivalences, 85-86

existence proofs,

MSI, see Medium

Multigraphs, 333, 437,438

687, 689-691

complete,

defined,80

91

Problem, 687, 689-

Marriage

691

Matching

order

existential

The

graphs,

proof,

algorithms, 419
333

Nondirected multigraphs, 333


path,

388

Nondirected trees, 469

747

Index

graphs, 449-457

Nonisomorphic

recurrence

Nonlinear

321-322

Nonplanar

Organic moleculesas graphs,

524-525

523,

Out-degree of a vertex,

406

algorithms,

general

439

333,

726

relation,

Nontrivial

path,

Nontrivial

tree,

388-389

Parent

Normal
Normal

and

algorithm,

fuzzy set, 700

graph,

457

string,

373

Null set, 4
Null

362-363, 580

133-134

for sets,

function

Onto

Openpath,

14

442
y

355-358

on integers modulo m,
see under Relations
relations,
on sets, see under Sets
397
Operator on operators,
Operator postfix, prefix notation,
on

471-472

Operators

Sets

of a proposition, 41-42
Boolean
OR, OR.AND
operators,

398-400
OR function, EXCLUSIVE and
INCLUSIVE,
601, 602, 603
437

pair, 9

Ordered partition of a set,

181,182-184
selection

Ordered

Orderedtree, 517

177-

of objects,

enumeration,
lexicographic,

143

see Enumeration
373-375

340-341, 362-363, 580


see Strings
strings,

partial,
on

topological, 428-432
total,

363

Ordinary

generating

Generating

\"Ordinary\"

functions, see

functions

sets, 9

simple,
trivial,

Perfect

718-720

Post hoc

30

Plausible

Postulates,

164

Powell,

144,146

numbers,

172-177

and

M. B., 565

repetitions,

series,

partitions,

repetitions,

247-251

Predicate,81-82
logic

723-724
Preimages

181-184

inverse,

multiplicative

Power set, 7, 9
Predicate

162-

515,

579

formal, 239
division of, 247-251

Power

partitions, 177-181,

with constrained

(LRN),

consistent

independent,

summary of use, 182-184


unordered

traversal

hoc fallacy,

518

Inference,

75

unlimited

ergo propter

Postorder

442

182-184

with

consistency

719

principle,

389

148-151

repetition

715-720

theory,

Possibility/probability

defined,143
ordered

715-720

716

to probability,

related

Possibility,

circular, 150-151
linear,

365

364,

Possibility Postulate,
Possibility

388, 442

integer,

algorithms,

distribution,

Possibility

388-389

in

polynomial

716-717

666

vertex-disjoint,

Patterns
18

of, 458

Posets, 362, 364-368,370


Possibility
assignment
equation,

543-548

a vertex,
442

traverse

edge graphs

solids,
G., 18

Poset diagrams,

of, 388

nontrivial,

406

406

hyperpaths, 728-731

open,442

Subgraph Problem,

Characteristic

Eulerian, 537-539
Hamiltonian,

527

self-dual,

Polynomial-bounded
442

flow-augmenting,

of, 530-532

531, 532
Polyhedral plane graph,
Polynomial, characteristic, see

388

endpoints,

526-527

531, 532

regions of, 525, 569

Polya,

directed, 388
edge-disjoint,

569-

571

Platonic

Permutations

relations

Ordering

265

maximal length, 391

Opposite

Ordered

273

relation,

388, 442

length

Boolean, 398-400

Order of a graph,

numbers,

in graphs

cycle,

Kempe-chain argument,

The Planar

closed,442

set

operations

set, seeunder

265

circuit, 388, 442

sets, see Fuzzy

on fuzzy

Fibonacci

193-194

569-

571

properties

192-194,

as a recurrence
Path graph, 457
Paths

81-86

Open proposition,
Operations

Pascal'sidentity,

569-571

Problem,

polyhedral,

178

Pascal's triangle,

5-Color Theorem,

maximal planar, 534

181-184

of a set,

and

525

region,

multigraphs,

126,350-351

unordered,

0( ), see Big O notation


Octahedron, edge graph of, 458
One-to-one correspondence, 13,14,

Posets

177-181,182-184

of a set,
Parts

sets, see

ordered

ordered,

of, 526-527

TheFour-Color

340-341,

relations,

ordering

Partially
Partition

dual

Euler's formula, 530-532


exterior

252-257

Partial

crossovers,523
cycles,524
defined,523

404

fraction decomposition,

Partial

density

problems, 406-407

NP-complete

tree, 507

Partial correctness of an

591-592

probability
function, 732

Null

Parsing

conjunctive

form,
disjunctive,

of a vertex, 482
in binary
vertex
a sentence,
505

Parent

NOR function, 602,603


Normal

critical, 529

Russell's, 7, 9

469

for, 569-571

numbers

chromatic

Cantor's, 7

fuzzy

relation/726

67-71

principle,

Planar graphs

Paradox

general

Nonsymmetric

of

principle

Inclusion-exclusion,

Pigeonhole

138

Palindrome,

graph, 438

Nonsimple

148-151

Petersen graph, 463, 464

P-ciosure of a set, 384

fuzzy

(Contd.)
repetitions,

see also Combinations;

729-731

Nonpolynomial-bounded
Nonreflexive

Permutations
without

OR-VERTEX,

graph,

446-

447

relations,

in expert

of set

systems,

elements, 13

Premise,35,47
Preorder

traversal

515,518

(NLR), 514,

748

Index

of (Contd.)
Proof, methods
direct proof, 61,63-64

Primes

76

adjacent,

existenceproofs,

Euclidean, 118
Mersenne,

quadruple, 76
Prim's

proof

Principle

66

494

algorithm,

Principle

of duality, 580
of inclusion-exclusion,

proof

71

principle of
Induction,103-108

proof

of

principles

Counting,

Probability, related
718-720

proof by exhaustion,
proof
by mathematical

see

of counting,

Principles

by equivalence,
87
by example,

proof

of Mathematical

to

87, 89

cases, 62,

63, 64-65

87, 89

possibility,

61
trivial proof,
vacuous proof,
61
see also Inference,

733

function, 37-42

Propositions,

33

Number

Problem,406

Problem, 361

The Coconut

TheCommittee

686,

Problem,

691

The Four-Color Problem, 569-

571

TheHamiltonian
Problem,406

TheKnight's
The

Cycle

Tour

The

Puzzle,

687,

Problem,

Marriage

555

535-

Bridges,

Konigsberg

538

689-691

NP-complete, 406-407

ThePlanar

Subgraph

406

The Scheduling

Problem,
558-

Problem,

Problem,

The Towers

of Hanoi,

Problem-solving

strategies, see

of fuzzy

sets, 705-706

of generating

functions,

Product rule, 128-132


Product-of-sums

form,

arithmetic,
Projection
Proof,

existential, 83-87,89-91

591, 612

of
methods

110,115

110,116, 249-251
a relation, 379-380
of

conditional proof, 62-63,72


377-378
diagonal
argument,

fuzzy

Reflexive

general

Reflexive

relation

726

connected

of a

describea
108
relation,

subroutine,
binary

Reflexive
713

\342\200\242

fuzzy relation,
on a set,

11

binary relation, 339, 340

of a similarity
of a planar

726

relation,

vertices,

Regular

language,

Range
Rational

of relation on a set,,10-11
roots theorem,-89

525

tree, 505

directed

Relations
see

binary,

725

Query

569

graph,

of a plane,

83-87, 89-91

relations

Binary

closure property,

Quotient, 64

383-384

379

complement,

composition, 382-383
379

difference,

see Equivalence

equivalence,
relations

24-26

fuzzy,

approach,17-19

aspects of discovery,
circular, 29-30

general

381-382

inverse,

19-20

join, 380

meet, 368

22-24

working

backward, 26-27

working

forward,

20-21

see also Inference,


rules
Proof, methods of

see Fuzzy relations


fuzzy, 726-727

intersection, 379

21-22

elements of an argument,
fallacies, see Fallacies
inductive,

set, 3

109-111

Regions

89-91

\"analysis-synthesis,\"

Progression
geometric,

97-100

propositions,

Quantifiers

Reasoning
240-241

formula to

Reflexivity

282

Reasoning

Product

Quadruple primes, 76

universal,

Recursive

77

triple,

multiple,

108-109

Recursive

system,

498-500

657, 686, 691

Representatives
Problem,

expert

of Hanoi, 282
functions

Generating

Recursion,
of

relations,
of a tree, 495-497

Pythagorean

406

System of Distinct

code

TheTowers

Recursion theorem,

fundamentals

281-285

solutions,

systems of, 319-322

see also

713, 726

Quasi-strongly

Isomorphism

of,

722
Priifer

285-290

functions,

solution, defined, 267

quantified, 97-100

Proximity

321-322

properties of generating

substitution

see alsoLogic,

282-284,

algorithm,

models, 274-275

open, 81-86

Quantified

560

The Subgraph

negation

of, 34

PROSPECTOR

utilities, 523-525

houses and

38

of

Equations

275

425-426

34

equivalent,

268

conditions,

shifting

and disjunction

conjunction

306-311

266,

inhomogeneous, see Inhomogeneous recurrence


relations

nonlinear,

Propositional

Assignment

290-296

homogeneous,

merge sort
of;

Problems

Problem, 686

269-273

relation,

generating function solutions,

linear, 266
rules

\"Probe\" sequence, 358

The Chromatic

285, 321-322

Combat,

Proper subgraph, 334


3-4
Proper subset,

The

relations,

divide-and-conquer

initial

75

divisor,

Proper

as, 274

derangements

The Lancaster

Reasoning

in

methods
723-724

Probability-based
expert systems,

as, 274

compound interest
defined, 266

induction,103-108,111-115

functions, 732-

Probability density

by counterexample,
of
by elimination

solutions,

300-304

Fibonacci

proof

see Inclusion-exclusion,

Principle

67-71

proof by cases, 61-62, 71


61, 66-67
by contradiction,
61, 65proof
by contrapositive,

twin, 76

Primitive triple, 77

roots

characteristic

principle,

pigeonhole

76

triple,

87-88

positive), 61,65-66

120

110

relations,

boundary conditions, 268

proof (proof by contra-

indirect

120

Fermat,

Recurrence

Ordering

P-closure of a set, 384


partial

of;

see

ordering,

ordering

ordering,
relations

projection,

relations

see Partial

379-380

749

Index
Relations

Series

(Contd.)

713, 726

proximity,

Recurrence

see

recurrence,
relations

SES, see
Sets

726

713,

similarity,

symmetric closure, 383


total

transitive (reflexive)closure, 383


379

union,

105, 366-367
of a set, 4
complement
prime
integers, 356

well-ordering,
Relative
Relatively

Remainder, 64

144,146

Repetition

numbers,

Revelation

stage of development,

Resolution

708-710

identity,

22

binary relation on,


sum, 5

Cantor's

Root of a

507

tree, 469,482

300-304

Rule
Rule of detachment, 47-48, 49
Rules
of inference,
see Inference,
Russell,

of

Bertrand, 9

Russell's paradox

for sets, 7, 9

definition,

639

The Scheduling Problem,

558-560

algorithms

Searching

DFS, 482,

485

Selections, see Combinations;


Permutations

plane graph, 526-527


2-valued
Boolean

Self-dual
Self-dual

135

functions,

Self-loop,

437

Semilattice, 368, 371

Sentenceparsing,

505

Sequences

binary search, 415-418

deBruijn,

539-541

111, 270-273, 278


functions
for, table,

Fibonacci,
generating

289

graphic,

sequences,423-

358

searching, 415

sorted, 415
of, 282

Sequential counting, 128-132

11

Simple digraph,

images, 13

elements,

into

14

363

intersection, 5
function,

14

function,

operator,

ordered

13

pair, 9

\"ordinary,\" 9

scale

(SSI), 600
integration
algebra, 588-

Boolean

589

for fuzzy

AND

\"Soft\"

437

edge, 639

\"Soft\" expert

set

systems (SES),722-

724

one-to-onecorrespondence,14
onto function, 14

388, 442

operations,705

368

function,

path,

49
Simplification rule of inference,
Singleton set, 4, 442
for sets, 13
function
Single-valued
Sink
633, 638, 640
vertex,

\"Smallest\"

null, 4
one-to-one

Simple

Small

364

lub, 364

members,

graph, 437, 438

Slack of an

least element, 364


bound,

333

Simple

Sizeofa graph,

inverse function, 14
368
of elements,
join
lower

224-

Similarity relations, 713,726


circuit, 388, 442
Simple

idempotent property, 5

incomparable

of

225

364

element,

greatest

see

The Sieve of Eratosthenes,

meetof elements,

424

tail

see

fuzzy,

gib, 364

of generating

properties

functions, 285-290

Inclusion-exclusion,
principle

defined, 13
Fuzzy sets

mapping, 13

444

merging sorted

\"probe,\"

function,

609, 610

Sievemethod,

many-to-one

head of, 282


Lucas, 278

367-368

214
13

well-ordered, 366-367
(SSD),
Seven-segment display

Shifting

empty, 4

\"extraordinary,\"

415

sequences,

Searching

10-11

elements, 1

equivalence relation,

415-418

binary,

laws,

relation,

6, 212,
function,

Sheffer stroke function, 593


Shell sort algorithm,
419
Shift registers, 539-541

5, 211

equality,

bound,364
diagrams,

596-600,

enumerations,

BFS, 482-485

2-3

universal,

well-defined

2-3

of

union, 4-5
Venn

50,61,86

domain

367

uncountable,

upper

DeMorgan's Laws,6, 40-41,49,

description,

13

relation, 11

transitive

correspondence,13
367

ordered, 363

totally

transformation,

n, 12

modulo

distributive

S-D cut, 647-651


edge,

representatives,
657,686

14-15

of relation,

of distinct

system

16

disjoint,
Saturated

symmetrical difference, 5

commutative property, 5

congruence class,12

11

relation,

symmetric

13

function,

subset, 3-4

operations,

binary

countable,

7, 9

paradox,

single-valued

383-384

property,

containment, 3-4

22,126-132

rules

function, 2

characteristic

congruence

product, 128-132
sum,

Russell's

singleton, 4, 442

product, 8,10

composition

Roots, characteristic,

relative complement, 4

363

chain,

on, 10

relation

comparable elements, 363

tree, 468

Rooted

16

10

paradox,

Cartesian

3-4

subset,

10-11
range of relation,
reflexive relation, 11

Boolean

commutative

child, edge, subtree,


607
pattern,

Right
\"Ring\"

preimages, 13

16

operations,

closure

edge, 666

Reverse

power, 7
proper

associative
associative property, 5
binary

350-351

partition,

systems

11
relation,
binary
operations,

antisymmetric

see Posets

ordered,

partially

249-251

110, 116,
\"Soft\"
expert

absolute complement, 4

363

ordering,

384
P-closure,

239, 247-251

formal power,
geometric,

Sets

see under

set,

Sets (Contd.)
115

110,

arithmetic,

13

ARIES,

727-731

EKB, 725-727

FRKB, 724-727
VKB,

Sorted

725-727

lists, merging 282-284

Sorted sequences,415

750

Index

Sum

algorithms

Sorting

binary search, 415-418


bubble
sort, 297, 419, 423

rule,

see also

22,126-132

Transitive

Inclusion-exclusion,

Transitivity

of

principle

merge sort, 282-284,425-426

Sum-of-products form, 591,605


of a fuzzy set, 700
Support

run

Switching

418-423

sort,

interchange

347

times,

Shell sort, 419


successiveminima,

Source vertex,
Spanning subgraph,

603

452

trees

Spanning

Gray-code (to binary-code

497

formula,

DFS, 482,485
480

maximal,

493

minimal,

485-489

Prim's

properties
Prufer code,

495-497

terminology

associated

with, 482

Specialization, 22

Star graph, 457-458

State diagrams,

shift

722

540

second

,
kind,209-210
for problem

Reasoning

373-375

Strings,

Strong inductive hypothesis,

seealso

Inductive

hypothesis

Strong mathematical

induction,

111-115

seealso

111

induction

Mathematical

392

Symmetric

Problem,406

Subgraphs,

complement

Subroutine,

108

recursive,

Subset

of a fuzzy
of a set,
Substitution

set,

Successiveminima
Sum bit, 614
Sum

of Degrees

440-441
Sum

algorithm,

of generating

Theorem,\"

Terms

of a similarity

^-transitivity
726

494

spanning,
469

nontrivial,

prefix and

operator

postfix

517
in,

482

of, 473-476
properties
Prufer code, 495-497
root
of, 469

rooted, 468

see

spanning,

Spanning

subtree, 482
traversal

trees

514-515,

algorithms,

518

205

Trinomial,

graph, 467

Tripartite
Trivial

path,

Trivial

tree,

(reflexive)

relation

363
282

Functions
closure

on a

469

84
Truth set of a proposition,
Truth tables, 35, 37-41,46
for logic networks
Truth
tables

601

function,

set, 11

function, 602

616

full-adder,

Gray-code
relation,

442

Trivial proof, 61

EXCLUSIVE-OR

428-432

713
of a fuzzy binary
relation,
of a relation, 383
WarshalPs
407-412,
algorithm,

Transitive

482

nondirected, 469

AND

tree, 506

607

Transitive

vertex,

Triple primes, 76

of an algorithm, 404
Termination
in formal
power series, 239
Tetrahedron,
edge graph of, 458

539

functions, 240

178

vertex, 442

The Towers of Hanoi,


see
Transformation,
419

691

38

Total order

for
281-285

Subtree, 482, 507

\"The

partition

Torus,

solutions

recurrence relations,

510-512

trivial,1469
of a set,

Topological sorting,

3-4

191
713

657, 686,

Representatives
Problem,

Thin directed

700

506

parent

relation, 726

System of Distinct

relation,

486

edges, 483

ordered,

coefficients,
relation,

of a fuzzy binary
of a similarity

Terminal

components, 391-392
80-81
Subject-predicate analysis,
Subnormal
fuzzy set, 700
connected

directed, seeDirectedtrees

minimal

binary relation, 339, 340

of binomial

Tautology,

of, 455-456

descendant in,482

notation, 471-472

Tail of a sequence,282

334, 452

509-510

binary,

defined,468

leaf of, 482

of fuzzy sets, 732


of sets, 5

t-part

Isomorphism

relationships,

complete

difference

Mevelset, 708

584

Boolean,

Subalgebra,

The Subgraph

combinatorial

internal

directed graph, 438


relation
on a set, 11

Symmetric

Strongly connected vertices, 391-

search,

height of, 501

Symmetric closure of a relation,

of a

see Binary trees


512-514

binary,

full,

48, 49

hypothetical,

Symmetry

B-tree,503-504

height-balanced,

Symmetrical

solving, see

Strategies

unit;

minimization
of

383

register,

Stirling number of the

see also Arithmetic


logic
Boolean functions,
disjunctive, 49

Institute, 722

Research
University,

Trees

economy,

Syllogism

SSD,seeSeven-segment
display
SSI, see Small scaleintegration
Stanford

596-600,

609, 610

494
of, 480-482

Stanford

602, 603

function,

NAND function, 602,603


NOR
function,
602, 603

seven-segment display,

algorithm,

518

514-515,

501-503

INVERTER

algorithm, 486-489

KruskaFs

537

multigraph,
algorithms,

child in, 482

function, 601,

603

networks, see Networks

Traverse (path), 389

binary

604

converter),

INCLUSIVE-OR

defined,480

directed,

600-601

gate minimization,

BFS, 482-485

Cayley's

596

gate,

724

727

improvement,

Traversal

function, 602,

EXCLUSIVE-OR

339-340

relation,
systems,

Traversable

596

equivalent,

of a binary
in expert

Transport

601, 603

AND function,
419

sort, 428-432
633, 638, 640

topological

mechanisms

48, 49

rule,

converter,

half-adder,

to binary-code
604

615

INCLUSIVE-OR function,
INVERTER
function, 602
623, 625

multiplexers,

NAND function, 602


NOR

function,

602

seven-segment display, 597


Twin

primes,

76

601

751

Index
Boolean

2-valued

2's complement

134-

function,

136

form,

620-621

Venn

defined, 311

312-315
319
polynomials

315-317
Uniform probability density
function, 732

602

connected

Unilaterally

391-392
Union

of fuzzy
of graphs,

of sets, 4-5
Universal

dual

generalization,

98

Universal quantifier, 83-87, 89-91


Universal

set,

2-3

Universal specification, 97-98


Universe
(of discourse),
2-3, 81-82
Unordered
of a set, 181partition

184

Unordered

selection

Unsaturated

Unwarranted
of, 29-30

edge,

of objects,
639

assumptions, fallacy

Upper bound of a set, 364


Vacuous

proof,

61

Valid inference, 46-47


base (VKB),
Value
knowledge

725-727

600
(VLSI),
circle\"
\"Vicious
see Value
VKB,

439

VLSI, see Very

descendant, 482

379

143

569

graph,

out

into,

of,

638,

640

567
in directed

of,

500-501

\"hub,\"
initial,

442

internal, 482

634

439

labeling of, 674-675


left child, 507
level of, in rooted tree, 469
level of, in forest, 501
level-order index, in binary tree,

509

scale

large

of an argument,
S., 402, 407

Warrants
Warshall,

19-20

Warshall's algorithm, 407-412,539


M. E., 464

Watkins,

Weakly connected vertices, 391-

392

333, 439

intermediate,
isolated,

forest,

457

in-degree,

fallacy, 29
knowledge base

437

greedy algorithm for coloring,


height

391-392

integration

edges between, joining,


388
endpoints,
flow

connected, 391-392

connected,

Very large scaleintegration


\"

332

degree,

unilaterally
weakly

cycle, 388

731

389

traverse,

638

472

vertex,

391-392

terminal, 442

covering of edges,695
defined,

sets, 705,
457

of relations,

equation,

633,638, 640

connected,

strongly

connected, 388, 472


cut

vertices,

388

sink, source,

558, 567

conversation

507

child,

simple path,

729-731

388

coloring,

507

quasi-strongly connected, 498root, 482

507

child, 482,

333, 439

482,

parent,

502-

729-731

OR-VERTEX,

out-degree,

right

ancestor, 482
AND-VERTEX,

503

500

439

adjacent,

circuit,

logic symbols, 601-

Uniform-shape

paths,

Vertices of graphs

for products of
and exponentials,

solutions

trial

444

of a graph,
442

labeling

Vertex-disjoint

for polynomials,

solutions

trial

Vertex

for exponentials,

solution

trial

path, 388
of, in directed tree,

number

567

of

out of, 638, 640

flow into,

nondirected

6, 212, 214
of a graph, 558,

diagrams,
coloring

Vertex

coefficients,

method

neighbors, 439
net

606

diagram,

Venn, John, 6

Uncountable sets, 367

204-205

(Contd.)

of graphs

Vertices

Vandermonde's identity,
Veitch, E. W.. 606
Veitch

Undetermined

640

of a flow,

Value

for sets, 13
of integers,

function

Well-defined

Well-ordered property
105

Well-ordered sets, 366-367


D. J. A., 565
Welsh,
Welsh-Power

algorithm,

565-566

Wheel graph, 457, 562-563


Working

backward,

26-27

Working forward, 20-21


Zadeh,

L. A., 699

You might also like