3

I got its integral to get the CDF, which is equal to $-e^{-x}$, and I equate it to 0.5, but I'm stuck since I was getting an answer of ln(-0.5) which is a math error.

iadvd
  • 8,875
Heyho
  • 31
  • The cdf is $1-e^{-x}$. For it is $\int_0^x e^{-t},dt$ When you integrated, you forgot to "plug in" $0$. – André Nicolas May 21 '15 at 00:47
  • Whenever you get an answer, check it for reasonableness. Since CDF's must lie between 0 and 1 you can immediately reject the cdf you gave in your question, since it's always $<0$. You can instantly tell you made a mistake. (Once you know you made a mistake, it's easy to figure out which mistake.) – Glen_b May 21 '15 at 02:50
  • @Heyho: You are welcome. One kind of gets used to functions evaluated at $0$ being $0$. But not always! – André Nicolas May 21 '15 at 05:23

1 Answers1

1

The problem with your reasoning is that the integral under the curve $e^{-x}$ from $-\infty$ to $\infty$ is actually infinite. However, if you limit the domain of your pdf to only from $0$ to $\infty$ the integral over the entire pdf would be $1$ as desired.

So if you set the equation to be integrating from $0$ to $a$ of $e^{-x}$ to be equal to $0.5$, then you would find the correct value of the median for this pdf!

$$\int_0^a{e^{-x}}=\frac12$$

Ant
  • 2,407
  • 2
    The actual question is to find the median of X which has a density function of f(x) = e^(-x) for x>0 – Heyho May 21 '15 at 00:51
  • 2
    Ah... so integrating $\int_0^a{e^{-x}} = -e^{-x}$ from $0$ to $a$. (This is the Fundamental Theorem of Calculus.) That is, $-e^{-a} - -e^{-0}$, which is $-e^{-a} + 1$. Setting this equal to $0.5$ would give you the answer. ($a = ln(2)$ in case you need the answer.) – Ant May 21 '15 at 00:53
  • 2
    Ok! Thank you very much! I get it now. :) – Heyho May 21 '15 at 00:58
  • 1
    You're very welcome. – Ant May 21 '15 at 00:59