how to approach the discrete counterpart of a continuous CDF of uniform random variable I am following an online example to get the CDF of a function $Y$ of uniform random variable $x \in [0, 1]$
$$ Y = \frac{30}{2-x}
$$
Based on the example, CDF is a distribution of probability for the case when random $Y$ is less than or equal to a given number $y$, that is
$$
  P(Y \leq y) = P\left(\frac{30}{2-x}\leq y\right) = P\left(x \leq 2 - \frac{30}{y}\right) = 2 - \frac{30}{y}
$$
Assuming that $Y$ is the temperature of a room, and the only fact we know is that the temperature is changed based on a function of uniform variable $x$, such that the random temperature is bound in [15, 30] celsius degrees, once an hour. After the temperature is stabilized, it will be constant until the next hour. We would like to know the chance to see the room temperature below a certain celsius degress (within [15, 30]), which could be told by
$$
  P(Y\leq y) = 2 - \frac{30}{y}
$$
This is not a uniform distribution. For example, the change to see the temperature between [15,20] degrees is
$$P(15 \leq Y\leq 20) = 50\%$$
but the change to see the temperature between [20, 25] is
$$P(20 \leq Y\leq 25) = 30\%$$
In all analyses, we consider the temperature distribution is continuous, any temperature between 15 and 30 is possible. But in the actual case, the temperature can only be changed in the increment of 0.1, which means we could only have
$$15, 15.1, 15.2, 15.3, \cdots 24.8, 24.9, \cdots, 29.7, 29.8, 29.9$$
The random process should be modified as
$$
  Y^* = 0.1\times\left\lfloor\frac{300}{2-x}\right\rfloor
$$
How do we approach $P(Y^*\leq y)$ when we only have some discrete values in the above case? I don't have a clue yet so I am trying the simulation below
r = 0:0.00000001:1;
N = length(r);
y = floor(300./(2-r))*0.1;
P = ( length(find(y<=25)) - length(find(y<=20)) )/N % probability with tempature between [20, 25]
 

I got the result $$P(20\leq Y^*\leq 25) = 29.7318\%$$
Similarly, the simulation get
$$P(15 \leq Y^*\leq 20) = 49.4218\%$$
It makes sense that the probability is lower for only some discrete numbers are included, but is it any way to get the close-form to estimate $P(Y^*\leq y)$? Thanks.

While I am reading one response, I am thinking is it correct to sum all (continuous) probabilities between [15, 15.1) for the probability of getting the discrete value 15, all continuous probabilities between [15.1, 15.2) for the probability of getting the discrete value 15.1 and so on. So we may have
$$P(Y^*=15) = P(15\leq Y < 15.1) = 2 - \frac{30}{15.1} - \left[2 - \frac{30}{15}\right] = 0.0130708$$
and something like that.
Now if we add all $$P(Y^*=15) + P(Y^*=15.1) + \cdots + P(Y^*=20) = 0.501606$$
This number is actually more than 50%! Does it mean $P(15\leq Y \leq 20) < P(15 \leq Y^* \leq 20)$?
I don't quite get it, if I do the simulation I get the result less than 50% for the discrete case, but from analytical, it is more than 50%.

If $Y^*$ is the same as $Y$ but rounded down to a $0.1$ of a degree, i.e. $Y^*=\lfloor 10Y\rfloor /10$  then you can say for any $y$ which is one of the possible values from $15.0$ through to $29.9$

*

*$P(Y^* \lt y) = P(Y \lt y) = 2 - \frac{30}{y}$

*$P(Y^* \le y) = P(Y \lt y+0.1) = 2 - \frac{30}{y+0.1}$

*$P(Y^* = y) = P(Y \lt y+0.1)-P(Y \lt y)=\frac{30}{y}-\frac{30}{y+0.1}=\frac{30}{10y^2+y}$
This will for example give you $P(15 \le Y^* < 20) = \frac12$ as you might expect, but $P(15 \le Y^* \le 20) = \frac{34}{67}$ which is slightly more.  The subtle $< , \le$ distinction happens with discrete distributions but not with continuous distributions.
