<<

4.4 Direct Proof and Counterexample IV: into Cases and the Quotient- Theorem

4.4 Quotient-Remainder Theorem 1 / 4 1 n = 34 and d = 6. 2 n = −34 and d = 6.

Examples For each of the following values of n and d, find q and r such that n = dq + r and 0 ≤ r < d.

The Quotient-Remainder Theorem

Theorem Given any n and positive integer d, there exist unique integers q and r such that n = dq + r and 0 ≤ r < d.

4.4 Quotient-Remainder Theorem 2 / 4 2 n = −34 and d = 6.

The Quotient-Remainder Theorem

Theorem Given any integer n and positive integer d, there exist unique integers q and r such that n = dq + r and 0 ≤ r < d.

Examples For each of the following values of n and d, find integers q and r such that n = dq + r and 0 ≤ r < d. 1 n = 34 and d = 6.

4.4 Quotient-Remainder Theorem 2 / 4 The Quotient-Remainder Theorem

Theorem Given any integer n and positive integer d, there exist unique integers q and r such that n = dq + r and 0 ≤ r < d.

Examples For each of the following values of n and d, find integers q and r such that n = dq + r and 0 ≤ r < d. 1 n = 34 and d = 6. 2 n = −34 and d = 6.

4.4 Quotient-Remainder Theorem 2 / 4 1 Compute 33 div 9 and 33 mod 9 (by hand and Python). 2 Keeping in mind which years are leap years, what day of the week will be 1 year from today? 3 Suppose that m is an integer. If m mod 11 = 7, what is 4m mod 11?

Examples

div and mod

Definition Given an integer n and a positive integer d, n div d = the integer quotient obtained when n is divided by d. n mod d = the nonnegative integer remainder obtained when n is divided by d.

4.4 Quotient-Remainder Theorem 3 / 4 2 Keeping in mind which years are leap years, what day of the week will be 1 year from today? 3 Suppose that m is an integer. If m mod 11 = 7, what is 4m mod 11?

div and mod

Definition Given an integer n and a positive integer d, n div d = the integer quotient obtained when n is divided by d. n mod d = the nonnegative integer remainder obtained when n is divided by d.

Examples 1 Compute 33 div 9 and 33 mod 9 (by hand and Python).

4.4 Quotient-Remainder Theorem 3 / 4 3 Suppose that m is an integer. If m mod 11 = 7, what is 4m mod 11?

div and mod

Definition Given an integer n and a positive integer d, n div d = the integer quotient obtained when n is divided by d. n mod d = the nonnegative integer remainder obtained when n is divided by d.

Examples 1 Compute 33 div 9 and 33 mod 9 (by hand and Python). 2 Keeping in mind which years are leap years, what day of the week will be 1 year from today?

4.4 Quotient-Remainder Theorem 3 / 4 div and mod

Definition Given an integer n and a positive integer d, n div d = the integer quotient obtained when n is divided by d. n mod d = the nonnegative integer remainder obtained when n is divided by d.

Examples 1 Compute 33 div 9 and 33 mod 9 (by hand and Python). 2 Keeping in mind which years are leap years, what day of the week will be 1 year from today? 3 Suppose that m is an integer. If m mod 11 = 7, what is 4m mod 11?

4.4 Quotient-Remainder Theorem 3 / 4 2 Prove that given any two consecutive integers, one is even and the other is odd.

Theorems

1 Prove that for any integer n there exists an integer q with n = 2q or n = 2q + 1.

4.4 Quotient-Remainder Theorem 4 / 4 Theorems

1 Prove that for any integer n there exists an integer q with n = 2q or n = 2q + 1. 2 Prove that given any two consecutive integers, one is even and the other is odd.

4.4 Quotient-Remainder Theorem 4 / 4