Do the data from these two different samplings follow the same distribution? I have two approaches for data sampling:


*

*Sampling from a uniform distribution in $[0, 1]$ and rejecting values outside a certain limit, i.e. $0.50<p<0.51$.

*Sampling from a uniform distribution in $(0.50,0.51)$. 


Having seen the plots of both ways, it seems they follow the same distribution, but how do I mathematically prove it? If they do follow the same distribution, what might the distribution be? Is it $\mathcal{U}(0.50,0.51)$?
I'm particularly interested in a rigorous explanation, but an intuitive one is also fine.
Note:
You may also refer to these two posts from Stack Overflow since they're both very related and things which motivate me to ask this question:


*

*Is Excel VBA's Rnd() really this bad?

*How to fix broken formats when exporting R output to a TXT file?
 A: In both cases you sample from $\mathcal{U}(0.50,0.51)$ distribution.
In fist case you sample uniformly from $\mathcal{U}(0,1)$ and reject the values outside the $(0.50,0.51)$ range. In second case you sample uniformly from $\mathcal{U}(0.50,0.51)$. In both cases you would sample values of interest uniformly. Rejecting the values outside $(0.50,0.51)$ have no influence on the values in the interval, so there is no reason why both methods should differ.
Uniform distribution over $(a,b)$ is constant for all the values within the interval, so also in the $(a', b')$ interval where $a' \ge a$ and $b' \le b$.
A: Think about a set of data, e.g. grains of salt uniformly spread over 1 square meter, and you measure their size.
On the first proposal you take in the whole set, and then reject values outside your desired target range. That sub-set follows an uniform distribution.
On the second proposal you take a sub-set inside your desired target range as sample, those also follow an uniform distribution.
Measurement does not affect the data, neither sampling, even if the disteibution is not uniform "if the sample is big enough to represent well the whole set".
