This is just a hypothetical question that I had (I made this question myself, just am curious about something). What if we were trying to find the $20\text{th}$ percentile in a discrete probability distribution from $0 \leq x \leq 5$, where
$F(0) = 0.1$
$F(1) = 0.3$
$F(2) = 0.5$
$F(3) = 0.6$
$F(4) = 0.8$
$F(5) = 1$
$F(x)$ is the cdf of course.
Would the $20\text{th}$ percentile be $0$ or $1$ or something else entirely?
This is where the $20\text{th}$ percentile is the value above or equal to $20%$ of the data
Can anyone give me the algorithm to find percentile in a discrete probability distribution if there is one?
Thank you for any help/comments.
From comments: I think you are looking for the value $k$ where $P(X<k)≤0.2≤P(X≤k)$
so the $20\%$ percentile is at the value $1$ for this distribution.
This approach works in general, but though there may be more than one solution. If in your example you had been looking for the median $(50\%)$ then $k$ could be $2$ or $3$ or any number in between; all these solutions would then be correct, so it is an arbitrary choice - some people conventionally take the middle of the range of correct values so here $2.5$ for the median, but that too is arbitrary.