13
$\begingroup$

I have tried to define the ceiling function of $x$ in terms of its floor function; I thought this might be easy, but it isn't. I can easily do this with a piecewise equation, but I need to do without it.

Attempts

I have tried three methods, one of which ($\mathbf{(3)}$) almost always works:

$$\left\lfloor x\right\rfloor+1\not= \left\lceil x\right\rceil,\tag 1$$ when $x=3$, because: $$\left\lfloor 3\right\rfloor+1=4,\text{and }4\not=\lceil3\rceil.$$ $$\left\lfloor x+1\right\rfloor\not= \left\lceil x\right\rceil,\tag2$$ when $x=3$. $$\left\lfloor x+\frac{x}{x+1}\right\rfloor\not= \left\lceil x\right\rceil,\tag3$$ when $\varepsilon$ is a number extremely close to $0$ and $x=(8+\varepsilon)$, i.e $x=8.099999999999987$. In that event: $$\left\lfloor 8.099999999999987+\frac{8.099999999999987}{9.099999999999987}\right\rfloor=\left\lfloor8.09999999999998+0.89010989010989\right\rfloor=\lfloor 8.99010989010987\rfloor=8,\text{and }8\not=\left\lceil8.099999999999987\right\rceil$$

Question

Is it possible to define $\left\lceil\ldots\right\rceil$ in terms of $\left\lfloor \ldots\right\rfloor$?

$\endgroup$
2
  • 20
    $\begingroup$ How about $-\lfloor -x \rfloor$? $\endgroup$ Dec 28, 2014 at 21:23
  • 1
    $\begingroup$ No continuous function $f(x)$ can satisfy $\lceil x \rceil = \lfloor f(x) \rfloor$ for all $x$, because for integer $n$ we would have $f(n) < n+1$ but $\lim_{x \downarrow n} f(x) \geq n+1$. $\endgroup$
    – user133281
    Dec 28, 2014 at 21:28

4 Answers 4

20
$\begingroup$

You can calculate ceiling as:

$$\lceil{x}\rceil=-\lfloor{-x}\rfloor$$


You can calculate floor itself as:

$$\lfloor{x}\rfloor=x-\frac12\left(\frac{\ln\left(e^{2\pi i\left(x-\frac12\right)}\right)}{\pi i}+1\right)$$

This is because $e^{2\pi i\left(x-\frac12\right)}$ has a period of $1$.

$\endgroup$
12
  • 1
    $\begingroup$ @MarcvanLeeuwen Most of the enthusiasm arises from the fact that Barak posted the $$ - \left\lceil -x \right\rfloor $$ response very quickly (which answers the question elegantly), not because of the second construction. Although it looks nice, Barak got about 6 upvotes before he edited that in. $\endgroup$ Dec 28, 2014 at 22:34
  • 1
    $\begingroup$ Your expression has three terms, separated (as terms are) by "$+$"; the third one is the fraction with $\pi$ in the denominator. It is undefined at all integer values, because $\tan(y)$ is not defined whenever $y$ is an odd multiple (positive or negative) of $\frac\pi2$. Using Python (or any programming language) is not a valid method to determine whether a mathematical function is defined at some value; one cannot even represent $\pi$ precisely in floating point. $\endgroup$ Dec 29, 2014 at 7:57
  • 1
    $\begingroup$ @AhaanS.Rungta: Please see revised answer. $\endgroup$ Dec 29, 2014 at 8:21
  • 1
    $\begingroup$ @ConorO'Brien: Please see revised answer (fixed due to a comment by Mark van Leeuwen). $\endgroup$ Dec 29, 2014 at 8:22
  • 1
    $\begingroup$ OK, the formula is correct now, at least if you are using the principal branch of the logarithm. $\endgroup$ Dec 29, 2014 at 8:23
10
$\begingroup$

Well-known lemma: $$ \left\lceil x \right\rceil = - \left\lfloor -x \right\rfloor $$*Proof.* Let $ x = a + k $, where $ a = \left\lfloor x \right\rfloor $. If $k=0$ the proof is trivial ,so let $ 0 < k < 1 $. Then, the LHS is $a+1$ and $$ \begin {align*} \text {RHS} &= - \left\lfloor - \left( a + k \right) \right\rfloor \\&= - \left\lfloor -a - k \right\rfloor \\&= - \left( -a - 1\right) \\&= a + 1. \end {align*} $$So we are done. $\Box$

$\endgroup$
3
$\begingroup$

$$ \lceil x \rceil = -\lfloor-x\rfloor $$

$\endgroup$
3
  • 4
    $\begingroup$ Have you read the other answers? ;) $\endgroup$ Dec 28, 2014 at 21:48
  • $\begingroup$ Apparently I didn't. $\endgroup$ Dec 28, 2014 at 21:48
  • 5
    $\begingroup$ @MichaelHardy +1 for honesty :) $\endgroup$
    – user253055
    Oct 21, 2015 at 1:00
1
$\begingroup$

If $a$ is infinitesimal positive number, and you assume that $\lceil{a}\rceil=1$, then...

$$\lfloor{x+1-a}\rfloor=\lceil{x}\rceil$$

$\endgroup$
2
  • 1
    $\begingroup$ This works in theory. My question was founded in practice. +1 anyhow. $\endgroup$ Dec 14, 2015 at 0:34
  • 2
    $\begingroup$ @ConorO'Brien Yeah, I just was trying to give you a solution based on your idea, and not just what is commonly known $\endgroup$
    – user285523
    Dec 14, 2015 at 0:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .