# Solving equation involving factorials

I have this particular equation

$\frac{(\alpha-1)!(\beta-1)!}{(\alpha+\beta-1)!} = \frac{\Gamma(p)(1+q)^{n+2p} 2^n}{q^{p}(2+q)^{n+p}}$.

Now, given the values of $\alpha$ and $\beta$, I need to find the corresponding values of p and q. n is fixed for a given model. How do I find an analytical solution?

What I did so far.

Suppose, $A = \frac{(\alpha-1)!(\beta-1)!}{(\alpha+\beta-1)!}$, we can rewrite the above equation as,

$A q^{p}(2+q)^{n+p} = 2^n (p-1)!(1+q)^{n+2p}$.

After setting the values for A and n, I took LHS as a function and RHS as another function. Then I plotted the two functions and checked for intersections. While this method may work when the values are chosen properly, it's desirable to get an analytical solution.

Details:

$\alpha$ and $\beta$ are the parameters of the beta prior and it is known that $p >0, q >0$. n specifies the model ($n > 0$).

Now given the beta prior (i.e., the values of $\alpha$ and $\beta$), I need to find the values of p and q. How do I solve this?

• I suppose $\alpha,\beta$ are integers? Or are we to understand $(\alpha -1)! = \Gamma(\alpha)$? – Fimpellizieri May 12 '16 at 5:36
• @Fimpellizieri, $\alpha$ and $\beta$ are integers – akashrajkn May 12 '16 at 5:43
• So $p$ is also an integer; is $q$ an integer too? – Fimpellizieri May 12 '16 at 5:47
• @Fimpellizieri, p and q need not be integers. I edited the equation. It is actually $\Gamma(p)$, I was trying to check for the integer case – akashrajkn May 12 '16 at 9:30