Direct Proof Floor and Ceiling

Similar documents
Direct Proof Division into Cases

Direct Proof Universal Statements

Direct Proof Divisibility

Direct Proof Divisibility

Strong Mathematical Induction

Instantaneous Rate of Change

Composition of Functions

Direct Proof Rational Numbers

Nondeterministic Finite Automata

The Pairwise-Comparison Method

Maximums and Minimums

Predicates and Quantifiers

Closure Properties of Regular Languages

Confidence Intervals for Proportions Sections 22.2, 22.3

The Interpretation of λ

Vector Operations. Lecture 19. Robb T. Koether. Hampden-Sydney College. Wed, Oct 7, 2015

Compound Interest. Lecture 34 Section 4.1. Robb T. Koether. Hampden-Sydney College. Tue, Mar 28, 2017

Conditional Statements

Paired Samples. Lecture 37 Sections 11.1, 11.2, Robb T. Koether. Hampden-Sydney College. Mon, Apr 2, 2012

Independent Samples: Comparing Means

Negations of Quantifiers

Sampling Distribution of a Sample Proportion

Elementary Logic and Proof

Sampling Distribution of a Sample Proportion

Binary Search Trees. Lecture 29 Section Robb T. Koether. Hampden-Sydney College. Fri, Apr 8, 2016

The Cobb-Douglas Production Functions

Lecture 45 Sections Wed, Nov 19, 2008

Variables. Lecture 12 Sections Tue, Feb 3, Hampden-Sydney College. Displaying Distributions - Qualitative.

Lecture 26 Section 8.4. Wed, Oct 14, 2009

Percent Problems. Percent problems can be solved using proportions. Use the following formula when solving percent problems with a proportion.

Lecture 11 Sections 4.5, 4.7. Wed, Feb 18, 2009

Lecture 41 Sections Wed, Nov 12, 2008

The Binomial Theorem

Solutions to Assignment 1

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

Outline Goals and Assumptions Real Numbers Rational and Irrational. L11: Numbers. Alice E. Fischer

NUMERICAL METHODS C. Carl Gustav Jacob Jacobi 10.1 GAUSSIAN ELIMINATION WITH PARTIAL PIVOTING

Tessellations II. Irena Swanson Reed College, Portland, Oregon. MathPath, Lewis & Clark College, Portland, Oregon, 9 July 2015

The Binomial Theorem

Proportion. Lecture 25 Sections Fri, Oct 10, Hampden-Sydney College. Sampling Distribution of a Sample. Proportion. Robb T.

Discrete Mathematics U. Waterloo ECE 103, Spring 2010 Ashwin Nayak May 17, 2010 Recursion

MA 180 Lecture. Chapter 0. College Algebra and Calculus by Larson/Hodgkins. Fundamental Concepts of Algebra

Second Trimester Exam: STUDY GUIDE: KEY

Integrated Arithmetic and Basic Algebra

Introduction Integers. Discrete Mathematics Andrei Bulatov

Chapter 2 Solutions of Equations of One Variable

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

UGRC 120 Numeracy Skills

QUESTION 6 (16 Marks) A continuous random variable X has a Weibull distribution if it has a probability distribution function given by

Introduction to Cryptology. Lecture 19

The Euclidean Division Implemented with a Floating-Point Multiplication and a Floor

Applied Cryptography and Computer Security CSE 664 Spring 2017

Lecture 6: Introducing Complexity

Lecture 26 Section 8.4. Mon, Oct 13, 2008

A CURIOUS PROPERTY OF UNIT FRACTIONS OF THE FORM 1/d WHERE (d, 10) = 1 INTRODUCTION

Chabot College Fall Course Outline for Mathematics 47 MATHEMATICS FOR LIBERAL ARTS

Section 7.2 Euler s Method

Section 3.3: Laws of Logarithms

Lecture 48 Sections Mon, Nov 16, 2009

9.4 Start Thinking. 9.4 Warm Up. 9.4 Cumulative Review Warm Up. Use a graphing calculator to graph ( )

Math Challengers. Regional Competition Face-off Round 2013

Lecture 10: The Normal Distribution. So far all the random variables have been discrete.

Module 1: Introduction to Finite Difference Method and Fundamentals of CFD Lecture 7:

Lecture 41 Sections Mon, Apr 7, 2008

