How to find value of floor function of a given number?

709 Views Asked by At

I am considering numbers $n = 3m + 1$ and $p = 3q$, where $m$ and $q$ are some positive integers.

I want to find the value of $\lfloor \frac{3m + 1}{2} \rfloor$ and $\lfloor \frac{3q}{2} \rfloor$. I know somewhere the answer depends on the values of $m$ and $q$.

For a particular number I can write but my mind is not working to find the generalised value. Kindly help.

2

There are 2 best solutions below

0
On

If $m$ is odd, $3m+1$ is even and $\displaystyle \left\lfloor \frac{3m+1}{2}\right\rfloor=\frac{3m+1}{2}$.

If $m$ is even, $3m+1$ is odd and $\displaystyle \left\lfloor \frac{3m+1}{2}\right\rfloor=\frac{3m}{2}$.

If $q$ is odd, $3q$ is odd and $\displaystyle \left\lfloor \frac{3q}{2}\right\rfloor=\frac{3q-1}{2}$.

If $q$ is even, $3q$ is even and $\displaystyle \left\lfloor \frac{3q}{2}\right\rfloor=\frac{3q}{2}$.

1
On

Assume that $m=2k+1$ ($k$ is a positive integer), then

$$\lfloor \frac{3m + 1}{2} \rfloor=\lfloor \frac{3(2k+1)+1}{2} \rfloor=\lfloor \frac{6k+4}{2} \rfloor=\lfloor 3k+2 \rfloor=3k+2.$$

If $m$ is an even number or $m=2k$, then

$$\lfloor \frac{3m + 1}{2} \rfloor=\lfloor \frac{3(2k)+1}{2} \rfloor=\lfloor \frac{6k+1}{2} \rfloor=\lfloor 3k+0.5 \rfloor=3k.$$

This is because when $k$ is an integer, $3k<3k+0.5<3k+1.$

For $\lfloor \frac{3q}{2} \rfloor$, you can also do similarly by splitting into cases whether $q$ is an even or odd number.