Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to find a clever way to compute the quotient of two gamma functions whose inputs differ by some integer. In other words, for some real value $x$ and an integer $n < x$, I want to find a way to compute

$$ \frac{\Gamma(x)}{\Gamma(x-n)} $$

For $n=1$, the quotient it is simply $(x-1)$ since by definition

$$ \Gamma(x) = (x - 1)\Gamma(x-1) $$

For $n=2$, it is also simple:

$$ \frac{\Gamma(x)}{\Gamma(x-2)} = \frac{(x-1)\Gamma(x-1)}{\Gamma(x-2)} = (x-1)(x-2)$$

If we continue this pattern out to some arbitrary $n$, we get

$$ \frac{\Gamma(x)}{\Gamma(x-n)} = \prod_i^n (x-i)$$

Obviously I am floundering a bit here. Can anyone help me find an efficient way to compute this quotient besides directly computing the two gamma functions and dividing?

I am also okay if an efficient computation can be found in log space. Currently I am using a simple approximation of the log gamma function and taking the difference. This was necessary because the gamma function gets too big to store in any primitive data type for even smallish values of $x$.

share|improve this question
    
Taking logarithms and using Stirling's approximation? –  Did Dec 7 '12 at 6:18
    
What you have does look like a falling factorial... –  J. M. Apr 3 '13 at 7:28
add comment

2 Answers

I think you mean $$ \frac{\Gamma(x)}{\Gamma(x-n)} = \prod_{i=1}^{n} (x - i) $$ Of course this might not be very nice if $n$ is very large, in which case you might want to first compute the $\Gamma$ values and divide; but then (unless $x$ is very close to one of the integers $i$) the result will also be enormous. If you're looking for a numerical approximation rather than an exact value, you can use Stirling's approximation or its variants.

EDIT: Note also that if your $x$ or $x-n$ might be negative, you may find the reflection formula useful: $$ \Gamma(z) \Gamma(1-z) = \frac{\pi}{\sin(\pi z)} $$

For $x > n$, $$ \eqalign{\ln\left(\frac{\Gamma(x)}{\Gamma(x-n)}\right) &= n \ln x + \sum_{i=1}^n \ln(x-i)\cr &= n \ln x + \sum_{i=1}^n \left( - \frac{i}{x} - \frac{i^2}{2x^2} - \frac{i^3}{3x^3} - \frac{i^4}{4x^4} - \frac{i^5}{5x^5} - \frac{i^6}{6 x^6}\ldots \right)\cr &= n \ln x - \frac{n(n+1)}{2x} - \frac{n(n+1)(2n+1)}{12 x^2} - \frac{n^2 (n+1)^2}{12 x^3} \cr & -{\frac {n \left( n+ 1 \right) \left( 2\,n+1 \right) \left( 3\,{n}^{2}+3\,n-1 \right) }{120 { x}^{4}}}-\frac { \left( n+1 \right) ^{2}{n}^{2} \left( 2\,{n}^{2}+2\,n-1 \right) }{60 {x}^{5}} \ldots} $$ This provides excellent approximations as $x \to \infty$ for fixed $n$ (or $n$ growing much more slowly than $x$). On the other hand, for $n = tx$ with $0 < t < 1$ fixed, as $x \to \infty$ we have

$$ \eqalign{\ln\left(\frac{\Gamma(x)}{\Gamma(x-n)}\right) &=(1-t) x \ln(x) - (t \ln(t) - t + 1) x +\frac{\ln(t)}{2}\cr &+{ \frac {t-1}{12tx}}+{\frac {1-{t}^{3}}{360{t}^{3}{x}^{3}} }+{\frac {{t}^{5}-1}{1260{t}^{5}{x}^{5}}}+\frac{1-t^7}{1680 t^7 x^7} \ldots }$$

share|improve this answer
    
Thank you for the fix - I've edited my question. –  jlund3 Dec 7 '12 at 4:00
    
I've edited my answer to stipulate that $n < x$, which is the case for my application. –  jlund3 Dec 7 '12 at 16:46
add comment

You can write the expression in terms of the Pochhammer symbol as

$$ (x-1)_n = \frac{\Gamma(x)}{\Gamma(x-n)}. $$

share|improve this answer
    
Nifty - I hadn't heard of the Pochhammer symbol before. Now, if only I knew how to calculate it... –  jlund3 Dec 7 '12 at 5:23
    
@jlund3: It is used in the hypergeometric functions and has some useful properties. –  Mhenni Benghorbal Dec 7 '12 at 5:49
    
@Downvoter: What's the downvote for? –  Mhenni Benghorbal Dec 7 '12 at 6:22
2  
My guess is that it was downvoted because it just gave a name to the desired expression and did not help in any way with the desired evaluation. –  marty cohen Dec 7 '12 at 6:50
1  
So maybe it would be better as a comment than an answer. –  GEdgar Dec 7 '12 at 17:01
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.