Unformatted text preview: Common Mistakes in Discrete Mathematics CM1 Common Mistakes in Discrete Mathematics
In this section of the Guide we list many common mistakes that people studying discrete mathematics sometimes
make. The list is organized chapter by chapter, based on when they ﬁrst occur, but sometimes mistakes made early
in the course perpetuate in later chapters. Also, some of these mistakes are remnants of misconceptions from high
school mathematics (such as the impulse to assume that every operation distributes over every other operation).
In most cases we describe the mistake, give a concrete example, and then oﬀer advice about how to avoid
it. Note that additional advice about common mistakes in given, implicitly or explicitly, in the solutions to the
oddnumbered exercises, which constitute the bulk of this Guide . Solving Problems in Discrete Mathematics
Before getting to the common mistakes, we oﬀer some general advice about solving problems in mathematics, which
are particularly relevant to working in discrete mathematics. The problemsolving process should consist of the
following steps. (This fourstep approach is usually attributed to the mathematician George P´lya (1887–1985).)
o
1. Read and understand the problem at hand. Play around with it to get a feeling for what is going on and what
is being asked.
2. Apply one or more problemsolving strategies to attack the problem. Do not give up when one particular tactic
doesn’t work. This phase of the process can take a long time.
3. Carefully write up the solution when you have solved the problem. Make sure to communicate your ideas
clearly.
4. Look back on what you have done. Make sure that your answer is correct (think of creative ways to test it).
Also consider other ways of solving the problem, and think about how you might generalize your results.
Your bag of problemsolving strategies may include drawing a picture or diagram; looking at special cases or
simpler instances of your problem; looking at related problems; searching for patterns; making tables of what you
know (and in general, being organized); giving names to what you don’t know and writing equations about it (or,
more generally, applying the mathematical tools you have learned in algebra and other courses); working backwards
and setting subgoals (“I could solve this problem if I could do suchandsuch”); using trial and error (usually called
“guess and check” in educational circles); using indirect reasoning and looking for counterexamples (“if this weren’t
true, then what would have to happen?”); jumping out of the system and trying something totally diﬀerent; or just
going away from the problem and coming back to it later. You will ﬁnd it useful to read over this description of
the problemsolving process repeatedly during your study of discrete mathematics.
Here is an example of applying the problemsolving process to a problem in discrete mathematics. Suppose
we want to ﬁnd the number of squares (of all sizes) on a checkerboard. We understand this to mean not only the
obvious 64 little squares, but also the 2 × 2 squares (of which there will be many), the 3 × 3 squares, and so on,
up to the entire 8 × 8 board itself. We should draw a picture to see what’s going on here. Let’s begin by playing
with a smaller version of this problem, using a board of size 2 × 2 . Then obviously there are 4 small squares and
the entire board, for a total of 4 + 1 = 5 . Let’s try a 3 × 3 board. Here there are 9 little squares, and it is easy
to see that there are 4 squares of size 2 × 2 (nuzzled in the upper left, the upper right, the lower left, or the lower
right), as well as the entire board; so the answer here is 9 + 4 + 1 = 14 . A pattern seems to be emerging—we
seem to be adding perfect squares to get the answer. Maybe for the 4 × 4 board there will be 16 + 9 + 4 + 1 = 30
squares in all. We draw the 4 × 4 picture and verify that this is correct. In fact, we can see exactly what is
going on, the way the upper left corner of a k × k square can be in any of the ﬁrst 5 − k rows and ﬁrst 5 − k
columns of the board, for k = 1, 2, 3, 4 , and so there are (5 − k )2 squares of size k in the 4 × 4 board, exactly
as our sum indicated. We have now solved the problem and can write up a solution explaining why the answer is
82 + 72 + 62 + 52 + 42 + 32 + 22 + 12 = 204 . In the looking back stage (step 4) we would certainly want to notice that
for an n × n board, there are n i2 squares. To continue our investigation, we might want to explore such further
i=1
questions as allowing rectangles rather than squares, looking at rectangular checkerboards rather than square ones
(or counting triangles in boards made up of triangles), or moving to 3dimensional space and counting cubes in a
large cube. Notice how we followed the process outlined above and used many of the strategies listed. CM2 Common Mistakes in Discrete Mathematics List of Common Mistakes
If students or instructors have items to add to the lists below, please let the author know (visit the companion
website for Discrete Mathematics and Its Applications at http://www.mhhe.com/rosen).
Chapter 1
• Incorrectly translating English statements into symbolic form. There are many errors of this type. For example,
there are diﬃculties with the use of the word “or” in English; be sure to diﬀerentiate between inclusive and
exclusive versions (see pages 4–5 of the text). A conditional statement is quite diﬀerent from a conjunction,
but some speakers fail to distinguish them; to say that B will happen if A happens is quite diﬀerent from
saying that A and/or B will happen. Perhaps the most common mistake is confusing p → q with q → p . To
say, for example, that I will go to the movie if I ﬁnish my homework means something quite diﬀerent from
asserting that I will go to the movie only if I ﬁnish my homework.
• Incorrectly negating compound statements without using De Morgan’s laws—in eﬀect saying, for example, that
¬(p ∨ q ) is logically equivalent to ¬p ∨ ¬q , or that ¬(p ∧ q ) is logically equivalent to ¬p ∧ ¬q . For example,
if it is not true that John is over 18 years old or lives away from home, then it is true that he is not over 18
years old and (not or ) he does not live away from home. The correct statements are that ¬(p ∨ q ) is logically
equivalent to ¬p ∧ ¬q , and that ¬(p ∧ q ) is logically equivalent to ¬p ∨ ¬q . This mistake is a general instance
of assuming that every operation distributes over every other operation, here that negation distributes over
disjunction (or conjunction).
• Misinterpreting the meaning of the word “any” in a mathematical statement. This word is ambiguous in many
situations, and so should usually be avoided in mathematical writing. If you are not sure whether the writer
meant “every” or “some” when the word “any” was used, get the statement clariﬁed. As a corollary, of course,
you should avoid using this word yourself. Here is an example: What would one mean if she deﬁned a purple
set of integers to be one “in which any integer in the set has at least three distinct prime divisors”? Does “any”
mean “every” here (in which case the set {30, 40} is not purple), or does “any” mean “some” here (in which
case the set {30, 40} is purple)?
• Incorrectly writing the symbolic form of an existential statement as ∃x(A(x) → B (x)) instead of ∃x(A(x) ∧
B (x)) . For example, the symbolic form of “There exists an even number that is prime” is ∃x(E (x) ∧ P (x)),
not ∃x(E (x) → P (x)), where we are letting E (x) mean “ x is even” and P (x) mean “ x is prime.” As a rule
of thumb, existential quantiﬁers are usually followed by conjunctions.
• Incorrectly writing the symbolic form of a universal statement as ∀x(A(x) ∧ B (x)) instead of ∀x(A(x) → B (x)) .
For example, the symbolic form of “Every odd number is prime” is ∀x(O(x) → P (x)), not ∀x(O(x) ∧ P (x)),
where we are letting O(x) mean “ x is odd” and P (x) mean “ x is prime.” As a rule of thumb, universal
quantiﬁers are usually followed by conditional statements.
• Incorrectly putting predicates inside predicates, such as P (O(x)) . For example, if P (x) means “ x is prime,”
and O(x) means “ x is odd,” then it would never make sense to write P (O(x)) in trying to express a statement
such as “ x is an odd prime” or to write ∀x P (O(x)) to say “all odd numbers are prime.” The notation P (O(x))
would mean that the assertion that x is odd is a prime number, and clearly an assertion isn’t any kind of
number at all. Functional notation has a wonderful internal beauty and consistency to it—the thing inside the
parentheses has to be what the thing outside the parentheses applies to.
• Failure to change the quantiﬁer when negating a quantiﬁed proposition, especially in English. For example, the
negation of the statement that some cats like liver is not the statement that some cats do not like liver; it is
that no cats like liver, or that all cats dislike liver.
• Overusing the term “by deﬁnition” in justifying statements in a proof. For example, Franklin Roosevelt was
not the President of the United States at the start of the country’s entry into World War II in December, 1941,
“by deﬁnition”; he was the President because he had been inaugurated as such early in 1941 and had not died
or left oﬃce.
• Not going back to carefully check the deﬁnitions in justifying statements in a proof. For example, if one is trying
to prove something about odd integers, then it is important to correctly use the meaning of that notion (that
an odd integer is one that can be written as 2k + 1 for some integer k ) at one or more places in the proof.
• Incorrectly starting a proof by assuming what is to be proved. A common occurrence of this in an earlier course
is trying to prove trigonometric identities by starting with the identity and using algebra to reach A = A ; this
is not valid. Similarly, if we are trying to prove a set identity in Chapter 2, such as A ⊆ A ∪ B , it would be Common Mistakes in Discrete Mathematics CM3 invalid to start with the statement A ⊆ A ∪ B .
• Invalidly assuming that a few (or even a large number of ) examples of a universally quantiﬁed proposition
imply that the proposition is true. There is an example from number theory of an intriguing proposition about
a positive integer n that is true for every n ≤ 4,000,000 with the sole exception of n = 1969 . A proof of the
universally quantiﬁed proposition ∀x P (x) consists of showing that the property P (x) holds no matter what
x is chosen from the domain (universe of discourse).
• Incorrectly assuming that an arbitrary object has a particular property when all you know is that there exists
an object with the property. For example, suppose we are trying to prove the assertion that x2 always leaves
a remainder of 1 when divided by 8 . It would be invalid to start our proof by assuming that x = 2n + 1 for
some integer n ; even though some integers have this property of being odd, it is not true that all of them do,
so we would be proving the assertion to be true only some of the time, rather than always.
Chapter 2
• Incorrectly forming complements of sets without using De Morgan’s laws—in eﬀect saying, for example, that
A ∩ B = A ∩ B . The correct statements are A ∩ B = A ∪ B and A ∪ B = A ∩ B . This is another general
instance of assuming that every operation distributes over every other operation, here that complementation
distributes over intersection (or union). Students sometimes make similar errors in algebra, such as asserting,
√
incorrectly, that a2 + b2 = a + b or sin(α + β ) = sin α + sin β .
• Using incorrect notation regarding elements and subsets of power sets and confusing the notions of “element”
and “subset” when dealing with a power set. If A is a subset of S , then A is an element of the power set
of S . For example, if S = {p, q, r} , then {p, r} ⊆ S , so {p, r} ∈ P (S ). On the other hand, {p, r} ⊆ P (S ),
and {p, r} ∈ S . Also, note that Ø ∈ S , Ø ∈ P (S ), and {Ø} ∈ P (S ).
/
/
/
• Incorrectly writing {Ø} to represent the empty set. One reason this cannot be the empty set is that it has one
element in it. Correct notation for the empty set is either { } or Ø . It is a set with no elements in it.
• Incorrectly omitting parentheses in expressions involving intersection, union, and diﬀerence of sets. In absence
of a default order of operations, an expression such as A ∩ B ∪ C is ambiguous, since it might mean either
(A ∩ B ) ∪ C or A ∩ (B ∪ C ), and these are not the same sets. It is important to put in parentheses so that the
reader knows what you mean.
• Failing to regard a function as an object at a higher order of abstraction than an element, an ordered pair, or
a set. The notation f : A → B means that f is a process—a rule that must apply to every element of A and
in each case yield a result in B . The function is not A , it is not B , it is not an element of A or B , nor is it
the action on just one element of A . For example, if f is the function from {1, 2, 3} to the natural numbers
that has the rule f (x) = x2 , then f is the entire process that takes 1 to 1 , 2 to 4 , and 3 to 9 ; it is not, for
example, just the number 9 or just the pair (3, 9).
• Confusing the idea that a function must be well deﬁned with the concept of onetooneness. A function in
general need not have the property that distinct elements of the domain be sent to distinct elements of the
range. What a function must satisfy is the requirement that two diﬀerent elements of the range cannot both
be the image of the same element of the domain. Thus f (x) = x2 is a function from the set of real numbers
√
to the set of nonnegative real numbers (it’s onto but not onetoone), but f (x) = ± x is not a function from
the nonnegative real numbers to the real numbers.
• Incorrectly calculating values of ﬂoor and ceiling functions, especially for negative values. The ﬂoor function
always rounds down, and the ceiling function always rounds up. Thus, for example, −3.2 = −4 , and
−3.2 = −3 .
• Incorrectly including diagonal portions in sketches of ﬂoor and ceiling functions and their variations. These
graphs almost always consist entirely of horizontal segments.
• Misusing function notation, especially the dummy variable in a deﬁning equation. The input goes inside the
parentheses following the function name, and the entire expression then represents the output. For example, if
f (x) = x2 , then it is correct to write f (7) = 49 , not things like f = 49 or f = 7 or 7 = 49 . The equals sign
in mathematics should be used to mean that two things are equal, and not as a shorthand for “and then we
have . . . .”
• Confusing function notation with multiplication. Although writing two mathematical expressions next to each
other, especially with parentheses, often implies multiplication, this deﬁnitely does not apply when the ﬁrst
object is a function. For example, if a function is deﬁned by f (x) = x + 10 , then f (7) means “eﬀ of seven” CM4 Common Mistakes in Discrete Mathematics (which is 17 in this case) and not “eﬀ times seven” (which makes no sense). Math has to make sense!
• Thinking that all functions are linear. The distributive law for numbers says that t(x + y ) = t(x) + t(y ) if here
t , x , and y are numbers and the juxtaposition means multiplication. For example, 8(2 + 10) = 8 · 2 + 8 · 10 ;
both sides equal 96 . However, if t is the squaring function and again x and y are numbers, then it is not true
that t(x + y ) = t(x) + t(y ); if we again take x = 2 and y = 10 , then the lefthand side is (2 + 10)2 = 122 = 144 ,
whereas the righthand side is 22 + 102 = 4 + 100 = 104 .
Chapter 3
• Forgetting to increment counters inside loops of procedures when constructing algorithms. If the counter is not
incremented, the loop will probably run forever.
• Thinking of a bigO estimate as if it were a bigTheta estimate, i.e., thinking that is provides both a lower
bound and an upper bound on the size of the function. BigO estimates are only upper bounds. It is not correct
to say that suchandsuch an algorithm is ineﬃcient because it runs in time O(n7 ), since, for instance, a linear
algorithm (one with running time proportional to n ) also satisﬁes this estimate. What one would want to say
in such a case (if it is true) is that the algorithm runs in time Θ(n7 ).
• Not understanding that the constant in a bigO estimate can be very large. For example, if an algorithm has
running time O(n2 ), then it might take 1055 n2 steps and so be impractical even for small values of n .
• Being misled by exponents when comparing dissimilar functions. For example, it might at ﬁrst glance look as
if (log n)100 is growing faster than n1/2 , but in fact the latter is growing faster, since log n grows so slowly
compared to n . Thus (log n)100 is O(n1/2 ), but n1/2 is not O((log n)100 ).
• Adding when one should be multiplying, or vice versa, when analyzing running times of algorithms. If one loop
is nested inside another, then the running times are multiplied; if one loop follows another, the times are added.
• Incorrectly making a mod m negative. For example, −16 mod 5 is 4 , not −1 .
• Confusing a/b and a  b . The slanted slash is an operation, and the result of the operation is a number . For
example, 6/3 is the number 2 . The vertical bar is the verb of a sentence. For example, 3  6 is asserting that
3 is a divisor of 6 ; it is not speaking of the result of actually carrying out the division.
• Writing a  b when one means b  a . It is true that 3  6 , but it is not true that 6  3 .
• Incorrectly considering 1 to be a prime number. It’s as much a matter of convention as anything else, but the
number 1 is, by deﬁnition, neither prime nor composite.
• Forgetting that all positive integers are divisors of 0 , and therefore that gcd(a, 0) = a for all positive integers a .
For example, gcd(6, 0) = 6 . Of course 0 is not a divisor of any nonzero number, and division by 0 is undeﬁned.
• When carrying out the Euclidean algorithm, incorrectly using the last quotient as the ﬁnal answer (the gcd ),
rather than the last divisor. For example, if the last step is to divide 4 into 8 , giving a quotient of 2 and
remainder of 0 , then the gcd is the ﬁnal divisor, 4 , not the ﬁnal quotient, 2 .
• Incorrectly assuming that everything that works for equality works for congruence. For example, it is not true
that just because r and s are congruent modulo m , ar ≡ as (mod m). Try m = 3 , a = 2 , r = 1 , and s = 4 .
Also, note that even though 8 ≡ 14 (mod 6), it would be wrong to divide both sides by 2 and claim that 4 ≡ 7
(mod 6).
• Incorrectly assuming that multiplication of matrices means entrybyentry multiplication. Addition of matrices
is done term by term, but multiplication is more complex.
Chapter 4
• Erroneously believing that all inﬁnite sets are countable. Although it is possible to give an inﬁnite list of certain
1
1
3
inﬁnite sets (such as the set of rational numbers, using an order like 0, 1 , − 1 , 1 , − 2 , 2 , − 2 , 1 , − 3 , 3 , − 1 , 1 , − 1 ,
1
12
1
13
1
4
4
2
23
34
41
3 , − 3 , 2 , − 2 , 1 , − 1 , 5 , . . . , it is not possible to do this for certain larger sets, such as the set of real numbers.
There is no list of all the real numbers, as was proved in Section 2.4.
• Incorrectly applying to inﬁnite sets intuition that is valid for ﬁnite sets. For example, if a ﬁnite set A can be
put into onetoone correspondence with a proper subset of B , then clearly A < B  . This is not true if A is
inﬁnite, however: Let A be the even natural numbers and let B be the natural numbers—then A can be put
into onetoone correspondence with (in fact is ) a proper subset of B , but A can also be put into onetoone
correspondence with all of B (pairing 2n with n for n = 0, 1, 2, . . . ), so in fact A = B  .
• Forgetting to do the basis step in a proof by mathematical induction. The inductive step goes through ﬁne, for Common Mistakes in Discrete Mathematics • •
• •
• • CM5 example, if we try to prove that n = n + 1 for all positive integers n , but this proposition is obviously not
true. The catch is that the basis step (when n = 1 ) fails, since 1 = 1 + 1 .
Failing to do more than one case in the basis step in a proof by mathematical induction in certain situations,
such as when the inductive step needs two or more previous conditions. For example, when proving statements
about the Fibonacci sequence, it usually is necessary to check the ﬁrst two basis cases (say n = 1 and n = 2 ),
since the inductive step relies on the equation fn = fn−1 + fn−2 .
Confusing a summation with the propositional function P (n) in an induction proof. For example, in trying to
prove 1 + 2 + 3 + · · · + n = n(n + 1)/2 by induction, P (n) is this entire equation, not its lefthand side.
Not being organized when attempting to write a recursive deﬁnition. Good advice here is to think about how
you want to build up the items under discussion, step by step. The inductive rules of the deﬁnition need to
be formulated to permit each such step, and base cases are needed to get the process oﬀ the ground. Common
mistakes include not including enough base cases (for example, the recursive deﬁnition of regular expressions
in Chapter 12 requires three base cases), having conﬂicting cases (for example, having one clause to handle n
divisible by 2 and another clause to handle n divisible by 3 , and thereby not having a unique deﬁnition for
those n divisible by 6 ), or having a function value at n depend on a function value at an input larger than n
(e.g., trying to set f (n) = f (3n + 1) − 2 ).
In a proof by mathematical induction, writing P (k + 1) incorrectly. Once P (n) is properly formulated, writing
P (k + 1) can usually be done more or less mechanically by plugging k + 1 in for n . For example, if P (n) is
the statement 2 + 4 + 6 + · · · + 2n = n(n + 1), then P (k + 1) is 2 + 4 + 6 + · · · + 2k + 2(k + 1) = (k + 1)(k + 2).
In a proof by mathematical induction, making errors in basic algebra, especially in simplifying expressions. For
example, you might have to use the fact that 2n + 2n = 2n+1 , or to simplify (n + 1)3 + 5(n + 1)2 , which is
best done by factoring, not by ﬁrst expanding each term. Carefully check your algebraic manipulations when
you have trouble with the inductive step of such a proof.
In a recursive algorithm, failing to let the computer do the recursing. The hardest thing to overcome in thinking
about recursive algorithms is the reluctance to believe that the smaller case will be handled correctly. For
example, suppose that you want to write a recursive algorithm to compute an , using the facts that a2k = (ak )2
and a2k+1 = (ak )2 · a . The recursive call will handle the calculation of ak , and so you don’t need to worry
about how the computer will repeatedly recurse, all the way down to the base case, in order to do that. As
long as your recursive step and basis case (here, a0 = 1 ) are correct, your algorithm is correct. Chapter 5
• Drawing an incorrect diagram when solving counting problems. Diagrams are very useful in all of mathematics,
and drawing a diagram is almost always a good way to start solving a problem; thus failing to draw a diagram
could also be considered a common mistake. For example, you should draw a row of six blanks (not ﬁve) as
a template for constructing words of length 6 whose symbols are chosen from a set of ﬁve elements. Tree
diagrams are also sometimes quite helpful.
• Not determining whether or not order matters in solving a counting problem. For example, if we are asked for
the number of ways to write 7 as the sum of positive integers, then we need to know whether 3 + 2 + 2 and
2 + 3 + 2 are to be considered the same way or distinct ways. Read the problem very carefully to understand
what is being counted. Resolve any ambiguities ahead of time by explicitly stating any assumptions that seem
to be missing from the problem formulation.
• Not determining whether or not repetitions are allowed in solving a counting problem. For example, if we are
asked for the number of ways to choose ﬁve donuts from a shop selling eight varieties of donuts, we need to
know whether we are allowed to choose more than one donut of the same variety. Read the problem very
carefully to understand what is being counted. Resolve any ambiguities ahead of time by explicitly stating any
assumptions that seem to be missing from the problem formulation.
• Counting each item in the set under discussion more than once, not recognizing that an adjustment needs to be
made for double counting. For example, if we count handshakes person by person, then we need to recognize
that each shake has been counted twice, once for each of its participants.
• Counting each item in the set under discussion more than once, not recognizing that the inclusion–exclusion
principle is needed. For example, if we are told that there are 26 computer science majors and 34 mathematics
majors at a certain university, then there may not be 26 + 34 = 60 people majoring in either computer science
or mathematics, since these two numbers might both include the double majors. To correctly compute the CM6 Common Mistakes in Discrete Mathematics total number of people majoring in these subjects, we would need to subtract the number of double majors
from this sum.
• Using the pigeonhole or generalized pigeonhole principle incorrectly. It helps to explicitly identify the pigeons
and the holes. For example, to ﬁnd the minimum number of cards that must be chosen in order to guarantee
that at least six of the same suit are picked, the holes are the suits, and the cards are the pigeons (the answer
is 21 ).
Chapter 6
• When trying to calculate the probability that one of two events will occur, incorrectly taking the sum of the
individual probabilities. For example, the probability that a 3 will show up if a fair die is rolled twice is not
1
1
6 + 6 , the sum of the probability that the 3 occurs on the ﬁrst roll and the probability that the 3 occurs on the
second roll. Instead, we should calculate this as 1 minus the probability that the 3 fails to appear on either
roll (which is 5 · 5 , since the rolls are independent). Thus the correct answer is 1 − 25 = 11 , rather than 2 .
66
36
36
6
• Assuming that all events in a probability calculation are disjoint. Doing so can lead to absurd conclusions, such
as a probability greater than 1 . (This is really a generalization of the previously listed mistake.) For example,
to calculate the probability that someone else in your graduating class of 400 students shares your birthday
(assuming that all birthdays are equally likely and ignoring February 29), you cannot argue that since each of
them has a probability of 1/365 of sharing your birthday, the probability is 399/365 (probabilities can never
exceed 1 , and in any case, this event is not a certainty).
• Assuming that all events in a probability calculation are independent. For example, to calculate the probability
that we get two hearts when drawing two cards from a deck of cards, without replacing the ﬁrst card before
drawing the second, we cannot simply note that the probability of drawing a heart is 13 on each draw (that
52
1
much is true) and therefore conclude that the answer is 13 · 13 = 16 . Instead, we must determine that for
52
52
the second draw, the probability of drawing a heart, given that we drew a heart on the ﬁrst draw, is 12 , and
51
1
therefore that the probability of drawing a heart both times is 13 · 12 = 17 .
52 51
• Getting misled by the subtle assumptions inherent in probability problems. The most famous example here is
the Monty Hall Three Door Problem (see Example 10 in Section 6.1 of the text). Unless one is very careful
about the assumptions one makes about the game host’s protocol, one cannot calculate the probability that
switching doors will change your chances of winning. For example, if the host (who knows where the prize lies)
were to oﬀer you a switch if and only if you had chosen the correct door, then obviously it would be wrong for
you to switch when he makes the oﬀer. A national debate about this problem raged for many months when it
was popularized in a magazine article.
• Letting intuition interfere with reason in working with probability. For example, it might seem counterintuitive
that among a group of 23 people, the odds favor two of them having the same birthday, but the calculation
shows this to be true.
• Forgetting that units for variance are squares of units for the underlying random variable. For example, if the
heights of adults have a mean of 67 inches and a variance of 9 , this is 9 square inches, not 9 inches. One
should take the square root and restate this as “the standard deviation is 3 inches,” which is a more meaningful
way to measure the spread of the distribution of heights.
• Confusing p(A  B ) with p(B  A) . For example, the probability that a person who tests positive for a disease
actually has the disease is usually much smaller than the probability that a person who has the disease tests
positive for it. One can often use Bayes’ Theorem to compute the former probability, given the latter (and
additional information about the prevalence of the disease and the false positive rate for the test).
Chapter 7
• Failing to note the need for the inclusion–exclusion principle. To believe that A ∪ B  = A + B  is always
true is related to the wishful thinking that every operation distributes (or otherwise behaves in some simple,
agreeable way) with respect to every other operation. This equality holds only when A and B are disjoint.
• Confusing the signs of the terms when applying the inclusion–exclusion principle. Note that the signs alternate
as we take larger and larger unions.
• Not including all the terms when applying the inclusion–exclusion principle. If there are n sets involved, then
there are nearly 2n diﬀerent terms in the equation altogether. Common Mistakes in Discrete Mathematics CM7 • Giving up too easily when trying to write down a recurrence relation to model a problem situation. Ask yourself
how one can obtain an instance of the problem of size n from instances of sizes n − 1 (or sometimes also smaller
instances). Make sure to consider all the possibilities, and make sure to include enough initial conditions. For
example, if an is the number of ways to climb n stairs if we are allowed to take them either one at a time or
three at a time, then clearly a1 = 1 , a2 = 1 , and a3 = 2 , and then an = an−1 + an−3 for n ≥ 4 , since the
ﬁrst step could be a single step or a triple step.
• Misapplying the algorithm for solving linear homogeneous recurrence relations with constant coeﬃcients when
there are repeated roots of the characteristic equation. One needs to multiply by powers of n in this case.
For example, if the characteristic equation is r2 − 6r + 9 = (r − 3)2 = 0 , then the general solution is an =
c 1 · 3 n + c2 n · 3 n .
• Finding a bogus particular solution of a linear nonhomogeneous recurrence relation with constant coeﬃcients.
It is always advisable to check the solutions you obtain. For example, if you had computed that an = 2n was
a particular solution to an = 2an−1 + 2n , then plugging this in would show you that you must have made an
error, since it is not true that 2n = 2 · 2n−1 + 2n .
• Forgetting to use the inclusion–exclusion principle when counting solutions to an equation in nonnegative integers. For example, to count the number of solutions to x + y + z = 58 where 0 ≤ x < 8 , 0 ≤ y < 10 , and
0 ≤ z < 15 , one needs to count the number of solutions when the upper bound restrictions are lifted, then
subtract the number of solutions in which each such restriction is violated, then add back the number of solutions in which two such restrictions are violated simultaneously, and ﬁnally subtract the number of solutions
in which all three restrictions are violated.
• Forgetting to worry about the ﬁrst few terms of a power series. When solving a recurrence relation by using
generating functions, the recurrence relation usually kicks in only for k ≥ 1 or 2 ; thus the ﬁrst term or two
must be handled explicitly.
• Failing to change the variable in a power series when necessary. For example, if a power series has xk−1 and
you need it to be xk , you can replace k by k + 1 throughout the summation (including the limits) and simplify
∞
∞
∞
k −1
= k+1=1 (k + 1) x(k+1)−1 = k=0 (k + 1) xk .
algebraically:
k=1 k x
• Setting up the wrong model when solving counting problems with generating functions. You need to carefully
work out what each factor of the generating function needs to be, worrying about how much repetition is
allowed and whether order matters. See, for instance, Example 12 in Section 7.4 of the text, where the proper
generating function depends on whether or not we take order into account.
• Making algebraic errors in working with generating functions. When expanding a generating function to ﬁnd
the coeﬃcient of xn , one must of course use the distributive law. The algebraic manipulations can get messy,
as the number of terms can grow rapidly. One solution to this problem is to use a computer algebra package
such as Maple to do the algebra. For example, to multiply out (1 + x + x2 )(1 + x2 + x4 + x6 ), you end up with
12 terms, which then simplify to 1 + x + 2x2 + x3 + 2x4 + x5 + 2x6 + x7 + x8 .
• Not knowing how to use partial fraction decomposition when dealing with generating functions, or making errors
in the procedure, such as forgetting to include terms of the form (x − a)k for all k such that 1 ≤ k ≤ n when
the factor (x − a)n appears in the denominator of the fraction to be expanded. This subject is traditionally
taught in calculus courses, even though it has little to do with calculus (other than the fact that it is used as a
technique of integration). Therefore those students who have not yet studied enough calculus (partial fractions
are usually covered in the second semester), or who have taken a course in which this topic is not covered, may
need to ﬁnd a source of instruction for this useful tool (or rely on a computer algebra package such as Maple
to perform the task). Any traditional calculus text will probably have a section from which this material can
be learned or reviewed.
Chapter 8
• Failing to draw a picture when dealing with relations. The digraph of a relation on a set gives an excellent way
to visualize what is going on. This common mistake can be generalized: Failing to draw a picture when dealing
with any mathematical object. See the list of general problemsolving strategies given in the introduction to
this section of the Guide .
• Forgetting to think about pairs (a, b) and (b, a) when checking for transitivity of a relation or forming the
transitive closure. In this case, one needs to have (or add) the loops (a, a) and (b, b) as well.
• Failing to recognize that symmetry or transitivity often hold vacuously. For example, the relation {(1, 2), (1, 3)} CM8 •
• • • • •
• • Common Mistakes in Discrete Mathematics is transitive, because it is vacuously true that whenever (a, b) and (b, c) are in the relation, so is (a, c)—i.e.,
there are no pairs making the hypothesis of this conditional statement true.
Forgetting that order of operations matters when forming closures. The symmetric, transitive closure is not the
same as the transitive, symmetric closure, for example.
Incorrectly assuming that every relation has desired properties, such as symmetry or transitivity. It is certainly
not true that every relation is a total order or an equivalence relation. Many partial orders are not total, so
elements can be incomparable (for example, it is true neither that {1, 2} ⊆ {1, 3} nor that {1, 3} ⊆ {1, 2} ).
If I know you and you know Mary, that doesn’t mean that I necessarily know Mary. If f (x) is O(g (x)), that
doesn’t mean that g (x) is O(f (x)).
Confusing equivalence relations and partitions. These two concepts are closely related—two elements in the
underlying set are related if and only if they are in the same set of the partition. An equivalence relation is a
set of ordered pairs of elements of the underlying set (satisfying certain conditions), and a partition is a set of
subsets of the underlying set (again satisfying certain conditions).
Making the understanding of equivalence relations harder than necessary. In most cases you can think of an
equivalence relation as a relation of the form “two elements are related if and only if they have the same
somethingorother.” For example, the equivalence relation on the set of integers given by “ a is related to b
if and only if a ≡ b (mod 7)” can be thought of as “ a and b are related if and only if they have the same
remainder when divided by 7 .” See the important Exercise 9 in Section 8.5.
Invalidly applying to inﬁnite partially ordered sets intuition that is valid for ﬁnite posets. Hasse diagrams can
be misleading for inﬁnite posets (or they may not exist at all), so be wary about thinking of all posets in ﬁnite
diagrammatic terms. For example, in the poset consisting of the positive real numbers under the ≤ relation,
there is no immediate successor to any element, so there would be no edges in the Hasse diagram if we were to
try to draw one.
Forgetting to eliminate all the implied edges when drawing a Hasse diagram. If there is an edge from a to b
and one from b to c , where a lies above b and b lies above c , then you must not show an edge between a
and c .
Forgetting that certain pairs in a relation are implied in a Hasse diagram. If there is an edge from a to b and
one from b to c , where a lies above b and b lies above c , then c is related to a even though there is no edge
between a and c .
Incorrectly supposing that all partial orders have least or greatest elements, or that least upper bounds or greatest
lower bounds always exist. For example, in the poset ({a, b, c, d, e}, {(a, a), (b, b), (c, c), (d, d), (e, e), (a, b), (c, b),
(c, d), (e, d)}) there is no least element, no greatest element, and no least upper bound for {a, e} . Similarly, in
the poset consisting of the integers under ≤ together with two extra elements x and y that are deﬁned to be
less than all the integers and unrelated to each other, there is no least upper bound for {x, y } , even though
every integer is an upper bound. Chapter 9
• Getting confused by some of the terminology in graph theory, such as the distinction between path and simple
path. Here is one place where memorization is required. Making your own glossary on ﬁle cards or in a computer
ﬁle may be helpful.
• Overcounting the edges in a graph by forgetting to divide by 2 when adding the degrees of the vertices. Each
edge is counted twice, once for each end.
• Being unsure about what kind of graph model to use. If the relationship between objects in the situation you
are trying to model is symmetric, then an undirected graph is probably appropriate; otherwise a directed
graph usually works best. For example, highways joining major cities can be traversed in either direction, so
an undirected graph is appropriate for this model. The predatorprey relation among species of animals is
deﬁnitely not symmetric, so a digraph seems right here.
• Incorrectly thinking that if two graphs share many of the same attributes (invariants like number of vertices,
number of edges, etc.) then they must be isomorphic. See Section 9.3 for some counterexamples.
• Incorrectly interchanging the deﬁnitions of Hamilton and Euler paths and circuits. Remember that there is a
simple test for Euler paths and circuits, but no one knows of any simple tests for Hamilton paths and circuits.
• Ignoring the fact that having an Euler [Hamilton] circuit implies the existence of an Euler [Hamilton] path.
Look carefully at the deﬁnitions. Common Mistakes in Discrete Mathematics CM9 • Confusing theorems in graph theory with their converses. For example, if in a connected simple graph with
n ≥ 3 vertices each vertex has degree at least n/2 , then the graph has a Hamilton circuit; but the converse
or inverse of this statement is not true (there are plenty of graphs having Hamilton circuits in which the
vertex degrees are small). Here is another example: If a connected simple graph is planar, then it must satisfy
e ≤ 3v − 6 , where e is the number of edges and v is the number of vertices. Therefore (by the contrapositive),
we know that if a graph has too many edges ( e > 3v − 6 ), then it cannot be planar. What we cannot conclude
is the converse—it is not a theorem that if e ≤ 3v − 6 , then the graph has to be planar.
• Using the nonexistent word “vertice” instead of the correct word “vertex” to talk about just one of the dots in
a graph. Similarly, there is no such thing as a “matrice.”
• Mistakenly thinking that a graph is nonplanar just because it is drawn one way with two edges crossing. If it
is possible to redraw the graph without edges crossing, then the graph is planar. For example, K4 is planar,
even though drawing it as the vertices of a square with straight line segments representing the edges causes
a crossing in the middle of the picture. (Redraw it as the vertices of a triangle with one more vertex in the
interior.)
• Invalidly concluding that once one has found a coloring of a graph with n colors, its chromatic number has to
be n . In fact, all we know in that case is that its chromatic number is at most n . It may be possible to ﬁnd
another coloring with fewer than n colors. For example, one could color C4 with four colors (a diﬀerent color
for each vertex), but its chromatic number is in fact 2 .
• Mistakenly believing that greedy algorithms always produce the optimal solution to a problem. It often happens
that the simpleminded greedy approach does ﬁnd the best solution (e.g., in looking for minimum spanning
trees in Section 10.5), but often the greedy approach fails (e.g., in ﬁnding a coloring of a graph using as few
colors as possible).
• Failing to recognize that writing down a procedure doesn’t guarantee that it does what you want it to do. For example, one cannot write down a greedy algorithm to color a graph and then claim without justiﬁcation that this
procedure ﬁnds the coloring with the fewest possible colors. In fact, it won’t, as fairly simple counterexamples
can show.
Chapter 10
• Incorrectly setting up a decision tree for a problem such as identifying counterfeit coins by weighing them, and
thereby drawing the wrong conclusions. Each possible situation must correspond to a path from the root of the
tree to a leaf.
• Not realizing what type of tree is needed for a particular mathematical model. Issues to consider are whether
there should be a root (a starting point for some process), whether the children of a vertex are ordered, and
whether each child should be classiﬁed as a right child or a left child.
• Incorrectly omitting parentheses in expressions written in inﬁx notation. In absence of a default order of
operations, an expression such as A ∩ B ∪ C is ambiguous, since it might mean either (A ∩ B ) ∪ C or A ∩ (B ∪ C ),
and these are not the same sets. With preﬁx or postﬁx notation, no such ambiguities arise.
• Forgetting that when doing an inorder traversal of an ordered rooted tree that is not binary, the root of each
subtree comes after the ﬁrst subtree but before all the other subtrees. For a binary tree, inorder traversal is
rather obvious—left, root, right. When the tree isn’t binary, we can still deﬁne inorder traversals, but the
deﬁnition isn’t as natural.
• When applying Prim’s algorithm for ﬁnding minimum spanning trees, forgetting that edges become eligible for
inclusion in the tree gradually (as opposed to Kruskal’s algorithm, in which they are all eligible from the start).
If there is a lowcost edge that does not currently have any endpoint in the tree constructed so far, then it
cannot yet be added to the tree. When one of its endpoints ﬁnally becomes part of the tree, it suddenly
becomes eligible and can then be added to the tree if it is the lowest cost edge currently eligible. It is easy to
overlook such edges when performing the algorithm.
Chapter 11
• Being oﬀ by one level of abstraction when thinking about Boolean functions. A Boolean function with n
n
variables can be represented by a table with 2n rows; therefore there are 22 diﬀerent Boolean functions with
n variables. CM10 Common Mistakes in Discrete Mathematics • Putting inverters in the wrong place when building combinational circuits. If we want to invert the value of the
output of a gate, the inverter needs to go after the gate.
• Forgetting to apply De Morgan’s laws correctly when evaluating the output of a combinational circuit. The
output of a circuit is a certain Boolean expression of the input variables. When simplifying this expression, it
is important to remember than x y = x + y and x + y = x y .
• Not ﬁnding the largest possible blocks when looking for minimum Boolean expressions using Kmaps. Since
there is no known eﬃcient algorithm for solving this problem in general (with more than just a few variables),
it should not be surprising that this procedure seems to involve some ugly “guessing” to it.
• Not ﬁnding the best cover when looking for minimum Boolean expressions using the Quine–McCluskey method.
Since there is no known eﬃcient algorithm for solving this problem in general (with more than just a few
variables), it should not be surprising that this procedure seems to involve some ugly “guessing” to it. It
might be very hard to make sure that a covering we have found with, say, ﬁve minterms is really the best
possible—that there isn’t another covering with four minterms.
Chapter 12
• Incorrectly constructing grammars to generate a desired language. There is no algorithm for doing this (this
statement is a theorem in the theory of computation, similar to Turing’s theorem on the unsolvability of the
halting problem). Constructing grammars is like writing computer programs, and all the advice given in a
programming course (such as thinking from the top down in a structured way) applies.
• Incorrectly constructing ﬁnitestate machines (including Turing machines) to perform a desired task. There
is no algorithm for doing this (this statement is a theorem in the theory of computation, similar to Turing’s
theorem on the unsolvability of the halting problem). Constructing machines is like writing computer programs,
and all the advice given in a programming course (such as thinking from the top down in a structured way)
applies.
• Not including all the strings that are accepted by a given ﬁnitestate automaton. Sometimes students will follow
some paths that the machine can take to reach an accepting state and forget to consider others. This will lead
to a claim that the language recognized by this automaton is a proper subset of what it really is. Make sure
to “play computer” and follow all the branches.
• Forgetting to have one arrow leaving each state for each input symbol when constructing deterministic ﬁnitestate automata. You usually want to have a “graveyard” state to which the machine goes when it is clear
that the input is not acceptable. There needs to be a loop from the graveyard state to itself for each alphabet
symbol.
• Failing to realize that a nondeterministic ﬁnitestate automaton can accept a string even when some computation
paths on a certain input drive the machine to a nonaccepting state. As long as at least one path leads to an
accepting state, the input string is accepted.
• Failing to keep track of all the possible states in which a nondeterministic ﬁnitestate automaton can enter at
each step, when constructing the corresponding deterministic automaton. Make good use of all your ﬁngers in
analyzing what can happen!
• Failing to check that a machine or a grammar or a regular expression presented as the solution of some problem
actually works. This is similar to debugging a computer program. Many test cases should be tried, so that you
can be conﬁdent that your machine or grammar or expression really works.
• When constructing Turing machines, forgetting to include all the cases. If the machine can ever reach a certain
state and be viewing a particular input symbol, then a transition is needed to handle that case. Using topdown
programming methodology is advisable to make sure your machines do what you want them to do.
• Getting so bogged down in the details of constructing Turing machines that you lose sight of the main points
of the theory. The main point is given in the Church–Turing thesis: that every conceivable computation
can be performed by any reasonable computational model, be it a Turing machine, your favorite highlevel
programming language, or yourself working with pencil and paper. And on that note of keeping the “big
picture” in mind, we’ll bring this list of common mistakes to a close. ...
View
Full Document
 Fall '10
 Ford
 Natural number, Prime number

Click to edit the document details