Direct Proof and Counterexample IV: Division into Cases and the Quotient-Remainder Theorem For each of the following values of n and d, find integers q.

Slides:



Advertisements
Similar presentations
Discrete Mathematics Lecture 3
Advertisements

Mathematical Induction
Chapter 3 Elementary Number Theory and Methods of Proof.
Review for CS1050. Review Questions Without using truth tables, prove that  (p  q)   q is a tautology. Prove that the sum of an even integer and an.
Chapter 3 Direct Proof and Proof by Contrapositive
1 In this lecture  Number Theory ● Rational numbers ● Divisibility  Proofs ● Direct proofs (cont.) ● Common mistakes in proofs ● Disproof by counterexample.
COUNTING AND PROBABILITY
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Copyright © Cengage Learning. All rights reserved.
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
Chapter 4: Elementary Number Theory and Methods of Proof
Copyright © Cengage Learning. All rights reserved.
6.1 The Fundamental Property of Rational Expressions.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Chapter 4: Elementary Number Theory and Methods of Proof 4.2 Direct Proof and Counter Example II: Rational Numbers 1 Such, then, is the whole art of convincing.
(CSC 102) Discrete Structures Lecture 10.
Mathematical Maxims and Minims, 1988
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Chapter 3 Elementary Number Theory and Methods of Proof.
P.1 Real Numbers. 2 What You Should Learn Represent and classify real numbers. Order real numbers and use inequalities. Find the absolute values of real.
Section 2.6 Representation of numbers. Decimal representation (base 10) Given a positive integer X, the decimal representation of X is a string of digits.
1 Methods of Proof Proof techniques in this handout –Direct proof –Division into cases –Proof by contradiction In this handout, the proof techniques will.
Week 3 - Friday.  What did we talk about last time?  Proving universal statements  Disproving existential statements  Rational numbers  Proof formatting.
4.1 Proofs and Counterexamples. Even Odd Numbers Find a property that describes each of the following sets E={…, -4, -2, 0, 2, 4, 6, …} O={…, -3, -1,
Theorem The square of any odd integer has the form 8m + 1 for some integer m.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
CS104:Discrete Structures Chapter 2: Proof Techniques.
1 CMSC 250 Chapter 3, Number Theory. 2 CMSC 250 Introductory number theory l A good proof should have: –a statement of what is to be proven –"Proof:"
Divisibility and Modular Arithmetic
EXAMPLE 3 Write an indirect proof Write an indirect proof that an odd number is not divisible by 4. GIVEN : x is an odd number. PROVE : x is not divisible.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Mathematical Induction. The Principle of Mathematical Induction Let S n be a statement involving the positive integer n. If 1.S 1 is true, and 2.the truth.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Chapter 1 Logic and Proof.
The Relation Induced by a Partition
Methods of Proof Proof techniques in this handout
Indirect Argument: Contradiction and Contraposition
Trigonometric Identities
Unit 2: Absolute Value Absolute Value Equations and Inequalities
Direct Proof and Counterexample III: Divisibility
CSE15 Discrete Mathematics 02/08/17
Indirect Argument: Two Classical Theorems
Advanced Algorithms Analysis and Design
Number Theory and Cryptography
ELEMENTARY NUMBER THEORY AND METHODS OF PROOF
ELEMENTARY NUMBER THEORY AND METHODS OF PROOF
Direct Proof and Counterexample V: Floor and Ceiling
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Modular Arithmetic I Lecture 9: Oct 4.
Direct Proof and Counterexample IV
COUNTING AND PROBABILITY
More Maths Programming Guides.
Direct Proof and Counterexample III
Copyright © Cengage Learning. All rights reserved.
Direct Proof and Counterexample IV
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Quotient-Remainder Theorem
Lecture 5 Number Theory & Proof Methods
Foundations of Discrete Mathematics
5.6 Inequalities in Two Triangles and Indirect Proof
Copyright © Cengage Learning. All rights reserved.
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Introduction to Proofs
Presentation transcript:

Direct Proof and Counterexample IV: Division into Cases and the Quotient-Remainder Theorem For each of the following values of n and d, find integers q and r such that n = dq + r and 0 ≤ r < d. a. n = 54, d = 4 b. n = –54, d = 4 c. n = 54, d = 70 Solution: 54 = (4)(13) + 2, and so q = 13 and r = 2 –54 = (4)(–14) + 2, and so q = –14 and r = 2 54 = (70)(0) + 54, and so q = 0 and r = 54

div and mod A number of computer languages have built-in functions that enable you to compute values of q and r for the quotient-remainder theorem. div and mod in Pascal / and % in C, C++, and Java / (or \) and mod in .NET The functions give the values that satisfy the quotient-remainder theorem when a nonnegative integer n is divided by a positive integer d and the result is assigned to an integer variable.

div and mod However, they do not give the values that satisfy the quotient-remainder theorem when a negative integer n is divided by a positive integer d.

div and mod For instance, to compute n div d for a nonnegative integer n and a positive integer d, you just divide n by d and ignore the part of the answer to the right of the decimal point. To find n mod d, you can use the fact that if n = dq + r then r = n – dq. Thus, n = d  (n div d) + n mod d and so n mod d = n – d  (n div d)

Example 2 – Computing div and mod Compute 32 div 9 and 32 mod 9 by hand. Solution: Performing the division by hand gives: Discarding the fractional part gives 32 div 9 = 3, and so 32 mod 9 = 32 – 9 (32 div 9) = 32 – 27 = 5

Representations of Integers Theorem: Any integer is either even or odd (but not both). Proof: Let n be any integer. By the quotient-remainder theorem (with d = 2), there exist unique integers q and r such that n = 2q + r and 0 ≤ r < 2 But the only integers that satisfy 0 ≤ r < 2 are r = 0 and r = 1. Thus, there exists an integer q with n = 2q + 0 or n = 2q + 1 In the first case, n is even. In the second, n is odd. The uniqueness of q and r means n cannot be both.

Representations of Integers The parity of an integer refers to whether the integer is even or odd. For instance, 5 has odd parity and 28 has even parity. We call the fact that any integer is either even or odd the parity property.

Example 5 – Consecutive Integers Have Opposite Parity Two integers are called consecutive if, and only if, one is one more than the other. So if one integer is m, then the next consecutive integer is m + 1. Theorem: For any two consecutive integers, one is even and the other is odd. Proof: Let m be any integer. We need to prove that if m is even, then m+1 is odd, and if m is odd, then m+1 is even.

Example 5 – Solution Case 1: m is even. Then, cont’d Case 1: m is even. Then, m = 2k for some integer k, by the definition of “even” m + 1 = 2k + 1 is odd, by the definition of “odd” Case 2: m is odd. Then, m = 2k + 1 for some integer k, by the definition of “odd” m + 1 = 2k + 2 = 2(k + 1) is even, by the definition of “even” (since k+1 is an integer)

Proof by Division into Cases First assume A1 is true and deduce C; next assume A2 is true and deduce C; and so forth until you have assumed An is true and deduced C. At that point, you can conclude that regardless of which statement Ai happens to be true, the truth of C follows.

Example 6 – Representations of Integers Modulo 4 Lemma: Any integer can be written in one of the four forms n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3 for some integer q. Proof: Given any integer n, apply the quotient-remainder theorem to n with d = 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.

n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3 Example 7 Proof: Suppose n is an odd integer. By the preceding lemma, n can be written in one of the forms n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3 for some integer q. In fact, since n is odd and 4q and 4q + 2 are even, n must have one of the forms n = 4q + 1 or n = 4q + 3

Example 7 – Solution Case 1 (n = 4q + 1 for some integer q): cont’d Case 1 (n = 4q + 1 for some integer q): Let Then m is an integer since 2 and q are integers and sums and products of integers are integers. Thus, substituting, where m is an integer.

Example 7 – Solution Case 2 (n = 4q + 3 for some integer q): cont’d Case 2 (n = 4q + 3 for some integer q): Let Then m is an integer since 1, 2, 3, and q are integers and sums and products of integers are integers. Thus, substituting, where m is an integer.

Representations of Integers Note that the result of Theorem 4.4.3 can also be written, “For any odd integer n, n2 mod 8 = 1.” In general, according to the quotient-remainder theorem, if an integer n is divided by an integer d, the possible remainders are 0, 1, 2, . . ., (d – 1). This implies that n can be written in one of the forms for some integer q.

Absolute Value and the Triangle Inequality The triangle inequality is one of the most important results involving absolute value. It has applications in many areas of mathematics.

Absolute Value and the Triangle Inequality A lemma is a statement that does not have much intrinsic interest but is helpful in deriving other results.

Absolute Value and the Triangle Inequality Lemmas 4.4.4 and 4.4.5 now provide a basis for proving the triangle inequality.