Factorial inverse equation

173 Views Asked by At

I need to find a solution to a problem and I need to solve an equation. The following equation is the result of some manipulation.

I'm a little bit rusty and I can't see how to find a simple solution ( to be honest I can't find a solution at all ):

$e^{-A} \cdot A^x = x! \cdot K$

What I need is $x$. $A$ and $K$ are real, positive constant numbers an I'm expecting the solution would be real and positive. Does anyone has suggestions ?

3

There are 3 best solutions below

2
On

$x!$ is not defined for arbitrary real positive $x$, just for nonnegative integers. You could replace it by $\Gamma(x+1)$. But still your equation can't be solved in "closed form". Numerical methods might be tried.

0
On

Here's a possible solution - not sure if it will be of particularly good numerical stability. Take logs:

$$ \ln{(e^{-A} A^x)} = \ln{(x! K)} \implies - A + x \ln{A} = \ln{x!} + \ln{K}.$$

You might be able to solve this numerically if you use a an accurate enough approximation for $\ln x!,$ using the Stirling series:

$$ \ln x! \approx x \ln x - x + \frac{1}{2} \ln{2\pi x} + \frac{1}{12 x} - \frac{1}{360 x^3} + \dots$$

so a solution will be close to the solution of, say,

$$ x \ln x - (1 + \ln A)x+\frac{1}{2} \ln{2\pi x} + (A + \ln K) = 0.$$

3
On

Before trying to solve this equation, I think it is better to get a sense of the possible solutions. Maybe this graph could help:

graph

As you see, the solution is not unique for some values of $A$ and $K$, while it doesn't have any solution for some positive values of $A$ and $K$.