Let's assume that we have a random variable $X$ that takes integer values from the range $[0, b]$, the left boundary $b$ is not precisely defined, but on practice $b<10,000$.
x <- c(rep(7, 2), rep(9, 163), rep(11,231), rep(13,343), rep(15, 211),rep(17, 159),rep(19, 27))
I need to estimate a probability $Pr(X<a)$, where $a>0$ and $a << b$.
In order to estimate the probability, I propose to plot a probability densities, so that the histogram has a total area of one.
hist(x, freq = FALSE, label = TRUE, breaks = c(seq(7, 19, 1)))
Than I can find the sum of corresponded densities, for example, for the random variable $X$ generated above: $Pr(X<a=10)=0.002+0.143$.
Question: Is proposed approach correct?