Show that the expression is always either or In what circum
Show that the expression is always either or . In what circumstances does each case arise?
Solution
The first function will be equal to
ceil (x + 1/2) - ceil(x/2 + 1/4) + floor(x/2+1/4)
Let us suppose the value of x = 3.1
ceil(3.1+0.5) - ceil(3.1/2 + 1/4) + floor(ceil/2 + 0.25)
4 - 2 + 1
= 3
Hence in this case the function value will be equal to 3 which is the floor of x
Let us suppose now x = 3.51
ceil(3.51+0.5) - ceil(3.51/2 + 1/4) + floor(3.51/2 + 1/4)
=> 5 - 3 + 2
=> 4
Hence in this case the value of function will be ceil(x)
Hence for number in the range of x < number < x + 0.5, where x is an integer it will give floor(x) and in the range of x + 0.5 < number < x + 1, it will give ceil(x)
