I have floor(sqrt(floor(x))). Which is true:
- The inner
flooris redundant. - The outer
flooris redundant.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Obviously the outer floor is not redundant, since for example,
sqrt(2)is not an integer, and thusfloor(sqrt(2))≠sqrt(2).It is also easy to see that
sqrt(floor(x))≠sqrt(x)for non-integerx. Sincesqrtis a monotone function.We need to find out whether or not
floor(sqrt(floor(x)))==floor(sqrt(x))for all rationals (or reals).Let us prove that if
sqrt(n)<mthensqrt(n+1)<m+1, for integersm,n. It is easy to see thatTherefor by the fact that
sqrtis montone we have thatTherefor
floor(sqrt(n))=floor(sqrt(n+eps))for all0<eps<1and integern. Assume otherwise thatfloor(sqrt(n))=mandfloor(sqrt(n+eps))=m+1, and you’ve got a case wheresqrt(n)<m+1howeversqrt(n+eps)>=m+1.So, assuming the outer
flooris needed, the innerflooris redundant.To put it otherwise it is always true that
What about inner
ceil?It is easy to see that
floor(sqrt(n)) ≠ floor(sqrt(ceil(n))). For exampleHowever you can prove in similar way that