1
$\begingroup$

I am currently engaging with the following hypergeometric function as a result of attempting to find a solution for this probability problem for $n$ number of dice:

$$_2F_1\left (\frac{n+k}{2}, \frac{n+k+1}{2};k+1;\frac{4b(d-e+1)}{d^2}\right ); \{n,k,b,d,e\}\in \mathbb{N}^+, z\in \mathbb{R},b < e \leq d$$

I'm trying to determine if there's way to calculate this function that doesn't require infinite sums (ideally, just with elementary functions and finite sums/products).

I first note that this function is of the pattern: $$_2F_1\left (a, a+\frac{1}{2};c;z\right )$$ DLMF 15.9.17 then states that:

$$_2\bar{F}_1\left (a, a+\frac{1}{2}; c; z \right )=2^{c-1}z^\frac{1-c}{2}(1-z)^{-a+\frac{c-1}{2}}P_{2a-c}^{1-c}\left ( \frac{1}{\sqrt{1-z}} \right )$$

where we're using DLMF's definition (14.7.14) of:

$$P_{n}^{m}(z)=\frac{(z^2-1)^{\frac{m}{2}}}{2^nn!}\frac{d^{m+n}}{dx^{m+n}}(z^2-1)^n$$

Okay, that seems reasonable enough to plug in, and if we do, we get:

$$_2\bar{F}_1\left (\frac{n+k}{2}, \frac{n+k+1}{2}; k+1; z \right )=2^{k}z^{-\frac{k}{2}}(1-z)^{-\frac{n}{2}}P_{n-1}^{-k}\left ( \frac{1}{\sqrt{1-z}} \right )$$

So that leaves us with an Associated Legendre Function of negative integer order. DLMF 14.9.3 gives us a recurrence relation that can convert this to an ALF of positive order:

$$P_{\nu}^{-m}\left ( z \right )=\frac{\Gamma(\nu-m+1)}{\Gamma(\nu+m+1)}P_{\nu}^{m}\left ( z \right )$$

But after a lot of work I've realised that this isn't actually suitable for the problem I'm looking at, because for ALFs of integer order and degree, $P_{n}^{m}=0$ where $m>n$, and the problem I'm looking at it's quite common for $|m|>n$, so the easy method is out. I've tried looking at as much of the literature as I can understand, and so far as I can tell, there doesn't seem to be a known identity for $P_{n}^{-m}$ for $|m|>n$ that doesn't involve infinite sums.

So the question I am asking is: Is there a known equation to calculate Associated Legendre Functions of arbitrarily large negative integer order and positive integer degree that doesn't require infinite sums (and, preferably, only requires elementary functions with finite sums/products)?

$\endgroup$
4
  • $\begingroup$ To clarify: an existing library implementation of $_{2}F_{1}$, such as the ARB library's arb_hypgeom_2f1(), or corresponding complex-valued function, would be of no use to you, because you need to create your own implementation? $\endgroup$
    – njuffa
    Commented Mar 23 at 1:22
  • $\begingroup$ If there's a mostly-human-readable and mostly-human-computable algorithm already in existence, I'd be happy to be directed to it, but the goal isn't specifically to implement in code (there are plenty of $_2F_1$ functions in various languages that can calculate this, and Mathematica can do it even better). I want something that's mostly human-computable and can generate an exact answer. I know this should be possible, there are finite ALF series out there, but none seem to be appropriate for this particular problem. $\endgroup$ Commented Mar 23 at 10:51
  • $\begingroup$ Specifically: I'm building this as part of a series of Probability Mass Functions on various dice pool variations, and I'm trying to assume high-school-level-or-lower math background with the formulae. $\endgroup$ Commented Mar 23 at 10:55
  • $\begingroup$ I am afraid I do not know what "human-readable" and "human-computable" means. One can read the source code for ARB. It is open-source software and was written by a human. If you are referring to "simple" algorithms also capable of accurate computation, that gets one about as far as the error function or Lambert's W. When accurate answers are required, already something like the incomplete gamma function will result in a more challenging "complex" algorithm, let alone any of the hypergeometric functions. $\endgroup$
    – njuffa
    Commented Mar 23 at 17:16

