Direct Proof Floor and Ceiling Lecture 17 Section 4.5 Robb T. - - PowerPoint PPT Presentation

direct proof floor and ceiling
SMART_READER_LITE
LIVE PREVIEW

Direct Proof Floor and Ceiling Lecture 17 Section 4.5 Robb T. - - PowerPoint PPT Presentation

Direct Proof Floor and Ceiling Lecture 17 Section 4.5 Robb T. Koether Hampden-Sydney College Wed, Feb 13, 2013 Robb T. Koether (Hampden-Sydney College) Direct Proof Floor and Ceiling Wed, Feb 13, 2013 1 / 21 The Floor and Ceiling


slide-1
SLIDE 1

Direct Proof – Floor and Ceiling

Lecture 17 Section 4.5 Robb T. Koether

Hampden-Sydney College

Wed, Feb 13, 2013

Robb T. Koether (Hampden-Sydney College) Direct Proof – Floor and Ceiling Wed, Feb 13, 2013 1 / 21

slide-2
SLIDE 2

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 13, 2013 2 / 21

slide-3
SLIDE 3

title

Definition (The Floor Function)

Let x ∈ R. Define ⌊x⌋ to be the integer n such that n ≤ x < n + 1.

Definition (The Ceiling Function)

Let x ∈ R. Define ⌈x⌉ to be the integer n such that n − 1 < x ≤ n.

Robb T. Koether (Hampden-Sydney College) Direct Proof – Floor and Ceiling Wed, Feb 13, 2013 3 / 21

slide-4
SLIDE 4

Examples

For example,

⌊3.8⌋ = 3 ⌈3.8⌉ = 4 ⌊−3.8⌋ = −4 ⌈−3.8⌉ = −3

Robb T. Koether (Hampden-Sydney College) Direct Proof – Floor and Ceiling Wed, Feb 13, 2013 4 / 21

slide-5
SLIDE 5

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 13, 2013 5 / 21

slide-6
SLIDE 6

Theorem

Theorem

For all x ∈ R and all n ∈ Z, ⌊x + n⌋ = ⌊x⌋ + n.

Proof.

Let x ∈ R and let n ∈ Z. Let m = ⌊x⌋ ∈ Z. Then x = m + e for some e ∈ R with 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 13, 2013 6 / 21

slide-7
SLIDE 7

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, ⌊x2⌋ = (⌊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 13, 2013 7 / 21

slide-8
SLIDE 8

Theorem

Theorem

For all real numbers x, ⌊x⌋ + ⌊x + 1

2⌋ = ⌊2x⌋.

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 13, 2013 8 / 21

slide-9
SLIDE 9

Proof

Proof.

Case 1: Suppose 0 ≤ e < 1/2. Then ⌊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 13, 2013 9 / 21

slide-10
SLIDE 10

Proof

Proof.

Case 2: Suppose 1/2 ≤ e < 1. Then, on one hand, ⌊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 13, 2013 10 / 21

slide-11
SLIDE 11

Proof

Proof.

Case 2 (cont’d): On the other hand, ⌊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 13, 2013 11 / 21

slide-12
SLIDE 12

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 13, 2013 12 / 21

slide-13
SLIDE 13

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 13, 2013 13 / 21

slide-14
SLIDE 14

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 13, 2013 14 / 21

slide-15
SLIDE 15

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 13, 2013 15 / 21

slide-16
SLIDE 16

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 13, 2013 16 / 21

slide-17
SLIDE 17

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. The number of iterations is ⌈log2 225⌉ = 8. In general, the number is ⌈log2 n⌉.

Robb T. Koether (Hampden-Sydney College) Direct Proof – Floor and Ceiling Wed, Feb 13, 2013 17 / 21

slide-18
SLIDE 18

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 13, 2013 18 / 21

slide-19
SLIDE 19

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 13, 2013 19 / 21

slide-20
SLIDE 20

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 13, 2013 20 / 21

slide-21
SLIDE 21

Collected Homework 4

Collected Homework 4

Exercises 28, 58, page 161. Exercises 14, 28, page 168. Exercises 28, 29, page 177. Exercises 19, 41, page 189.

Robb T. Koether (Hampden-Sydney College) Direct Proof – Floor and Ceiling Wed, Feb 13, 2013 21 / 21