# Talk:Factorial

I would like to propose adding Avogadro's number  (NA = 6.02214076×1023) to the table of factorials. It has some practical significance in that the factorial is the number of possible arrangements of molecules in one mole of gas.--agr (talk) 16:57, 20 December 2021 (UTC)

Nope. I see no evidence that this is a significant enough connection to factorials to mention anywhere in the article, let alone to put in the table in the lead. I can find some sources (chemistry texts mostly) noting that the factorial of Avogadro's number is huge; they don't tend to give the value. I am trying to clean the article of cruft, not add more. —David Eppstein (talk) 17:11, 20 December 2021 (UTC)
I appreciate your efforts to remove cruft, bit if some textbooks mention NA! without giving a value, it seems to me that gives NA! a better claim to be in the table than most of the other rows, which offer no such provenance.--agr (talk) 20:05, 24 December 2021 (UTC)
Re the need for sourcing calculations, see WP:CALC. Re the notability of "googolbang" at the last line of the table, for instance, see [1] and [2]. —David Eppstein (talk) 20:25, 24 December 2021 (UTC)
I don't think we need to say anything about 
  
    
      
        
          N
          
            A
          
        
        !
      
    
    {\displaystyle N_{A}!}
  
 specifically. It is true more generally that factorials naturally appear in formulae from quantum and statistical physics, because one considers all the possible permutations of a set of particles. There might be something worth saying about that in the article; I'll have to think about it. XOR'easter (talk) 20:52, 24 December 2021 (UTC)
Something like that could definitely go in the applications section (probably in the paragraph about applications to fields beyond mathematics) if it can be adequately sourced. —David Eppstein (talk) 20:54, 24 December 2021 (UTC)
Here's a draft of a sentence we could use for the statistical side of this, but I'm not sure of the best source for it. Also because this is material I'm unfamiliar with I'm likely to have made a mistake in summarizing it or in choosing the level of detail appropriate for this topic: "In statistical mechanics, calculations of entropy such as Boltzmann's entropy formula or the Sackur–Tetrode equation must correct the count of microstates by dividing by the factorials of the numbers of each type of indistinguishable particle to avoid the Gibbs paradox." — Preceding unsigned comment added by David Eppstein (talk • contribs) 
That sounds right, and it could be sourced to pages 107–110 of the textbook that I added. XOR'easter (talk) 17:09, 25 December 2021 (UTC)

This review is transcluded from Talk:Factorial/GA2. The edit link for this section can be used to add comments to the review.
Reviewer: Vogon101 (talk · contribs) 17:48, 4 January 2022 (UTC)

Taking this on as part of the January Drive. Previous reviewer David Eppstein has put in a lot of work to bring this up to standard (thanks!), article does indeed seem much improved!

Other comments / improvements:

In Applicatios (computer science) might it be worth explicitly mentioning 
  
    
      
        O
        (
        
          log
          
            2
          
        
        ⁡
        n
        )
        ∈
        O
        (
        n
        log
        ⁡
        n
        )
      
    
    {\displaystyle O(\log _{2}n)\in O(n\log n)}
  
 given that form would be more commonly known
Ok, expanded 
  
    
      
        
          log
          
            2
          
        
        ⁡
        n
        !
        =
        n
        
          log
          
            2
          
        
        ⁡
        n
        −
        O
        (
        n
        )
      
    
    {\displaystyle \log _{2}n!=n\log _{2}n-O(n)}
  
 (but because this is a lower bound, writing 
  
    
      
        O
        (
        n
        log
        ⁡
        n
        )
      
    
    {\displaystyle O(n\log n)}
  
 is incorrect; if written in that form it should be 
  
    
      
        Ω
        (
        n
        log
        ⁡
        n
        )
      
    
    {\displaystyle \Omega (n\log n)}
  
 but I don't want to take the space here to explain Omega and anyway 
  
    
      
        n
        
          log
          
            2
          
        
        ⁡
        n
        −
        O
        (
        n
        )
      
    
    {\displaystyle n\log _{2}n-O(n)}
  
 is more accurate). —David Eppstein (talk) 18:29, 4 January 2022 (UTC)
