Q:

Confused on the derivation of the gamma distribution

In the (approximate) poisson process with mean $\lambda$, we have seen that the waiting time until the first occurrence has an exponential distribution. We now let $W$ denote the waiting time until the $\alpha$ occurrence and find the distribution of $W$. The cdf of W when $w\ge 0$ is given by $F(w)= P(W\le w) = 1 - P(W > w)$ = $1 - P(\mbox{fewer than $\alpha$ occurrences in [0,w]}) = 1 - \sum_{k=0} ^{\alpha-1} \dfrac{(\lambda w)^k e^{-\lambda w}}{k!}$. Taking the derivative we get $f(w) = \dfrac{\lambda(\lambda w)^{\alpha - 1}e^{-\lambda w}} {(\alpha-1)!}$. So I understand the derivation completely till we replace $(\alpha -1)!$ with the gamma function.  So I understand the distribution is continuous so we would we want to replace $(\alpha -1)!$ with a continuous function. I also understand how $\alpha$ does not have to be an integer, for example maybe we would want to know the waiting for like .5 of a chemical to decay. My issue is why the gamma function, are there not any functions that we can replace so the function integrates to 1 across the domain? I personally don't think that is true. Is the reason that the gamma function perfectly models the factorial function for positive integers? 

A:

So I understand the distribution is continuous so we would we want to replace $(\alpha - 1)!$ with a continuous function.

The distribution is continuous but I guess it is not the reason here. For $\alpha$ is a positive integer, we have a special name called Erlang distribution. When the parameter $\alpha$ is generalize to all positive real, we call it a gamma distribution. (It may not be the historical reason how gamma distribution arises, I am not sure).

My issue is why the gamma function, are there not any functions that we can replace so the function integrates to 1 across the domain? I personally don't think that is true.

That should be true if I understood your question correctly. You want a normalizing constant $g(\alpha)$ such that
$$ \begin{align} 
\int_0^{+\infty} \frac {1} {g(\alpha)} \lambda(\lambda w)^{\alpha - 1}
e^{-\lambda w}dw &= 1 \\
\iff g(\alpha) &= \int_0^{+\infty} \lambda(\lambda w)^{\alpha - 1} e^{-\lambda w}dw \\
&= \int_0^{+\infty} u^{\alpha - 1} e^{-u}du
\end{align}$$
and you see this is the definition of gamma function $\Gamma(\alpha)$.
https://en.wikipedia.org/wiki/Gamma_function

