{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CommonFunctions

# CommonFunctions - CMPS 201 Algorithms and Abstract Data...

This preview shows pages 1–2. Sign up to view the full content.

1 CMPS 201 Algorithms and Abstract Data Types Some Common Functions We present several common functions and estimates which occur frequently in the analysis of algorithms. Floors and Ceilings Given R x , we denote by   x and   x the floor of x and the ceiling of x , respectively. These are defined to be the unique integers satisfying     1 1 + < < - x x x x x Equivalently, if R x and Z N then (1)   x N = if and only if 1 + < N x N , and (2)   x N = if and only if N x N < - 1 . In other words: (1)   x is the greatest integer less than or equal to x , and (2)   x is the least integer greater than or equal to x . Lemma 1: Let R x and Z b a , . Then (1) b x a < if and only if   b x a < , and (2) b x a < if and only if   b x a < . Proof of (1): (i) x a implies   x a , since among all integers that are less than or equal to x ,   x is the greatest. (ii) b x < implies   b x < , since   x x . (iii)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

CommonFunctions - CMPS 201 Algorithms and Abstract Data...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online