Yeah - just feel a computer science user would recognise that better, and absolutely right you don't wanna get into omega/big o/theta etc... will continue review today Vogon101 (talk) 10:12, 5 January 2022 (UTC)
Should the equation for Euler's reflection formula include the not in Z as stated in other sources? I think it might be possible also to state the line before slightly more clearly took me a short second to understand. Perhaps something like "This definition can be extended to the rest of the complex plane by solving Euler's reflection formula (EQN). However this fails to assign a value to the gamma function: the reflection formula only holds for non-integer values of z to avoid division by 0" though I recognise that's getting very clunky

  
    
      
        Γ
        (
        z
        )
        Γ
        (
        1
        −
        z
        )
        =
        
          
            π
            
              sin
              ⁡
              π
              z
            
          
        
        ,
        
        z
        ∉
        
          Z
        
        .
      
    
    {\displaystyle \Gamma (z)\Gamma (1-z)={\frac {\pi }{\sin \pi z}},\qquad z\not \in \mathbb {Z} .}
  

Reworded. —David Eppstein (talk) 18:54, 5 January 2022 (UTC)
The line "The greatest common divisor of the values of a primitive polynomial over ... degree" could be clearer
Reworded. —David Eppstein (talk) 18:54, 5 January 2022 (UTC)
The code in "Computation" section, to my mind, could be formatted better - currently it's in a bi template, I see no reason for it not to be a code block. Granted - it's pseudo code - but to my eyes it's strange to have it in text style like that. Makes article flow less well
<syntaxhighlight> only permits monospaced typewriter text. That would make the variables in the code inconsistent in appearance with the same variables in the article text, undesirable. —David Eppstein (talk) 18:54, 5 January 2022 (UTC)

The statement "There are infinitely many ways to extend the factorials to a continuous function." is true, but trivial and rather useless. As the cited source states, This is ridiculously easy to solve. [...] Merely take a pencil and draw some curve—any curve will do—which passes through the points. Such a curve automatically defines a function which solves the interpolation problem. This is of course true of any set of discrete points. The interesting part is that there are infinite ways to do it within certain confines, most importantly while still satisfying the recurrence relation. I therefore added the qualifier "that satisfies the recurrence relation 
  
    
      
        f
        (
        x
        +
        1
        )
        =
        (
        x
        +
        1
        )
        ⋅
        f
        (
        x
        )
      
    
    {\displaystyle f(x+1)=(x+1)\cdot f(x)}
  
 for non-integer values", which was reverted on the basis that it would exclude an interpolation based on Hadamard's gamma function. That, to me, misses the point. It also excludes interpolating the points linearly or indeed arbitrarily. I suppose it would be possible to rephrase it to make both statements at once (e.g. "There are infinitely many ways to extend the factorials to a continuous function, which remains true if the resulting function 
  
    
      
        f
      
    
    {\displaystyle f}
  
 is required to satisfy the recurrence relation 
  
    
      
        f
        (
        x
        +
        1
        )
        =
        (
        x
        +
        1
        )
        ⋅
        f
        (
        x
        )
      
    
    {\displaystyle f(x+1)=(x+1)\cdot f(x)}
  
 for non-integer values."), but I don't think the bare statements that we have now is satisfactory. TompaDompa (talk) 11:36, 19 August 2023 (UTC)

The point is that you have to constrain things somehow to be able to say that Gamma is the canonical interpolation. Your edit adds half the constraint, turning that thought from "you have to constrain things" to "we have already constrained things but you have to constrain more things". What is so natural about that choice? Why not instead start with the other half of the Bohr–Mollerup theorem, and only consider log-convex functions? Or why not leave the constraints out of it until they are needed for uniqueness? I'm not embarrassed to say trivial things when they're relevant. Not every statement in our mathematics articles has to have deep reasoning behind it. —David Eppstein (talk) 13:02, 19 August 2023 (UTC)
The recurrence relation is a fundamental and defining property of factorials—it's what makes factorials factorials, so to speak. When I first heard of interpolating factorials many years ago, I took for granted that the recurrence relation would hold for the non-integer relations, because I thought that without that property it wouldn't be much of an interpolating function. The non-uniqueness of the Gamma function in this regard is, I think, very important. TompaDompa (talk) 16:07, 19 August 2023 (UTC)
Hadamard's Γ obeys a form of the recurrence relation. But it is a form with an extra term that happens to be zero on the positive integers. —David Eppstein (talk) 07:35, 20 August 2023 (UTC)
I must admit that I don't understand what you're getting at. TompaDompa (talk) 07:53, 20 August 2023 (UTC)
Hadamard's gamma function#Properties. When you generalize from integers to reals, it may be the case that part of a formula that vanish for integers becomes visible for reals. So although I agree that the usual Γ is usually the correct interpolation, I don't see the rationale for insisting that only functions obeying the integer version of the recurrence can be of any interest. —David Eppstein (talk) 09:15, 20 August 2023 (UTC)
That's not what I'm saying. What I'm saying is way closer to the Gamma function not being the "correct" interpolation—or perhaps even more to the point not the correct interpolation. Had there been infinitely many interpolations but only one satisfying the recurrence relation for non-integer values, it may very well have been the case that many interpolations are interesting for one reason or another but the only one with that property might be considered the "correct" extension to non-integer values. But that's not the case (and what I wanted to make clearer to readers). The Gamma function is the most commonly used interpolation because it has useful properties, but using it to extend the factorials to non-integer values, in general, is convention rather than correct. TompaDompa (talk) 17:20, 20 August 2023 (UTC)

