Inmathematics, anempty product, ornullary product orvacuous product, is the result ofmultiplying no factors. It is by convention equal to themultiplicative identity (assuming there is an identity for the multiplication operation in question), just as theempty sum—the result ofadding no numbers—is by conventionzero, or theadditive identity.[1][2][3][4] When numbers are implied, the empty product becomesone.
The termempty product is most often used in the above sense when discussingarithmetic operations. However, the term is sometimes employed when discussingset-theoretic intersections, categorical products, and products incomputer programming.
Leta1,a2,a3, ... be a sequence of numbers, and let
be the product of the firstm elements of the sequence. Then
for allm = 1, 2, ... provided that we use the convention. In other words, a "product" with no factors at all evaluates to 1.Allowing a "product" with zero factors reduces the number of cases to be considered in manymathematical formulas. Such a "product" is a natural starting point ininduction proofs, as well as inalgorithms. For these reasons, the "empty product is one" convention is common practice in mathematics and computer programming.
The notion of an empty product is useful for the same reason that the numberzero and theempty set are useful: while they seem to represent quite uninteresting notions, their existence allows for a much shorter mathematical presentation of many subjects.
For example, the empty products 0! = 1 (thefactorial of zero) andx0 = 1 shortenTaylor series notation (seezero to the power of zero for a discussion of whenx = 0). Likewise, ifM is ann × n matrix, thenM0 is then × nidentity matrix, reflecting the fact that applying alinear map zero times has the same effect as applying theidentity map.
As another example, thefundamental theorem of arithmetic says that every positiveinteger greater than 1 can be written uniquely as a product of primes. However, if we do not allow products with only 0 or 1 factors, then the theorem (and its proof) become longer.[5][6]
More examples of the use of the empty product in mathematics may be found in thebinomial theorem (which assumes and implies thatx0 = 1 for allx),Stirling number,König's theorem,binomial type,binomial series,difference operator andPochhammer symbol.
Since logarithms map products to sums:
they map an empty product to anempty sum.
Conversely, the exponential function maps sums into products:
and maps an empty sum to an empty product.
Consider the general definition of theCartesian product:
IfI is empty, the only suchg is theempty 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 familiarn-tuple interpretation,
that is, thesingleton set containing theempty tuple. Note that in both representations the empty product hascardinality 1 – the number of all ways to produce 0 outputs from 0 inputs is 1.
In anycategory, theproduct of an empty family is aterminal object of that category. This can be demonstrated by using thelimit definition of the product. Ann-fold categorical product can be defined as the limit with respect to adiagram given by thediscrete category withn 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 thecategory of sets the categorical product is the usual Cartesian product, and the terminal object is a singleton set. In thecategory of groups the categorical product is the Cartesian product of groups, and the terminal object is atrivial group with one element. To obtain the usual arithmetic definition of the empty product we must take thedecategorification of the empty product in the category of finite sets.
Dually, thecoproduct of an empty family is aninitial object.Nullary categorical products or coproducts may not exist in a given category; e.g. in thecategory of fields, neither exists.
Classical logic defines the operation ofconjunction, which is generalized touniversal quantification inpredicate calculus, and is widely known as logical multiplication because we intuitively identify true with 1 and false with 0 and our conjunction behaves as ordinary multiplier. Multipliers can have arbitrary number of inputs. In case of 0 inputs, we haveempty conjunction, which is identically equal to true.
This is related to another concept in logic,vacuous truth, which tells us that empty set of objects can have any property. It can be explained the way that the conjunction (as part of logic in general) deals with values less or equal 1. This means that the longer the conjunction, the higher the probability of ending up with 0. Conjunction merely checks the propositions and returns 0 (or false) as soon as one of propositions evaluates to false. Reducing the number of conjoined propositions increases the chance to pass the check and stay with 1. Particularly, if there are 0 tests or members to check, none can fail, so by default we must always succeed regardless of which propositions or member properties were to be tested.
Many programming languages, such asPython, 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:
>>>math.prod([2,3,5])30>>>math.prod([2,3])6>>>math.prod([2])2>>>math.prod([])1
(Please note:prod
is not available in themath
module prior to version 3.8.)
This convention helps avoid having to code special cases like "if length of list is 1" or "if length of list is zero."
Multiplication is aninfix operator and therefore a binary operator, complicating the notation of an empty product. Some programming languages handle this by implementingvariadic functions. For example, thefully parenthesized prefix notation ofLisp languages gives rise to a natural notation fornullary functions:
(* 2 2 2) ; evaluates to 8(* 2 2) ; evaluates to 4(* 2) ; evaluates to 2(*) ; evaluates to 1
Hardy and Wright: 'Every positive integer, except 1, is a product of primes', Harold M. Stark: 'Ifn is an integer greater than 1, then eithern is prime orn 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.
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: 'Ifn is a positive integer, thenn is a finite product of primes.'