# How can I prove that the random variable $\frac{\lfloor 2^n X\rfloor}{2^n}$ is uniformly distributed?

Let $$X\sim Uni[0,1]$$. Then define $$X_n= \frac{\lfloor 2^n X\rfloor}{2^n}$$. I want to show that this is uniformly distributed on $$A=\{\frac{k}{2^n}: 0\leq k<2^n\}$$ for all $$n\geq 1$$.

My Idea was the following. Let me remark that $$\frac{2^nX-1}{2^n}< \frac{\lfloor 2^n X\rfloor}{2^n}\leq \frac{2^nX}{2^n}$$then as $$n\rightarrow \infty$$ we get $$\frac{\lfloor 2^n X\rfloor}{2^n}\rightarrow X$$ Then for all $$x\in A$$ we have that $$F_{X_n}(x)=\Bbb{P}\left( \frac{\lfloor 2^n X\rfloor}{2^n}\leq x\right)\rightarrow \Bbb{P}(X\leq x)$$ using Fubini/Tonelli. So by portmanteau theorem we get $$X_n\rightarrow X$$ in distribution and hence $$X_n$$ has the uniform distribution.

Is this true or what am I doing wrong?

• Why does $X_n\to X$ in distribution imply that (for some fixed $n$), $X_n$ has a uniform distribution? Commented Nov 5, 2022 at 19:40
• @spaceisdarkgreen wouldn't this imply that $X_n$ has the same distribution as $X$? Commented Nov 5, 2022 at 19:41
• @spaceisdarkgreen but now thinking about it it does not make much sense your right. How could I fix it? Commented Nov 5, 2022 at 19:42
• No, in fact it tells you absolutely nothing about the distribution of any given $X_n$. Commented Nov 5, 2022 at 19:42
• I meant the defining expression for $X_n$. And it doesn’t help, as we discussed previously… I was just saying you weren’t wrong about that fact. Commented Nov 5, 2022 at 20:47

This seems much harder than it needs to be though.

Let us define $$X_n = 2^n \times \frac{\lfloor 2^n X \rfloor}{2^n}.$$ Then $$X_n$$ is clearly integral; the numerator $$2^n \times \lfloor X \rfloor$$ is both integral and is clearly an integral multiple of the denominator $$2^n$$. Furthermore, $$X_n$$ must be nonnegative [lest $$X$$ is negative], and it must be less than $$2^n$$ with probability $$1$$ [lest $$X \ge 1$$, note that as $$X$$ is uniformly distributed on $$[0,1]$$, that $$X=1$$ with probability $$0$$, and $$X$$ cannot be larger than $$1$$.] So the support of $$X_n$$ is $$A_n =\{0,1,2,\ldots, 2^n-1\}$$.

So now we show that $$X_n$$ is uniformly distributed on $$A_n$$. It is clear [due to the fact that $$X$$ is uniformly distributed on $$[0,1]$$] that, for each integer $$n$$ [no need to take limits], and each $$k \in A_n = \{0 \le k < 2^n\}$$, the following equation holds:

$$\mathbb{P}[X_n = k] = \mathbb{P}\Big[X \in \Big[\frac{k}{2^n},\frac{k+1}{2^n}\Big)\Big]$$ $$= \frac{(k+1)-k}{2^n} = \frac{1}{2^n},$$ where the "$$=$$" on the second line follows from the fact that $$X$$ is uniformly distributed on $$[0,1]$$. Then this gives $$X_n$$ uniformly distributed on $$A_n$$; indeed, for all $$k \in A_n$$, the probability that $$X_n$$ is $$k$$ is the same, namely $$\frac{1}{2^n}$$.

• Do we know that $X_n$ only takes values $k\in A_n$? Commented Nov 5, 2022 at 20:00
• That is straightforward. It is straightforward to see that $X_n = 2^n \frac{\lfloor X \rfloor}{2^n}$ must be an integer as the numerator and denominator are both integral and the numerator is a multiple of the denominator. So if $X_n$ took a value $k$ not in $A_n$, then as $A_n$ is the set of nonnegative integers up to $2^n-1$, it follows that $k \ge 2^n$ or $k<0$. The former would imply $X>1$, the latter $X<0$....
– Mike
Commented Nov 5, 2022 at 20:06
• Sorry could you maybe explain the second equality with the probability I don't see this one. Commented Nov 5, 2022 at 20:15
• If $X$ is uniformly distributed on $[0,1]$, then for each $a,b \in [0,1]$ with $a<b$, the following equation holds: $\mathbb{P}[X \in [a,b)] = b-a$.
– Mike
Commented Nov 5, 2022 at 20:17
• YES @cristallo, with $X_n$ as you defined it, $\mathbb{P}[X_n = k/2^n]$ is $2^{-n}$, for all $k\in A_n$. With $X_n$ as I defined it, $\mathbb{P}[X_n =k]$ is the same $2^{-n}$ as well, again, for all $k \in A_n$. This implies the uniform distribution on $A_n$ as desired.
– Mike
Commented Nov 5, 2022 at 22:59