I couldn't find anything about the factorial of the imaginary unit on this page. Adding the factorial of the imaginary unit can be quite useful. Bera678 (talk) 16:18, 21 December 2023 (UTC)

You probably could find a section titled "Continuous interpolation and non-integer generalization" and headed by "Main article: Gamma function". That suggests that if this material is anywhere it should be in the Gamma function article. However, I did not see anything about 
  
    
      
        Γ
        (
        i
        +
        1
        )
      
    
    {\displaystyle \Gamma (i+1)}
  
 in Gamma function#Particular values. Is there any reason to think that 
  
    
      
        i
        +
        1
      
    
    {\displaystyle i+1}
  
 has any special meaning as a parameter of the Gamma function, making it significant enough to report its value in that article? —David Eppstein (talk) 16:58, 21 December 2023 (UTC)
You may want to go here to find what you’re looking for: Particular values of the gamma function#Imaginary and complex arguments 107.9.41.132 (talk) 00:42, 25 January 2025 (UTC)

Is the reference ok it' s all ok even in the version in Spanish it is https://es.wikipedia.org/wiki/Factorial#Soluci%C3%B3n_n%C3%BAmero_negativo_factorial
So, why they regressed my edition? Arrobaman (talk) 22:47, 30 December 2023 (UTC)

The reason given for the first revert was "not an improvement, broken citation, technically not make reader understand". The reason given for the second revert was "This was recently reverted. Please do not reinsert it without first discussing it on the talk page". Another reason would be that the standard extension of the factorial to numbers other than the non-negative integers is given by the gamma function and that function diverges to infinity rather than having a finite value at all negative integers. Additionally, the link you give cannot be used as a reference (Wikipedia cannot be used as a reference for itself). —David Eppstein (talk) 22:59, 30 December 2023 (UTC)
That is not true the gamma function is for $(n -1)!$ and the equation that I make reference find value for $(-n)!$ and the reference is to this paper https://figshare.com/articles/journal_contribution/beta_SM_project/24901614 Arrobaman (talk) 23:06, 30 December 2023 (UTC)
That is also not a reliable source. And do you really think there is a difference between 
  
    
      
        (
        n
        −
        1
        )
        !
      
    
    {\displaystyle (n-1)!}
  
 (for 
  
    
      
        n
      
    
    {\displaystyle n}
  
 a non-positive integer) and 
  
    
      
        (
        −
        n
        )
        !
      
    
    {\displaystyle (-n)!}
  
 (for 
  
    
      
        n
      
    
    {\displaystyle n}
  
 a positive integer)? They are both expressions for the factorial function at negative integers. Besides being incorrect (for the standard extension of factorial to gamma) this material appears to be original research, forbidden on both the Spanish and English Wikipedias. —David Eppstein (talk) 23:27, 30 December 2023 (UTC)
Yet another problem is the equation

  
    
      
        
          
            
              
                
                  
                    
                      
                        
                          n
                          +
                          1
                        
                        
                          n
                          !
                        
                      
                    
                    =
                    (
                    −
                    1
                    
                      )
                      
                        n
                      
                    
                    (
                    −
                    n
                    )
                    !
                  
                
              
            
          
        
      
    
    {\displaystyle {\displaystyle {\displaystyle {\displaystyle {\frac {n+1}{n!}}=(-1)^{n}(-n)!}}}}
  

uses 
  
    
      
        (
        −
        n
        )
        !
      
    
    {\displaystyle (-n)!}
  
 before it is defined.—Anita5192 (talk) 23:36, 30 December 2023 (UTC)
