I need to solve one equation, but I dont know how to solve equation with floor functions

70 Views Asked by At

Im a student with not such a knowledge to solve equations with floor functions. I want to ask, if it is even possible and if it so, how is possible to prove this equation to be true.

- ⌊(n+m)/G⌋ = ⌊(2g-n-m)/G⌋-1

and where :

  G= b^r 
  g= b^r - 1 

when needed , r and b can be replaced by any natural number

Edit1 : I only need to prove it when G= 2^r and g = 2^r-1 where r is variable

Edit2 : One of the variables, n or m can be fixed.

1

There are 1 best solutions below

1
On BEST ANSWER

If $G=2^r$; $g=2^r-1$ and $n+m=k$ then we have $$- \Big\lfloor\frac{k}{2^r}\Big\rfloor = \Big\lfloor\frac{2^{r+1}-2-k}{2^r}\Big\rfloor-1$$ $$\Big\lfloor\frac{k}{2^r}\Big\rfloor+\Big\lfloor\frac{2^{r+1}-2-k}{2^r}\Big\rfloor=1$$ $$\Big\lfloor\frac{k}{2^r}\Big\rfloor+\Big\lfloor2-\frac{k+2}{2^r}\Big\rfloor=1$$ As $k\gt0$ we need one of the floor expressions to evaluate to $0$ and the other evaluate to $1$ in order for this to be true. This occurs when $$2^r\le k\le2^{r+1}-2$$ So a valid solution is any values of $n,m$ such that $$G\le n+m\le2g$$ If you fix one of the variables, for example $n=0$ then we have a range of solutions $$G\le m\le2g$$