09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

)Ouch.(<br />

3<br />

Integer Functions<br />

WHOLE NUMBERS constitute the backbone of discrete <strong>mathematics</strong>, and we<br />

often need to convert from fractions or arbitrary real numbers to integers. Our<br />

goal in this chapter is to gain familiarity and fluency with such conversions<br />

and to learn some of their remarkable properties.<br />

3.1 FLOORS AND CEILINGS<br />

We start by covering the floor (greatest integer) and ceiling (least<br />

integer) functions, which are defined <strong>for</strong> all real x as follows:<br />

1x1 = the greatest integer less than or equal to x;<br />

[xl = the least integer greater than or equal to x .<br />

(3.1)<br />

Kenneth E. Iverson introduced this notation, as well as the names “floor” and<br />

“ceiling,” early in the 1960s [161, page 121. He found that typesetters could<br />

handle the symbols by shaving the tops and bottoms off of ’ [’ and ‘I ‘. His<br />

notation has become sufficiently popular that floor and ceiling brackets can<br />

now be used in a technical paper without an explanation of what they mean.<br />

Until recently, people had most often been writing ‘[xl’ <strong>for</strong> the greatest integer<br />

6 x, without a good equivalent <strong>for</strong> the least integer function. Some authors<br />

had even tried to use ‘]x[‘-with a predictable lack of success.<br />

Besides variations in notation, there are variations in the functions themselves.<br />

For example, some pocket calculators have an INT function, defined<br />

as 1x1 when x is positive and [xl when x is negative. The designers of<br />

these calculators probably wanted their INT function to satisfy the identity<br />

INT(-x) = -INT(x). But we’ll stick to our floor and ceiling functions,<br />

because they have even nicer properties than this.<br />

One good way to become familiar with the floor and ceiling functions<br />

is to understand their graphs, which <strong>for</strong>m staircase-like patterns above and<br />

67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!