Uniform random variable problem $U$ is a uniform r.v on $[0,1]$ and $n\geq 1$ is an integer. What is
the probability mass function of the (discrete) random variable $X = \lfloor{nU}\rfloor + 1$?
 A: $X$ is uniform on $[n]$. $X$ can also take the value $n+1$ but almost surely doesn't.
[Edit:]
If $U$ is between $(k-1)/n$ and $k/n$, then $X$ takes the value $k$. Since $U$ is equally likely to lie in each of the $n$ intervals of length $1/n$, $X$ is equally likely to take each of the corresponding values $1$ to $n$. The special case $U=1$ has probability $0$ and corresponds to the special case $X=n+1$.
A: Trying to expand joriki's answer, it is obvious $nU$ is uniformly distributed between $(0,n)$. When you take the floor, $\lfloor{nU}\rfloor$ becomes a discrete random variable which takes values in the set $\{0,1,2,\ldots n-1\}$.  Since the original variable was uniform, the probability masses are equal (=$1/n$) on the above set. Now since $X=\lfloor{nU}\rfloor+1$, it takes values $\{1,2,\ldots n\}$ with equal probability, i.e., $P(X=x)=1/n\  1\le x \le n$ and $P(X=x)=0$ for other integers.
Since $U$ is a continuous random variable, $P(nU=n)=0$, so consequently $P(X=n+1)=0$.
A: I'm not completely positive about my methodology, but this a "straightforward" way of solving it that I did:
$$P(X\leq x)=P(\lfloor nU \rfloor + 1 \leq x)=P(\lfloor nU \rfloor \leq  x-1)$$
Since $\lfloor nU \rfloor$ is an integer that is either x-1 or the next integer below it, we must have
$$P(x-2 \leq nU \leq x-1)=P(\frac{x-2}{n}\leq U \leq \frac{x-1}{n})$$
$$=\int_{\frac{x-2}{n}}^{\frac{x-1}{n}} du=\frac{1}{n}\cdot I_{\{x=1,2,...n\}}$$
where $I_{\{x=1,2,...n\}}$ is the indicator function; 1 for $x=1,2,...n$ and $0$ otherwise. It is clear that $X$ is a discrete uniform random variable.
