0
$\begingroup$

I've been trying to prove the following, for $A \geq B$, both are strictly positive integers: $$A - \lfloor A/B \rfloor - \lceil A/B \rceil \leq (\lfloor A/B \rfloor + 1) \times B$$ Not sure if it's true. Can't find a counterexample so far. Anyone has an idea?

$\endgroup$
0

2 Answers 2

1
$\begingroup$

$ \newcommand{\f}[1]{\left\lfloor #1 \right\rfloor} \newcommand{\c}[1]{\left\lceil #1 \right\rceil} $ Note that $\f{A/B} \leq \c{A/B}$, so: $$ A - \f{A/B} - \c{A/B} \leq A - 2\f{A/B} \\ (\f{A/B} + 1)B = \f{A/B}B + B \geq (A/B - 1)B + B = A $$ Thus the inequality clearly holds as $\f{A/B} > 0$.

$\endgroup$
1
1
$\begingroup$

$A\ge B\implies\lfloor A/B \rfloor\ge 1$ and $\lceil A/B \rceil\ge 1$ $$A-\lfloor A/B\rfloor - \lceil A/B \rceil <A=A/B\times B\le \lceil A/B\rceil \times B \le (\lfloor A/B \rfloor +1)\times B$$

where the last inequality holds since $\lceil A/B \rceil = \lfloor A/B \rfloor $ if $A$ is divisible by $B$, otherwise $A/B$ is not an integer and $\lceil A/B \rceil = \lfloor A/B \rfloor +1$.

$\endgroup$
0

You must log in to answer this question.

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