2 Answers 2

2
$\begingroup$

Sometimes you miss the easy solutions. It turns out that the Hypergeometric representation of the Associated Legendre Functions does, indeed, work with integer degrees and order, and will happily accomodate negative integer degree, even negative integer degrees where $|m|>n$ .

By DLMF 14.3.6:

$$P^\mu_\nu(x) = \left( \frac{x+1}{x-1}\right)^{\frac{\mu}{2}}\,_2\bar{F}_1\left(\nu+1,-\nu;1-\mu;\frac{1-x}{2}\right)$$ And by DLMF 15.4:

$$\,_2\bar{F}_1\left(b,-m;c;z\right)=\frac{1}{\Gamma(c)}\sum_{n=0}^{m}(-1)^n\binom{m}{n}\frac{(b)_n}{(c)_n}z^n$$

Since $\mu$ and $\nu$ are integers in our case, we can plug our figures in:

$$P^{-m}_{n}(x)=\left( \frac{x-1}{x+1}\right)^{\frac{m}{2}}\frac{1}{\Gamma(m+1)}\sum_{j=0}^{n}(-1)^j\binom{n}{j}\frac{(n+1)_j}{(m+1)_j}\left (\frac{1-x}{2} \right )^j$$

Since $m$ and $n$ are integers, we can go ahead and convert everything to factorials:

$$\begin{align*} P^{-m}_{n}(x)&=\left( \frac{x-1}{x+1}\right)^{\frac{m}{2}}\frac{1}{m!}\sum_{j=0}^{n}(-1)^j\frac{m!n!(n+j)!}{j!n!(n-j)!(m+j)!}\left (\frac{1-x}{2} \right )^j\\ &=\left( \frac{x-1}{x+1}\right)^{\frac{m}{2}}\sum_{j=0}^{n}\frac{(n+j)!}{j!(n-j)!(m+j)!}\left (\frac{x-1}{2} \right )^j \end{align*}$$

Which means we can now use this to determine a finite sum for our hypergeometric function of interest:

$$\begin{align*} _2F_1\left ( \tfrac{n+k}{2}, \tfrac{n+k+1}{2};k+1;z\right )&= 2^{k}k!z^{-\frac{k}{2}}(1-z)^{-\frac{n}{2}}P^{-k}_{n-1}\left(\frac{1}{\sqrt{1-z}}\right)\\ &=2^{k}k!z^{-\frac{k}{2}}(1-z)^{-\frac{n}{2}}\left( \frac{\frac{1}{\sqrt{1-z}}-1}{\frac{1}{\sqrt{1-z}}+1}\right)^{\frac{k}{2}}\sum_{j=0}^{n-1}\frac{(n+j-1)!}{j!(n-j-1)!(k+j)!}\left (\frac{\frac{1}{\sqrt{1-z}}-1}{2} \right )^j\\ &=2^{k}k!z^{-\frac{k}{2}}(1-z)^{-\frac{n}{2}}\left( \frac{1-\sqrt{1-z}}{1+\sqrt{1-z}}\right)^{\frac{k}{2}}\sum_{j=0}^{n-1}\frac{(n+j-1)!}{j!(n-j-1)!(k+j)!}\left (\frac{1-\sqrt{1-z}}{2\sqrt{1-z}} \right )^j \end{align*}$$

And this will work even if $k>n$, and thus can be used in my particular application.

