Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For all real numbers, if x - floor(x) < 1/2, then floor(2x) = 2 * floor(x)
- Proof:
- Suppose that x is a real number and that x - floor(x) < 1/2
- Since floor(x) is, by definition, always an integer, then x - floor(x) is the fractional part of x.
- Note that if
- x - floor(x) < 1/2
- That is, fractional part of x is less than 1/2, then if we multiply the fractional part with 2 we won't get a fractional part greater than 1.
- Hence it holds that:
- floor(2x) = 2 * floor(x)
- because the fractional part is always going to be less than 1.
- Q.E.D.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement