Minimization of Floor and Ceiling Functions

602 Views Asked by At

So the problem at hand is:

Find the minimum value of the following function for $ x> 0 $: $$ \def\lc{\left\lceil} \def\rc{\right\rceil} \newcommand{\floor}[1]{\lfloor #1 \rfloor} x\lc x \rc + \lc \frac{1}{x} \rc + x + \floor{x}x + \floor{\frac{1}{x}} $$

My approach was to set $$ f(x) = \def\lc{\left\lceil} \def\rc{\right\rceil} \newcommand{\floor}[1]{\lfloor #1 \rfloor} x\lc x \rc + \lc \frac{1}{x} \rc + x + \floor{x}x + \floor{\frac{1}{x}} $$

and then find the minimum using the derivative. I was reading previous Maths SE posts on the derivative of the floor and ceiling functions:

1) What technique should I apply to find the derivative of a ceiling or floor function e.g d/dx(x*⌈x⌉) and d/dx(x*⌊x⌋)?

2) Derivative of floor function

Using these, I was able to find out the derivative of nearly $50\%$ of $ f(x)$ but I am not able to proceed ahead and find the entire derivative. Could someone shed some light on how to approach this problem?

Any other methods would also be greatly appreciated!

3

There are 3 best solutions below

0
On BEST ANSWER

Hint

  • For $x>0$ the derivative (if it exists) is $f'(x)= \lceil x\rceil + 1 + \lfloor x \rfloor$, which is positive
  • but $f(x)$ and $f'(x)$ have discontinuities at integers and reciprocals of integers
  • you might look at least at values of $f(x)$ when $x \in \left\{\frac13,\frac12,1,2,3\right\}$ and at values in the neighbourhood of these
  • I suspect that $f(x)$ does not in fact have a minimum, but instead a greatest lower bound

$f(x)$ may look something like this where it does have a derivative:

enter image description here

0
On

$$f(x) = \def\lc{\left\lceil} \def\rc{\right\rceil} \newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor} x\lc x \rc + \lc \frac{1}{x} \rc + x + \floor{x}x + \floor{\frac{1}{x}}$$

Let $[x]$ denote the nearest integer to $x$. Then (modulo corner cases) $\lfloor x \rfloor = \left[x - \frac12\right]$ and $\lceil x \rceil = \left[x + \frac12\right]$. So we rewrite as $$f(x) = x\left[x + \frac12\right] + \left[\frac1x + \frac12\right] + x + x\left[x - \frac12\right] + \left[\frac1x - \frac12\right]$$

Let $\{z\}$ denote an error term whose absolute value is bounded by $z$. Then $[x] = x \pm \{\frac12\}$. So $$f(x) = x\left(x + \frac12 \pm \left\{\frac12\right\}\right) + \left(\frac1x + \frac12 \pm \left\{\frac12\right\}\right) + x + x\left(x - \frac12 \pm \left\{\frac12\right\}\right) + \left(\frac1x - \frac12 \pm \left\{\frac12\right\}\right) \\ = 2x^2 + x + \frac2x \pm \left\{x+1\right\}$$

We can minimise the part without the error bound: $\frac{\textrm{d}}{\textrm{d}x} 2x^2 + x + 2x^{-1} = 4x + 1 - 2x^{-2}$ which has extrema where $4x^3 + x^2 - 2 = 0$ with one real root at $x \approx 0.71851$ and value $f(0.71851) = 4.43702$.

If $x > 1$ then $f(x) \ge x^2 + 1 + x + x(x-1) = 2x^2 + 1$, so certainly the minimum value occurs for $x \le \sqrt{\frac{4.43702 - 1}{2}} \approx 1.311$.

In the range $1 < x < 2$, $f(x) = 2x + 1 + x + x + 0 = 4x + 1 > 5$, so we can reject this range. $f(1) = 1 + 1 + 1 + 1 + 1 = 5$, so the minimum must be less than $1$.

In the range $0 < x < 1$, $f(x) = x + \left\lceil\frac1x\right\rceil + x + 0 + \left\lfloor\frac1x\right\rfloor = 2x + \left\lceil\frac1x\right\rceil + \left\lfloor\frac1x\right\rfloor$ is a bit simpler to work with...

We probably want to switch to $g(y) = f(x^{-1})$; then we're interested in the range $y > 1$ for which $g(y) = \frac2y + \lceil y\rceil + \lfloor y\rfloor = \frac2y + 2y \pm \{1\}$. Without the error term the extrema are at $y^2 = 1$, and since we've already rejected $x=1$ as a minimum we're interested in where the error term is in our favour. $\lceil y\rceil + \lfloor y\rfloor - 2y$ clearly depends only on the fractional part of $y$, and in the range $0 < y < 1$ we see that $\lceil y\rceil + \lfloor y\rfloor - 2y = 1 - 2y$, so the error is in our favour when $y$ is just less than an integer.

$g(2 - \varepsilon) = \frac2{2 - \varepsilon} + \lceil {2 - \varepsilon}\rceil + \lfloor {2 - \varepsilon}\rfloor = (1 - \frac{\varepsilon}{2})^{-1} + 3 = 4 + \frac{\varepsilon}{2} + O(\varepsilon^2)$. However, $g(2) = 5$ because both floor and ceiling give $2$.

If $y > 2$ then $g(y) >= \frac2y + 5$, so we can discard that range.

Hence we conclude that $f(x)$ is minimised as $x \to \frac{1}{2 - \varepsilon}$ and $f(x) \to 4$, but that the limit cannot be reached.

0
On

Rewrite $f(x)=x\left(\lceil{x}\rceil+\lfloor{x}\rfloor+1\right)+\left\lceil{\tfrac{1}{x}}\right\rceil+\left\lfloor{\tfrac{1}{x}}\right\rfloor$ or shortly $f(x)=x\times m(x)+r(x).$ The functions $m$ and $r$ are constant on each of the intervals $(k,k+1)$ and $\left(\tfrac{1}{k+1},\tfrac{1}{k}\right),\;k\in\mathbb{N}.$

Therefore study the cases

  • $x=1,$ we have $f(1)=5$

  • $x\in\mathbb{N},\; x>1$, then $f(x)=2x^2+x+1$ with minimal value $f(2)=11$

  • $x\in(k,k+1),\;k\in\mathbb{N},$ then $f(x)=x(2k+2)+1.$ Here $f$ doesn't reach a minimal value, but the infimum is $k(2k+2)+1.$ The smallest limit value is $5$ (as $k=1$).

  • $x=\tfrac{1}{k},\;k\in\mathbb{N},\;k>1,$ compute $f\left(\tfrac{1}{k}\right)=\tfrac{2}{k}+2k=2\left(\tfrac{1}{k}+k\right)$ with minimal value $f\left(\tfrac{1}{2}\right)=5$

  • $x\in \left(\tfrac{1}{k+1},\tfrac{1}{k}\right),\;k\in\mathbb{N},$ here $f(x)=2x+2k+1.$ Again, $f$ doesn't reach a minimal value, and infimum is $2\times \tfrac{1}{2}+2\times1+1=4$ as $k=1$ and $x\to\tfrac{1}{2}.$

Conclusion the function $f:(0,\infty)\to(0,\infty)$ doesn't have a minimum.