Mathematics for Computer Science
MIT 6.042J/18.062J
The Well Ordering
Principle
Albert R Meyer, Feb. 24, 2009
lec 4T.1
Well Ordering principle
Every nonempty set of
nonnegative integers
has a
least element.
Familiar? Now you mention it, Yes.
Obvious? Yes.
Trivial?
Yes. But watch out:
Albert R Meyer, Feb. 24, 2009
lec 4T.3
Well Ordering principle
Every nonempty set of
nonnegative integers
rationals
has a
least element.
NO!
Albert R Meyer, Feb. 24, 2009
lec 4T.4
Well Ordering principle
Every nonempty set of
nonnegative integers
has a
least element.
NO!
Albert R Meyer, Feb. 24, 2009
lec 4T.5
Prime Products
Thm: Every integer > 1 is a
product of primes.
Proof: (by contradiction) Suppose
{nonproducts} is nonempty. By WOP,
there is a least m > 1 that is a
nonproduct. This m is not prime
(else is a product of 1 prime)
Albert R Meyer, Feb. 24, 2009
lec 4T.9
Prime Products
Thm: Every integer > 1 is a
product of primes.
…So m = j·k for integers j,k
where m > j,k > 1. Now j,k < m
so both are prime products:
j = p1·p2··· p94 k = q1·q2···q213
Albert R Meyer, Feb. 24, 2009
lec 4T.10
Prime Products
Thm: Every integer > 1 is a
product of primes.
…now
m = j·k = p1·p2···p94·q1·q2···q213
is prime product, contradiction.
So {counterexamples} =
Albert R Meyer, Feb. 24, 2009
. QED
lec 4T.11
Well Ordering Principle Proofs
To prove n
. P(n) using WOP:
• define set of counterexamples
C ::= {n
| not P(n)}
• assume C is not empty.
By WOP, have minimum element m C.
• Reach a contradiction somehow …
usually by finding c C with c < m.
Albert R Meyer, Feb. 24, 2009
lec 4T.12
Well Ordered Postage
available stamps:
5¢
Thm: Get any amount n
3¢
8¢
Prove by WOP. Suppose not.
Let m be least counterexample:
if m > n
8, can get n¢.
Albert R Meyer, Feb. 24, 2009
lec 4T.13
Well Ordered Postage
m
8:
m
9:
m
10:
Albert R Meyer, Feb. 24, 2009
lec 4T.14
Well Ordered Postage
So m 11. Now m m-3 8
so can get m-3¢. But
= m¢
+
m-3¢
3¢ contradiction!
Albert R Meyer, Feb. 24, 2009
lec 4T.15
Well-founded
Partial Orders
Albert R Meyer, Feb. 24, 2009
lec 4T.16
Well-founded Partial Orders
A partial order is
well-founded iff every
nonempty subset has a
minimal element.
Albert R Meyer, Feb. 24, 2009
lec 4T.17
Well-founded Partial Orders
Special case:
on nonnegative integers
is a well-founded partial
(actually total) order
Albert R Meyer, Feb. 24, 2009
lec 4T.18
Well-founded Partial Orders
Lemma: A partial order
is well founded iff no infinite
-decreasing sequence
a1 a0
ak
Albert R Meyer, Feb. 24, 2009
a2
lec 4T.22
Well-founded Partial Orders
“only if” proof:
Say
S domain( )
has no minimal element.
Then show has infinite
-decreasing sequence.
Albert R Meyer, Feb. 24, 2009
lec 4T.23
Well-founded Partial Orders
s1 S not minimal, so have s2 S,
s2
s1
s2 not minimal, so have s3 S,
s3
s2
s1
Continue this way
to get -decreasing sequence!
Albert R Meyer, Feb. 24, 2009
lec 4T.24
Lexicographic order on
2
Define:
(a1,b1) lex (a2,b2) ::=
a1 a2 or (a1=a2 and b1 b2)
Fact: lex is a well-founded
2
total order on
.
Albert R Meyer, Feb. 24, 2009
lec 4T.26
Ackermann’s Function
2
A:
A(m,n) = 2n if m=0 or n 1,
A(m,n) = A(m-1,A(m,n-1))
if m > 0 and n > 1.
problem:
A(m,n) calls A(m-1,big)
Albert R Meyer, Feb. 24, 2009
lec 4T.30
Ackermann’s Function
A:
A(m,n) = 2n if m=0 or n 1,
A(m,n) = A(m-1,A(m,n-1))
if m > 0 and n > 1.
do the recursive calls
terminate?
Albert R Meyer, Feb. 24, 2009
lec 4T.31
Ackermann’s Function
A:
A(m,n) = 2n if m=0 or n 1,
A(m,n) = A(m-1,A(m,n-1))
if m > 0 and n > 1.
YES: because
(m,n) lex(m-1,big)
so no inf. seq. of recursive calls
Albert R Meyer, Feb. 24, 2009
lec 4T.32
Team Problems
Problems
1 3
Albert R Meyer, Feb. 24, 2009
lec 4T.33
© Copyright 2026 Paperzz