Find the median of the following distribution
$p(x)=\frac{4!}{x!(4-x)!} {(\frac{1}{4})}^x {(\frac{3}{4})}^{4-x}$ , x=0,1,2,3,4, zero elsewhere.
In the question, the median is defined as the value of x such that $P(X<x)<\frac{1}{2}$ and $P(X\leq x)\geq\frac{1}{2}$.
I have calculated all values of P(X=x) but I am unable to understand how to find x from these values. These are the following values I have obtained: P(X=0) = 0.3164, P(X=1) = 0.4218, P(X=2) = 0.2109, P(X=3) = 0.0468, P(X=4) = 0.003906.
Also, from what I was taught in one of the class median is the value of x such that $P(X\leq x) = 0.5 = P(X\geq x)$. So, is the definition in the book incorrect?
dbinom(0:4,4,1/4)returns probabilities $0.31640625,$ $0.42187500,$ $0.21093750,$ $0.04687500,$ $0.00390625.$ which are in agreement with what you have. Also,qbinom(.5,4,1/4)returns the median $1,$ which agrees with @StubbornAtom's comment. // However, various texts and statistical software programs use slightly different definitions of the median and other quantiles. If confusion remains, maybe it's best if you provide the exact definition of the median from your text. – BruceET Jun 17 '20 at 06:03qnorm(.5)returns $0,$ the median of the standard normal distribution, which matches both the definition you give and @StubbornAtom's more general definition. // Moreover,qunif(.5)gives the median $0.5$ of a standard uniform distribution. // It would be hard to argue that the median of the symmetrical distrete distribution $\mathsf{Binom}(4, 1/2)$ isn't 2. – BruceET Jun 17 '20 at 06:16