Empty product

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In mathematics, an empty product, or nullary product, is the result of multiplying no factors. It is by convention equal to the multiplicative identity 1 (assuming there is an identity for the multiplication operation in question), just as the empty sum—the result of adding no numbers—is by convention zero, or the additive identity.[1][2][3]

The term "empty product" is most often used in the above sense when discussing arithmetic operations. However, the term is sometimes employed when discussing set-theoretic intersections, categorical products, and products in computer programming; these are discussed below.

Nullary arithmetic product[edit]


Let a1, a2, a3,... be a sequence of numbers, and let

P_m = \prod_{i=1}^m a_i = a_1 \cdots  a_m

be the product of the first m elements of the sequence. Then

P_m = a_m \cdot P_{m-1}

for all m = 1,2,... provided that we use the following conventions: P_1 = a_1 and P_0=1. In other words, a "product" P_1 with only one factor evaluates to that factor, while a "product" P_0 with no factors at all evaluates to 1. Allowing a "product" with only one or zero factors reduces the number of cases to be considered in many mathematical formulas. Such "products" are natural starting points in induction proofs, as well as in algorithms. For these reasons, the "empty product is one convention" is common practice in mathematics and computer programming.

Frequent examples[edit]

Two often-seen instances are 0! = 1 (zero factorial is one) and x0 = 1 (see zero to the power of zero for a discussion when x=0). Likewise, if M is an n × n matrix then M0 is the n × n identity matrix.

More examples of the use of the empty product in mathematics may be found in the binomial theorem, factorial, fundamental theorem of arithmetic, birthday paradox, Stirling number, König's theorem, binomial type, difference operator, Pochhammer symbol, proof that e is irrational, prime factor,[4][5] binomial series, and multiset.


Since logarithms turn products into sums, they should map an empty product to an empty sum. So if we define the empty product to be 1, then the empty sum should be \ln(1)=0. Conversely, the exponential function turns sums into products, so if we define the empty sum to be 0, then the empty product should be e^0 = 1.

\prod_i x_i = e^{\sum_i \ln x_i}

Nullary Cartesian product[edit]

Consider the general definition of the Cartesian product:

\prod_{i \in I} X_i = \{ g : I \to \bigcup_{i \in I} X_i\ |\ \forall i\ g(i) \in X_i \}.

If I is empty, the only such g is the empty function f_\varnothing, which is the unique subset of \varnothing\times\varnothing that is a function \varnothing \to \varnothing, namely the empty subset \varnothing (the only subset that \varnothing\times\varnothing = \varnothing has):

\prod_\varnothing{} = \{ f_\varnothing: \varnothing \to \varnothing \} = \{ \varnothing\}.

Thus, the cardinality of the Cartesian product of no sets is 1.

Under the perhaps more familiar n-tuple interpretation,

\prod_\varnothing{} = \{ ( ) \},

that is, the singleton set containing the empty tuple. Note that in both representations the empty product has cardinality 1.

Nullary Cartesian product of functions[edit]

The empty Cartesian product of functions is again the empty function.

Nullary categorical product[edit]

In any category, the product of an empty family is a terminal object of that category. This can be demonstrated by using the limit definition of the product. An n-fold categorical product can be defined as the limit with respect to a diagram given by the discrete category with n objects. An empty product is then given by the limit with respect to the empty category, which is the terminal object of the category if it exists. This definition specializes to give results as above. For example, in the category of sets the categorical product is the usual Cartesian product, and the terminal object is a singleton set. In the category of groups the categorical product is the Cartesian product of groups, and the terminal object is a trivial group with one element. To obtain the usual arithmetic definition of the empty product we must take the decategorification of the empty product in the category of finite sets.

Dually, the coproduct of an empty family is an initial object. Nullary categorical products or coproducts may not exist in a given category; e.g. in the category of fields, neither exists.

In computer programming[edit]

Many programming languages, such as Python, allow the direct expression of lists of numbers, and even functions that allow an arbitrary number of parameters. If such a language has a function that returns the product of all the numbers in a list, it usually works like this:

   listprod( [2,3,5] ) --> 30
   listprod( [2,3] )   --> 6
   listprod( [2] )     --> 2
   listprod( [] )      --> 1

This convention sometimes helps avoid having to code special cases like "if length of list is 1" or "if length of list is zero" as special cases.

Many programming languages do not permit the direct expression of the empty product, because they do not allow expressing lists. Multiplication is taken to be an infix operator and therefore a binary operator. Languages implementing variadic functions are the exception. For example, the fully parenthesized prefix notation of Lisp languages gives rise to a natural notation for nullary functions:

(* 2 2 2)   ; evaluates to 8
(* 2 2)     ; evaluates to 4
(* 2)       ; evaluates to 2
(*)         ; evaluates to 1

See also[edit]


  1. ^ Jaroslav Nešetřil, Jiří Matoušek (1998). Invitation to Discrete Mathematics. Oxford University Press. p. 12. ISBN 0-19-850207-9. 
  2. ^ A.E. Ingham and R C Vaughan (1990). The Distribution of Prime Numbers. Cambridge University Press. p. 1. ISBN 0-521-39789-8. 
  3. ^ Page 9 of Lang, Serge (2002), Algebra, Graduate Texts in Mathematics 211 (Revised third ed.), New York: Springer-Verlag, ISBN 978-0-387-95385-4, Zbl 0984.00001, MR 1878556 
  4. ^ Edsger Wybe Dijkstra (1990-03-04). "How Computing Science created a new mathematical style". EWD. Retrieved 2010-01-20. "Hardy and Wright: “Every positive integer, except 1, is a product of primes”, Harold M. Stark: “If n is an integer greater than 1, then either n is prime or n is a finite product of primes.”. These examples —which I owe to A.J.M. van Gasteren— both reject the empty product, the last one also rejects the product with a single factor." 
  5. ^ Edsger Wybe Dijkstra (1986-11-14). "The nature of my research and why I do it". EWD. Retrieved 2010-07-03. "But also 0 is certainly finite and by defining the product of 0 factors —how else?— to be equal to 1 we can do away with the exception: "If n is a positive integer, then n is a finite product of primes."" 

External links[edit]

This article incorporates material from Empty product on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License.