# (Ab)using the factorial and gamma functions

I have a product of the following form:

$$P = (N-\alpha)(N-2\alpha)\cdots(N-k\alpha)$$

where $k$ is an integer between $1$ and $N-1$, and $\alpha$ is a real number in $(0,1]$.

Clearly, for $\alpha=1$,

$$P = \frac{(N-1)!}{(N-k-1)!}$$

Now, in general I can write:

$$P = \alpha^k \left(\frac{N}{\alpha}-1\right) \left(\frac{N}{\alpha}-2\right) \cdots \left(\frac{N}{\alpha}-k\right)$$

This looks like a factorial, but $\frac{N}{\alpha}$ is not an integer in general. I tried rounding it up and using the factorial function anyway. This gave results in the right ballpark (at least for the values I tried), but they were still off by quite a bit, which I assume is because the rounding error is being multiplied.

I am not very familiar with the Gamma function, but looking at its definition and relation to the factorial function, I took a guess and wrote:

$$P = \alpha^k \frac{\Gamma\left(\frac{N}{\alpha}\right)}{\Gamma\left(\frac{N}{\alpha}-k\right)}$$

This gave exactly the same results as the factorial function with rounding.

Is this a proper way of using the Gamma function?

Is there a more accurate way to write $P$ using it or anything else?

You can write $P$ with the Gamma function, but more simply using falling powers. There are several notations, but using the one from the linked wiki article, $(n)_k=n(n-1)(n-2)\cdots (n-k+1)$. Hence, $$P=\alpha^k \left(\frac{N}{\alpha}-1\right)_k$$
• You're right, the Gamma one is exact - it was only that my software was making numerical inaccuracies for large values of $N$ and $k$. Using the factorial and rounding $N/\alpha\approx \left[N/\alpha\right]$, though, is of course not exact. – MGA Dec 10 '15 at 3:56