12
$\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$
  • 17
    $\begingroup$ How about $-\lfloor -x \rfloor$? $\endgroup$ – Mark Dickinson Dec 28 '14 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 '14 at 21:28
19
$\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$
  • 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$ – Ahaan S. Rungta Dec 28 '14 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$ – Marc van Leeuwen Dec 29 '14 at 7:57
  • 1
    $\begingroup$ @AhaanS.Rungta: Please see revised answer. $\endgroup$ – barak manos Dec 29 '14 at 8:21
  • 1
    $\begingroup$ @ConorO'Brien: Please see revised answer (fixed due to a comment by Mark van Leeuwen). $\endgroup$ – barak manos Dec 29 '14 at 8:22
  • 1
    $\begingroup$ OK, the formula is correct now, at least if you are using the principal branch of the logarithm. $\endgroup$ – Marc van Leeuwen Dec 29 '14 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
    $\begingroup$ Have you read the other answers? ;) $\endgroup$ – Ahaan S. Rungta Dec 28 '14 at 21:48
  • $\begingroup$ Apparently I didn't. $\endgroup$ – Michael Hardy Dec 28 '14 at 21:48
  • 2
    $\begingroup$ @MichaelHardy +1 for honesty :) $\endgroup$ – user253055 Oct 21 '15 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$
  • $\begingroup$ This works in theory. My question was founded in practice. +1 anyhow. $\endgroup$ – Conor O'Brien Dec 14 '15 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 '15 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.