# How to find median from a probability distribution?

Having trouble on something that should be really, really easy. I need to find the median of the following probability distribution...but according to the website I linked below...I'm doing it incorrectly.

Anyways, I computed the following probability table along with its mean and variance.

x    0        1        2        3        4
P(x) 0.728303 0.240297 0.029732 0.001635 0.000034


Mean = .304802

Variance = .28158

Assuming I got this much right...do I just rearrange the probabilities in ascending order and choose the value in the middle (i.e. like every other time I've ever found the median)? If so, why does the following link give 2 and not 1 for the median from the distribution below?

Number of hits, x   0       1       2       3       4
Probability, P(x)   0.10    0.20    0.30    0.25    0.15

Arranged in ascending order...
Number of hits, x   0       4       1       3       2
Probability, P(x)   0.10    0.15    0.20    0.25    0.30


I chose that the median should be 1...but I guess the median is 2 according to the website. Why doesn't my method work?

http://stattrek.com/random-variable/mean-variance.aspx?Tutorial=AP

What are the proper steps to finding the median in the first probability distribution given above?

The median for a random variable $X$ is $m$ such that $P(X \le m) \ge 1/2$ and $P(X \ge m) \ge 1/2$. In the first example the correct answer is $0$: $P(X \le 0) = P(X = 0) = 0.728303$ and $P(X \ge 0) = 1$. In the second example it is $2$: $P(X \le 2) = 0.10 + 0.20 + 0.30 = 0.6$, $P(X \ge 2) = 0.30 + 0.25 + 0.15 = 0.7$. Your method is completely wrong.