Factorial Calculation for Non-Integers?

28.6k Views Asked by At

I was playing with numbers on calculator and to my amaze i could see that calculator calculated $(4.5)!$ or any real numbers but factorial is defined for integers how is this done any advanced function. (Note I am grade $11$ student)

5

There are 5 best solutions below

7
On

It's possible the calculator gave you the value of $\Gamma(5.5)$.

The $\Gamma$ function is a sort of generalization of the factorial in the sense that for every $n\in\mathbb N$, you have that $\Gamma(n) = (n-1)!$. So if you ever want to calculate $m!$, that's the same as calculating $\Gamma(m+1)$.

4
On

There is a function called the Gamma function. It is similar to the factorial as the factorial could be thought of as a special case of the gamma function.

$\Gamma(n) = (n-1)!$

or rather, when you shift it by one, as shown in the above equation.

The gamma function happens to be

$\Gamma(t) = \int_0^\infty x^{t-1} e^{-x} dx$

Calculators often use the gamma function to calculate factorials of non-natural values.

The generalization is useful when you need to extend the definition of the factorial beyond the natural numbers. For example, some probability distributions use the factorial, and the gamma function can be used to generalize them.

The factorial and gamma function both have some interesting properties in common.

For example, the factorial function can be defined recursively.

$0!=1$

$(n+1)! = (n+1) \times n!$

The gamma function also has this property

$\Gamma (1) = 1$

$\Gamma(x+1) = (x+1) \times \Gamma(x) $

5
On

In general, $~n!~=~\displaystyle\int_0^\infty\exp\Big(-\sqrt[n]x\Big)~dx,~$ which for $~n=\dfrac12~$ yields $~\Big(\tfrac12\Big)!~=~\displaystyle\int_0^\infty e^{-x^2}~dx.~$

But the value of the Gaussian integral is known to be $\sqrt\pi~,~$ implying that $~\Big(\tfrac12\Big)!~=~\dfrac{\sqrt\pi}2,~$

since the integrand is even. Now all that's left to do is to repeatedly employ the well-known

factorial property $(n+1)!=(n+1)~n!~$ for $~n+1=4+\dfrac12,~$ and the result follows.

1
On

Along with the gamma function, it is much easier to approximate to good accuracy using Stirling's approximation.

It is defined as:

$$n!\approx \sqrt{2\pi n}\left(\frac ne\right)^n$$

0
On

An answer was never accepted so I’d like to take a stab at it. In particular the OP mentioned being grade 11, and I think “what is going on here” is an excellent question.

Faced with a function like x! -which is defined for positive integers- which we want to extend to other numbers, the most important question we can ask is:

Q: What are its properties?
A factorial is pretty simple. For any integer n > 1
(1). (n+1)! = (n+1) n!
In other words, to get (n+1)! we don’t have to start over from scratch. We just multiply n! by the next integer. For example 6! = 6 • 5!. Hopefully this just sounds like a restatement of what “factorial” means.

Continuation
The factorial for non integers is called a continuation of the factorial for integers: we seek a function that obeys the known properties of the factorial, at all values of x. In math, we need (1) to be satisfied for any number x, not just the integers:
1’. (x+1)! = (x+1) x!
One way to visualize this question is to plot the integer factorial values on a graph. The continuous function x! will be a smooth curve passing through these points. Now, you can draw an infinite number of curves that do this. The curve we seek, is the one that satisfies 1’ everywhere on the curve. So we now have a new question:

Q: but what is this mystery function?
I didn’t take the op as looking for a proof. However, a word about how to solve problems of this kind:
The definition 1’ is nice but as written it does not tell us how to draw the curve. If I put my pencil on 3! = 6 and begin to draw upward toward 4! = 24, the first thing I need to know is what direction to start drawing — the slope of the curve. But also the curve is not a straight line, so I can’t keep drawing in that same direction. The curve changes continuously. In a nutshell, to draw it, we need to understand how the function changes as x varies.

The tools to answer this kind of problem —to identify how it changes; and how to assemble this information into a formula for practical calculation — come from the Calculus.

I hope that helps.