I remember you and import limit of the gamma function is that he can' t represent negative factorial that' s why the limits are infinity to 0  if can resolve also negative factorials will be to infinity to -infinity.
And what you say of original research if you read a little bit more you can see "material—such as facts, allegations, and ideas" is some of this the paper I making reference no so it not a original research.
And what Anita say is just the equation you have to isolate $(-n)!$ having the solution
$(-n)! = \frac{n +1}{n! (-1)^n}$ Arrobaman (talk) 23:44, 30 December 2023 (UTC)
Can I make the modification? Arrobaman (talk) 11:59, 31 December 2023 (UTC)
These equations are mathematically incorrect. Please do not insert them again.—Anita5192 (talk) 13:35, 31 December 2023 (UTC)
Why is incorrect? Explain to me please Arrobaman (talk) 13:45, 31 December 2023 (UTC)
Please read the lead carefully and you will see that the factorial function and the gamma function are not defined at all for negative integers. Thus the equations you inserted make no sense at all.—Anita5192 (talk) 15:14, 31 December 2023 (UTC)
Do you even read the paper that I' m making reference? Look the name of the paper is Beta SM project in the introduction say the objective of the project is literally this "This project want to resolve all the problems or functions that are calculations with a difficult solution or they are limits of the basis of mathematical" [8] so yes is solving a problem of the maths is the point of the paper.
Before we continue talking please read the paper that I' m making reference and please also read this Wikipedia:Edit warring#The three-revert rule Arrobaman (talk) 15:30, 31 December 2023 (UTC)
Your above cites are not WP:reliable sources and cannot therefore be used here. Otherwise, I fully agree with Anita192. D.Lazard (talk) 16:14, 31 December 2023 (UTC)
You are right figshare isn' t a very good reference I will comment the problem that you say to the mail of the author Arrobaman (talk) 16:51, 31 December 2023 (UTC)

Why isn't the Pi Function discussed? Pi(x)=Gamma(x+1)=x!=the integral from 0 to infinity of t^x * e^-tdt. Derek Verduijn (talk) 11:04, 22 November 2024 (UTC)

I don't think the Pi function may be included, as it basically the same thing as changing the gamma function with its input is by adding 1: 
  
    
      
        Π
        (
        x
        )
        =
        Γ
        (
        x
        +
        1
        )
      
    
    {\displaystyle \Pi (x)=\Gamma (x+1)}
  
, which seems to be redundant. The article should provide the understanding, not the technical confusing symbols per WP:TECHNICAL. Here, the article is focus on factorial only: its basic concept, definition, and its appearance in different fields. Dedhert.Jr (talk) 11:14, 22 November 2024 (UTC)
Discussing the Pi function here would require reliable sources establishing that this variant of the Gamma function is still in common use. This seems not the case. Moreover, using both Gamma and Pi function would be confusing, because of the need of distinguish many formulas from similar formulas resulting from a shift of 1 of the variable. In  Gamma function#19th century: Gauss, Weierstrass and Legendre, you will find a discussion on the historical choice of Gamma over Pi. D.Lazard (talk) 11:59, 22 November 2024 (UTC)

Should there be a section on why negative factorials (like -1! = undefined) are calculated as undefined? Alimsts (talk) 20:14, 16 May 2025 (UTC)

Negative factorials are not "calculated as undefined". They are not defined. Similarly, the factorial of ⁠
  
    
      
        
          
            2
          
        
      
    
    {\displaystyle {\sqrt {2}}}
  
⁠ is not defined. It is silly to try to explain why people do not define something. This is already sufficiently difficult to explain why common definitions have been chosen as they are. D.Lazard (talk) 20:34, 16 May 2025 (UTC)
Well, if we can find a high-quality source that properly explains why they are undefined (not so much because nobody has bothered to define them, but because it is impossible to define a numerical value that fits the recurrence equation) we could add a brief note to the definition section. My own searches were not promising, though, turning up lots of low-quality sources that instead said that the factorial of a negative number was defined as infinite, or defined as some integer multiple of the infinite value of –1!, or some such. —David Eppstein (talk) 20:42, 16 May 2025 (UTC)
(edit conflict) This being said, the factorial is formally defined by ⁠
  
    
      
        0
        !
        =
        1
      
    
    {\displaystyle 0!=1}
  
⁠ and ⁠
  
    
      
        n
        !
        =
        n
        ⋅
        (
        n
        −
        1
        )
        !
      
    
    {\displaystyle n!=n\cdot (n-1)!}
  
⁠. In the case of ⁠
  
    
      
        n
        =
        0
      
    
    {\displaystyle n=0}
  
⁠, this would give ⁠
  
    
      
        1
        =
        0
        !
        =
        0
        ⋅
        (
        −
        1
        )
        !
      
    
    {\displaystyle 1=0!=0\cdot (-1)!}
  
⁠, that is, ⁠
  
    
      
        (
        −
        1
        )
        !
        =
        
          
            1
            0
          
        
      
    
    {\displaystyle (-1)!={\frac {1}{0}}}
  
⁠. For the generalization of the factorial to values that are not natural numbers, you may see Gamma function. D.Lazard (talk) 20:51, 16 May 2025 (UTC)