EppDM5e 04 05
EppDM5e 04 05
3
Direct Proof and Counterexample Ⅴ: Division into Cases
and the Quotient-Remainder Theorem (2/2)
4
Example 4.5.1 – The Quotient-Remainder Theorem
a. n = 54, d = 4
b. n = −54, d = 4
c. n = 54, d = 70
5
Example 4.5.1 – Solution
a. 54 = 4 · 13 + 2; hence q = 13 and r = 2.
6
div and mod
7
div and mod (1/1)
8
Example 4.5.2 – Computing div and mod by Hand or with a Four-
Function Calculator
9
Example 4.5.2 – Solution (1/2)
Performing the division by hand gives the following results:
10
Example 4.5.2 – Solution (2/2) continued
11
Example 4.5.4 – Solving Problems about mod
12
Example 4.5.4 – Solution (1/2)
a. Proof: Suppose n is any positive integer. The decimal
representation for n is dk dk − 1 …d2 d1 d0, where d0, d1, d2,
… , dk are integers from 0 to 9 inclusive, dk ≠ 0 unless n
= 0 and k = 0,
13
Example 4.5.4 – Solution (2/2) continued
14
Representations of Integers
15
Representations of Integers (1/4)
We defined an even integer to have the form twice some
integer. At that time we could have defined an odd integer
to be one that was not even.
16
Example 4.5.5 – Consecutive Integers Have Opposite Parity
M = 2k;
M + 1= 2k + 1;
P = 2k + 1;
P + 1 = 2k + 2
17
Example 4.5.5 – Solution (1/2)
Two integers are called consecutive if, and only if, one is
one more than the other. So if one integer is m, the next
consecutive integer is m + 1.
To prove the given statement, you can divide the analysis
into two cases: case 1, where the smaller of the two
integers is even, and case 2, where the smaller of the two
integers is odd.
Case 1 (m is even): In this case, m = 2k for some integer
k, and so m + 1 = 2k + 1, which is odd [by definition of odd].
Hence in this case, one of m and m + 1 is even and the
other is odd.
18
Example 4.5.5 – Solution (2/2) continued
19
Representations of Integers (2/4)
20
Representations of Integers (3/4)
21
Example 4.5.6 – Representing Integers mod 4
n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3
22
Example 4.5.6 – Solution
Given any integer n, apply the quotient-remainder theorem
to n with the divisor equal to 4. This implies that there exist
an integer quotient q and a remainder r such that
n = 4q + r and 0 ≤ r < 4.
But the only nonnegative remainders r that are less than 4
are 0, 1, 2, and 3.
Hence
n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3
for some integer q. In other words, n mod 4 equals 0, 1, 2,
or 3.
23
Example 4.5.7 – The Square of an Odd Integer
24
Example 4.5.7 – Solution
If checking some examples convinces you that the
statement may be true, begin to develop a proof by asking,
“Where am I starting from?” and “What do I need to show?”
To help answer these questions, introduce variables to
rewrite the statement more formally.
25
Example 4.5.7 – Solution (1/3) continued
26
Example 4.5.7 – Solution (2/3) continued
Then It is clear
from this analysis that can be written in the form 4m + 1,
but it may not be clear that it can be written as 8m + 1.
27
Example 4.5.7 – Solution (3/3) continued
28
Representations of Integers (4/4)
29
Absolute Value and the Triangle
Inequality
30
Absolute Value and the Triangle Inequality (1/2)
31
Absolute Value and the Triangle Inequality (2/2)
32