Index
Index
i=0
(2 + 7i) = 13 2 + 7
12
i=0
i
= 26 + 7
12(12 + 1)
2
= 572.
Part c. There is a slight trick to this. Often it is more obvious to start with the
zero
th
term as I have above. Then the form of the i
th
term is 2 + 7i, showing
the initial term directly. However, many people prefer counting from one. To
convert the form, substitute n 1 for i and see that 2 + 7(n 1) = 5 + 7n is
the form of the n
th
form.
Part d. One method of computing the sum again is to emulate Gausss trick
with the observation from Part a. We expect the sum to be the number of terms,
n, times the rst plus the last, 2 +(5 +7n) = 3 +7n, divided by two. So the
sum is n(7n 3)/2.
Another method is to work with summation form,
n
i=0
(2 + 7i) = (n + 1) 2 + 7
n
i=0
i
= 2(n + 1) + 7
n(n + 1)
2
.
10.3. PROBLEM SET 1.3 69
With sucient algebra, this does simplify to the other form.
10.3.2 Problem 9
Part a. Personally, Id point out that in their limited imagination, the writers
likely intend 16 to be the next number.
Part b.
n 2
n
n
2
n + 2 n
3
5n
2
+ 10n 4
1 2 2 2
2 4 4 4
3 8 8 8
4 16 14 20
Part c. There are many, many functions that could generate 2, 4, and 8. One
needs more information to decide on which function.
And the wording of the rst problem uses likely. To me, likely infers some
probability, but there is none.
Better wording would ask for the reason why the student believes the sequence
extends to their guesses.
10.3.3 Problem 11
Following the hint, consider rearranging B B R R to B R B R. That requires
one swap in the middle. The number of swaps cannot be fewer, so this is the
minimum number.
Now rearrange B B B R R R to B R B R B R. Two swaps move the left-most
R into position, B R B B R R. The rst two letters are correct, and the rest
match the previous problem. No fewer swaps could have moved an R into the
second-left-most position; there must be at least one swap for each position
moved. So we know the fewest swaps beyond the rst case is two, for a minimum
total of three.
At this point, its reasonable to guess that the number of swaps is either 2
#B1
1
or
#B1
i=1
i. Either ts the data so far. However, at each stage we moved one R
into place and then reduced to a known subproblem. This adds moves, so the
summation seems the most likely.
To verify that
#B1
i=1
i = 4 (4 + 1)/2 = 10 swaps suces, use the following:
70 CHAPTER 10. SOLUTIONS FOR SECOND WEEKS ASSIGNMENTS
Start with: B B B B B R R R R R
4 swaps later: B R B B B B R R R R
3 swaps later: B R B R B B B R R R
2 swaps later: B R B R B R B B R R
1 swap later: B R B R B R B R B R
Total number of swaps: 10
To support that this is the minimum, we rely on inductive reasoning. At each
stage, we add the minimum number of necessary swaps to the subproblem, which
in turn is solved minimally. To formalize this, we could apply mathematical
induction.
10.3.4 Problem 20
Part a. The sums are 12, 24, 48, and 64. One pattern is that the sum is four
times the repeated quantity on the anti-diagonal. Another is to note that the
repeated quantity is one larger than the upper-left corner and one smaller than
the lower-right corner.
So adding along opposite anti-diagonals is like adding the same number entries
from the main anti-diagonal. So given a block of the form
k 1 k
k k + 1
we can add the two far anti-diagonals to get (k 1) + (k + 1) = 2k. Along with
the main diagonal, the total sum is (k 1) + (k + 1) +k +k = 4k.
Part b. The sums are 54, 108, and 144.
Part c. The blocks follow a similar pattern as the previous part:
k 2 k 1 k
k 1 k k + 1
k k + 1 k + 2
Again, add along opposite anti-diagonals to match +2 and 2, +1 and 1.
So the sum must be 9k.
Part d. In each case, the sum is the number of squares times the element
repeated along the main anti-diagonal. If the square is side-length n and the
main anti-diagonal holds k, the sum is n
2
k.
10.4. PROBLEM SET 1.4 71
10.4 Problem set 1.4
10.4.1 Reducing possibilities: Problem 7
Part a. Writing out the conditions that are easy to express gives
x = 2k + 1 for some k,
x > 1,
x < 100,
x > 20,
x < 5 7 = 35, and
x = 5i for some i.
Combining the rst and last, we know x is an odd multiple of ve, or x = 5(2j +1)
for some j. The inequalities reduce to 20 < x < 35. The only possibility in this
range is x = 25, and the digits here add to seven.
Part b. Again, translating the conditions and rewriting them to be positive
rather than negated (so not even becomes odd) gives
x = 2k + 1 for some k,
x = 11i for some i,
x > 20,
x = 3j for some j, and
x < 79.
An odd multiple of three and nine can be expressed by composing the require-
ments, so x = 3 11 (2p + 1) = 33(2p + 1) for some integer p. The bounds here
are not redundant, so 20 < x < 79. The only multiples of 33 in this region are
33 and 66. Both have digits whose sums are even (divisible by two). So there
are two possible results.
Part c. Translating this is not quite as useful, giving
x = 2k for some k,
x = 3j
1
+i
1
for some j and i = 0,
x = 4j
1
+i
1
for some j and i = 0,
x 81, and
x 64.
One observation helps: An even number not divisible by four has only one factor
of 2. So the rst and third requirements become
x = 2 (2p + 1) for some p.
72 CHAPTER 10. SOLUTIONS FOR SECOND WEEKS ASSIGNMENTS
So we are looking for even numbers in 64 x 80 with only one factor of two
and that are not multiples of three. This reduces to looking for an odd z = x/2
in 32 x 40 that is not a multiple of three.
The odd non-multiples of three in this range are 35 and 37. So z is either 35 or
37, and x is either 70 or 74.
10.4.2 Logic puzzle: Problem 9
The problem assumes neither bigamy nor marriage to immediate relations is
allowed, which is reasonable in the US. The true (T) and false (F) values are
subscripted by a number if they are a direct implication of that rule. The forth
rule was useless.
Kitty Sarah Josie Anne
David F
3
F
5
T F
Will F
3
T
5
F
1
F
5
Floyd F
3
F
5
F
2
T
Gus T
3
F
3
F
3
F
3
10.4.3 Pigeonholes: Problem 12
Part a. To ll 365 days and guarantee one is repeated, you need 366 people.
As an amazing aside, though, with only 23 people the chance of two sharing a
birthday is over 50%!
Part b. The result here is twice 365 plus one, or 731.
10.4.4 Pigeonholes: Problem 13
There are only ten units digits possible, zero through nine. If one digit is repeated,
the dierence between the two numbers with the same units digit must have
units digit zero and be divisible by ten. With eleven numbers, we must have
two with the same units digit.
10.4.5 Pigeonholes: Problem 14
Part a. Note there are six ways single-digit numbers (or the units digit) can
add to ten, 1 + 9, 2 + 8, 3 + 7, 4 + 6, and 5 + 5. If we use those as pigeonholes
for the units digit, then we know one of those holes must be lled twice with
seven numbers. Now within the holes we have another set of holes with one hole
for each digit. If both holes are lled, then the sum is divisible by ten. If only
one hole is lled, then the numbers share a units digit and their dierence is
divisible by ten.
10.5. INDUCTIVE OR DEDUCTIVE? 73
Part b. With six numbers, we can ll each hole once. Any consecutive sequence
of six numbers suce, e.g. 1, 2, 3, 4, 5, 6.
10.5 Inductive or deductive?
It has rained for the past week. It will rain tomorrow.
This is inductive because it is based solely on repeated observations.
All men are mortal. Socrates is a man. Therefore, Socrates is mortal.
Deductive reasoning begins with premises and draws a conclusion as in
this example.
Satellite-based network access does not function through heavy rain. It is
raining heavily. I cannot upload the notes right now.
Again, this example sets up data and rules from which it draws a conclusion.
This is deductive reasoning.
The next number after 3, 8, 13, 18, and 23 is 28.
This could fall either way, depending on how you decide on the next number.
If you assume this is an arithmetic sequence and calculate the next term,
this could be considered deductive reasoning. Recognizing an arithmetic
sequence without further information is inductive in itself. If you just look
and see a pattern, the process is completely inductive.
Often the initial phase of problem solving, understanding the problem, is
an exercise in reasoning inductively.
74 CHAPTER 10. SOLUTIONS FOR SECOND WEEKS ASSIGNMENTS
Chapter 11
Notes for 1 September
Notes also available as PDF.
11.1 Review
Two key forms of reasoning in mathematics:
Inductive Making a guess from prior observations.
Deductive If premises are satised, conclusion follows.
Typically,
problems to nd use inductive reasoning, and
problems to prove apply deductive reasoning.
But nding a proof is in many ways inductive.
Problem solving so far has been inductive. Take example problems and their
solutions. Emulate the solutions on similar problems.
Remember to take great care with the premises in both forms of reasoning!
Inductive reasoning generalizes from examples.
If the examples are not appropriate, the result will be incorrect.
Mathematics is representative reasoning.
We model the real world and represent pieces of it with symbols (numbers,
letters, digits, etc.).
Then we reason about how the symbols interact.
Only takes a few rules to build a massive system.
75
76 CHAPTER 11. NOTES FOR 1 SEPTEMBER
Amazingly, the system often mimics some aspect of the real world.
11.2 Proof
1. You start with a guess, possibly after seeing a pattern.
2. A few tests, and the guess becomes a conjecture.
3. Once the conjecture is proven, you have a theorem.
A lemma is a theorem leading to other theorems. Typically a technical
result leading to the main theorem.
A corollary is a subsequent theorem, a simple result after a primary
theorem.
Other items:
Denitions are dicult to dene.
Axioms are fundamental denitions. The classic example:
Two points dene a line.
11.3 Direct proof
Example 1.16 from the text:
Theorem: If n is a non-negative integer, then n
2
is either a multiple of 4 or
one larger than a multiple of 4.
(A whole number is a non-negative integer.)
What are we trying to show? Rephrasing with mathematical symbols, we
want to prove that for every non-negative integer n there is some integer k where
n
2
= 4k or n
2
= 4k + 1.
To prove this, it doesnt matter what k is for a given n or which of the two terms
apply. For simpler forms like these, however, its often useful to construct the
result.
Initial exploration.
What else? Build a little table.
11.4. PROOF BY CONTRAPOSITIVES 77
n n
2
form
0 0 4 0
1 1 4 0 + 1
2 4 4 1
3 9 4 2 + 1
4 16 4 4
5 25 4 6 + 1
Recognize a pattern: Evens have one form, odds another. This breaks the
problem into two cases.
If n is even, then n = 2i for some integer i. Then n
2
= 4i and k = i.
If n is odd, then n = 2i+1 for some integer i. Then n
2
= (2i+1)
2
= 4i
2
+4i+1 =
4(i
2
+i) + 1 and k = i
2
+i.
To summarize, we have proven the following:
If n is a non-negative integer, then n
2
is either 4i or 4(i
2
+i) + 1 for
some integer i.
11.4 Proof by contrapositives
Sometimes called indirect reasoning, often called proof by contradiction. Purists
hate that phrase.
Logically, if p then q is equivalent to if not q then not p. This is the contrapositive.
Thus if you prove that the negation of your conclusion q implies the negation of
your hypothesis p, you have proven that your hypothesis p implies the conclusion
q. Clear? No? This is why the method often is called proof by contradiction.
That route is often easier to understand.
For a demonstration, remember the denition of a prime number. A prime is an
integer p = 1 that only can be divided cleanly by 1 and p itself.
Theorem: There are innitely many prime numbers.
Proof: Suppose there is some largest prime P. Then form the (very large)
integer Q = 2 3 5 7 . . . P +1, one larger than the product of all primes. Now
Q is not divisible by any prime, so Q must itself be prime. But Q is larger than
P, contradicting the assumption that P is the largest prime.
What have we actually proven? If there is a largest prime P, then there is a
larger prime Q. Thus, there can be no largest prime.
(The symbol is one traditional ending for a proof. It is used instead of the
letters QED, for quod erat demonstrandum. Literally it means that which was
to be demonstrated.)
78 CHAPTER 11. NOTES FOR 1 SEPTEMBER
The texts Example 1.17 is another very nice example of this style.
11.5 Homework
Groups are ne, turn in your own work. Homework is due in or before class on
Mondays.
Write out (briey) your approach to each problem.
Prove the formula for the sum of the rst n positive integers by mathe-
matical induction. That is, prove 1 + 2 + 3 + +n = n(n + 1)/2. The
base case here is n = 1. Then show that the n
th
term transforms into the
(n + 1)
th
term by adding n + 1.
Note that you may email homework. However, I dont use Microsoft
TM
products
(e.g. Word), and software packages are notoriously nicky about translating
mathematics.
If youre typing it (which I advise just for practice in whatever tools you use),
you likely want to turn in a printout. If you do want to email your submission,
please produce a PDF or PostScript document.
Chapter 12
Notes for 3 September
Notes also available as PDF.
12.1 Proof review
1. You start with a guess, possibly after seeing a pattern.
2. A few tests, and the guess becomes a conjecture.
3. Once the conjecture is proven, you have a theorem.
A lemma is a theorem leading to other theorems. Typically a technical
result leading to the main theorem.
A corollary is a subsequent theorem, a simple result after a primary
theorem.
Other items:
Denitions are dicult to dene.
Axioms are fundamental denitions. The classic example:
Two points dene a line.
A direct proof takes the given hypotheses and applies rules directly to produce
the conclusion. We used a direct proof to show that n
2
is either a multiple of
four (can be written as 4k for some k) or one larger than a multiple of four
(4k + 1) when n is a non-negative integer.
An indirect proof, often called proof by contradiction or proof by contrapositive,
proves that the opposite of the conclusion implies the opposite of the hypothesis.
Thus if the hypothesis is true, the conclusion must be true. We used proof by
contradiction to show that there are innitely many primes. We actually proved
79
80 CHAPTER 12. NOTES FOR 3 SEPTEMBER
that if there is a largest prime, then there is a larger number not divisible by
any known prime and thus prime itself. The contradiction, constructing a prime
larger than the largest prime, proved that there is no largest prime. Along with
the known existence of primes, the fact there is no largest prime implies there
must be innitely many primes.
12.2 Inductive proof
Remember Pascals triangle? We proved that the sum of the n
th
row is 2
n
if we
start counting rows from zero.
Written in rather boring table form, each entry is the sum of the entry directly
above and above to the left:
#
0 1
1 1 1
2 1 2 1
3 1 3 3 1
4 1 = 0 + 1 4 = 1 + 3 6 = 3 + 3 4 = 3 + 1 1 = 1 +0
We will use our result as an example of mathematical induction. This is a proof
technique that formalizes inductive reasoning and using a representative case.
1. Start with verifying a base case.
2. Then assume the n
th
case.
3. Use that to prove the (n + 1)
st
case.
We want to prove the following:
Theorem: The sum of the n
th
line of Pascals triangle is 2
n
.
Proof:
Here, the base case is the 0
th
line:
# sum
0 1 1 = 2
0
Then let line n be the sequence
# sum
n Pn,1 Pn,2 Pn,3 Pn,n+1 2
n
Now we need to prove that line (n + 1) holds true. In our notation, item j
th
on
line (n + 1) is formed be P
n+1,j
= P
n,j1
+P
n,j
, setting the entries outside the
table (P
n,0
and P
n,n+2
) to zero.
12.3. STARTING WITH SET THEORY 81
Then we need to show that
n+2
j=1
P
n+1,j
= 2
n+1
.
n+2
j=1
P
n+1,j
=
n+2
j=1
(P
n,j1
+P
n,j
)
=
n+2
j=1
P
n,j1
+
n+2
j=1
P
n,j
=
_
_
P
n,0
+
n+1
j=1
P
n,j
_
_
+
_
_
P
n,n+2
+
n+1
j=1
P
n,j
_
_
=
n+1
j=1
P
n,j
+
n+1
j=1
P
n,j
= 2
n
+ 2
n
= 2 2
n
= 2
n+1
.
12.3 Starting with set theory
Our coverage of set theory mostly will cover denitions. We will use some
concepts to work with problem solving and to illustrate proofs. Then we will
use sets to build up whole numbers (0, 1, 2, . . .) and basic arithmetic on those
numbers.
12.4 Language of set theory
We will cover just enough set theory to use later.
Cardinalities are important for probability. We dont have time to cover
probability suciently well, so we will not explore the sizes of sets deeply.
This is known as nave set theory. We do not dene absolutely everything,
nor do we push set theorys logical limits. Much.
Goals:
Impart some of the language necessary for later chapters.
Practice reasoning in a formal setting.
One key aspect is what to do in extreme cases like empty sets.
Set up straight-forward examples for logic.
82 CHAPTER 12. NOTES FOR 3 SEPTEMBER
12.5 Basic denitions
To start, we require unambiguous denitions of terms and items. When a term
or item is unambiguously dened, it is called well-dened.
set An unordered collection of unique elements.
Curly braces: {A, B, C} is a set of three elements, A, B, and C.
Order does not matter: {cat, dog} is the same set as {dog, cat}.
Repeated elements do not matter: {1, 1, 1} is the same set as {1}.
Can be implicit: {x| x is an integer, x > 0, x < 3} is the same set as
{1, 2}.
Read the implicit form as the set of elements x such that x is an
integer, x > 0, and x < 3. Or the set of elements x where . . .
Other symbols that sometimes stand for such that: :, (reversed
)
Implicit (or set-builder) form can include formula or other bits left of
the bar. {3x| x is a positive integer} is the set {3, 6, 9, . . .}.
element Any item in a set, even other sets. (Also entry, member, item, etc.)
This is not ambiguous. If something is in a set, it is an item of that
set. It doesnt matter if the item is a number or a grape.
{A, {B, C}} is a set of two elements, A and {B, C}.
None of the following are the same: {A, {B, C}}, {A, B, C}, {{A, B}, C}.
empty set Or null set. Denoted by rather than {}.
This is a set on its own.
{} is the set of the empty set, which is not empty.
Think of sets as bags. An empty bag still is a bag, and if a bag
contains an empty bag, the outer bag is not empty.
Implicit denitions can hide empty sets.
For example, the set {x| x is an odd integer divisible by 2} is .
singleton A set with only one element.
{1} and {} both are singletons (or sometimes singleton sets).
12.6 Translating sets into (and from) English
From English:
12.7. NEXT TIME: RELATIONS BETWEENANDOPERATIONS ONSETS83
The days of the week:
{Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}
Of course, were using a representation of the days and not the days
themselves. That is how we reason about things; we model them and
represent them by symbols.
The days when homework is due:
{25
th
of August, 1
st
of September, . . .}
We could list them all.
{ every Monday after the 18
th
of August 2008 until after the 1
st
of
December }
Or: {x| x is a Monday, x is after the 18
th
of August, and x is on or
before the 1
st
of December }
To English:
{2, 3, 4}:
The set containing two, three, and four.
{x| x is an integer and x > 0}:
The positive integers, also called the counting numbers or the natural
numbers.
Often written as J
+
. The integers often are written as J (because the
I form can be dicult to read), rationals as Q (for quotients), the
reals as R.
{2x 1 | x J
+
}
The set whose members have the form 2x 1 where x is a positive
integer.
Cannot list all the entries; this is an innite set.
Here, the odd integers.
12.7 Next time: Relations between and opera-
tions on sets
12.8 Homework
Groups are ne, turn in your own work. Homework is due in or before class on
Mondays.
84 CHAPTER 12. NOTES FOR 3 SEPTEMBER
Write out (briey) your approach to each problem.
Prove the formula for the sum of the rst n positive integers by mathe-
matical induction. That is, prove 1 + 2 + 3 + +n = n(n + 1)/2. The
base case here is n = 1. Then show that the n
th
term transforms into the
(n + 1)
th
term by adding n + 1.
Problem set 2.1 (p83):
Problems 1, 2, 4, 5, 6, 27
Note that you may email homework. However, I dont use Microsoft
TM
products
(e.g. Word), and software packages are notoriously nicky about translating
mathematics.
If youre typing it (which I advise just for practice in whatever tools you use),
you likely want to turn in a printout. If you do want to email your submission,
please produce a PDF or PostScript document.
Chapter 13
Notes for 8 September
Notes also available as PDF.
13.1 Review
set An unordered collection of unique elements.
Curly braces: {A, B, C} is a set of three elements, A, B, and C.
Can be implicit or in set builder notation: {x| x is an integer, x >
0, x < 3} is the same set as {1, 2}.
Order does not matter, repeated elements do not matter.
element Any item in a set, even other sets. (Also entry, member, item, etc.)
empty set Or null set. Denoted by rather than {}.
This is a set on its own.
{} is the set of the empty set, which is not empty.
singleton A set with only one element.
13.2 Relations and Venn diagrams
(Someday I will include Venn diagrams for these in the notes.)
element of The expression x A states that x is an element of A. If x / A,
then x is not an element of A.
4 {2, 4, 6}, and 4 / {x| x is an odd integer }.
85
86 CHAPTER 13. NOTES FOR 8 SEPTEMBER
There is no x such that x , so {x| x } is a long way of writing
.
subset If all entries of set A also are in set B, A is a subset of B.
superset The reverse of subset. If all entries of set B also are in set A, then A
is a superset of B.
proper subset If all entries of set A also are in set B, but some entries of B
are not in A, then A is a proper subset of B.
{2, 3} is a proper subset of {1, 2, 3, 4}.
equality Set A equals set B when A is a subset of B and B is a subset of A.
Order does not matter. {1, 2, 3} = {3, 2, 1}.
The symbols for these relations are subject to a little disagreement.
Many basic textbooks write the subset relation as , so A B when A
is a subset of B. The same textbooks reserve for the proper subset.
Supersets are .
This keeps a supercial similarity to the numerical relations and <. In
the former the compared quantities may be equal, while in the latter they
must be dierent.
Most mathematicians now use for any subset. If a property requires
a proper subset, it often is worth noting specically. And the only
non-proper subset of a set is the set itself.
Extra relations are given for emphasis, e.g. or for proper subsets and
or to emphasize the possibility of equality.
Often a proper subset is written out: A B and A = B.
Ill never remember to stick with the textbooks notation. My
use of is for subsets and not proper subsets.
13.3 Translating relations into (and from) En-
glish
From English:
The train has a caboose.
Its reasonable to think of a train as a set of cars (they can be
reordered).
The cars are the members.
Hence, caboose train
13.4. CONSEQUENCES OF THE SET RELATION DEFINITIONS 87
The VI volleyball team consists of VI students.
VI volleyball team VI students
There are no pink elephants.
pink elephants =
To English:
x todays homework set.
x is a problem in todays homework set.
Todays homework this weeks homework.
Todays homework is a subset of this weeks homework.
13.4 Consequences of the set relation denitions
Every set is a subset of itself. Expected.
If A = B, then every member of A is a member of B, and every
member of B is a member of A. This is what we expect from equality, but
we did not dene set equality this way. Follow the rules:
A = B imples A B and B A.
Because A B, every member of A is a member of B.
Because B A, every member of B is a member of A.
The empty set is a subset of all sets. Unexpected! This is a case of
carrying the formal logic to its only consistent end.
For some set A, A if every member of is in A.
But has no members.
Thus all of s members also are in A.
This is called a vacuous truth.
The alternatives would not be consistent, but proving that requires more ma-
chinery that we need.
13.5 Operations
union The union of two sets A and B, denoted by A B, is the set consisting
of all elements from A and B.
A B = {x| x A or x B}.
88 CHAPTER 13. NOTES FOR 8 SEPTEMBER
Remember repeated elements do not matter: {1, 2}{2, 3} = {1, 2, 3}.
intersection The intersection of two sets A and B, denoted A B, is the set
consisting of all elements that are in both A and B.
A B = {x| x A and x B}.
{1, 2} {2, 3} = {2}.
{1, 2} {3, 4} = {} = .
set dierence The set dierence of two sets A and B, written A \ B, is the
set of entries of A that are not entries of B.
A\ B = {x| x A and x B}.
Sometimes written as AB, but that often becomes confusing.
If A and B share no entries, they are called disjoint. One surprising consequence
is that every set A has a subset disjoint to the set A itself.
No sets (not even ) can share elements with because has no elements.
So all sets are disjoint with .
The empty set is a subset of all sets.
So all sets are disjoint with at least one of their subsets!
Can any other subset be disjoint with its superset? No.
13.6 Homework
Groups are ne, turn in your own work. Homework is due in or before class on
Mondays.
Write out (briey) your approach to each problem.
Problem set 2.1 (p83):
Problems 7, 8, 10, 20, 24
Note that you may email homework. However, I dont use Microsoft
TM
products
(e.g. Word), and software packages are notoriously nicky about translating
mathematics.
If youre typing it (which I advise just for practice in whatever tools you use),
you likely want to turn in a printout. If you do want to email your submission,
please produce a PDF or PostScript document.
Chapter 14
Solutions for third weeks
assignments
Also available as PDF.
Note: These are my approaches to these problems. There are many ways to
tackle each.
14.1 Induction: Sum of rst n integers
Prove the formula for the sum of the rst n positive integers by
mathematical induction. That is, prove 1+2+3+ +n = n(n+1)/2.
The base case here is n = 1. Then show that the n
th
term transforms
into the (n + 1)
st
term by adding n + 1.
Theorem: Let n be a positive integer. Then the sum of the rst n positive
integers is
n
i=1
i =
n(n + 1)
2
.
Proof: We proceed by induction. First note that
1
i=1
i = 1 =
1(1 + 1)
2
.
Now assume that
n
i=1
i =
n(n + 1)
2
.
89
90 CHAPTER 14. SOLUTIONS FOR THIRD WEEKS ASSIGNMENTS
We must show that
n+1
i=1
i =
(n + 1)(n + 2)
2
.
To proceed, we pull the n + 1 term out of the sum to see that
n+1
i=1
i = n + 1 +
n
i=1
i = (n + 1) +
n(n + 1)
2
.
Then we factor out n + 1 and simplify to obtain
(n + 1) +
n(n + 1)
2
= (n + 1)
_
1 +
n
2
_
= (n + 1)
2 +n
2
=
(n + 1)(n + 2)
2
,
proving the result.
14.2 Problem set 2.1 (p83)
14.2.1 Problem 1
Wikipedia can be very useful.
Part a. {California, Oregon, Idaho, Utah, Arizona}. (Note that we could include
Nevada; it certainly shares a border with itself.)
Part b. {Mississippi, Missouri, Maine, Montana, Maryland, Massachusetts, Michigan, Minnesota}
Part c. {Arizona}
(Thanks to Chris Fields for pointing out the states I missed.)
14.2.2 Problem 2
Part a. {a, c, e, h, i, l, m, n, o, s, t, y}, possibly including capital L if you
treat that as a separate letter.
Part b. {a, e, m, t}.
14.2.3 Problem 4
Many answers are reasonable.
14.2. PROBLEM SET 2.1 (P83) 91
Part a. {x|x J, 10 < x < 15}, or perhaps {10 +i|i J, 0 < i < 5}.
Part b. {2i|i J, 3 i 8}.
Part c. {4 + 4i|i J, 0 i < 5}.
Part d. {i
2
+ 2i + 2|i J, 0 i < 4} or
{1 +i|i = the sum of the rst j positive odd integers where j 4}
14.2.4 Problem 5
Many answers are reasonable.
Part a. {2i|i J, i > 6}.
Part b. {(2i + 1)
2
|i J, i 12}.
Part c. {3i|i J
+
}
14.2.5 Problem 6
Part a. No, there are many cities with each name.
Part b. Yes, the cities are specic. There is only one Idaho, Montana, or Texas
in the world. There are two Georgias, but only one has a town called Duluth.
(The other Georgia does not use the same alphabet, but I am pretty sure no
town there transliterates to Duluth.)
Part c. No, there is no universal measure of smart.
Part d. Yes, this is specic. However, this likely is empty. How many people
have a gpa of exactly 3.5? If you have an odd number of credits, that is not
possible. And if you have an even number, you would have to have exactly as
many As as Bs.
14.2.6 Problem 27
These are just my rambling responses.
A set of china is a collection of dishware. However, there are many repeated
elements that are identical (until chipped), so this is not entirely a mathematical
set. If you label each piece, however, then each element has its own identity and
you do have a set.
In a family, pretty much everyone has their own identity and is not repeated,
even if they are twins. So families could be considered sets. If you rank the
family by age or otherwise, the ranked family is ordered and thus not a set.
An aggregate in my mind is a summary and not a listing, but Im poisoned by
programming. So to me, an aggregate is a function you apply to a set to nd a
value. For example, the mean or the median is an aggregate. But Im sure there
are other uses.
92 CHAPTER 14. SOLUTIONS FOR THIRD WEEKS ASSIGNMENTS
A class in a class room denitely is a set. Each member is unique and identiable.
And by the time there is a nal ranking (grade), the class is over. Mathematically,
however, class means something beyond set. The collection of all sets is a class
and not a set; no set can contain itself as an element.
In my wifes collection of antique sewing machines, each is identiable and
appears unique. Thus, a set.
Chapter 15
Notes for 10 September
Notes also available as PDF.
15.1 Review
15.1.1 Denitions
set An unordered collection of unique elements.
element Any item in a set, even other sets. (Also entry, member, item, etc.)
empty set Or null set. Denoted by rather than {}.
singleton A set with only one element.
15.1.2 Relations
element of The expression x A states that x is an element of A. If x / A,
then x is not an element of A.
subset A B if all entries of set A also are in set B.
superset The reverse of subset. B A when A B.
proper subset If all entries of set A also are in set B, but some entries of B
are not in A, then A is a proper subset of B.
equality A = B when A B and B A.
93
94 CHAPTER 15. NOTES FOR 10 SEPTEMBER
15.1.3 Operations
union A B = {x| x A or x B}.
intersection A B = {x| x A and x B}.
set dierence A\ B = {x| x A and x B}.
complement and universe The complement of a set with respect to a
given universal set U is the set A
c
= U \ A = {x| x U and x / A}.
Sometimes written A or A
20, only
primes remained.
Moving from one prime to the next is a systematic method both for nding
prime numbers and for nding a prime factorization.
Factorizations provide a useful mechanism for working
We will not prove the following, but is often called the fundamental theorem
of arithmetic:
Theorem: Every integer greater than one has a unique prime factorization.
22.4 Modular Arithmetic
Factorization itself will prove useful later. Now we will explore modular arithmetic
and nd some quick rules for determining when d | a for some d.
Modular arithmetic is arithmetic on remainders.
Consider expressions of 7 and 4 in terms of multiples of 3 plus remainders:
7 = 2 3 +1 and 4 = 1 3 +1. Now 11 = 7 +4 = (2 3 +1) +(1 3) +1 = 3 3 +2.
Note that the sum of the remainders was < 3 and was the new remainder itself.
If the remainder is 3, we can just pull a three out of it: 11 + 8 = (3 3 +
2) + (2 3 + 2) = 5 3 + 4. To convert this into the correct form, note that
140CHAPTER 22. NOTES FOR THE SEVENTHWEEK: PRIMES, FACTORIZATION, ANDMODULAR ARITHMETIC
4 = 1 3 + 1, and 19 = 5 3 + (1 3 + 1) = 6 3 + 1. We need consider only the
sum of remainders to compute the results remainder.
The remainder of the sum just wraps around. Think about time. If you add a
few hours and cross 12, the result just wraps around. So 1:00 is the same as
13:00 or 25:00.
We dont identify 1:00 as just one time but a member of a set of all times that are
one hour after a multiple of 12. Similarly, we can identify numbers as elements
of sets where all members have the same remainder relative to a given divisor.
The congruence class of r modulo a is {x| q : x = qa +r}. If a number b is
in the congruence class of r modulo a, we write b r (mod a).
The canonical member of a congruence class is its least positive member. Just as
we dont naturally consider 25:00 as 1:00, we tend to identify congruence classes
by the least r. So while 13 87 (mod 2) is correct (both 13 and 87 are odd),
we prefer 13 1 (mod 2).
We dene addition and multiplication on entire congruence classes. For the
operation to be dened, the modulus of each class must be the same. Then were
adding numbers of the form b
1
= q
1
a +r
1
for b
1
r
1
(mod a) and b
2
= q
2
a +r
2
for b
2
r
2
(mod a). As in our example above, the remainders add. Here
b
1
+b
2
= q
1
a +r
1
+q
2
a +r
2
= (q
1
+q
2
)a + (r
1
+r
2
) r
1
+r
2
(mod a).
Identifying congruence classes by their least positive element, we can write a
table showing all additions modulo 4:
+ (mod 4) 0 1 2 3
0 0 1 2 3
1 1 2 3 0
2 2 3 0 1
3 3 0 1 2
Addition of congruence classes maintains the additive identity that we expect,
b + 0 b (mod a).
Note that every class has an additive inverse, a class where b + (b) 0
(mod a). Remember that we forced the residual to be positive when we dened
division. Then we can see that the inverse of 1 modulo 4 is 1 = 1 4 + 3 3
(mod 4).
Another way to see this is that the canonical representation of b is the least
number which increases b to be equal to the modulus a. So the inverse of 1 is 3
because 1 + 3 = 4 0 (mod 4).
We also dene multiplication on congruence classes.
22.5. DIVISIBILITY RULES 141
If b
1
= q
1
a +r
1
and b
2
= q
2
a +r
2
, then
b
1
b
2
= (q
1
a +r
1
) (q
2
a +r
2
)
= q
1
q
2
a
2
+q
1
r
2
a +q
2
r
1
a +r
1
r
2
= (q
1
q
2
a +q
1
r
2
+q
2
r
1
)a +r
1
r
2
r
1
r
2
(mod a).
So we need only multiply remainders.
Identifying congruence classes by their least positive element, we can write a
table showing all multiplications modulo 4:
(mod 4) 0 1 2 3
0 0 0 0 0
1 0 1 2 3
2 0 2 0 2
3 0 3 2 1
Again, there is a multiplicative identity, b 1 b (mod a).
Unlike plain integer division, some congruence classes have an inverse. The
only integer that has an integer inverse is 1. But modulo 4, both 1 and 3 have
multiplicative inverses. Here 3 3 = 9 1 (mod 3).
22.5 Divisibility Rules
Using modular arithmetic and positional notation, we can derive some quick
divisibility tests.
First, consider divisibility by powers of 2 and 5. The factorization of 10 = 2 5,
and so 10
k
= 2
k
5
k
. So 2
k
| 10
k
and 5
k
| 10
k
, or 10
k
0 (mod 2)
k
and 10
k
0
(mod 5)
k
.
Now remember how to expand positional notation. We know that 1234 =
1 10
3
+ 2 10
2
+ 3 10
1
+ 4. So 1 10
3
+ 2 10
2
+ 3 10
1
+ 4 0 + 0 + 0 + 4
(mod 2) 0 (mod 2). Divisibility by 2 depends only on the nal digit. Similarly,
1234 0 + 0 + 0 + 4 (mod 5), and divisibility by 5 depends only on the nal
digit.
For 2
2
= 4 and 5
2
= 25, all but the last two digits are equivalent to zero. And
for 2
3
= 8 and 5
3
= 125, all but the last three digits are equivalent to zero. So
one divisibility rule:
When testing for divisibility by 2
k
or 5
k
, we need only consider the
last k digits.
Now consider divisibility by 3 or 9. We know that 10 1 (mod 3) and 10 1
(mod 9). Using modular arithmetic, 123 = 1 10
2
+ 2 10 + 3 1 + 2 + 3
142CHAPTER 22. NOTES FOR THE SEVENTHWEEK: PRIMES, FACTORIZATION, ANDMODULAR ARITHMETIC
(mod 3) 6 (mod 3) 0 (mod 3). Hence 3 | 123 because the sum of its digits
is divisible by 3.
Similarly, 10 1 (mod 3). So 123 1+2+3 (mod 9) 6 (mod 9), and 9 123.
If the sum of the digits is greater than 9, simply add those digits.
Test for divisibility by 3 or 9 by adding the numbers digits and
checking that sum. If that sum is greater than 9, add the digits again.
Repeat until the result is obvious.
Other primes are not so straight-forward. Divisibility by 7 is a pain; there is an
example method in the texts problems for Section 5.1.
The rule for 11 is worth exploring. Because 10 < 11, the canonical member of
its congruence class is just 10. But there is another member of interest, 10 1
(mod 1)1. So you can alternate signs on alternate digits from the right. So
123456 1 + 2 3 + 4 5 + 6 3 (mod 1)1, and 11 123456.
For divisibility by 6, 12, 18, or other composite numbers, factor the divisor and
test for divisibility by each factor. To test for divisibility by 72 = 2
3
3
2
= 8 9,
test for divisibility by 8 and by 9.
22.6 Homework
Problem Set 4.1 (p242):
Problem 2, but dont repeat the drawings.
4, 7, 9, 10, 13, 14, 23, 24
Also draw diagrams showing that 8 18 and 3 11.
Problem Set 4.2 (p252):
1, 2, 8, 14, 15
Take a familiar incomplete integer, 679 . Using the expression of 679
as N = 10
4
x
4
+x
0
+6790, use 8 | N to nd x
0
? Given that, use 9 | N to
nd x
4
. Now if 72 turkeys cost $ 679 , what is the total?
Chapter 23
Solutions for seventh weeks
assignments
Also available as PDF.
Note: These are my approaches to these problems. There are many ways to
tackle each.
23.1 Problem set 4.1
Problem 2 The (non-repeated) factorizations are 1 35 and 5 7. Drawing those
as boxes is straight-forward.
Problem 4 Factors of 18 1 2 3 6 9 18
Quotient 18 9 6 3 2 1
Problem 7 48 = 1 48 = 2 24 = 3 16 = 4 6, so the factors are 1, 2, 3, 4,
6, 16, 24, and 48.
54 = 1 54 = 2 27 = 3 18 = 6 9, so the factors are 1, 2, 4, 6, 9 18,
27, 54.
The largest common factor then is 6.
Problem 9 48 = 2
4
3
1
108 = 2
2
3
3
2250 = 2
2
3
2
5
3
24 750 = 2
1
3
2
5
3
11
1
143
144CHAPTER 23. SOLUTIONS FOR SEVENTH WEEKS ASSIGNMENTS
Problem 10 Yes, because all primes are shared and no powers of the
primes exceed those of a.
No, because 3
2
has a larger exponent than the 3
1
in a.
a/b = (2
3
3
1
7
2
)/(2
2
3
1
) = 2
32
3
11
7
20
= 2
1
7
2
.
There are (2 + 1) (1 + 1) (2 + 1) = 18 factors of a.
We can make a list by running up the exponents:
2
0
3
0
7
0
2
1
3
0
7
0
2
2
3
0
7
0
2
3
3
0
7
0
2
0
3
1
7
0
2
1
3
1
7
0
2
2
3
1
7
0
2
3
3
1
7
0
2
0
3
0
7
1
2
1
3
0
7
1
2
2
3
0
7
1
2
3
3
0
7
1
2
0
3
1
7
1
2
1
3
1
7
1
2
2
3
1
7
1
2
3
3
1
7
1
2
0
3
0
7
2
2
1
3
0
7
2
2
2
3
0
7
2
2
3
3
0
7
2
2
0
3
1
7
2
2
1
3
1
7
2
2
2
3
1
7
2
2
3
3
1
7
2
Problem 13 No, it is only true that at least one prime factor cannot exceed
94.
Problem 14 No. If n is not prime, some of its factors may split between b and
c. For example, 2 3 = 6 | 18 = 2 9, but 6 2 and 6 9. The factors of
n = 6, 2 and 3, are split between a = 2 and b = 9.
Problem 23 Here it is true. Consider the prime factorizations of b and c. If
p | bc, then p must appear in one or both of those prime factorizations,
and thus it must divide at least one of b and c.
Problem 24 Again, use the prime factorization of n. Because p and q are
primes, they must appear in that factorization. Then pq | n because both
23.2. TWO DIAGRAMS 145
appear, so you can commute products around to group (pq) and the rest
of the factorization.
23.2 Two diagrams
8 18: 18 = 2 8+2, so you can draw and count: +
3 11: 11 = 3 3 + 2: +
23.3 Problem set 4.2
Problem 1 1554 is even, so divisible by 2, does not end in 5 or 0, so
is not divisible by 5, and has digits that add to 0 (mod 3), so is
divisible by 3.
1999 is not even, so is not divisible by 2, does not end in 5 or 0,
so is not divisible by 5, and has digits that add to 1 (mod 3), so
is not divisible by 3.
805 is not divisible by 2, is divisible by 5, and is not divisible
by 3.
2450 is divisible by 2, is divisible by 5, and is not divisible by
3.
Problem 2 2 and 3
2 and 5
3 and 5
2, 3, and 5
Problem 8 The missing digit must be divisible by 2. Also, the sum of the
digits must be congruent to 0 modulo 3. The non-blank digits already add
to 0 (mod 3), so the missing digit must be a multiple of 3. There is only
one even multiple of 3 less than 10, so the missing digit must be 6.
Problem 14 Expanding the positional notation and simplifying, abc, abc =
a(10
5
+10
2
)+b(10
4
+10
1
)+c(10
3
+10
0
) = (a10
2
+b10
1
+c)(10
3
+10
0
) =
abc 1001. Now 1001 = 7 11 13, so abc, abc is divisible by each of those.
Problem 15 ab ba = a 10 + b (b 10 + a) = (a b) 10 + (b a).
Because 10 1 (mod 9), this becomes a b + b a 0 (mod 9).
The result always is a multiple of 9. Equivalently, we can rearrange
146CHAPTER 23. SOLUTIONS FOR SEVENTH WEEKS ASSIGNMENTS
(ab)10+(ba) = (ab)10+1(ab) = (ab)(101) = 9(ab),
giving also which multiple of 9.
Here the dierence is (ac) 10
2
+0+(ca) because the middle digit
always cancels. Again, the result always is a multiple of 9 and we can
rearrange (a c) 10
2
+ 0 + (c a) = (a c) 10
2
+1 (a c) =
(a c) (10
2
1) = 99(a c) to see the result is a multiple of 99.
23.4 A familiar incomplete integer
Take a familiar incomplete integer, 679 . Using the expression of
679 as N = 10
4
x
4
+x
0
+6790, use 8 | N to nd x
0
. Given that,
use 9 | N to nd x
4
. Now if 72 turkeys cost $ 679 , what is the
total?
If 8 | N then 8 divides the last three digits, so 8 | 790 +x
0
. Thus 790 +x
0
0
(mod 8). Because 790 6 (mod 8), we know that x
0
2 (mod 8). The only
decimal digit satisfying x
0
2 (mod 8) is x
0
= 2.
Now we have N = 10
4
x
4
+ 6792. For 9 | N, the sum of the digits must be zero
modulo 9. Thus x
4
+ 6 + 7 + 9 + 2 0 (mod 9), or x
4
+ 6 0 (mod 9). Thus
x
4
= 3, and N = 36792.
(I forgot the decimal place in the problem, so these are very expensive turkeys.)
So if 72 turkeys cost $36792, each turkey costs $511. If I had remembered the
decimal place correctly, the turkeys cost $5.11 each.
Chapter 24
Notes for the eighth week:
GCD, LCM, and ax + by = c
Notes also available as PDF.
What we covered last week:
divisibility and prime numbers,
factorization into primes,
modular arithmetic,
nding divisibility rules,
This weeks topics:
review modular arithmetic and nding divisibility rules,
greatest common divisors and least common factors,
Euclids algorithm for greatest common divisors, and
solving linear Diophantine equations.
These all are useful when you deal with integral numbers of things
24.1 Modular arithmetic
Remember the divisibility form for b with respect to dividing by a = 0,
b = q a +r, with 0 r < |a|.
This form is unique for a given a and b.
147
148CHAPTER 24. NOTES FOR THE EIGHTHWEEK: GCD, LCM, ANDAX+BY = C
Consider a = 5. There are only ve possible values of r, zero through four.
Because the form is unique, we can place every b into one of r congruence
classes. Each congruence class is a set. For a = 5, we have the following classes:
{. . ., -10, -5, 0, 5, 10, . . .} = {5k + 0 | k J}
{. . ., -9, -4, 1, 6, 11, . . .} = {5k + 1 | k J}
{. . ., -8, -3, 2, 7, 12, . . .} = {5k + 2 | k J}
{. . ., -7, -2, 3, 8, 13, . . .} = {5k + 3 | k J}
{. . ., -6, -1, 4, 9, 14, . . .} = {5k + 4 | k J}
We say that two numbers are in the same congruence class for a given a by
b c (mod a).
Or b is equivalent to c modulo a. A collection of one entry from each set is called
a complete residue system. We typically select the least positive numbers,
those in bold above.
We dene arithmetic on congruence classes by arithmetic on the remainders. The
remainders wrap around every multiple of the modulus. For example, addition
modulo 4 and modulo 5 are dened as follows:
+ (mod 4) 0 1 2 3
0 0 1 2 3
1 1 2 3 0
2 2 3 0 1
3 3 0 1 2
+ (mod 5) 0 1 2 3 4
0 0 1 2 3 4
1 1 2 3 4 0
2 2 3 4 0 1
3 3 4 0 1 2
4 4 0 1 2 3
This works as you expect. Addition is commutative and associative. There is
an additive identity, because b + 0 0 (mod a). Unlike the positive integers,
there also is an additive inverse for every residue because b + (a b) 0
(mod a).
Multiplication likewise is commutative and associative, and there is a mul-
tiplicative identity, 1. The unusual aspect appears with the multiplicative
inverse. Some residues have inverses, and some dont:
(mod 4) 0 1 2 3
0 0 0 0 0
1 0 1 2 3
2 0 2 0 2
3 0 3 2 1
(mod 5) 0 1 2 3 4
0 0 0 0 0 0
1 0 1 2 3 4
2 0 2 4 1 3
3 0 3 1 4 2
4 0 4 3 2 1
The dierence here is that 5 is prime while 4 is composite. Any factor of the
modulus will not have a multiplicative inverse.
24.2. DIVISIBILITY RULES 149
24.2 Divisibility rules
One common application of modular arithmetic (besides telling time) is in
testing whether one integer divides another. We use modular arithmetic and
positional notation. Both help us break the larger problem, testing divisibility
of a potentially large number, into the smaller problems of breaking apart the
number and evaluating expressions in modular arithmetic.
If a | b (a divides b), then b 0 (mod a). So we can test for divisibility by
expanding b in positional notation and evaluating the operations modulo a.
When the divisor is small, a straight-forward evaluation is simplest. Because
10 1 (mod 3), we can test for divisibility by 3 by adding the numbers digits
modulo 3. For example,
1234 10
3
+ 2 10
2
+ 3 10 + 4 (mod 3)
1
3
+ 2 1
2
+ 3 1 + 4 (mod 3)
1 + 2 + 3 + 4 1 + 2 + 0 + 1 1 (mod 3).
Hence 3 1234. The same trick applies to 9 because 10 1 (mod 9).
When the divisor is closer to a power of 10, using a negative element of the
congruence class may be useful. For 11, remember that 10 and 1 are in the
same congruence class because 10 = 0 11+10 and 1 = 1 11+10. So 10 1
(mod 11) and we can expand the powers of ten,
1234 10
3
+ 2 10
2
+ 3 10 + 4 (mod 11)
(1)
3
+ 2 (1)
2
+ 3 (1) + 4 (mod 11)
1 + 2 +3 + 4 (mod 11) 2 (mod 11).
Hence 11 1234. Here, the trick form is that you start from the units digit
and then alternate subtracting and adding digits.
For more complicated examples, we can factor the divisor. To test if a number
is divisible by 72, factor 72 = 2
3
3
2
= 8 9. Then test if the number is divisible
by 8 and by 9.
If a | b and c | b, then it may be true that ac | b. This is certainly true of a and
b are powers of dierent primes. The key point is that a and b share no common
divisors. Note that 72 = 6 12, 6 | 24, and 12 | 24, but obviously 72 24 because
24 < 72.
24.3 Greatest common divisor
So nding common divisors is useful for testing divisibility. The greatest common
divisor of numerator and denominator reduces a fraction into its simplest form.
150CHAPTER 24. NOTES FOR THE EIGHTHWEEK: GCD, LCM, ANDAX+BY = C
In general, common divisors help break problems apart.
Written (a, b) or gcd(a, b), the greatest common divisor of a and b is
the largest integer d 1 that divides both a and b.
Well discuss a total of two methods for nding the greatest common divisor.
The rst uses the prime factorization, and the second uses the divisibility form in
the Euclidean algorithm. Later well extend the Euclidean algorithm to provide
integer solutions x and y to equations ax +by = c.
The prime factorization method factors both a and b. Consider a = 1400 =
2
3
5
2
7 and b = 1350 = 2 3
3
5
2
.
Lining up the factorizations and remembering that x
0
= 1, we have
a = 1400 = 2
3
3
0
5
2
7
1
, and
b = 1350 = 2
1
3
3
5
2
7
0
.
Now chose the least exponent for each factor. Then
d = 2
1
3
0
5
2
7
0
= 50
is the greatest common divisor. For more than two integers, factor all the
integers and nd the least exponents across the corresponding factors in all of
the factorizations.
For an example use, reduce a fraction a/b = 1350/1400 to its simplest form. To
do so, divide the top and bottom by d = 50. Then a/b = 1350/1400 = 27/28.
Now we can state the requirement about divisibility given some factors:
If two relatively prime integers a and b both divide c, then ab divides
c.
Some other properties of the gcd:
Because the gcd is positive, (a, b) = (|a|, |b|).
(a, b) = (b, a)
If the gcd of two numbers is 1, or (a, b) = 1, then a and b are called
relatively prime.
24.4 Least common multiple
Before the other method for nding the gcd, we consider one related quantity.
The least common multiple, often written lcm(a, b), is the least
number L a and L b such that a | L and b | L.
There are clear, every day uses. Think of increasing a recipe when you can only
buy whole bags of some ingredient. You need to nd the least common multiple
24.5. EUCLIDEAN GCD ALGORITHM 151
of the recipes requirement and the bags quantity. Or when you need to nd
the next day two dierent schedules intersect.
Again, you can work from the prime factorizations
a = 1400 = 2
3
3
0
5
2
7
1
, and
b = 1350 = 2
1
3
3
5
2
7
0
.
Now the least common multiple is the product of the larger exponents,
lcm(a, b) = 2
3
3
3
5
2
7
1
= 37 800.
And for more than two integers, take the maximum across all the exponents of
corresponding factors.
Another relation for two integers a and b is that
lcm(a, b) =
ab
d
.
So given a = 1350, b = 1400, and d = 50,
lcm(1350, 1400) =
1350 1400
50
=
1 890 000
50
= 37 800.
This does not hold directly for more than two integers.
24.5 Euclidean GCD algorithm
Another method for computing the gcd of two integers a and b is due to Euclid.
This often is called the rst algorithm expressed as an abstract sequence of steps.
We start with the division form of b in terms of a = 0,
b = qa +r with 0 r < a.
Because (a, b) = (|a|, |b|), we can assume both a and b are non-negative. And
because (a, b) = (b, a), we can assume b a.
Let d = (a, b). Last week we showed that if d|a and d|b, then d|ra +sb for any
integers r and s. Then because d|a and d|b, we have d|b qa or d|r. So we have
that d = (b, a) also divides r. Note that any number that divides a and r also
divides b, so d = (a, r).
Continuing, we can express a in terms of r as
a = q
r +r
with 0 r
< r.
Now d|r
and d = (r, r
). Note that r
336 = 5 64 +16,
64 = 4 16 + 0.
So (336, 64) = 16.
(15, 75) = (15, 75):
75 = 5 15 + 0.
So (15, 75) = 15.
25.3 Computing LCMs
Compute the least common multiples:
lcm(64, 336)
lcm(11, 17)
lcm(121, 187)
lcm(2025, 648)
lcm(64, 336) = 64 336/(336, 64) = 1344
Both are prime, so lcm(11, 17) = 11 17 = 187
lcm(121, 187) = lcm(11
2
, 11 17) = 11
2
17 = 2057
lcm(2025, 648) = lcm(3
3
5
2
, 2
3
3
4
) = 2
3
3
4
5
2
= 16200
25.4 Linear Diophantine equations
Find two integer solutions to each of the following, or state why no
solutions exist:
64x + 336y = 32
160 CHAPTER 25. SOLUTIONS FOR EIGHTH WEEKS ASSIGNMENTS
33x 27y = 11
31x 27y = 11
From a previous problem, we have that 336 = 64 5 + 16. Thus 336 1 +
64 5 = 16 and 336 2 + 64 10 = 32. So one solution is x
0
= 10 and
y
0
= 2. The general solution is x = x
0
+t 336/(336, 64) = 10 +21t and
y = y
0
t 64/(336, 64) = 2 4t for any integer t. Another solution then
is x(1) = 10 +1 21 = 11 and y(1) = 2 4 1 = 2.
Here, (33, 27) = (3 11, 3
3
) = 3. Now 3 11, so there are no solutions.
Now 31 is prime, so (31, 27) = 1 | 11 and there are solutions. Running
through the Euclidean algorithm we see that
31 = 27 1 + 4,
27 = 4 6 + 3, and
4 = 3 1 + 1.
Starting from the bottom and substituting for the previous remainder,
4 + 3 (1) = 1,
4 + (27 + 4 (6)) 1 = 27 (1) + 4 7 = 1,
27 (1) + (31 + 27 (1)) 7 = 31 7 + 27 (8) = 1.
We nd that 31 7 +27 (8) = 1, so 31x27y = 11 has an initial solution
of x
0
= 7 11 = 77 and y
0
= 1 8 11 = 88.
The general solutions have the form
x = x
0
+t
27
(31, 27)
= 77 27t, and
y = y
0
t
31
(31, 27)
= 88 31t,
Another solution is given by x(1) = 77 27 1 = 50 and y(1) = 88 31 1 = 57.
Chapter 26
Notes for the ninth week:
ax + by = c, fractions
Notes also available as PDF.
26.1 Linear Diophantine equations
In a few weeks, we will examine linear equations ax +by = c over real numbers.
But many every-day applications require integer solutions. We can use the
Euclidean algorithm to nd one integer solution to ax +by = c or prove there
are none. Then we can use the computed gcd to walk along the line to all integer
solutions.
Some solvable problems:
A 98 pound box contains 5 pound bags of sugar and 12 pound sacks
of oranges. How many of each are in the box?
Or:
Say you need a digital image in a 4 : 3 aspect ratio (x : y) that
includes a 50 pixel border along each side. What sizes are possible
for the inner image?
Consider the latter problem. Rephrasing algebraically,
4
3
=
x + 100
y + 100
, or
3x 4y = 100.
We start by solving
3x 4y = 1
161
162CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
and then multiplying the base solutions by 100. This case has one easy solution,
x = 1 and y = 1, with 3 1 4 1 = 3 + 4 = 1. Another solution is
x = 3 and y = 2.
In fact, there are inntely many solutions to 3x 4y = 1 given by
x = 1 + 4t, and
y = 1 + 3t
for any integer t. You can substitute these expressions into 3x 4y to verify the
result. Scaling the right-hand side by 100, solutions to 3x 4y = 100 are given
by
x = 100 + 4t, and
y = 100 + 3t.
For x > 0 and y > 0, we need t > 33. So the rst positive solutions are given by
t = 34, 35, . . . and are
(x, y) {. . . , (36, 2), (40, 5), (44, 8), (48, 11), (52, 14), (56, 17), (60, 20), . . .}.
26.1.1 In general. . .
Say we need to solve ax+by = c for integers a, b, and c to nd integer solutions
x and y. In general, equations over integers are called Diophantine equations
after Diophantus of Alexandria (approx. 200AD-290AD). He was the rst known
to study these equations using algebra. The form ax +b = c describes linear
Diophantine equations.
Let d = (a, b). Then, as before, d | ax +by for all integers x and y. So d | c for
any solutions to exist. If d c, then there are no integer solutions. If a and b
are relatively prime, then (a, b) = 1 and solutions exist for any integer c.
Consider solving ax + by = d. Because d | c, we can multiply solutions to
ax +by = d by c/d to obtain solutions of ax +by = c. To solve ax +by = d we
work backwards after using the Euclidean algorithm to compute d = (a, b).
Say the algorithm required k steps, so d = r
k1
. Working backward one step,
d = r
k1
= r
k3
q
k1
r
k2
= r
3
q
k1
(r
k4
q
k2
r
k3
)
= (1 +q
k1
q
k2
)r
3
q
k1
r
k4
.
So d = r
k1
= i r
k3
+j r
k4
where i and j are integers. Continuing, the gcd
d can be expressed as an integer combination of each pair of remainders.
26.1. LINEAR DIOPHANTINE EQUATIONS 163
Returning to the example of (77, 53), we found
77 = 1 53 + 24,
53 = 2 24 + 5,
24 = 4 5 + 4,
5 = 1 4 + 1, and
4 = 4 1 + 0.
Working from the second to the last,
1 = 5 1 4,
= 5 1 (24 5 5) = 5 5 1 24
= 5 (53 2 24) 1 24 = 5 53 11 24
= 5 53 11 (77 1 53) = 16 53 11 77.
To solve 53x +77y = 22, we start with 53 16 +77 (1) = 1. Multiplying by 22,
53 (16 22) + 77 (1 22) = 22,
and x = 352, y = 22 is one solution.
But if there is one solution, there are innitely many! Remember that d = (a, b),
so a/d and b/d are integers. Given one solution x = x
0
and y = y
0
, try
substituting x = x
0
+t (b/d) and y = y
0
t (a/d) for any integer t. Then
a(x
0
+t (b/d)) +b(x
0
t (a/d)) = ax
0
+bx
0
+t (ab/d)) +t (ba/d))
= ax
0
+bx
0
= c.
Actually, all integer solutions to ax +by = c are of the form
x = x
0
+t (b/d), and y = y
0
t (a/d),
where t is any integer, d = (a, b), and x
0
and y
0
are a solution pair.
Another example, consider solving 12x+25y = 331. First we apply the Euclidian
algorithm to compute (12, 25) = 1:
25 = 2 12 + 1, and
12 = 12 1 + 0.
Substituting back,
12 (2) + 25 1 = 1, and
12 (662) + 25 331 = 331.
164CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
So we can generate any solution to 12x + 25y = 331 with the equations
x = 662 + 25t and y = 331 12t.
Using these, we can nd a smaller solution. Try making x non-negative with
662 + 25t 0,
25t 662, thus
t > 26.
Substituting t = 27,
x = 13, and y = 7.
Interestingly enough, this must be the only non-negative solution. A larger t will
force y negative, and a smaller t forces x negative. But the solution for t = 26 is
still small,
x = 12, and y = 19.
26.1.2 The other example
Our other posed problem:
A 98 pound box contains 5 pound bags of sugar and 12 pound sacks
of oranges. How many of each are in the box?
So we need to solve 5x + 12y = 98, and start with 5x + 12y = 1.
Computing (12, 5),
12 = 2 5 + 2,
5 = 2 2 + 1, and
2 = 2 1 + 0.
So (12, 5) = 1. Because 1 | 98, there are innitely many integer solutions. We
need to nd the non-negative solutions from those.
For a base solution,
1 = 5 2 2
= 5 2 (12 2 5)
= 5 (5) + 12 (2).
So x
0
= 5 and y
0
= 2 solve 5x + 12y = 1. Multiplying by 98,
x
0
= 490 and y
0
= 196
solve 5x + 12y = 98.
26.2. INTO REAL NUMBERS 165
To nd all solutions,
x = 490 + 12t, and
y = 196 5t.
To nd non-negative solutions, rst consider how to make y positive. Here
t = 40 makes y = 4. Trying x, x = 10. So one solution is
x
+
= 10 and y
+
= 5.
With t = 39, y is negative. And with t = 41, x is negative. So this is the
only possible solution for the actual problem.
26.2 Into real numbers
Weve used real numbers without much thought. For the next week and a half,
well ll in a few details.
Rational numbers
Arithmetic and comparisons
Decimal expansion (and other bases)
Percentages
Irrational numbers
Show that non-rational real numbers exist
Square roots, cube roots, and other radicals
Computing
Floating-point arithmetic (arithmetic with restricted rationals)
This week will cover topics in rational numbers and hence fractions. For some
people, this will be old hat. For others, this is a continuing thorn in their sides.
This presentation will be a bit dierent than the texts more typical structure. I
hope that this dierence may help some who struggle with rationals and fractions
by providing reasons for the rules.
26.2.1 Operator precedence
A quick aside on the order in which operations can be applied. Working with
fractions stress operator precedence.
Operations generally dont pass through straight lines, whether horizontal for
fractions or vertical for absolute value.
166CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
Parentheses force an order. Work from the inner outwards.
The general order of precedence between operations:
1. exponents, then
2. multiplication and division (which really are the same thing), then
3. addition, subtraction, and negation (again, these are the same thing).
Within a class, operations proceed from left to right.
Go through a parenthetical clause and compute every exponent, then every
multiplication from left to right, and then every addition from left to right.
When in doubt, use parentheses when you write expressions.
26.3 Rational numbers
Rational numbers are ratios of integers. In a fraction
n
d
, n is the numerator
and d is the denominator. The rational numbers form a set,
Q = {
a
b
| a J, b J, b = 0},
where J is the set of all integers. Let R be the set of all real numbers, then
J Q R. The integer on top, a, is the numerator; the integer on the bottom,
b, is the denominator.
Note that this is a very formal construction. We just plop one integer atop
another and call it a number. Amazing that it works.
Fractions represent ratios and proportions. When you state that 1 in 10 people
are attractive to mosquitos
1
, thats a rational number. We wont reach probabil-
ity, where we learn to interpret these ratios correctly, but we will cover basic
manipulations of rational numbers.
Two fun points:
There are only as many rational numbers as there are non-negative integers
(and hence integers)! Both sets are innite, but you can construct a
mapping from each non-negative integer to and from a corresponding
fraction.
Between any two real numbers of any sort, there is a rational number. The
size of the separation does not matter! There always exists a rational num-
ber arbitrarily close to a given real. Consider taking a decimal/calculator
expansion and chopping it o once its close enough.
1
http://www.webmd.com/a-to-z-guides/features/are-you-mosquito-magnet
26.4. REVIEW OF RATIONAL ARITHMETIC 167
26.4 Review of rational arithmetic
Rational arithmetic is based on integer arithmetic. The following properties will
be inherited by multiplication and addition for rationals q, r, and s:
closure q +r Q, qr Q
commutative q +r = r +q, qr = rq,
associative q + (r +s) = (q +r) +s, q(rs) = (qr)s, and
distributive q(r +s) = qr +qs.
One homework question is to take the operation denitions below and verify
some of these properties.
The following are somewhat formal denitions to show how to construct rationals
along strict rules.
26.4.1 Multiplication and division
We start with multiplication and division. Let a, b, k, x, y J, so all the variables
are integers. We will extend these variables to run over the rational numbers
shortly.
The denition of multiplying fractions:
a
b
x
y
=
ax
by
.
As an example
3
7
5
2
=
15
14
.
The denition of a relationship between division and fractions:
a/b = a
1
b
=
a
b
so 8/2 = a
1
2
=
8
2
.
We need to be a little careful here. Integer division was dened only when b | a,
so this expression formally only holds when b | a. We relax this restriction later
to allow the variables to run over rational numbers.
An important consequence is that
a =
a
1
for all a.
This leads to very useful technique, expressing 1 as a fraction:
1 = k/k =
k
k
168CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
for any k = 0. Remember that in the divisibility form k = 1 k + 0, so k | k and
k/k = 1.
Next we show what the text calls the fundamental property of rational numbers,
which is not terribly fundamental. First we show that 1 is the multiplicative
identity for rationals by using the fact that 1 is the multiplicative identity
for integers,
a
b
1 =
a
b
1
1
=
a 1
b 1
=
a
b
.
Using this fact, we show that
a
b
=
ak
bk
for any k = 0,
a
b
=
a
b
1 =
a
b
k
k
=
ak
bk
.
Now we introduce proper fractions. A proper fraction is a rational
a
b
where
the numerator a and denominator b are relatively prime. That is gcd(a, b) = 1
and they share no common factors. Every fraction is equal to some proper
fraction. Given gcd(a, b) = d, we can factor out the common divisor,
a
b
=
a
d
b
d
=
a
d
d
=
a
.
So for 15 and 35, (15, 35) = 5 and
15
35
=
3 5
7 5
=
3
7
.
A fraction that is not proper is improper. An improper fraction is a redundant
representation, and keeping fractions improper sometimes helps speed operations.
Every rational number with a non-zero numerator has a multiplicative inverse.
This uses only the expression for 1 and the relationship between integer division
and fractions. Using that a/a = 1 and commutativity of integer multiplication,
1 = (ab)/(ab) =
ab
ab
=
ab
ba
=
a
b
b
a
.
So if a = 0, then
b
a
is the multiplicative inverse of
a
b
. As an example,
3
5
5
3
=
15
15
= 1.
With a multiplicative inverse, we can dene division of rationals analogously
to the fractional form of division of integers,
a
b
/
x
y
=
a
b
y
x
=
ay
bx
.
For example,
3
5
/
5
7
=
3
5
7
5
=
21
25
.
26.4. REVIEW OF RATIONAL ARITHMETIC 169
26.4.2 Addition and subtraction
When adding rational numbers, you must ensure both ratios have the same
denominators. This is the same as ensuring measurements are all in the same
units; both numerators need measured by the same denominator.
The denition for adding fractions:
a
b
+
x
y
=
ay
by
+
bx
by
=
ay +bx
by
.
Later we will use the least common multiple of b and y to work with a smaller
initial denominator. So
1
2
+
1
3
=
3
6
+
2
6
=
5
6
.
Rational numbers have additive identities:
a
b
+
0
b
=
a + 0
b
=
a
b
.
We prefer there to be only one additive identity. We can use the fundamental
property above to prove that all additive identities are equal to
0
1
:
0
b
=
0 b
1 b
=
0
1
b
b
=
0
1
1 =
0
1
.
Given that 1 | 0,
0
1
= 0/1 = 0. So zero is the additive identity for rationals as
well as integers.
Like integers, rationals have additive inverses:
a
b
+
a
b
=
a +a
b
=
0
b
= 0.
Given the additive inverse exists, we can dene the negation of a rational as
a
b
=
a
b
,
and then we dene subtraction in terms of addition as
a
b
x
y
=
a
b
+
x
y
=
ay bx
xy
.
So
1
2
1
3
=
3
6
+
2
6
=
1
6
.
170CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
26.4.3 Comparing fractions
We start with some high-level denitions and nd the common product rule for
comparing fractions.
First, a quick review of integer ordering. We say an integer is negative if it has
a negative sign, e.g. -1. An integer is positive if it is neither zero nor negative,
or equivalently if the integer is also a counting number. We start an ordering of
the integers by saying that a positive i > 0, a negative i < 0, and 0 = 0.
Then we can compare two integers i and j by their dierence. There are three
cases:
If i j > 0, then i > j.
If i j < 0, then i < j.
Finally, if i j = 0, then i = j.
This phrasing may help with the common confusion regarding comparisons and
multiplication by negative numbers.
Consider two integers 3 < 5. That 3 < 5 implies 3 5 < 0 (and we know it is -2).
Now multiply both sides here by -1. If 3 5 < 0, that implies 3 5 is negative,
and in turn 1 (3 5) = 5 3 = 2 is positive. Thus multiplying both sides
by -1 (and hence any negative number) requires reversing the comparison. Here
1(35) = 53 > 0. But by the distributive property, 1(35) = (3)(5)
as well, so (3) (5) > 0 and 3 > 5.
Returning to rationals, the integers are a subset, so an order on the rationals
should respect the same ordering on the integer subset.
A positive fraction is equal to some fraction where both the numerator and
denominator are positive integers. So both the numerator and denominator must
have the same sign,
3
5
, or
3
5
=
3
5
1
1
=
3
5
.
A negative fraction is equal to some fraction where the numerator is negative
and the denominator is positive. Here the signs must be opposite,
3
5
, or
3
5
=
3
5
1
1
=
3
5
.
As we saw with the additive identity, a zero fraction is equal to the integer
zero and has a zero numerator. The sign of zero does not matter in rational
arithmetic (although it may in a computers oating-point arithmetic).
Given two rationals r and q, r is strictly less than q, r < q, if q r is positive.
Thus
q
n
q
d
r
n
r
d
=
q
n
r
d
q
d
r
n
q
d
r
d
> 0.
26.5. COMPLEX FRACTIONS 171
We can always move negative signs into the numerator, so we assume that q
d
and r
d
are positive. But remember to convert the fraction into having
a positive denominator! Then the above relation
q
n
r
d
q
d
r
n
> 0 or, equivalently, q
n
r
d
> q
d
r
n
.
So
q
n
q
d
>
r
n
r
d
when q
n
r
d
> q
d
r
n
.
By symmetry, then we can compare two rational numbers by comparing appro-
priate products.
If q
n
r
d
> q
d
r
n
, then
qn
q
d
>
rn
r
d
.
If q
n
r
d
< q
d
r
n
, then
qn
q
d
<
rn
r
d
.
If q
n
r
d
= q
d
r
n
, then
qn
q
d
=
rn
r
d
.
Consider comparing
1
2
and
1
3
,
1 3 > 1 2
1
2
>
1
3
.
And for the negations
1
2
and
1
3
,
1 3 < 1 2
1
2
<
1
3
.
As an example of why you need to force the denominator to be positive, consider
1
2
and
1
3
.
1 3 < 1 2
1
2
<
1
3
.
This is because we are in essence multiplying both sides by the product of their
denominators. That product is negative, so we would have to ip the sign. Its
just as easy to remember to make the denominator positive.
26.5 Complex fractions
So far, the numerator and denominator have been integers. We can loosen
the denition slightly and allow complex fractions where the numerator and
denominator are rational numbers. We extend the division denition to map
complex fractions into fractions with integral numerators and denominators,
a
b
x
y
=
a
b
/
x
y
=
a
b
y
x
=
ay
bx
.
We could use this denition to show that all the arithmetic operations work as
expected on complex fractions.
172CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
Working with complex fractions sometimes allows adding fractions without using
a massive denominator.
Let L be the least common multiple of b and y. Then b | L and y | L, so L/b
and L/y are integers. We can manipulate the addition denition slightly by
introducing L,
a
b
+
x
y
=
a
b
1
+
x
y
1
=
a
1
b
1
+
x
1
y
1
=
L
L
_
a
1
b
1
+
x
1
y
1
_
=
a
L
b
L
+
x
L
y
L
=
a(L/b)
L
+
x(L/y)
L
=
a(L/b) +x(L/y)
L
.
With 75 = lcm(15, 25),
7
15
+
8
25
=
7 3 + 8 5
75
=
61
75
.
Quite often there is less work in reducing the result into proper form if you use
the least common multiple as the denominator.
26.6 Homework
Practice is absolutely critical in this class.
Groups are ne, turn in your own work. Homework is due in or before class on
Mondays.
Repeated, because I didnt cover the material last week: Find
two integer solutions to each of the following, or state why no solutions
exist:
64x + 336y = 32
33x 27y = 11
31x 27y = 11
Problem set 6.1 (p354)
2, 6, 11, 12
32
26.6. HOMEWORK 173
Problem set 6.2 (p375)
6, 18, 13, 25
Problem set 6.3 (p389)
2
8, 9
12
Note that you may email homework. However, I dont use Microsoft
TM
products
(e.g. Word), and software packages are notoriously nicky about translating
mathematics.
If youre typing it (which I advise just for practice in whatever tools you use),
you likely want to turn in a printout. If you do want to email your submission,
please produce a PDF or PostScript document.
174CHAPTER 26. NOTES FOR THE NINTHWEEK: AX+BY = C, FRACTIONS
Chapter 27
Solutions for ninth weeks
assignments
Also available as PDF.
Note: These are my approaches to these problems. There are many ways to
tackle each.
27.1 Diophantine equations
See the previous weeks solutions.
27.2 Problem set 6.1
Problem 2 Im not going to draw this, but it should be fairly straight-forward.
This was more an exercise in something handy for elementary classes.
Problem 6
20
60
=
1
3
30
60
=
1
2
5
7
25
100
=
1
4
25
100
=
1
4
3
12
=
1
4
2
3
175
176 CHAPTER 27. SOLUTIONS FOR NINTH WEEKS ASSIGNMENTS
3
4
(A quart is made of quarters... There are four cups in a quart.
Cooking is a source of bizarre but traditional units.)
Problem 11
4
5
=
64
65
=
24
30
6
9
=
32
33
=
2
3
7
25
=
207
2025
=
140
500
18
3
=
36
31
=
6
1
=
16
11
=
6
1
Problem 12
18
42
=
63
67
=
3
7
.
Here (18, 49) = 1 and (5, 14) = 1, so both are in lowest common terms.
That form is unique, and these fractions dier, so these fractions
cannot be equal. Following the texts method, you want to compare
218
249
=
36
98
and
75
714
=
35
98
, because lcm(49, 14) = 98.
9
25
=
209
2025
=
180
500
=
140
500
.
24
144
=
2
12
=
1
6
,
32
96
=
1
3
=
2
6
. These are not equal.
Problem 32 Yes, this is a general property. But you need to provide some
examples.
27.3 Problem set 6.2
Problem 6
5
7
10
5
= 2
20
24
=
5
6
56
65
76
60
=
19
15
100
200
=
1
2
31
100
321
450
=
107
150
Problem 18 1
1
4
1
Problem 13 3
5
2
=
15
2
2
3
3
2
= 1
3
4
2 =
3
2
27.4. PROBLEM SET 6.3 177
Problem 25 For each, you proceed by solving the row, column, or diagonal
that has only one open spot. Repeating suces to ll the squares.
1
2
1
12
5
12
1
4
1
3
5
12
1
4
7
12
1
6
8
15
1
5
4
15
1
15
1
3
3
5
2
5
7
15
2
15
27.4 Problem set 6.3
Problem 2 Reassociate to add the rst two terms with the common
denominator of 5 rst.
Commute the terms in the parenthesis and reassociate to add terms
with common denominator of 4 rst.
Use the distributive property to pull out the
2
3
, then add the eighths.
Commute and reassociate to multiply
3
4
4
3
= 1 rst.
Problem 8
2
3
4
7
+
2
3
3
7
=
2
3
(
4
7
+
3
7
) =
2
3
1 =
2
3
4
5
2
3
3
10
2
3
= (
4
5
3
10
)
2
3
=
1
2
2
3
=
1
3
4
7
3
2
4
7
6
4
=
4
7
(
3
2
6
4
) =
4
7
0 = 0
(
4
7
2
5
)/
2
7
=
42
75
7
2
=
4
5
Problem 9 adding fractions with a common denominator
multiplying fractions
distributing multiplication over addition
adding fractions with a common denominator
multiplying fractions
Problem 12 First subtraction of 32, then multiplication by the inverse of
9
5
.
4 = 2.
In most circumstances,
a means the positive root, often called the principal
square root. When you hit a square-root key or apply a square root in a
spreadsheet, you get the principal square root.
Other rationals provide other roots:
a
1
= (a
1
3
)
3
is the cube root,
3
a = a
1
3
.
Here, though, (a)
3
= (1)
3
a
3
= (a
3
), and there is no worry about the sign
of the cube root.
Using (a
k
)
m
= a
km
, we also have
a
2
3
=
3
a
2
= (
3
a)
2
The exponential operator can be dened on more than just the rationals, but we
wont go there. However, remember that I mentioned the rationals are dense in
the reals. There is a rational number close
28.2.5 Irrational numbers
There are more reals than rationals. This is a very non-obvious statement. To
justify it, we will
prove that
2 is not rational, and
generalize that proof to other roots.
Remember the table to show that there are as many integers as rationals? You
cannot construct one for the reals. I might show that someday. Its shockingly
simple but still a mind-bender. But for now, a few simple examples suce to
make the point.
Theorem: The number
2 is not rational.
Proof. Suppose
2 were a rational number. Then
2 =
a
b
28.3. DECIMAL EXPANSIONS AND PERCENTAGES 185
for some integers a and b. We will show that any such a and b, two must divide
both and so (a, b) 2. Previously, we explained that any fraction can be reduced
to have (a, b) = 1. Proving that (a, b) 2 shows that we cannot write
2 as a
fraction.
Now if
2 =
a
b
, then 2 =
a
2
b
2
and 2b
2
= a
2
. Because 2 | 2b
2
, we also know that
2 | a
2
. In turn, 2 | a
2
and 2 being prime imply that 2 | a and thus a = 2q for
some integer q.
With a = 2q, a
2
= 4q
2
. And with a
2
= 2b
2
, 2b
2
= 4q
2
or b
2
= 2q
2
. Now 2 | b as
well as 2 | a, so (a, b) 2.
Theorem: Suppose x and n are positive integers and that
n
x is rational. Then
n
x is an integer.
Proof. Because
n
x =
a
b
.
We can assume further that the fraction is in lowest terms, so (a, b) = 1. Now
we show that b = 1.
As in the previous proof,
n
x =
a
b
implies that x b
n
= a
n
.
If b 1, there is a prime p that divides b. And as before, p | b implies
p | a, contradicting the assumption that (a, b) = 1. Thus b = 1 and
n
x is an
integer.
With decimal expansions, we will see that rational numbers have repeating
expansions. Irrational numbers have decimal expansions that never repeat.
There are some fascinating properties of the expansions
Irrational numbers come in two kinds, algebraic and transcendental. We
wont go into the dierence in detail, but numbers like
2 are algebraic, and
numbers like and e are transcendental.
28.3 Decimal expansions and percentages
Remember positional notation:
1 234 = 1 10
3
+ 2 10
2
+ 3 10
1
+ 4 10
0
.
Given negative exponents, we can expand to the right of 10
0
. General English
notation uses a decimal point to separate the integer portion of the number
from the rest.
186CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
So with the same notation,
1 234.567 = 1 10
3
+ 2 10
2
+ 3 10
1
+ 4 10
0
+5 10
1
+ 6 10
2
+ 7 10
3
.
Operations work in exactly the same digit-by-digit manner as before. When any
position goes over 9, a factor of 10 carries into the next higher power of 10. If
any digit becomes negative, a factor of 10 is borrowed frrom the next higher
power of 10.
Other languages use a comma to separate the integer from the rest and also use
a period to mark o powers of three on the other side, for example
1, 234.567 = 1.234, 567.
You may see this if you play with locales in various software packages. Obvi-
ously, this can lead to massive confusion among travellers. (A price of 1.234 is
not less than 2 but rather greater than 1000.)
Typical international mathematical and science publications use a period to
separate the integer and use a space to break groups of three:
1, 234.567 = 1 234.567.
28.3.1 Representing rationals with decimals
What is the part to the right of the decimal point? It often is called the
fractional part of the number, giving away that it is a representation of a
fraction.
Here we consider the decimal representation of rational numbers
1
a
for dierent
integers a. We will see that the expansions fall into two categories:
1. some terminate after a few digits, leaving the rest zero; and
2. some repeat a trailing section of digits.
For rational numbers, these are the only two possibilities.
We can nd the decimal expansions by long division.
Two simple examples that terminate:
0. 5
2 1. 0
1. 0
0. 2
5 1. 0
1. 0
Note that 2 | 10 and 5 | 10, so both expansions terminate immediately with
1
2
= .5 and
1
5
= .2.
28.3. DECIMAL EXPANSIONS AND PERCENTAGES 187
Actually, all fractions with a denominator consisting of powers of 2 and ve have
terminating expansions. For example,
1
2
2
=
1
4
= 0.25,
1
5
3
=
1
125
= 0.008, and
1
2 5
2
=
1
50
= 0.02.
What if the denominator a in
1
a
does not divide 10, or a 10? Then the expansion
does not terminate, but it does repeat. If the denominator has no factors of 2
or 5, it repeats immediately.
Examples of repeating decimal expansions:
0. 3 3 . . .
3 1. 0 0 0
. 9
. 1 0
9
1 0
0. 1 4 2 8 5 7 1 . . .
7 1. 0 0 0 0 0 0 0 0
. 7
3 0
2 8
2 0
1 4
6 0
5 6
4 0
3 5
5 0
4 9
1 0
7
3
We write these with a bar over the repeating portion, as in
1
3
= 0.3, and
1
7
= 0.142857.
We say that 0.3 has a period of 1 and 0.142857 has a period of 6.
We could write 0.2 = 0.20, but generally we say that this terminates once we
reach the repeting zeros.
If the denominator a contains factors of 2 or 5, the repeating portion occurs a
number of places after the decimal. For example, consider
1
6
=
1
23
and
1
45
=
1
59
:
188CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
0. 1 6 6 . . .
6 1. 0 0 0 0
. 6
4 0
3 6
4 0
0. 0 2 2 . . .
45 1. 0 0 0 0
. 9 0
1 0 0
9 0
1 0
So the decimal representations are
1
6
= 0.16, and
1
45
= 0.02.
The hard way to determine the period of a repeating fraction
Note that for all non-negative integer k,
10
k
0 (mod 2),
10
k
0 (mod 5), and
10
k
1 (mod 3).
These tell us that the expansions have periods of 0, 0, and 1.
For seven,
10
0
1 (mod 7),
10
1
3 (mod 7),
10
2
2 (mod 7),
10
3
6 (mod 7),
10
4
4 (mod 7),
10
5
5 (mod 7), and
10
6
1 (mod 7),
so the period is of length 7.
For 45,
10
0
1 (mod 45),
10
1
10 (mod 45), and
10
2
10 (mod 45).
28.3. DECIMAL EXPANSIONS AND PERCENTAGES 189
This is a little more complicated, but the pattern shows that there is one initial
digit before hitting a repeating pattern, exactly like the expansion
1
45
= 0.02.
In each case, we are looking for the order of 10 modulo the denominator. Finding
an integer with a large order modulo another integer is a building block in RSA
encryption used in SSL (the https prex in URLs).
28.3.2 The repeating decimal expansion may not be unique!
One common stumbling block for people is that the repeating decimal expansion
is not unique.
Let
n = 0.9 = 0.99999.
Then multiplying n by 10 shifts the decimal over one but does not alter the
pattern, so
10n = 9.9 = 9.99999.
Given
10n = 9.9, and
n = 0.9,
we can subtract n from the former.
9n = 9.9 0.9 = 9.
With 9n = 9, we know n = 1. Thus 1 = 0.9!
This is a consequence of sums over innite sequences, a very interesting and
useful topic for another course. But this technique is useful for proving that
rationals have repeating expansions.
28.3.3 Rationals have terminating or repeating expansions
Theorem: A decimal expansion that repeats (or terminates) represents a
rational number.
Proof. Let n be the number represented by a repeating decimal expansion.
Without loss of generality, assume that n > 0 and that the integer portion is
zero. Now let that expansion have d initial digits and then a period of length
p. Here we let a terminating decimal be represented by trailing 0 digits with a
period of 1.
190CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
For example, let d = 4 and p = 5. Then n looks like
n = 0 . d
1
d
2
d
3
d
4
p
1
p
2
p
3
p
4
p
5
.
Then 10
d
n leaves the repeating portion to the right of the decimal. Following
our example d = 4 and p = 5,
10
4
n = d
1
d
2
d
3
d
4
. p
1
p
2
p
3
p
4
p
5
.
Because it repeats, 10
d+p
n has the same pattern to the right of the decimal. In
our running example,
10
4+5
n = d
1
d
2
d
3
d
4
p
1
p
2
p
3
p
4
p
5
. p
1
p
2
p
3
p
4
p
5
.
So 10
d+p
n 10
d
n has zeros to the right of the decimal and is an integer k. In
our example,
k = 10
4+5
n 10
4
n = d
1
d
2
d
3
d
4
p
1
p
2
p
3
p
4
p
5
d
1
d
2
d
3
d
4
.
We assumed n > 0, so the dierence above is a positive integer. The fractional
parts cancel out.
Now n =
k
10
d+p
10
d
is one integer over another and thus is rational.
Theorem: All rational numbers have repeating or terminating decimal expan-
sions.
Proof. This is a very dierent style of proof, using what we have called the
pidgeonhole principle. Without loss of generality, assume the rational number
of interest is of the form
1
d
for some positive integer d.
At each step in long division, there are only d possible remainers. If some
remainder is 0, the expansion terminates.
If no remainder is 0, then there are only d1 possible remainders that appear. If
the expansion is taken to length d, some remainder must appear twice. Because
of the long division procedure, equal remainders leave equal sub-problems, and
thus the expansion repeats.
28.3.4 Therefore, irrationals have non-repeating expansions.
So we know that any repeating or terminating decimal expansion represents a
rational, and that all rationals have terminating or repeating decimal expansions.
Thus, we have the following:
Corollary: A number is rational if and only if it has a repeating decimal
expansion.
28.4. FIXED AND FLOATING-POINT ARITHMETIC 191
So if there is no repeating portion, the number is irrational. One example,
0.101001000100001 ,
has an increasing number of zero digits between each one digit. This number is
irrational.
Its beyond our scope to prove that is irrational, but it is. Thus the digits of
do not repeat.
28.3.5 Percentages as rationals and decimals
Percentage comes from per centile, or part per 100. So a direct numerical
equivalent to 85% is
85% =
85
100
= .85.
We can expand fractions to include decimals in the numerator and denominator.
The decimals are just rationals in another form, and we already explored complex
fractions with rational numerators and denominators.
So we can express decimal percentages,
85.75% =
85.75
100
= .8575.
Everything else just works. To convert a fraction into a percentage, there are
two routes. One is to convert the denominator into 100:
1
2
=
50
100
= 50%.
Another is to produce the decimal expansion and then multiply that by 100:
1
7
= 0.142857 = 14.2857142857%.
Converting a percentage into a proper fraction required dropping the percentage
into the numerator and then manipulating it appropriately:
85.75% =
85.75
100
=
8575
100
100
=
8575
10000
=
343
400
.
28.4 Fixed and oating-point arithmetic
So far we have considered innite expansions, ones that are not limited to a set
number of digits. Computers (and calculators) cannot store innite expansions
that do not repeat, and those that do require more overhead than they are worth.
192CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
Instead, computers round innite results to have at most a xed number
of signicant digits. Operations on these limited representations incur some
round-o error, leading to a tension between computing speed and the precision
of computed results. One important fact to bear in mind is that precision
does not imply accuracy. The following is a very precise but completely
in-accurate statement:
The moon is made of Camembert cheese.
First well cover dierent rounding rules from the perspective of xed-point
arithmetic, or arithmetic using a set number of digits to the right of the decimal
plce. Then well explain oating-point arithmetic where the decimal point
oats through a xed number of signicant digits.
We will not cover the errors in oating-point operations, but we will cover the
errors that come from typical binary representation of decimal data.
The points you need to take away from this are the following:
Using a limited number of digits (or bits) to represent real numbers leads
to some inherent, representationall error.
Representing every-day decimal quantities in binary also incurs some
representational error.
Despite the doom-like points above, oating-point arithmetic often provides
results that are accurate enough. We wont be able to cover why this is, but the
high-level reasons include:
using far more digits of precision than initially appear necessary, and
carrying intermediate results to even higher precision.
28.4.1 Rounding rules
Generally, computer arithmetic can be modelled as computing the exact result
and then rounding that exact result into an economical representation.
truncation or rounding to zero With this rounding method, digits beyond
the stored digits are simply dropped.
rounding half-way away from zero This is the texts method of round half
up. A number is rounded to the nearest representable number. In the
half-way case, where the digits beyond the number of digits stored are
5000 , the number is rounded upwards.
rounding half-way to even This is the preferred method for rounding in
general. A number is rounded to the nearest representable number. In
the half-way case, where the digits beyond the number of digits stored are
5000 , the number is rounded so the nal stored digit is even.
28.4. FIXED AND FLOATING-POINT ARITHMETIC 193
There are more rounding methods, but these suce for our discussion. Rounding
rules are hugely important in banking and nance, and there are quite a few
versions required by dierent regulations and laws.
Examples of each rounding method above, rounding to two places after the
decimal point:
initial number truncate round half up round to nearest even
1
3
= 0.3 0.33 0.33 0.33
1
7
= 0.142857 0.14 0.14 0.14
0.444 0.44 0.44 0.44
0.445 0.44 0.45 0.44
0.4451 0.44 0.45 0.45
0.446 0.44 0.45 0.45
0.455 0.44 0.46 0.46
Rounding error is the absolute dierence between the exact number and the
rounded, stored representation. In the table above, the rounding error in
representing
1
3
is |
1
3
0.33| = |
1
3
33
100
| = |
100
300
99
300
| =
1
300
= 0.003. Note that
here the rounding error is 1% of the exact result. That error is large because we
use only two digits.
Note that you cannot round in stages. Consider round-to-nearest-even applied
to 0.99455 and rounding to two places after the point:
Incorrect Correct
0.99455 0.99455
0.9946
0.995
1.00 0.99
28.4.2 Floating-point representation
Consider repeatedly dividing by 10 in xed-point arithmetic that carries two
digits beyond the decimal:
1 10 = 0.10,
0.1 10 = 0.01,
0.01 10 = 0.00.
So ( ( 1 10 ) 10 ) 10 evaluates to 0! This phenomenon is called underow,
where a number grows too small to be represented. A similar phenomenon,
overow, occurs when a number becomes too large to be represented. Computer
arithmetics dier on how they handle over- and underow, but generally overow
produces an symbol and underow produces 0.
Floating-point arithmetic compensates for this by carrying a xed number of
signicant digits rather than a xed number of fractional digits. The position
194CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
of the decimal place is carried in an explicit, integer exponent. This allows
oating-point numbers to store a wider range and actually makes analysis of the
round-o error easier.
In oating-point arithmetic,
1 10 = 1.000 10
0
,
0.1 10 = 1.000 10
1
,
0.01 101.000 10
2
,
.
.
.
This continues until we run out of representable range for the integer exponents.
We leave the details of oating-point underow for another day (if youre unlucky).
28.4.3 Binary fractional parts
Just as integers can be converted to other bases, fractional parts can be converted
as well.
Each position to the right of the point (no longer the decimal point) corresponds
to a power of the base. For binary, the typical computer representation,
1
2
= 2
1
= 0.1
2
= 0.5,
1
4
= 2
2
= 0.01
2
= 0.25,
1
8
= 2
3
= 0.001
2
= 0.125.
So a binary fractional part can be expanded with powers of two:
0.1101
2
=
1
2
1
+
1
2
2
+
0
2
3
+
1
2
4
= 0.8125.
To nd a binary expansion, we need to carry out long division in base 2. I wont
ask you to do that.
The important part to recognize is that nite decimal expansions may have
innite, repeating binary expansions! Remember that in decimal, 2 | 10 and
5 | 10, so negative powers of 2 and 5 have terminating decimal expansions. In
binary, only 2 | 2, so only powers of 2 have terminating binary expansions.
Numbers you expect to be exact are not. Consider 0.1. Its binary expansion is
0.1 = 0.00011
2
.
28.5. HOMEWORK 195
A ve-bit xed-point representation would use
0.1 0.00011
2
.
The error in representing this with a ve-digit xed-point representation is
0.00625, or over 6%.
In a ve-bit oating-point representation,
0.1 1.1001
2
2
4
.
The error here is less than 0.0024, or less than 0.24%. You can see what
oating-point gains here.
Ultimately, though, in a limited binary fractional representation, adding ten
dimes does not equal one dollar! This is why often programs slanted towards
nance (e.g. spreadsheets) use a form of decimal arithmetic. On current common
hardware, decimal arithmetic is implemented in software rather than hardware
and is orders of magnitude slower than binary arithmetic.
28.5 Homework
Practice is absolutely critical in this class.
Groups are ne, turn in your own work. Homework is due in or before class on
Mondays.
Problem set 7.1 (p421):
1, 2, 3, 4
14
25
28
Problem set 7.2 (p433):
4
5 (I wont get a chance to cover this, but scientic notation is a good
exercise in positional notation and rounding.)
9
Problem set 7.4 (p457);
2, 3, 4
18
On rounding and oating point arithmetic:
196CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
Round each of the following to the nearest tenth (one place after the
decimal) using round to nearest even, round to zero (trunca-
tion), and round half-up:
86.548
86.554
86.55
Compute the following quantities with a computer or a calculator.
Write what type of computer/calculator you used and the
software package if its a computer. Compute it as shown. Do
not simplify the expression before computing it, and do not re-enter
the intermediate results into the calculator or computer program. Also
compute the expressions that do not include 10
16
by hand exactly.
There should be a dierence between the exact result and the displayed
result in some of these cases. Remember to work from the innermost
parentheses outward.
(
10 times
..
0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1) 1
( (
10 times
..
0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1) 1)
10
16
, where 10
16
often is entered as 1e16. If the result overows
(signals an error) on various calculators, replace 10
16
by 10
8
in
this and later portions.
( ( (2 3) 1) 3) + 1
( ( ( (2 3) 1) 3) + 1) 10
16
( ( (6 7) 1) 7) + 1
( ( ( (6 7) 1) 7) + 1) 10
16
The object of this rst part is to demonstrate round-o error. The
rst to problems, adding 0.1 repeatedly, may see no error if the device
calculates in decimal. The latter four parts should see some error
regardless of the base used.
Now copy down the number displayed by the rst calculation in each
of the following. Re-enter it as x in the second calculation.
1 3, then 1 3 x where x is the number displayed.
If you have a calculator or program with , , then x where
x is the number displayed.
The object here is to see that the number displayed often is not the
number the computer or calculator has stored.
28.5. HOMEWORK 197
Note that you may email homework. However, I dont use Microsoft
TM
products
(e.g. Word), and software packages are notoriously nicky about translating
mathematics.
If youre typing it (which I advise just for practice in whatever tools you use),
you likely want to turn in a printout. If you do want to email your submission,
please produce a PDF or PostScript document.
198CHAPTER 28. NOTES FOR THE TENTHWEEK: IRRATIONALS ANDDECIMALS
Chapter 29
Second exam and solutions
Available as PDF.
199
200 CHAPTER 29. SECOND EXAM AND SOLUTIONS
Chapter 30
Third exam, due 1
December
Available as PDF. Remember, this is due on 1 December, 2008.
201
202 CHAPTER 30. THIRD EXAM, DUE 1 DECEMBER
Chapter 31
Third exam solutions
Available as PDF.
203
204 CHAPTER 31. THIRD EXAM SOLUTIONS
Chapter 32
Final exam
Available as PDF. As a warning, there are typos.
205
206 CHAPTER 32. FINAL EXAM
Part IV
Resources
207
Chapter 33
Math Lab
See the Math Lab Information Sheet for details.
Room 209 of the J. F. Hicks Memorial Library. Tutoring and additional material.
Run by Prof. Charlotte Ingram.
209
210 CHAPTER 33. MATH LAB
Chapter 34
On-line
As with all things, question the provenance of on-line resources before relying
upon them. This list is not comprehensive and does not provide endorsements;
this list is just a starting point.
34.1 Educational Standards
Virginia DOE Standards of Learning resources for mathematics
National Council of Teachers of Mathematics standards
34.2 General mathematics education resources
Encyclopedia:
Planet Math
Wolfram Mathworld
Texts:
Wikibooks
George Cains list of online mathematics textbooks
Alex Stef(?)s list of texts
Education and Coursework:
The Math Forum
Internet School Library Media Center Mathematics Resources K-12
211
212 CHAPTER 34. ON-LINE
Math Archives K-12 Teaching Materials
Mathematics Association of Americas professional development resources
Elementary?: Maths is Fun (British, obviously)
Late high school through graduate: Webcast@Berkeley, MIT Open Course-
Ware
Everyday items: SIAMs Math Matters! publications
others. . .
34.3 Useful software and applications
This list is for future reference. Each item has a somewhat steep learning curve
that is outside our scope. These may not be immediately useful for this course,
but they can be useful for playing with ideas quickly.
Exploratory and programming environments:
Linear algebra: Octave
Statistics: R
Geometry: Geomview
Algebra: Maxima, YACAS, others. . .
Spreadsheet: OpenOce, SIAG, others. . . Note: spreadsheets often are
made notorious for their poor quality arithmetic.