I solved the problem using the Riemann integral. However, my answer did not match with the result given in the book. My answer was $\frac{3}{4}$ and the answer given in the book was just 3.

Help me understand where I went wrong. My solution

$$\lim_{n\to\infty} \sum_{i=1}^n \frac{1}{n}\cdot \lfloor \sqrt{\frac{4i}{n}}\rfloor =\lim_{n\to\infty} \sum_{i=1}^n \frac{1}{n} \cdot \lfloor 2\sqrt{\frac{i}{n}}\rfloor=$$ $$=\lim_{n\to\infty}\left(\frac{1}{n}\cdot \lfloor2\sqrt{\frac{1}{n}}\rfloor+\frac{1}{n}\cdot \lfloor2\sqrt{\frac{2}{n}}\rfloor+\ldots +\frac{1}{n}\cdot \lfloor2\sqrt{\frac{n}{n}}\rfloor\right)$$

Clearly, the given expression is a Riemann sum of the function $\lfloor2\sqrt{x}\rfloor$ on the interval $[0,1]$.

$$\lim_{n\to\infty} \sum_{i=1}^n \frac{1}{n}\cdot \lfloor \sqrt{\frac{4i}{n}}\rfloor =$$

$$=\int_0^1 \lfloor2\sqrt{x}\rfloor dx=\int_0^{\frac14} \lfloor2\sqrt{x}\rfloor dx+\int_{\frac14}^1 \lfloor2\sqrt{x}\rfloor dx=0+1\cdot\left(1-\frac14\right)=\frac34$$

  • 4
    $\begingroup$ If you've typed the problem in correctly, I don't see how you've done anything wrong. Maybe the book's solution is in error. Note that the result of the floor is mostly $0$ and $1$, with one $2$, so the total result, which is the average of those values, obviously cannot be $3$. $\endgroup$
    – Brian Tung
    Commented May 26, 2023 at 17:32
  • $\begingroup$ Gotcha. Thank you very much mate. $\endgroup$
    – Teufel
    Commented May 26, 2023 at 18:18
  • $\begingroup$ Please do not use pictures for critical portions of your post. Pictures may not be legible, cannot be searched and are not view-able to some, such as those who use screen readers. – For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to. $\endgroup$
    – Martin R
    Commented May 27, 2023 at 5:48
  • $\begingroup$ @Teufel I've typed the image as suggested by MartinR. Take a look to it in order to proceed in the same way for the next question. Bye $\endgroup$
    – user
    Commented May 27, 2023 at 9:00
  • $\begingroup$ Thank you very much for doing so. $\endgroup$
    – Teufel
    Commented May 28, 2023 at 7:41

2 Answers 2


Your solution seems fine, to check we can also solve it in a direct way for $n=4N$

$$\sum_{i=1}^n \frac{1}{n}\cdot\lfloor\sqrt{\frac{4i}{n}}\rfloor=\sum_{i=1}^{4N} \frac{1}{4N}\cdot\lfloor\sqrt{\frac{i}{N}}\rfloor=$$

$$=\sum_{i=1}^{N-1} \frac{1}{4N}\cdot0+\sum_{i=N}^{4N-1} \frac{1}{4N}\cdot 1+\frac1{2N}=\frac{3}{4}+\frac1{2N} \to \frac34$$


Distinguish the three cases I < n/4, n/4 <= I < n, and I = n, and the result is trivial. This has nothing to do with any integral or Riemann sum.

The square root is 0 <= root < 1 if I < n/4, 1 <= root < 2 if n/4 <= I < n, and 2 if I = n. Rounded down to an integer it is 1 for n/4 <= I < n and 2 if I = n.

The sum therefore is (n - floor(n/4)) / n + 2/n, which is 3/4 + 5/4n <= sun <= 3/4 + 2/n, with limit 3/4.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .