Skip to main content

Unit 0.2 Some useful functions

Here are some more useful special functions.
The greatest integer function at the argument \(x\) is denoted \(\lfloor x \rfloor\) defined to be the greatest integer \(y\) such that \(y \leq x\text{.}\) In other words, if \(x\) is an integer then \(\lfloor x \rfloor = x\text{;}\) if \(x\) is positive and not an integer, then \(\lfloor x \rfloor\) is the "whole number you get when you write \(x\) as a decimal and ignore what comes after the decimal point"; if \(x\) is negative and not an integer, it is \(-1\) plus what you get when you ignore the decimals. In older texts, the same function is sometimes denoted \([x]\text{.}\) This square bracket notation has largely been abandonded in favor of the "floor" notation, because (especially in computer science) we also often want to use the ceiling function as well. The ceiling function at the argument \(x\) is denoted \(\lceil x \rceil\) and is defined to be the least integer \(y\) such that \(y \geq x\text{.}\) Informally, \(\lfloor x \rfloor\) rounds down to the nearest integer and \(\lceil x \rceil\) rounds up.

Checkpoint 11.

Compute the following floor values:
  1. \(\lfloor 3\rfloor\)
  2. \(\lfloor 9.4\rfloor\)
  3. \(\lfloor\sqrt{2}\rfloor\)
  4. \(\lfloor 0\rfloor\)
  5. \(\lfloor -1.5\rfloor\)
Compute the following ceiling values:
  1. \(\lceil 3\rceil\)
  2. \(\lceil 9.4\rceil\)
  3. \(\lceil\sqrt{2}\rceil\)
  4. \(\lceil 0\rceil\)
  5. \(\lceil -1.5\rceil\)
Answer 1.
\(3\)
Answer 2.
\(9\)
Answer 3.
\(1\)
Answer 4.
\(0\)
Answer 5.
\(-2\)
Answer 6.
\(3\)
Answer 7.
\(10\)
Answer 8.
\(2\)
Answer 9.
\(0\)
Answer 10.
\(-1\)
Figure 0.7. The floor function.
Figure 0.8. The ceiling function.
Another useful function is the sign function.

Aside

This is defined by
\begin{equation*} \operatorname{sgn}(x) = \begin{cases} 1 \amp x \gt 0 \\ 0 \amp x = 0 \\ -1 \amp x \lt 0 \end{cases} \qquad. \end{equation*}
Another is the delta function, defined by \(\delta (x) = 1\) when \(x = 0\) and \(0\) when \(x \neq 0\text{.}\)
Figure 0.9. The sign function.
Figure 0.10. The delta function.

Checkpoint 12.

Write the delta function as a definition by cases.