How to prove that $\lfloor \frac{n}{2}\rfloor$ = $\lceil \frac{n-1}{2}\rceil$

160 Views Asked by At

I'm having a hard time proving that:

$$\left \lfloor \frac{n}{2}\right\rfloor = \left\lceil \frac{n-1}{2}\right\rceil$$

I've tried various algebraic manipulations. I've also tried to see if I could use induction. I've been unsuccessful in both approaches. Any help would be greatly appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

HINT Try splitting it up into two cases:

Case 1: $n=2k$ for some $k\in\{1,2,3,\ldots\}$.

Case 2: $n=2k-1$ for some $k\in\{1,2,3,\ldots\}$.