Formula to find mean & median for exponential distribution.

560 Views Asked by At

I need a bit of help from you guys.

I have a function like this :

$F(X)=\frac{95}{1-X}$

(in python)

def f(x):
  return math.floor(95 / (1 - x))

Where X is a uniform, equidistant number in the double floating point range [0, 1).

I know it's about exponential distribution but Wikipedia doesn't really help me. :(

I struggle to understand how to find the mean and the median of this function.

I see that $F(0.5)=190$ So it must be the median but I would like to know how can I calculate it (and the mean) theoretically.

Any help, answers, comment, remark would be very much appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

So the mean can be represented like this. Notice that the 1-x isn't necessary.
$$\frac{1}{9}*(\frac{95}{1-0.1}+\frac{95}{1-0.2}......+\frac{95}{1-0.9})$$ We could just write 95/a, and then convert it later $$\frac{1}{a}*(\frac{95}{1a}+\frac{95}{2a}......+\frac{95}{(a-1)a})$$ so we can take it another step. instead, let's say a is actually the denominator of a fraction. $$\frac{1}{a}*(\frac{95}{1a^{-1}}+\frac{95}{2a^{-1}}......+\frac{95}{(a-1)a^{-1}})$$ So for example, a=8,(a will always be a whole number) and x will be 1-0.125. So if you wanted x to be f(0.25)+f(0.5)+f(0.75)/3, 'a'=4. Thinking of x in this way will be more helpful. So next we will do some basic factoring. $$\frac{95}{a}*(\frac{1}{(1/a)}+\frac{1}{(2/a)}......+\frac{1}{(a-1/a)})$$ So 1/(1/a)=1 divided by (1/a) so... $$\frac{95}{a}*(\frac{1}{1}*\frac{a}{1}+\frac{1}{1}*\frac{a}{2}......+\frac{1}{1}*\frac{1}{a-1})$$ $$\frac{95}{a}*(\frac{a}{1}+\frac{a}{2}......+\frac{a}{a-1})$$ So to add these fractions up, we should factor the 'a' out. So ... $$\frac{95a}{a}*(\frac{1}{1}+\frac{1}{2}......+\frac{1}{a-1})$$ And now we have a harmonic series, which is 1+1/2+1/3...+1/a-1. So there are many ways to calculate a harmonic series https://en.wikipedia.org/wiki/Harmonic_series_(mathematics), each with varying complexities. So let's think about why this might make sense. So as 'a' increases, the fraction gets smaller and the mean gets more accurate. So we see the bigger the 'a', the more accurate the harmonic series. And the median is f(0.5) like you said.