$\lim_{n\rightarrow\infty}\frac{1}{n}\sum_{i=1}^n\left[\sqrt{4i/n}\right]$ $$
\lim_{n \to \infty}
\sum_{i = 1}^{n}{1 \over n}
\,\left\lfloor\,\sqrt{\,{4i \over n}\,}\,\right\rfloor\quad
\mbox{where}\ \left\lfloor\,x\,\right\rfloor\
\mbox{is the greatest integer function.}
$$
I approached the problem this way- 
$$
\lim_{n \to \infty}
\sum_{i = 1}^{n}{1 \over n}
\,\left\lfloor\,\sqrt{\,{4i \over n}\,}\,\right\rfloor
=
\lim_{n \to \infty}\frac{1}{n}\int_{n/4}^{n}\mathrm{d}x =
\lim_{n \to \infty}\left(\frac{1}{n}\times\frac{3n}{4}\right) =
\frac{3}{4}
$$

I felt like a bad-ass doing this, only to find that the answer is actually $3$. Where did I go wrong? How do I make it right ?.
 A: The Riemann integral is $$\lim_{n \to \infty} \frac{b-a}{n} \sum_{k=1}^n f\left(a + \frac{b-a}{n} k\right) = \int_{x=a}^b f(x) \, dx,$$ and with $a = 0$, $b = 1$,and $f(x) = \lfloor 2 \sqrt{x} \rfloor$, we obtain $$\lim_{n \to \infty} \frac{1}{n} \sum_{k=1}^n \lfloor 2 \sqrt{k/n} \rfloor = \int_{x=0}^1 \lfloor 2 \sqrt{x} \rfloor \, dx.$$  Since $2 \sqrt{x} = 1$ when $1/4 \le x < 1$, and $0$ if $0 \le x < 1/4$, this becomes $$\int_{x=1/4}^1 \, dx = \frac{3}{4}.$$  It is not possible for the given sum to equal $3$, since it is trivially bounded above by $$\frac{1}{n} \sum_{k=1}^n \left\lfloor 2\sqrt{\frac{k}{n}} \right\rfloor < \frac{1}{n} \sum_{k=1}^n 2 \sqrt{\frac{k}{n}} < \frac{1}{n} \sum_{k=1}^n 2 = \frac{2n}{n} = 2.$$
A: It is a Riemann sum.
The limit is
$$\int_0^1\lfloor 2\sqrt {x}\rfloor dx $$
$$=\int_0^\frac {1}{4}\lfloor 2\sqrt {x}\rfloor dx +\int_{\frac {1}{4}}^1\lfloor 2 \sqrt {x}\rfloor dx$$
$$=(\frac {1}{4}-0).0+(1-\frac {1}{4}).1=\frac {3}{4} $$
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

A 'direct approach' which means " working out explicitily the 'initial sum' " !!!.

$$
\mbox{Note that}\qquad\left\{\begin{array}{l}
\ds{\color{#f00}{0} \leq \root{4i \over n} < 1 \implies
\bbox[#ffe,10px]{\ds{0 \leq i < {n \over 4}}}}
\\[2mm]
\ds{\color{#f00}{1} \leq \root{4i \over n} < 2 \implies
\bbox[#ffe,10px]{\ds{{n \over 4} \leq i < n}}}
\\[2mm]
\ds{\color{#f00}{2} \leq \root{4i \over n} < 3  \implies
\bbox[#ffe,10px]{\ds{n \leq i < {9 \over 4}\,n}}}
\end{array}\right.
$$

\begin{align}
\lim_{n \to \infty}\sum_{i = 1}^{n}{1 \over n}
\,\left\lfloor\root{4i \over n}\right\rfloor & =
\lim_{n \to \infty}\pars{%
{1 \over n}\sum_{0\ \leq\ i\ <\ n/4}\color{#f00}{0}\ +\
{1 \over n}\sum_{n/4\ \leq\ i\ <\ n }\color{#f00}{1} +
{1 \over n}\,\color{#f00}{2}}
\\[5mm] & =
\lim_{n \to \infty}\braces{\vphantom{\huge A}%
{1 \over n}
\bracks{4 \not\mid n}\pars{n - \left\lfloor\,{n \over 4}\right\rfloor} +
{1 \over n}
\bracks{4 \mid n}\pars{n - \left\lfloor\,{n \over 4}\right\rfloor + 1} +
{2 \over n}}
\\[5mm] & =
\lim_{n \to \infty}\braces{\vphantom{\huge A}%
{n - \left\lfloor\,n/4\,\right\rfloor \over n} +
{\bracks{4 \mid n} \over n} + {2 \over n}}
\\[5mm] & =
\lim_{n \to \infty}\braces{\vphantom{\huge A}%
{n - \bracks{n/4 - \braces{n/4}} \over n} +
{\bracks{4 \mid n} + 2 \over n}}
\\[5mm] & =
\lim_{n \to \infty}\braces{\vphantom{\huge A}%
\color{#f00}{3 \over 4} + {\braces{n/4} + \bracks{4 \mid n} + 2 \over n}} =
\bbx{\large{3 \over 4}}
\end{align}
