1

I'm trying to solve a problem I posted here on Math SE. Part of my solution is to round up to the nearest x (e.g. 4.5 rounds up to 6 if x = 2). How do I express that in mathematical notation?

2 Answers2

6

Typically, we round to integers, and so we have good notation for doing so. For example:

  1. $\lfloor x \rfloor$ rounds $x$ down to an integer,
  2. $\lceil x \rceil$ rounds $x$ up to an integer, and
  3. $\lceil x \rfloor$ rounds $x$ to the nearest integer (with the borderline case $\ast.5$ rounding up or down according to some rule).

To round to a multiple of some given number, we can first divide by that number, round to an integer, then multiply by that number. Thus if we want to round $x$ up to the nearest multiple of $m$, we can write $$ m \left\lceil \frac{x}{m} \right\rceil.$$ To round down, or to round to the nearest multiple of $m$, replace $\lceil \cdot \rceil$ with the appropriate operation.

5

How about $2\lceil x/2 \rceil$?

EDIT: Yes, it does work.
Proof: We know that $0\le \lceil x/2 \rceil-x/2<1$. Then $0\le 2\lceil x/2 \rceil-x<2$. Since $2\lceil x/2 \rceil$ is an even integer, it is the least even integer that is not lesser than $x$.

ajotatxe
  • 65,084