I think I don't get the probability density function. At least on uniform distribution.
There are infinitely many numbers between $0$ and $1$, in probability, I understand this means that the weight it assigns to individual points must necessarily be zero. For this reason, we represent a continuous distribution with a probability density function (pdf) such that the probability of seeing a value in a certain interval equals the integral of the density function over the interval.
Then I don't get why, in this book page 74, the density function for the uniform distribution is just:
def uniform_pdf(x):
return 1 if x >= 0 and x < 1 else 0
Shouldn't it be:
def uniform_pdf(x):
return x if x >= 0 and x < 1 else 0