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, given that 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.
When a mathematical recipe says "multiply all the numbers in this list", and the list contains, say, 2, 3, 2 and 4, we multiply first the first number by the second, then the result by the third, and so on until the end of the list, so the product of (2,3,2,4) would be 48. If the list contains only one number, so that we cannot multiply first by second, common convention holds that the 'product of all' is that same number, and if the list has no numbers at all, the 'product of all' is 1. This value is necessary to be consistent with the recursive definition of what a product over a sequence means. For example,
In general, we define
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.
- 1 Nullary arithmetic product
- 2 0 raised to the 0th power
- 3 Nullary conjunction and intersection
- 4 Nullary Cartesian product
- 5 Nullary categorical product
- 6 In computer programming
- 7 See also
- 8 References
- 9 External links
Nullary arithmetic product
Imagine a calculator that can only multiply. It has an "ENTER" key and a "CLEAR" key. One would wish that, for example, if one presses "CLEAR", 7 "ENTER", 3 "ENTER", 4 "ENTER", then the display reads 84, because 7 × 3 × 4 = 84. More precisely, we specify:
- A number is displayed just after "CLEAR" is pressed.
- When a number is displayed and one enters another number, their product is displayed.
Then the starting value after pressing "CLEAR" has to be 1. After one has pressed "clear" and done nothing else, the number of factors one has entered is zero. Therefore the product of zero numbers is 1.
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, binomial series, and multiset.
The definition of an empty product can be based on that of the empty sum:
The sum of two logarithms is equal to the logarithm of the product of their operands, i.e. for any base b > 0:
and more generally
i.e., multiplication across all elements of a set is b to the power of the sum of all logarithms of the set's elements.
Using this property as definition, and extending this to the empty product, the right-hand side of this equation evaluates to b0 for the empty set, because the empty sum is defined to be zero, and therefore the empty product must equal one.
0 raised to the 0th power
In set theory and combinatorics, the cardinal number nm is the size of the set of functions from a set of size m into a set of size n. If m is positive and n is zero, then there are no such functions, because there are no elements in the set of size 0 to map elements of the set of size m into. Thus 0m = 0 when m is positive. However, if both sets are empty (have size 0), then there is exactly one such function — the empty function. For this reason, authors in combinatorics and set theory frequently define 00 to be 1 when it represents an empty product.
Nullary conjunction and intersection
For similar reasons, the logical conjunction of no argument is the tautology. Accordingly the intersection of no set is conventionally equal to the universe. See nullary intersection for more information.
Nullary Cartesian product
Consider the general definition of the Cartesian product:
If I is empty, the only such g is the empty function , which is the unique subset of that is a function , namely the empty subset (the only subset that has):
Thus, the cardinality of the Cartesian product of no sets is 1.
Under the perhaps more familiar n-tuple interpretation,
Nullary Cartesian product of functions
The empty Cartesian product of functions is again the empty function.
Nullary categorical product
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.
In computer programming
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 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
- Jaroslav Nešetřil, Jiří Matoušek (1998). Invitation to Discrete Mathematics. Oxford University Press. p. 12. ISBN 0-19-850207-9.
- A.E. Ingham and R C Vaughan (1990). The Distribution of Prime Numbers. Cambridge University Press. p. 1. ISBN 0-521-39789-8.
- 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
- 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."
- 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.""