How to find the value of $x$ which its factorial for example equals to 100 ?
$x! = 100 $
$x= ?$
How to find the value of $x$ which its factorial for example equals to 100 ?
$x! = 100 $
$x= ?$
On
The best approach to solving this would be bisection in my opinion, and it goes as follows:$$4!<100<5!$$$$4.5!<100<5!$$$$4.75!<100<5!$$$$4.875!<100<5!$$$$4.875!<100<4.9!$$$$4.89!<100<4.9!$$$$x\approx4.895$$Bisection works great as long as the function is only growing or decaying in the area which we are considering.
You start with two guesses and get closer by a half each time, hence bisection.
And it doesn't half to get closer by exactly a half each time (the decimals get longer if you do so), which is why you may have noticed that I went from $4.875$ to $4.9$.
There is no such integer. If you generalize to reals with Gamma function, $x!\to\Gamma(x+1)$, then you have an ugly transcendental equation which you need to attack numerically, no way around it. Bisection is probably the safest bet.
If it happens to be integer, I'd do a linear search... just increase $x$ in $x!$ until you get to the solution. If you jump over it, then there's no integer solution and you have a bracket for the continuous case with the Gamma function.