Section Notes 9. IP: Cutting Planes. Applied Math 121. Week of April 12, 2010

2.3 Solving Equations Containing Fractions and Decimals

Paper 5525_06. NB: embedded answers: B1; award Bs for evaluations rounded or truncated to at least 1 dp or for 31

Kevin James. MTHSC 412 Section 3.1 Definition and Examples of Rings

Chapter 4: Radicals and Complex Numbers

Math 412: Number Theory Lecture 3: Prime Decomposition of

Diffusion with particle accounting

cse547,mat547 DISCRETE MATHEMATICS Lectures Content For Midterm 2 and Final Infinite Series, Chapter 3 and Chapter 4

The Behavior of Algorithms in Practice 2/21/2002. Lecture 4. ɛ 1 x 1 y ɛ 1 x 1 1 = x y 1 1 = y 1 = 1 y 2 = 1 1 = 0 1 1

MTH303. Section 1.3: Error Analysis. R.Touma

Powers, Roots and Radicals. (11) Page #23 47 Column, #51, 54, #57 73 Column, #77, 80

3E4: Modelling Choice. Introduction to nonlinear programming. Announcements

Romberg Integration. MATH 375 Numerical Analysis. J. Robert Buchanan. Spring Department of Mathematics

Writing Exponential Equations Day 2

Solving a Linear-Quadratic System

Discrete Mathematics. Spring 2017

Spring 2016 Indiana Collegiate Mathematics Competition (ICMC) Exam

Algorithms: Background

Simple Iteration, cont d

Math 0095: Developmental Mathematics Emporium

Structured Problems and Algorithms

1 The linear algebra of linear programs (March 15 and 22, 2015)

How do computers represent numbers?

ACCUPLACER Sample Questions for Students

Numerical Methods. King Saud University

Basic Fraction and Integer Operations (No calculators please!)

Numbers. Dr Hammadi Nait-Charif. Senior Lecturer Bournemouth University United Kingdom

Linear integer programming and its application

Exam 2 Review Chapters 4-5

Nearest Neighbor Search with Keywords: Compression

Rounding. In mathematics rounding off is writing an answer to a given degree of accuracy.

Introduction CSE 541

E&CE 223 Digital Circuits & Systems. Winter Lecture Transparencies (Introduction) M. Sachdev

3. Infinite Series. The Sum of a Series. A series is an infinite sum of numbers:

9 5 Testing Convergence at Endpoints

Elementary Algebra SAMPLE Final Examination Fall 2017

Transcription:

Direct Proof Floor and Ceiling Lecture 17 Section 4.5 Robb T. Koether Hampden-Sydney College Wed, Feb 12, 2014 Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 1 / 27

1 The Floor and Ceiling Functions 2 Theorems 3 Applications 4 Assignment Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 2 / 27

Outline 1 The Floor and Ceiling Functions 2 Theorems 3 Applications 4 Assignment Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 3 / 27

The Floor and Ceiling Functions Definition (The Floor Function) Let x R. Define the floor function, denoted x, to be the unique integer n such that n x < n + 1. Definition (The Ceiling Function) Let x R. Define the ceiling function, denoted x, to be the unique integer n such that n 1 < x n. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 4 / 27

Examples For example, 3.8 = 3 3.8 = 4 3.8 = 4 3.8 = 3 Note that, for negative numbers, this is not the same as truncation. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 5 / 27

Rounding Definition (The Round Function) Let x R. Define x = x + 1/2. We see that x is the value of x, rounded to the nearest integer. If x is exactly halfway between two integers, then it is rounded up to the next largest integer. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 6 / 27

Outline 1 The Floor and Ceiling Functions 2 Theorems 3 Applications 4 Assignment Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 7 / 27

Theorem Theorem For all x R and all n Z, x + n = x + n. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 8 / 27

Theorem Proof. Let x R and let n Z. Let m = x Z and let e = x m. Then x = m + e and 0 e < 1. Then x + n = (m + e) + n = (m + n) + e = m + n = x + n. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 9 / 27

Conjectures Is there a comparable statement involving x + n? Is it true that x, y R, x + y = x + y? Is it true that x R, 2x = 2 x? Is it true that x R, x 2 = ( x ) 2? Is it true that x R, x + 1/2 = x 1/2? If they are not true for all x, y R, then are they true for some x, y R? Which ones? Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 10 / 27

