Discrete Mathematics Questions and Answers – Floor and Ceiling Function

This set of Discrete Mathematics Multiple Choice Questions & Answers (MCQs) focuses 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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: b
Explanation: A integral part of a number is subtracted from that number we are left with the fractional part of that number.
advertisement

4. Floor(2.4) + Ceil(2.9) is equal to __________
a) 4
b) 6
c) 5
d) none of the mentioned
View Answer

Answer: c
Explanation: 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
View Answer

Answer: b
Explanation: If x < n < x + 1 then ceil(x) = n.
Free 30-Day Python Certification Bootcamp is Live. Join Now!

6. For some number x, Floor(x) <= x <= Ceil(x).
a) True
b) False
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: 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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: b
Explanation: Only in case of integers X = Floor(X) = Ceil(X) holds good.
advertisement

10. Let n be some integer greater than 1,then floor((n-1)/n) is 1.
a) True
b) False
View Answer

Answer: b
Explanation: Since (n-1)/n will always be less than one thus f floor((n-1)/n) is 0.

Sanfoundry Global Education & Learning Series – Discrete Mathematics.

To practice all areas of Discrete Mathematics, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
I’m Manish - Founder and CTO at Sanfoundry. I’ve been working in tech for over 25 years, with deep focus on Linux kernel, SAN technologies, Advanced C, Full Stack and Scalable website designs.

You can connect with me on LinkedIn, watch my Youtube Masterclasses, or join my Telegram tech discussions.

If you’re in your 40s–60s and exploring new directions in your career, I also offer mentoring. Learn more here.