$\endgroup$
4
  • $\begingroup$ I think that a factor $\Gamma(k+1)$ is missing in your calculation (the relation DLMF concerns the regularized hypergeometric function (HG)). Including this factor gives the same result as mine. They are also identical to the direct evaluation of the initial HG function and to the ALF, according to Maple, both for $n\ge k$ and $n<k$. $\endgroup$
    – Paul Enta
    Commented Apr 4 at 17:09
  • $\begingroup$ Ah, you are right, that was an error, I'll correct that. $\endgroup$ Commented Apr 5 at 6:07
  • $\begingroup$ But as noted in the initial post, that can only get you to $P^{-l}_l$, because $P^{m}_l=0$ if $m>l$! $\endgroup$ Commented Apr 5 at 9:45
  • $\begingroup$ Sorry, I removed the above comment. $\endgroup$
    – Paul Enta
    Commented Apr 6 at 7:57
1
$\begingroup$

To evaluate \begin{equation} G={}_2F_1\left (\frac{n+k}{2}, \frac{n+k+1}{2};k+1;x \right) \end{equation} one can recognize the pattern \begin{equation} G={}_2F_1\left (s, s+1/2;2s+1-n;x \right) \end{equation} where $s=(n+k)/2$. Under this form, it can be interpreted as the $n$-th derivative of a simpler hypergeometric function by this relation: \begin{equation} \frac{{\mathrm{d}}^{n}}{{\mathrm{d}z}^{n}}\left(z^{c-1}{}_2F_1\left(a,b;c;z\right)% \right)={\left(c-n\right)_{n}}z^{c-n-1}{}_2F_1\left(a,b;c-n;z\right) \end{equation} ($(.)_n$ correspond to the Pochhamer symbols). Here $a=s,b=s+1/2,c=2s+1$, then \begin{equation} G=\frac{x^{n-2s}}{(2s+1-n)_n}\frac{{\mathrm{d}}^{n}}{{\mathrm{d}x}^{n}}\left(z^{2s}F\left(s,s+1/2;2s+1;x\right)% \right) \end{equation} But this special hypergeometric function is tabulated: \begin{equation} {}_2F_{1}(s,s+{\frac{1}{2}};2\,s+1;z)=2^{2s}\left({\sqrt{1-z}}+1\right)^{-2s} \end{equation} then \begin{equation} G=\frac{2^{n+k}x^{-k}}{(k+1)_n}\frac{{\mathrm{d}}^{n}}{{\mathrm{d}x}^{n}}\left(z^{n+k}\left({1+\sqrt{1-x}}\right)^{-n-k} \right) \end{equation} The inner function \begin{align} z^{n+k}\left({1+\sqrt{1-z}}\right)^{-n-k}&=\left( \frac{z}{1+\sqrt{1-z}} \right)^{n+k}\\ &=\left( 1-\sqrt{1-x} \right)^{n+k}\\ &=\sum_{m=0}^{n+k}\binom{n+k}m (-1)^m\left( 1-x \right)^{m/2} \end{align} As \begin{equation} \frac{{\mathrm{d}}^{n}}{{\mathrm{d}x}^{n}}\left( \left( 1-x \right)^{m/2} \right)=(-1)^n\left( m/2+1-n \right)_n(1-x)^{m/2-n} \end{equation} one obtains \begin{equation} G=\frac{2^{n+k}(-1)^nx^{-k}}{(k+1)_n}\sum_{m=0}^{n+k}(-1)^m\binom{n+k}m \left( m/2+1-n \right)_n(1-x)^{m/2-n} \end{equation} which seems to be numerically correct.

$\endgroup$
2
  • $\begingroup$ Sorry for taking a while to get back - I've done some checking, and the equation for $\, _2F_1\left(\frac{n+k}{2},\frac{n+k+1}{2};k+1;z\right)$ that you've given has the same issues that other formulae I've seen have - it stops working if $k>n$, which unfortunately means it's not suitable for the application I need to use it for! This is why I've been looking for the ALF solution - I know it does work for the applications I want to use it for. $\endgroup$ Commented Apr 4 at 10:10
  • $\begingroup$ This expression gives the same results as the direct evaluation of the initial hypergeometric function and of the associated Legendre function, according to Maple, for both $n≥k$ and $n<k$. $\endgroup$
    – Paul Enta
    Commented Apr 5 at 7:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .