Suppose that the time in days until hospital discharge for a certain patient population follows a density $f(x) = (0.5)\exp(-x/2)$ for $x > 0$. What is the median discharge time in days?
I reason that the median is equivalent to the value of x that gives us the 50% quantile. In other words $F(x) = 0.5$. So I must determine the CDF from the PDF, which I believe is $-\exp(-x/2)$, and then solve for $x$ in $-\exp(-x/2) = 0.5$.
However this poses a problem. Instinctively, I want to take the natural log of both sides, but I don't believe I can do this without having to start incorporating imaginary numbers into my solution. I know for a fact that the actual solution must be a real-valued number, and since we're talking about a solution measured in terms of number-of-days, the solution cannot be negative either.
So, either I am missing something that would allow me to rearrange this equation and meet these criteria, or it could be that my CDF is simply incorrect.
Your CDF if $$ F(x) = \int_0^xf(t)\,\mathrm{d}t = -e^{-t/2}{\large|}_0^x = 1 - e^{-x/2}. $$ Therefore, setting $F(x)=1/2$ we het $$ 1-e^{-x/2} = \frac{1}{2} $$ So $e^{-x/2} = \frac{1}{2} \iff e^{x/2} = 2$. This yields $x = 2\log(2)$.