Theorem Theorem For all real numbers x, x + x + 1 2 = 2x. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 11 / 27

Theorem Proof. Let x R. Let n = x and e = x n. Either 0 e < 1 2 or 1 2 e < 1. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 12 / 27

Proof Proof. Case 1: Suppose 0 e < 1/2. Then 1/2 e + 1/2 < 1. Therefore x + x + 1/2 = n + n + e + 1/2 = n + n = 2n = 2 x. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 13 / 27

Proof Proof. Case 2: Suppose 1/2 e < 1. Then, 0 e 1/2 < 1/2. Therefore x + x + 1/2 = n + n + e + 1/2 = n + (n + 1) + (e 1/2) = n + (n + 1) = 2n + 1. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 14 / 27

Proof Proof. Also, 0 2e 1 < 1. Therefore, 2x = 2n + 2e = 2n + 1 + (2e 1) = 2n + 1, Therefore x + x + 1/2 = 2x. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 15 / 27

Proof Proof. Therefore, for all x R, x + x + 1/2 = 2x. Write a similar statement using the ceiling function. Write a similar statement using the round function. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 16 / 27

Outline 1 The Floor and Ceiling Functions 2 Theorems 3 Applications 4 Assignment Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 17 / 27

Binary Search In a binary search of a list of size n, we begin by comparing the value to the middle element. If it matches, we are done. If it fails to match, we continue searching in the same manner in the lower half or the upper half. How many comparisons are required to find the value we are looking for? Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 18 / 27

Binary Search Suppose n = 225 and the elements are a[0] through a[224]. We first compare to element a[112]. Next, we compare to element a[65] or a[168], and so on. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 19 / 27

Binary Search Initially we have 225 elements. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Again: 13 or 14. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Again: 13 or 14. Again: 6 or 7. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Again: 13 or 14. Again: 6 or 7. Again: 2 or 3. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Again: 13 or 14. Again: 6 or 7. Again: 2 or 3. Again: 0 or 1. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Again: 13 or 14. Again: 6 or 7. Again: 2 or 3. Again: 0 or 1. Done. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 20 / 27

Binary Search Initially we have 225 elements. We eliminate 1 and divide the rest in half: 112 in each half. We eliminate 1 more and divide the rest in half: either 55 or 56 in the halves. We eliminate 1 more and divide: 27 or 28 in the halves. Again: 13 or 14. Again: 6 or 7. Again: 2 or 3. Again: 0 or 1. Done. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 21 / 27

Binary Search Consider the calculation: 225 2 = 112, 112 2 = 56, 56 2 = 28, 28 2 = 14, 14 2 = 7, 7 2 = 3, 3 2 = 1. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 22 / 27

Binary Search The maximum number of comparisons is log 2 225 = 8. The minimum number of comparisons is log 2 225 = 7. In general, the number is either log 2 n or log 2 n. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 23 / 27

Binary Search The maximum number of comparisons is log 2 225 = 8. The minimum number of comparisons is log 2 225 = 7. In general, the number is either log 2 n or log 2 n. How many comparisons are required when n = 10000? Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 23 / 27

Binary Search The maximum number of comparisons is log 2 225 = 8. The minimum number of comparisons is log 2 225 = 7. In general, the number is either log 2 n or log 2 n. How many comparisons are required when n = 10000? When n = 100000? Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 23 / 27

Binary Search The maximum number of comparisons is log 2 225 = 8. The minimum number of comparisons is log 2 225 = 7. In general, the number is either log 2 n or log 2 n. How many comparisons are required when n = 10000? When n = 100000? When n = 10 12? Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 23 / 27

Puzzle How many trailing zeros are there in the decimal representation of 1000!? (1000! = 1000 999 998 2 1.) Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 24 / 27

Puzzle A trailing zero is produced by, and only by, a factor of 10. A factor of 10 is produced by, and only by, a pair of prime factors 2 and 5. How many pairs of factors 2 and 5 are there in 1000!? Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 25 / 27

Outline 1 The Floor and Ceiling Functions 2 Theorems 3 Applications 4 Assignment Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 26 / 27

Assignment Assignment Read Section 4.5, pages 191-196. Exercises 4, 8, 9, 10, 15, 16, 20, 21, 24, 25, page 197. Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 12, 2014 27 / 27