Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.

Slides:



Advertisements
Similar presentations
Chapter 3 Elementary Number Theory and Methods of Proof.
Advertisements

Chapter 3 Elementary Number Theory and Methods of Proof.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
COUNTING AND PROBABILITY
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
(CSC 102) Lecture 12 Discrete Structures. Previous Lecture Summary Floor and Ceiling Functions Definition of Proof Methods of Proof Direct Proof Disproving.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
3.3 Divisibility Definition If n and d are integers, then n is divisible by d if, and only if, n = dk for some integer k. d | n  There exists an integer.
Elementary Number Theory and Methods of Proof
Quotient-Remainder Theory, Div and Mod
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. CHAPTER 1 SPEAKING MATHEMATICALLY SPEAKING MATHEMATICALLY.
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(
Copyright © Cengage Learning. All rights reserved. 3 Differentiation Rules.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
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.
Copyright © Cengage Learning. All rights reserved. Calculating Limits 1.4.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
The importance of sequences and infinite series in calculus stems from Newton’s idea of representing functions as sums of infinite series.  For instance,
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. Equations and Inequalities 2.
Copyright © Cengage Learning. All rights reserved. CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF.
Chapter 3 Elementary Number Theory and Methods of Proof.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Copyright © Cengage Learning. All rights reserved. CHAPTER 3 THE LOGIC OF QUANTIFIED STATEMENTS THE LOGIC OF QUANTIFIED STATEMENTS.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Copyright © Cengage Learning. All rights reserved.
Chapter 2 Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter 2-1 Solving Linear.
1 Copyright © Cengage Learning. All rights reserved. 2. Equations and Inequalities 2.4 Complex Numbers.
Copyright © Cengage Learning. All rights reserved. Fundamental Concepts of Algebra 1.1 Real Numbers.
1 Copyright © Cengage Learning. All rights reserved. 2. Equations and Inequalities 2.3 Quadratic Equations.
Copyright © Cengage Learning. All rights reserved Inequalities 2. Equations and Inequalities.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Copyright © Cengage Learning. All rights reserved. Sequences and Series.
The Relation Induced by a Partition
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.
Trigonometric Identities
The Language of Sets If S is a set, then
Copyright © Cengage Learning. All rights reserved.
Direct Proof and Counterexample III: Divisibility
Reflexivity, Symmetry, and Transitivity
ELEMENTARY NUMBER THEORY AND METHODS OF PROOF
Direct Proof and Counterexample V: Floor and Ceiling
Trigonometric Identities
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
The sum of any two even integers is even.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

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. Direct Proof and Counterexample V: Floor and Ceiling SECTION 4.5

3 Direct Proof and Counterexample V: Floor and Ceiling Imagine a real number sitting on a number line. The floor and ceiling of the number are the integers to the immediate left and to the immediate right of the number (unless the number is, itself, an integer, in which case its floor and ceiling both equal the number itself ). Many computer languages have built-in functions that compute floor and ceiling automatically. These functions are very convenient to use when writing certain kinds of computer programs. In addition, the concepts of floor and ceiling are important in analyzing the efficiency of many computer algorithms.

4 Direct Proof and Counterexample V: Floor and Ceiling

5

6 Compute and for each of the following values of x: a. 25/4 b c. –2.01 Solution: a. b. c. Note that on some calculators is denoted INT (x). Example 1 – Computing Floors and Ceilings

7 Example 4 – Disproving an Alleged Property of Floor Is the following statement true or false? For all real numbers x and y, Solution: The statement is false. As a counterexample, take Then whereas

8 Example 4 – Solution Hence To arrive at this counterexample, you could have reasoned as follows: Suppose x and y are real numbers. Must it necessarily be the case that or could x and y be such that Imagine values that the various quantities could take. cont’d

9 Example 4 – Solution For instance, if both x and y are positive, then are the integer parts of respectively; just as so is and Where the term fractional part is understood here to mean the part of the number to the right of the decimal point when the number is written in decimal notation. cont’d

10 Example 4 – Solution Thus if x and y are positive, But also These equations show that if there exist numbers x and y such that the sum of the fractional parts of x and y is at least 1, then a counterexample can be found. cont’d

11 Example 4 – Solution But there do exist such x and y; for instance, x = and y = as before. cont’d

12 Direct Proof and Counterexample V: Floor and Ceiling The analysis of Example 4 indicates that if x and y are positive and the sum of their fractional parts is less than 1, then In particular, if x is positive and m is a positive integer, then (The fractional part of m is 0; hence the sum of the fractional parts of x and m equals the fractional part of x, which is less than 1.) It turns out that you can use the definition of floor to show that this equation holds for all real numbers x and for all integers m.

13 Prove that for all real numbers x and for all integers m, Solution: Begin by supposing that x is a particular but arbitrarily chosen real number and that m is a particular but arbitrarily chosen integer. You must show that Since this is an equation involving, it is reasonable to give one of these quantities a name: Let n = By definition of floor, Example 5 – Proving a Property of Floor

14 Example 5 – Solution This double inequality enables you to compute the value of in terms of n by adding m to all sides: Thus the left-hand side of the equation to be shown is On the other hand, since n =, the right-hand side of the equation to be shown is also. Thus cont’d

15 Example 5 – Solution This discussion is summarized as follows: Theorem 1 Proof: Suppose a real number x and an integer m are given. [We must show that ] Let n =. By definition of floor, n is an integer and cont’d

16 Example 5 – Solution Add m to all three parts to obtain [since adding a number to both sides of an inequality does not change the direction of the inequality]. Now n + m is an integer [since n and m are integers and a sum of integers is an integer], and so, by definition of floor, the left-hand side of the equation to be shown is cont’d

17 Example 5 – Solution But n =. Hence, by substitution, which is the right-hand side of the equation to be shown. Thus [as was to be shown]. cont’d

18 Direct Proof and Counterexample V: Floor and Ceiling The analysis of a number of computer algorithms, such as the binary search and merge sort algorithms, requires that you know the value of, where n is an integer. The formula for computing this value depends on whether n is even or odd.

19 Direct Proof and Counterexample V: Floor and Ceiling Given any integer n and a positive integer d, the quotient-remainder theorem guarantees the existence of unique integers q and r such that The following theorem states that the floor notation can be used to describe q and r as follows:

20 Direct Proof and Counterexample V: Floor and Ceiling Thus if, on a calculator or in a computer language, floor is built in but div and mod are not, div and mod can be defined as follows: For a nonnegative integer n and a positive integer d, Note that d divides n if, and only if, n mod d = 0, or, in other words,

21 Use the floor notation to compute 3850 div 17 and 3850 mod 17. Solution: By formula (4.5.1), Example 6 – Computing div and mod

22 Example 6 – Solution cont’d