Floor function equivalence

66 Views Asked by At

For $k\ge0$ and integer

Given this function $f(k)=\frac{1}{2}(3^k-1)$

Which is equal to this recurrence relation $f(k)=3f(k-1)+1$

It follows that $f(k-1)=\frac{f(k)-1}{3}$

But I am also told that $f(k-1)=\left\lfloor\frac{f(k)}{3}\right\rfloor$

I am not sure how the last equality is true.

2

There are 2 best solutions below

0
On BEST ANSWER

Since $f(0)$ is an integer, then from the recursion, it's clear that $f(k)$ is an integer, for all $k \ge 0$.

Let $k \ge 1$.

Then since $f(k-1)={\large{\frac{f(k)-1}{3}}}$, it follows that ${\large{\frac{f(k)-1}{3}}}$ is an integer, hence ${\large{\frac{f(k)}{3}}}$ is ${\large{\frac{1}{3}}}$ more than the same integer.

Taking the floor removes the extra $\frac{1}{3}$, hence $$\left\lfloor{{\small{\frac{f(k}{3}}}}\right\rfloor={\small{\frac{f(k)-1}{3}}}=f(k-1)$$

0
On

$$f(k)=\dfrac{3^k-1}{2}=\dfrac{3^k-1}{3-1}=3^{k-1}+3^{k-2}\cdots+3^2+3+1\in\mathbb N\\f(k-1)=3^{k-2}\cdots+3^2+3+1\in\mathbb N\\\frac{f(k)}{3}=3^{k-2}\cdots+3^2+3+1+\frac13=f(k-1)+\frac13$$ Consequently $$f(k-1)=\left\lfloor{{\small{\frac{f(k)}{3}}}}\right\rfloor$$