0

I have two equations:

$ 50.8 \lfloor \frac{w - 1}{50.8} \rfloor $ and $ 25.4 \lfloor \frac{w - 1}{25.4} \rfloor $

I need to determine if they are equal, how can I do this?

What I think the the first equation does is determine the nearest width to $w$ mm that will fit a whole inch but I cannot work out why the writer has used 50.8mm (2 inches) instead of 25.4mm (1 inch).

Lerp
  • 135
  • 2
    Those aren't equations but only expressions, and take for example $,w=0;$ to show they aren't equal. – DonAntonio Sep 09 '13 at 15:57
  • @DonAntonio Ahh, sorry for incorrect terms, I'm a programmer not a mathematician and I took the first expression from some legacy software I am remaking. I did try plugging in different numbers but I never thought to try 0! – Lerp Sep 09 '13 at 16:16

2 Answers2

2

They will be equal sometimes and not equal sometimes. The easiest way is to define $z=\frac {w-1}{50.8}$ and plot them both. You are now asking whether $2\lfloor z \rfloor=\lfloor 2z \rfloor$, which will be true when the fractional part of $z \in [0,\frac 12)$ and not otherwise.

Ross Millikan
  • 374,822
  • Brilliant, this is a huge help. Thanks! Perhaps the first expression is finding the length nearest to 2 inches and the second nearest to 1 inch? – Lerp Sep 09 '13 at 16:17
  • 1
    Yes, aside from the $-1$ they are rounding up to the next 1 or 2 inches. I am not sure what the purpose of the $-1$ is, maybe to cover measurement error. – Ross Millikan Sep 09 '13 at 16:28
0

If you plug in $w = 26.4$, you will get $0$ for the first expression and $25.4$ for the second expression. So in general they are not equal.

user2566092
  • 26,142