Discrete Mathematics Multiple Choice Questions on “Floor and Ceiling Function”.
1. A floor function map a real number to ___________
a) smallest previous integer
b) greatest previous integer
c) smallest following integer
d) none of the mentioned
Answer: b
Clarification: Floor function f(x) is the largest integer not greater than x.
2. A ceil function map a real number to __________
a) smallest previous integer
b) greatest previous integer
c) smallest following integer
d) none of the mentioned
Answer: c
Clarification: Ceil function f(x) is the smallest integer not less than x.
3. A function f(x) is defined as f(x) = x – [x], where [.] represents GIF then __________
a) f(x) will be intergral part of x
b) f(x) will be fractional part of x
c) f(x) will always be 0
d) none of the mentioned
Answer: b
Clarification: A integral part of a number is subtracted from that number we are left with the fractional part of that number.
4. Floor(2.4) + Ceil(2.9) is equal to __________
a) 4
b) 6
c) 5
d) none of the mentioned
Answer: c
Clarification: Floor(2.4) = 2, Ceil(2.9) = 3, 2 + 3 = 5.
5. For some integer n such that x < n < x + 1, ceil(x) < n.
a) True
b) False
Answer: b
Clarification: If x < n < x + 1 then ceil(x) = n.
6. For some number x, Floor(x) <= x <= Ceil(x).
a) True
b) False
Answer: a
Clarification: Floor function f(x) is the largest integer not greater than x and ceil function f(x) is the smallest integer not less than x.
7. If x, and y are positive numbers both are less than one, then maximum value of floor(x + y) is?
a) 0
b) 1
c) 2
d) -1
Answer: b
Clarification: Since x < 1 and y < 1 this implies x + y < 2 which means maximium value of floor(x + y) is 1.
8. If x, and y are positive numbers both are less than one, then maximum value of ceil(x + y) is?
a) 0
b) 1
c) 2
d) -1
Answer: c
Clarification: Since x < 1 and y < 1 this implies x + y < 2 which means maximum value of ceil(x + y) is 2.
9. If X = Floor(X) = Ceil(X) then __________
a) X is a fractional number
b) X is a Integer
c) X is less than 1
d) none of the mentioned
Answer: b
Clarification: Only in case of integers X = Floor(X) = Ceil(X) holds good.
10. Let n be some integer greater than 1,then floor((n-1)/n) is 1.
a) True
b) False
Answer: b
Clarification: Since (n-1)/n will always be less than one thus f floor((n-1)/n) is 0.