Factorial: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Dmitrii Kouznetsov
imported>Meg Taylor
No edit summary
 
(38 intermediate revisions by 5 users not shown)
Line 52: Line 52:


==Definitions==
==Definitions==
For complex values of the argument, the combinatoric definiton above should be extended.
For complex values of the argument, the combinatoric definition above should be extended.
 
===Implicit definition===
The factorial can be defined as unique meromorphic function <math>F</math>, satisfying  
The factorial can be defined as unique meromorphic function <math>F</math>, satisfying  
relations
relations
:<math> F(z+1)=(z+1) F(z) </math>
:<math> F(z+1)=(z+1) F(z) </math>
:<math> F(0)=1 </math>
:<math> F(0)=1 </math>
for all complex <math>z</math> except negative integer values. This definition is not constructive, and gives no straightforward way for the evaluation. Therefore, the integral representation is used as definition. For <math>\Re(z)>-1</math>, define
for all complex <math>z</math> except negative integer values.  
The [[uniqueness]] of function <math>F</math>, satisfying these equations, follows from the
[[Wielandt's theorem]]
<ref name="Wielandt's theorem">
Wielandt's theorem online:  http://www.math.ku.dk/~henrikp/specialtopic2000/node7.html
</ref>
<ref name="reinhold">
Reinhold Remmert
The American Mathematical Monthly, Vol. 103, No. 3 (Mar., 1996), pp. 214-220,  http://www.jstor.org/pss/2975370
</ref>. Historically, the deduction refers to the [[Gamma function]], but the application to the factorial is straightforward.
 
<!-- This definition is not constructive, and gives no easy way for the evaluation.!-->
 
===Definition through the integral===
Usually, the integral representation is used as definition. For <math>\Re(z)>-1</math>, define
:<math> z! = \int_0^\infty t^z \exp(-t) \mathrm{d}t </math>
:<math> z! = \int_0^\infty t^z \exp(-t) \mathrm{d}t </math>


Line 66: Line 82:
The definition above agrees with the combinatoric definition for integer values of the argument; at integer <math>z</math>, the integral can be expressed in terms of the elementary functions.  
The definition above agrees with the combinatoric definition for integer values of the argument; at integer <math>z</math>, the integral can be expressed in terms of the elementary functions.  


[[Image:Factorialz.jpg|400px|right|thumb|<math>f=z!</math> in the complex <math>z</math>-plane.]]
===Extension of integral definition===
The definition through the integral can be extended to the whole complex plane, using relation <math>z!=(z+1)!/(z+1)</math>
{{Image|Factorialz.jpg|right|400px|<math>f=z!</math> in the complex <math>z</math>-plane.}}
for the cases <math>\Re(z)<-1</math>, assuming that <math>z</math> in not negative integer. This allows to plot the map of factorial in the complex plane. In the figure,  
The definition through the integral can be extended to the whole complex plane, using relation  
:<math>z!=(z+1)!/(z+1)</math>
for the cases <math>\Re(z)<-1</math>, assuming that <math>z</math> is not negative integer.
Also, the symmetry formula takes place for the non-integer values of <math>z</math>,
:<math>z! (-z)! =\frac{\pi z}{\sin(\pi z)}</math>
The similar formula of symmetry holds however, for the [[Gamma function]].
From this expression, it follows that <math>\frac{1}{z!(-z)!}</math> is [[entire function]] of <math>z</math>.
Also, this symmetry gives the simple way to express <math>(1/2)!=\sqrt{\pi}/2</math>, and, therefore, factorial of half-integer numbers.
 
<!-- The f allows to plot the map of factorial in the complex plane.  
!-->
In the figure,  
lines of constant <math>u=\Re(z!)</math> and  
lines of constant <math>u=\Re(z!)</math> and  
lines of constant <math>v=\Im(z!)</math> are shown.<br>
lines of constant <math>v=\Im(z!)</math> are shown.<br>
Line 78: Line 105:
The levels v = 1,2,3,4,5,6,7,8,12,16,20,24 are drown with thick blue lines. some of intermediate levels v = const are shown with thin green lines.<br>
The levels v = 1,2,3,4,5,6,7,8,12,16,20,24 are drown with thick blue lines. some of intermediate levels v = const are shown with thin green lines.<br>
The dashed blue line shows the level  <math>u=\mu_0</math> and corresponds to the value <math>\mu_0=(x_0)!\approx 0.85</math> of the principal local minimum <math>x_0\approx 0.45</math> of the factorial of the real argument.<br>
The dashed blue line shows the level  <math>u=\mu_0</math> and corresponds to the value <math>\mu_0=(x_0)!\approx 0.85</math> of the principal local minimum <math>x_0\approx 0.45</math> of the factorial of the real argument.<br>
The dashed red line shows the level   and corresponds to the similar value of the negative local extremum of the factorial of the real argument.<br>
The dashed red line shows the level and corresponds to the similar value of the negative local extremum of the factorial of the real argument.<br>
Due to the fast growth of the function, in the right hand side of the figure, the density of the levels exceeds the ability of the plotter to draw them; so, this part is left empty.
Due to the fast growth of the function, in the right hand side of the figure, the density of the levels exceeds the ability of the plotter to draw them; so, this part is left empty.


==Factorial of the real argument==
==Factorial of the real argument==
[[Image:FactoReal.jpg|400px|right|thumb|
{{Image|FactoReal.jpg|right|400px|
<math>\mathrm{factorial}(x)=x!</math>; the inverse function, id est,  
<math>\mathrm{factorial}(x)=x!</math>; the inverse function, id est,  
<math>\mathrm{factorial}^{-1}(x)</math>, and
<math>\mathrm{factorial}^{-1}(x)</math>, and
<math>\mathrm{factorial}(x)^{-1}</math>  
<math>\mathrm{factorial}(x)^{-1}</math>  
versus real <math>x</math>.]]
versus real <math>x</math>.}}
The definition above was elaborated for factorial of complex argument. In particular, it can be used to evlauate the factorial of the real argument. In the figure at right, the <math>\mathrm{factorial}(x)=x!</math> is plotted versus real <math>x</math> with red line. The function has simple poluses at negative integer <math>x</math>.
The definition above was elaborated for factorial of complex argument. In particular, it can be used to evaluate the factorial of the real argument. In the figure at right, the <math>\mathrm{factorial}(x)=x!</math> is plotted versus real <math>x</math> with red line. The function has simple poluses at negative integer <math>x</math>.


At <math>x\rightarrow -1+o</math>, the <math>x! \rightarrow +\infty</math>.
At <math>x\rightarrow -1+o</math>, the <math>x! \rightarrow +\infty</math>.
Line 93: Line 120:
The factorial has local minimum at  
The factorial has local minimum at  
<!-- :<math>x=\nu_0\approx 0.4616321450</math>  !-->
<!-- :<math>x=\nu_0\approx 0.4616321450</math>  !-->
:<math>x=\nu_0\approx 0.461632144968362341262659542325721328468196204</math>
:<math>x=\nu_0\approx</math>0.461632144968362341262659542325721328468196204
marked in the picture with pink vertical line; at this point, the derivative of the factorial is zero:
marked in the picture with pink vertical line; at this point, the derivative of the factorial is zero:
:<math>\mathrm{factorial}^{\prime}(\nu_0)=0</math>
:<math>\mathrm{factorial}^{\prime}(\nu_0)=0</math>
The value of factorial in this point
The value of factorial in this point
<!-- :<math>\mu_0=\nu_0!=\mathrm{factorial(\nu_0)}\approx 0.8856031944</math>. !-->
<!-- :<math>\mu_0=\nu_0!=\mathrm{factorial(\nu_0)}\approx 0.8856031944</math>. !-->
:<math>\mu_0=\nu_0!=\mathrm{factorial(\nu_0)}\approx  0.88560319441088870027881590058258873320795153367</math>
:<math>\mu_0=\nu_0!=\mathrm{factorial(\nu_0)}\approx  </math>0.88560319441088870027881590058258873320795153367
The Tailor expansion of <math>z!</math> at the point <math>z=\nu_0</math> can be writen ax follows:
The Tailor expansion of <math>z!</math> at the point <math>z=\nu_0</math> can be written as follows:
:<math>z!=\mu_0+\sum_{n=2}^{N-1} c_n (z-\nu_0)^n + \mathcal{O}(z-\nu_0)^N</math>
:<math>z!=\mu_0+\sum_{n=2}^{N-1} c_n (z-\nu_0)^n + \mathcal{O}(z-\nu_0)^N~</math> .
The approximations for the coefficients of this expansion are in the table:
The coefficients of this expansion are copypasted in the table below:
{|class="wikitable" style="margin:0; text-align: right;" cellspacing="0"
{|class="wikitable" style="margin:0; text-align: right;" cellspacing="0"
! <math>n</math>
! <math>n</math>
Line 119: Line 146:
Other local extremums are at negative values of the argument; one of them in shown in the figure above.
Other local extremums are at negative values of the argument; one of them in shown in the figure above.


<!--
===Specific values===
===Specific values===
For several specific values of the argument, the simple representations for the factorial are known. In addition fo the integer values,
For several specific values of the argument, the simple representations for the factorial are known. In addition to the integer values,
<math>\left(-\frac{1}{2}\right)!=\sqrt{\pi}</math>; then, using the relation<math>z!=z\cdot(z+1)!</math>, values at half-integer argument can be expressed; for example, <math>\left(\frac{1}{2}\right)!=\frac{\sqrt{\pi}}{2}\approx 0.8862269255</math> is slightly greater than <math>\mu_0</math>, which is minimal value of this function for the positive values of the argument.
<math>\left(-\frac{1}{2}\right)!=\sqrt{\pi}</math>; then, using the relation<math>z!=z\cdot(z+1)!</math>, values at half-integer argument can be expressed; for example, <math>\left(\frac{1}{2}\right)!=\frac{\sqrt{\pi}}{2}\approx 0.8862269255</math> is slightly greater than <math>\mu_0</math>, which is minimal value of this function for the positive values of the argument.


Values of factorial at integer plus quarter and at integer plut third are mentioned in in textbooks, but these valeus do not have special notations.
Values of factorial at integer plus quarter and at integer plus third are mentioned in in textbooks, but these numbers do not have special names.
!-->


==Related functions==
==The Taylor expansion==
In the figure above, the two other functions are plotted. The first of them is 
The [[Taylor expansion]] of <math>z!</math> at <math>z=0</math>, or the [[MacLaurin expansion]], has the form
: <math>\mathrm{ArcFactorial}(x)=\mathrm{factorial}^{-1}(x)</math>
<math>z!=\sum_{n=0}^{N-1} g_n z^n+\mathcal{O}(z^N)~</math> .  The first coefficients of this expansion are copypasted in the table below:
is the [[inverse function]];
<table border="2" cellpadding="4" cellspacing="2" style="margin: 1em 1em 1em 0; background: #ffffff; border: 1px #aaa solid; border-collapse: collapse;">
:<math>\mathrm{factorial}\Big(\mathrm{ArcFactorial}(x)\Big)=x ~\forall x>\mu_0</math>
<tr><th><math>n</math></th> <th><math>g_n</math></th> <th>approximation of <math>g_n</math></th> </tr>
In the range of [[biholomorphism]], the inverse relation is also valid; in particular,
<tr><td>0</td> <td><math>1</math></td>
:<math>\mathrm{ArcFactorial}\Big(\mathrm{factorial}(x)\Big)=x~ \forall x> \nu_0</math>
<td><math>  1.000000000000000000000000000000000000000000000000000000000000</math></td> </tr>
Specific values of the inverse function:
<tr><td>1</td><td><math>~-\gamma~</math></td>
:<math> \mathrm{ArcFactorial}(\mu_0)=\nu_0</math>,
<td><math>-0.577215664901532860606512090082402431042159335939923598805767</math></td> </tr>
:<math> \mathrm{ArcFactorial}\left(   \frac{\sqrt{\pi}}{2} \right)=\frac{1}{2}</math>,
<tr><td>2</td> <td><math>\frac{\pi^2}{12}+\frac{\gamma^2}{2}</math></td>
:<math> \mathrm{ArcFactorial}\left(  1\right)=1</math>,
<td><math> 0.989055995327972555395395651500634707939183520728214090443192</math></td> </tr>
:<math> \mathrm{ArcFactorial}\left(   2\right)=2</math>,
<tr><td>3</td><td><math>-\frac{\zeta(3)}{3}-\frac{\pi^2\gamma}{12}+\frac{\gamma^3}{6}</math></td>
:<math> \mathrm{ArcFactorial}\left(   6\right)=3</math>.
<td><math>-0.907479076080886289016560167356275114928611449072563760941328</math></td></tr>
<tr><td>4</td><td><math>\frac{\pi^4}{160}+\frac{\zeta(3)}{3}-\frac{\pi^2\gamma^2}{12}+\frac{\gamma^4}{24}</math></td>
<td><math> 0.981728086834400187336380294021850850360573679723465415404953</math></td></tr>
</table>
Here,  <math>\gamma</math> is the [[Euler–Mascheroni constant|Euler constant]] and <math>\zeta</math> is the [[Riemann function]].
The [[Computer algebra system]]s such as [[Maple (sotfware)|Maple]] and [[Mathematica]] can generate many terms of this expansion.
The [[radius of convergence]] of the Taylor series is unity, and the coefficient <math>g_n</math> does not decay as <math>n</math> increases. However, due to the relation <math>z!=z\cdot \mathrm{factorial}(z)</math>, for any real value of argument of factorial, the expansion above can be used for the precise evaluation of factorial of the real argument, running the approximation above for an argument with modulus not larger than half.
Also, the expansion at the half-integer values can be used:
<math>z!=\sum_{n=0}^{N-1} h_n~\left(z-\frac{1}{2}\right)^n+\mathcal{O}\left(\left(z-\frac{1}{2}\right)^N\right)~</math> .  The first coefficients of this expansion are copypasted in the table below:
<table border="2" cellpadding="4" cellspacing="2" style="margin: 1em 1em 1em 0; background: #ffffff; border: 1px #aaa solid; border-collapse: collapse;">
<tr><th><math>n</math></th> <th><math>h_n</math></th> <th>approximation of <math>g_n</math></th> </tr>
<tr><td>0</td> <td><math>\frac{\sqrt{\pi}}{2}</math></td>
<td><math>0.886226925452758013649083741670572591398774728061193564106905  </math></td> </tr>
<tr><td>1</td><td><math>\frac{-\sqrt{\pi}}{2}(\gamma+\log(4)-2)</math></td>
<td><math>0.0323383974488850138288698842689703077813347888705070206366386</math></td> </tr>
<tr><td>2</td> <td><math>\frac{\pi^{5/2}}{8}+\sqrt{\pi}\gamma -\sqrt{\pi}\log(4) +\frac{\gamma^2\sqrt{\pi}}{4} +\sqrt{\pi}\log(2)^2</math></td>
<td><math> 0.414813453688301168230037623111356342848909963370422367977736</math></td> </tr>
<tr><td>3</td><td> long expression</td>
<td><math>-0.107294804564772211687541956389709662054575923821298300938631</math></td></tr>
<tr><td>4</td><td>even longer expression</td>
<td><math>0.144645359044621543038332210253884524070026861530981428414028</math></td></tr>
</table>
The Taylor series of <math>z!</math> developed at <math>z=1/2</math>, converges for all <math>z</math> such that <math>|z-1/2|<3/2</math>.  


In order to boost the approximation of factorial for real values of the argument, and, especially, for the evaluation for complex values, and the evaluation of the inverse function, the expansions for <math>\log(z!)</math>
and <math>1/z!</math> are used instead of the direct Taylor expansions above.


For comparison, in the figure above, the function
==Halving of the imaginary part of the argument==
:<math>f(x)=\mathrm{factorial}(x)^{-1}=(x!)^{-1}=\frac{1}{x!}</math>  
While neither <math>z</math> nor <math>(z+1)/2</math> is negative integer, the argument of factorial can be dropped with the identity
is plotted with the blue curve. This function is [[entire funciton|entire]], id est, it has no singularities, and can used for the approximation of factorial. The [[Tailor series]] for this function always converge (this function has has infinite [[radius of convergence]]).
:<math>
\mathrm{Factorial}(z)~=~\frac{2^z}{\sqrt{\pi}}~
\mathrm{Factorial}\!\left(\frac{z}{2} \right)\cdot
\mathrm{Factorial}\!\left(\frac{z\!-\!1}{2} \right)
</math>
This may be useful to drop with factor 1/2 the imaginary part of the argument (for example, to apply the Taylor expansion above for the evaluation), but the function has to be evaluated twice.


==Inverse function==
==Related functions==
[[Image:ArcGamma.jpg|300px|right|thumb|ArcFactorial in the complex plane.]]
{{Image|ArcGamma.jpg|right|400px|ArcFactorial in the complex plane.}}


In the plot of factorial of the real argument, the two other functions are plotted,
<math>\mathrm{ArcFactorial}(x)=\mathrm{factorial}^{-1}(x)</math> and <math>\mathrm{factorial}(x)^{-1}</math>.
These functions can be useful for the generalization of the factorial and for its evaluation.
===Inverse function===
<div class="thumb tright">
<div class="thumb tright">
<div style="width:19em;">
<div style="width:19em;">
Line 158: Line 220:
|  <math>\mu_0</math>  
|  <math>\mu_0</math>  
     || 0.46163214496836234126265954233
     || 0.46163214496836234126265954233
|-
|  <math>\frac{\sqrt{\pi}}{2}</math>
    || 0.50000000000000000000000000000
|-
|-
| 1 || 1.00000000000000000000000000000
| 1 || 1.00000000000000000000000000000
Line 191: Line 256:
Levels <math>v=-1,-2,-3</math> are shown with thick red curves.<br>
Levels <math>v=-1,-2,-3</math> are shown with thick red curves.<br>
The intermediate levels of constant <math>v</math> are shown with thin dark green curves.
The intermediate levels of constant <math>v</math> are shown with thin dark green curves.
The ArcFactorial has the [[branch point]] <math>\mu_0 \approx 0.85 </math>; the cut of the range of holomorphizm is shown with black dashed line.
The ArcFactorial has the [[branch point]] <math>\mu_0 \approx 0.85 </math>; the cut of the range of holomorphism is shown with black dashed line.
<!-- The figure shows the mapping ot the [[complex plane]] with the factorial function.   
<!-- The figure shows the mapping ot the [[complex plane]] with the factorial function.   
!-->
!-->


ArcFactorial for some real values of the argument is approximated in the table at right.
ArcFactorial for some real values of the argument is approximated in the table at right.
<div class="thumb tright">
<div style="width:19em;">
{|class="wikitable" style="margin:0; text-align: right;" cellspacing="0"
! <math>n</math>
! approximation for <math>d_n</math>
|-
| 1 || 1.43764234228440800
|-
| 2 || 0.315227181071631549
|-
| 3 || -0.0256407066268564423
|-
| 4 || 0.00492170392390056555
|-
|}
</div>
</div>
In vicinity of the branchpoint <math>z=\mu_0</math>, the ArcFactorial can be expanded as follows:
:<math>
\mathrm{ArcFactorial}(z)=\nu_0+\sum_{n=1}^{N-1} d_n\cdot \Big(\log(z/\mu_0) \Big)^{n/2}
</math>
The approximations for the first coefficients of this expansion are copypasted in the table at right.
About of 30 terms in this expansion are sufficient to plot the distribution of the real and the imaginary parts of
ArcFactorial in the figure above.


<!-- In particular, factorial maps the unity to unity; two is mapped to two, and 3 is mapped to 6. !-->
<!-- In particular, factorial maps the unity to unity; two is mapped to two, and 3 is mapped to 6. !-->


==Function <math>f(z)=1/z!</math>==
===Function <math>f(z)=1/z!</math>===
[[Image:OneOverFactorial.jpg|300px|right|thumb|<math>f(z)=\frac{1}{z!}</math> in the complex <math>z</math>-plane.]]
{{Image|OneOverFactorial.jpg|right|400px|<math>f(z)=\frac{1}{z!}</math> in the complex <math>z</math>-plane.}}
The inverse function of factorial, id est, <math>\mathrm{ArcFactorial}(z)=\mathrm{Factorial}^{-1}(z)</math> from the previous section, sohuld not be confused with
The inverse function of factorial, id est, <math>\mathrm{ArcFactorial}(z)=\mathrm{Factorial}^{-1}(z)</math> from the previous section, should not be confused with
<math>f(z)=\frac{1}{z!}=\mathrm{Factorial}(z)^{-1}=\frac{1}{\mathrm{Factorial}(z)}</math>
<math>f(z)=\frac{1}{z!}=\mathrm{Factorial}(z)^{-1}=\frac{1}{\mathrm{Factorial}(z)}</math>
shown in the figure at right.  
shown in the figure at right.  
Line 217: Line 307:
<math>\mathrm{factorial}(\nu_1)=\mu_1</math>.<br>
<math>\mathrm{factorial}(\nu_1)=\mu_1</math>.<br>


<math>f(z)=\frac{1}{z!}</math> is [[entire function]], that grows in the left hand side of the compelx plane and quickly decays to zero along the real axis.
In the upper-left hand side of the figure, and at the lower-left hand side of the figure, the density of levels exceeds the ability of the ploter to draw them, and these parts are left empty.
 
<math>f(z)=\frac{1}{z!}</math> is [[entire function]], that grows in the left hand side of the complex plane and quickly decays to zero along the real axis.
 
<!--
===Evaluation of the factorial===
In principle, the integral representation from the definition above can be used for the evaluation of the factorial. However, such an implementation is not efficient, and is not suitable, when the factorial is used as a component in construction of other functions with complicated representations, involving many evaluations of the factorial. Therefore, the approximations with elementary functions are used. For the efficient evaluation of <math>z!</math>, the approximations for <math>1/(z!)</math> above, of those for <math>\log(z!)</math> are used.
!-->


==Evaluation of the factorial==
In principle, the integral representation from the definition above can be used for the evlauation of the factorial. However, such an implementation is not efficient, and is not suitable, when the factorial is used as a component in construction of other functions with complicated representations, involving many evaluations of the factorial. Therefore, the approximations with elementary functions are used. For the efficient evaluation of <math>z!</math>, the approximatons for <math>1/(z!)</math> above, of those for
<math>\log(z!)</math> are used.
===Logfactorial===
===Logfactorial===
{{Image|LogFactorialZ.jpg|right|400px|LogFactorial at the complex plane.}}
For the approximation of factorial, if can be represented in the form  
For the approximation of factorial, if can be represented in the form  
: <math> z!=\exp(\mathrm{LogFactorial}(z)) </math>
: <math> z!=\exp(\mathrm{LogFactorial}(z)) </math>
Function LogFactorial has singularities at the same points, as the factorial, id est, at negative integer values of the argument. However, far from the negative part of the real axis, the function LogFactorial can be approximated through the coninual fraction 
====Plof of LogFactorial====
<math>p</math>:
Function LogFactorial is shown in figure with lines of constant real part and lines of constant imaginary part.
: <math>\mathrm{LogFactorial}(z)= p(z) +  \log(2\pi)/2 - z + (z+1/2)~\log(z)</math>
Levels of constant <math>u=\Re(\mathrm{LogFactorial}(z))</math> and
: <math>p(z)= \frac{a_0}{z+\frac{a_1}{z+\frac{a_2}{z+\frac{a_3}{z+..}}}}</math>
Levels of constant <math>v=\Im(\mathrm{LogFactorial}(z))</math> are drawn with solid lines:<br>
The coefficients of this approximation are in the table
Levels <math>u=-24,-20,-16,-12,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,12,16,20,24</math> are shown with thick black curves. <br>
Levels <math>u=
-3.8,-3.6,-3.4,-3.2
-2.8,-2.6,-2.4,-2.2
-1.8,-1.6,-1.4,-1.2
-0.8,-0.6,-0.4,-0.2</math> are shown with thin red curves.<br>
Levels <math>u=
0.2,0.4,0.6,0.8
1.2,1.4,1.6,1.8
2.2,2.4,1.6,2.8
3.2,3.4,3.6,3.8</math> are shown with thin blue curves.<br>
Levels <math>v=-24,-20,-16,-12,-8,-7,-6,-5,-4,-3,-2,-1</math> are shown with thick red curves.<br>
Level <math>v=0</math> is shown with thick pink line.<br>
Levels <math>v=1,2,3,4,5,6,7,8,12,16,20,24</math> are  shown with thick blue lines.<br>
Levels <math>v=
-3.8,-3.6,-3.4,-3.2
-2.8,-2.6,-2.4,-2.2
-1.8,-1.6,-1.4,-1.2
-0.8,-0.6,-0.4,-0.2
0.2,0.4,0.6,0.8
1.2,1.4,1.6,1.8
2.2,2.4,1.6,2.8
3.2,3.4,3.6,3.8</math> are shown with thin green curves.<br>
The cut of range of [[holomorphism]] is shown with black dashed line.
 
Function LogFactorial has singularities at the same points, as the factorial, id est, at negative integer values of the argument.


====Approximation of LogFactorial at large values of the argument====
<div class="thumb tright">
<table border="2" cellpadding="4" cellspacing="2" style="margin: 1em 1em 1em 0; background: #ffffff; border: 1px #aaa solid; border-collapse: collapse;">
<table border="2" cellpadding="4" cellspacing="2" style="margin: 1em 1em 1em 0; background: #ffffff; border: 1px #aaa solid; border-collapse: collapse;">
<tr> <th><math>n</math></th> <th><math>a_n</math></th> <th>approximation</th> </tr>
<tr> <th><math>n</math></th> <th><math>a_n</math></th> <th>approximation of <math>a_n</math></th> </tr>
<tr> <td>0</td>  <td>    1 /  12 </td>  <td>0.083333333333333333</td> </tr>
<tr> <td>0</td>  <td>    1 /  12 </td>  <td>0.083333333333333333</td> </tr>
<tr> <td>1</td> <td>    1 /  30 </td>  <td>0.033333333333333333</td> </tr>
<tr> <td>1</td> <td>    1 /  30 </td>  <td>0.033333333333333333</td> </tr>
<tr> <td>2</td> <td>  53 / 210 </td>  <td>0.252380952380952381</td> </tr>
<tr> <td>2</td> <td>  53 / 210 </td>  <td>0.252380952380952381</td> </tr>
<tr> <td>3</td> <td> 195 / 371 </td>  <td>0.525606469002695418</td> </tr>
<tr> <td>3</td> <td> 195 / 371 </td>  <td>0.525606469002695418</td> </tr>
</table>
</table></div>
Far from the negative part of the real axis, the function LogFactorial can be approximated through the continual fraction 
<math>p</math>:
: <math>\mathrm{LogFactorial}(z)= p(z) +  \log(2\pi)/2 - z + (z+1/2)~\log(z)</math>
: <math>p(z)= \frac{a_0}{z+\frac{a_1}{z+\frac{a_2}{z+\frac{a_3}{z+..}}}}</math>
The coefficients <math>a</math> and their approximate evaluations are copypasted in the table at right.
 


In vicinity of the real axis, while the modulus of the imaginary part of LogFactorial does not exceed <math>\pi</math>, the
In vicinity of the real axis, while the modulus of the imaginary part of LogFactorial does not exceed <math>\pi</math>, the
LogFactorial can be interpreted as lofarithm of factorial, id est,
LogFactorial can be interpreted as logarithm of factorial, id est,
: <math>\mathrm{LogFactorial}(z)=\log(z!)</math>
: <math>\mathrm{LogFactorial}(z)=\log(z!)</math>
In particular, this relation is valid for positive real values of <math>z</math>.
In particular, this relation is valid for positive real values of <math>z</math>.


For all <math>z</math> except negative integers,  <math> z!=\exp\!\Big(\mathrm{LogFactorial}(z)\Big)</math>
However, the LogFactorial has singularities at negative integer valies of the argument.
===Stirling formula===
Historically, one of the first approximations of the factorial with elementary  functions was the [[Stirling formula]] below.
Historically, one of the first approximations of the factorial with elementary  functions was the [[Stirling formula]] below.
==Stirling's formula==
For large ''n'' there is an approximation due to Scottish mathematician [[James Stirling]]
For large ''n'' there is an approximation due to Scottish mathematician [[James Stirling]]
:<math> n! \approx \sqrt{2\pi} n^{n+1/2} e^{-n} . \,</math>
:<math> n! \approx \sqrt{2\pi} n^{n+1/2} e^{-n} . \,</math>
This formula can be obtained from the approximation for LogFactorial above, just replacing <math>p(z)</math> to zero.


==References==
{{reflist}}


* {{cite book | author=Ronald L. Graham | coauthors=Donald E. Knuth, Oren Patashnik | title=Concrete Mathematics | publisher=[[Addison Wesley]] | year=1989 | isbn=0-201-14236-8 | pages=111,332 }}


==References==
* http://tori.ils.uec.ac.jp/TORI/index.php/Factorial
* {{cite book | author=Ronald L. Graham | coauthors=Donald E. Knuth, Oren Patashnik | title=Concrete Mathematics | publisher=[[Addison Wesley]] | year=1989 | isbn=0-201-14236-8 | pages=111,332 }}

Latest revision as of 09:31, 10 October 2013

This article is developed but not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
Code [?]
 
This editable, developed Main Article is subject to a disclaimer.
0 1
1 1
2 2
3 6
4 24
5 120
6 720
7 5040
8 40320
9 362880
10 3628800

In mathematics, the factorial is the meromorphic function with fast growth along the real axis; for non-negative integer values of the argument, this function has integer values. Frequently, the postfix notation is used for the factorial of number . For integer , the gives the number of ways in which n labelled objects (for example the numbers from 1 to n) can be arranged in order. These are the permutations of the set of objects. In some programming languages, both n! and factorial(n) , or Factorial(n), are recognized as the factorial of the number .

Integer values of the argument

For integer values of the argument, the factorial can be defined by a recurrence relation. If n labelled objects have to be assigned to n places, then the n-th object can be placed in one of n places: the remaining n-1 objects then have to be placed in the remaining n-1 places, and this is the same problem for the smaller set. So we have

and it follows that

which we could derive directly by noting that the first element can be placed in n ways, the second in n-1 ways, and so on until the last element can be placed in only one remaining way.

Since zero objects can be arranged in just one way ("do nothing") it is conventional to put 0! = 1.

The factorial function is found in many combinatorial counting problems. For example, the binomial coefficients, which count the number of subsets size r drawn from a set of n objects, can be expressed as

The factorial function can be extended to arguments other than positive integers: this gives rise to the Gamma function.

Definitions

For complex values of the argument, the combinatoric definition above should be extended.

Implicit definition

The factorial can be defined as unique meromorphic function , satisfying relations

for all complex except negative integer values. The uniqueness of function , satisfying these equations, follows from the Wielandt's theorem [1] [2]. Historically, the deduction refers to the Gamma function, but the application to the factorial is straightforward.


Definition through the integral

Usually, the integral representation is used as definition. For , define

Such definition is similar to that of the Gamma function, and leads to the relation

for all complex except the negative integer values.

The definition above agrees with the combinatoric definition for integer values of the argument; at integer , the integral can be expressed in terms of the elementary functions.

Extension of integral definition

in the complex -plane.

The definition through the integral can be extended to the whole complex plane, using relation

for the cases , assuming that is not negative integer. Also, the symmetry formula takes place for the non-integer values of ,

The similar formula of symmetry holds however, for the Gamma function. From this expression, it follows that is entire function of . Also, this symmetry gives the simple way to express , and, therefore, factorial of half-integer numbers.

In the figure, lines of constant and lines of constant are shown.
The levels u = − 24, − 20, − 16, − 12, − 8, − 7, − 6, − 5, − 4, − 3, − 2, − 1,0,1,2,3,4,5,6,7,8,12,16,20,24 are drown with thick black lines.
Some of intermediate levels u = const are shown with thin blue lines for positive values and with thin red lines for negative values.
The levels v = − 24, − 20, − 16, − 12, − 8, − 7, − 6, − 5, − 4, − 3, − 2, − 1 are shown with thick red lines.
The level v = 0 is shown with thick pink lines.
The levels v = 1,2,3,4,5,6,7,8,12,16,20,24 are drown with thick blue lines. some of intermediate levels v = const are shown with thin green lines.
The dashed blue line shows the level and corresponds to the value of the principal local minimum of the factorial of the real argument.
The dashed red line shows the level and corresponds to the similar value of the negative local extremum of the factorial of the real argument.
Due to the fast growth of the function, in the right hand side of the figure, the density of the levels exceeds the ability of the plotter to draw them; so, this part is left empty.

Factorial of the real argument

; the inverse function, id est, , and versus real .

The definition above was elaborated for factorial of complex argument. In particular, it can be used to evaluate the factorial of the real argument. In the figure at right, the is plotted versus real with red line. The function has simple poluses at negative integer .

At , the .

The local minimum

The factorial has local minimum at

0.461632144968362341262659542325721328468196204

marked in the picture with pink vertical line; at this point, the derivative of the factorial is zero:

The value of factorial in this point

0.88560319441088870027881590058258873320795153367

The Tailor expansion of at the point can be written as follows:

.

The coefficients of this expansion are copypasted in the table below:

approximation of
2 0.428486815855585429730209907810650582960483696962
3 -0.130704158939785761928008749242671025181542078103
4 0.160890753325112844190519489594363387594505844657
5 -0.092277030213334350126864106458600575084335085690

This expansion can be used for the precise evaluation of the inverse function of factorial (arcfactorial) in vicinity of the branchpoint.

Other local extremums are at negative values of the argument; one of them in shown in the figure above.


The Taylor expansion

The Taylor expansion of at , or the MacLaurin expansion, has the form . The first coefficients of this expansion are copypasted in the table below:

approximation of
0
1
2
3
4

Here, is the Euler constant and is the Riemann function. The Computer algebra systems such as Maple and Mathematica can generate many terms of this expansion. The radius of convergence of the Taylor series is unity, and the coefficient does not decay as increases. However, due to the relation , for any real value of argument of factorial, the expansion above can be used for the precise evaluation of factorial of the real argument, running the approximation above for an argument with modulus not larger than half. Also, the expansion at the half-integer values can be used: . The first coefficients of this expansion are copypasted in the table below:

approximation of
0
1
2
3 long expression
4even longer expression

The Taylor series of developed at , converges for all such that .

In order to boost the approximation of factorial for real values of the argument, and, especially, for the evaluation for complex values, and the evaluation of the inverse function, the expansions for and are used instead of the direct Taylor expansions above.

Halving of the imaginary part of the argument

While neither nor is negative integer, the argument of factorial can be dropped with the identity

This may be useful to drop with factor 1/2 the imaginary part of the argument (for example, to apply the Taylor expansion above for the evaluation), but the function has to be evaluated twice.

Related functions

(CC) Image: Dmitrii Kouznetsov
ArcFactorial in the complex plane.

In the plot of factorial of the real argument, the two other functions are plotted, and . These functions can be useful for the generalization of the factorial and for its evaluation.

Inverse function

ArcFactorial
0.46163214496836234126265954233
0.50000000000000000000000000000
1 1.00000000000000000000000000000
2 2.00000000000000000000000000000
3 2.40586998630956692469992921838
4 2.66403279720644615568638939436
5 2.85235545803172783164299808684
6 3.00000000000000000000000000000

Inverse function of factorial can be defined with equation

and condition that ArcFactorial is holomorphic in the comlex plane with cut along the part of the real axis, that begins at the minimum value of the factorial of the positive argument, and extends to . This function is shown with lines of constant real part and lines of constant imaginary part .

Levels are shown with thick black curves.
Levels are shown with thin blue curves.
Levels are shown with thick blue curves.
Level is shown with thick pink line.
Levels are shown with thick red curves.
The intermediate levels of constant are shown with thin dark green curves. The ArcFactorial has the branch point ; the cut of the range of holomorphism is shown with black dashed line.

ArcFactorial for some real values of the argument is approximated in the table at right.

approximation for
1 1.43764234228440800
2 0.315227181071631549
3 -0.0256407066268564423
4 0.00492170392390056555

In vicinity of the branchpoint , the ArcFactorial can be expanded as follows:

The approximations for the first coefficients of this expansion are copypasted in the table at right. About of 30 terms in this expansion are sufficient to plot the distribution of the real and the imaginary parts of ArcFactorial in the figure above.


Function

(CC) Image: Dmitrii Kouznetsov
in the complex -plane.

The inverse function of factorial, id est, from the previous section, should not be confused with shown in the figure at right. The lines of constant and the lines of constant are drawn.
The levels are shown with thick black lines.
The levels are shown with thick red lines.
The level is shown with thick pink line.
The levels are shown with thick blue lines.
Some of intermediate elvels const are shown with thin red lines for negative values and thin blue lines for the positive values.
Some of intermediate elvels const are shown with thin green lines.
The blue dashed curves represent the level and correspond to the positive local maximum of the inverse function of the real argument.
The red dashed curves represent the level , which corresponds to the first negative local maximum of the factorial of the real argument; ; .

In the upper-left hand side of the figure, and at the lower-left hand side of the figure, the density of levels exceeds the ability of the ploter to draw them, and these parts are left empty.

is entire function, that grows in the left hand side of the complex plane and quickly decays to zero along the real axis.


Logfactorial

Template:CC-Image
LogFactorial at the complex plane.

For the approximation of factorial, if can be represented in the form

Plof of LogFactorial

Function LogFactorial is shown in figure with lines of constant real part and lines of constant imaginary part. Levels of constant and Levels of constant are drawn with solid lines:
Levels are shown with thick black curves.
Levels are shown with thin red curves.
Levels are shown with thin blue curves.
Levels are shown with thick red curves.
Level is shown with thick pink line.
Levels are shown with thick blue lines.
Levels are shown with thin green curves.
The cut of range of holomorphism is shown with black dashed line.

Function LogFactorial has singularities at the same points, as the factorial, id est, at negative integer values of the argument.

Approximation of LogFactorial at large values of the argument

approximation of
0 1 / 12 0.083333333333333333
1 1 / 30 0.033333333333333333
2 53 / 210 0.252380952380952381
3 195 / 371 0.525606469002695418

Far from the negative part of the real axis, the function LogFactorial can be approximated through the continual fraction :

The coefficients and their approximate evaluations are copypasted in the table at right.


In vicinity of the real axis, while the modulus of the imaginary part of LogFactorial does not exceed , the LogFactorial can be interpreted as logarithm of factorial, id est,

In particular, this relation is valid for positive real values of .

For all except negative integers,

However, the LogFactorial has singularities at negative integer valies of the argument.

Stirling formula

Historically, one of the first approximations of the factorial with elementary functions was the Stirling formula below. For large n there is an approximation due to Scottish mathematician James Stirling

This formula can be obtained from the approximation for LogFactorial above, just replacing to zero.

References

  1. Wielandt's theorem online: http://www.math.ku.dk/~henrikp/specialtopic2000/node7.html
  2. Reinhold Remmert The American Mathematical Monthly, Vol. 103, No. 3 (Mar., 1996), pp. 214-220, http://www.jstor.org/pss/2975370