Lecture 3.6: Quotient, remainder, ceiling and floor Matthew Macauley - - PowerPoint PPT Presentation

lecture 3 6 quotient remainder ceiling and floor
SMART_READER_LITE
LIVE PREVIEW

Lecture 3.6: Quotient, remainder, ceiling and floor Matthew Macauley - - PowerPoint PPT Presentation

Lecture 3.6: Quotient, remainder, ceiling and floor Matthew Macauley Department of Mathematical Sciences Clemson University http://www.math.clemson.edu/~macaule/ Math 4190, Discrete Mathematical Structures M. Macauley (Clemson) Lecture 3.6:


slide-1
SLIDE 1

Lecture 3.6: Quotient, remainder, ceiling and floor

Matthew Macauley Department of Mathematical Sciences Clemson University http://www.math.clemson.edu/~macaule/ Math 4190, Discrete Mathematical Structures

  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 1 / 7

slide-2
SLIDE 2

Division and remainder

Theorem

Given any n ∈ Z and d ∈ Z+, there exists unique integers q, r such that n = dq + r, 0 ≤ r < d. We call q := n div d and r := n mod d the quotient and remainder, respectively.

Examples

  • 1. Compute 365 div 7 and 356 mod 7.
  • 2. Suppose m mod 11 = 6. Compute 4n mod 11.
  • 3. Given n ∈ Z, compute n2 mod 4.
  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 2 / 7

slide-3
SLIDE 3

Division and remainder

If n ∈ Z is odd, then n2 mod 8 = 1. Equivalently, ∀ odd n, ∃m ∈ Z such that n2 = 8m + 1.

  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 3 / 7

slide-4
SLIDE 4

Ceiling and floor

Definition

Given x ∈ R, the floor of x is defined as ⌊x⌋ = n ⇔ n ≤ x < n + 1. The ceiling of x is defined as ⌈x⌉ = n ⇔ n − 1 < x ≤ n.

Questions

Are the following true or false?

  • 1. ⌊x − 1⌋ = ⌊x⌋ − 1
  • 2. ⌊x − y⌋ = ⌊x⌋ − ⌊y⌋.
  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 4 / 7

slide-5
SLIDE 5

Ceiling and floor

Proposition

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

Proof

By definition, n ≤ x < n + 1, where ⌊x⌋ = n. Adding m yields n + m

=⌊x+m⌋

≤ x + m < n + m + 1. But ⌊x⌋ = n implies that n + m = ⌊x⌋ + m.

  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 5 / 7

slide-6
SLIDE 6

Ceiling and floor

Proposition

For all integers n, n 2

  • =

       . n 2 n is even n − 1 2 n is odd.

  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 6 / 7

slide-7
SLIDE 7

Ceiling and floor

Proposition

For all integers n and d, n div d = n d

  • ,

and n mod d = n − d n d

  • .
  • M. Macauley (Clemson)

Lecture 3.6: Quotient, remainder, ceiling & floor Discrete Mathematical Structures 7 / 7