# Which binds first, product or factorial?

Which is the case:

$$\prod_{i \in I}i! = \prod_{i \in I}(i!)$$

or

$$\prod_{i \in I}i! = \Bigg(\prod_{i \in I}i\Bigg)!$$

• It's ambiguous and it's best to put the parentheses in to make it clear. I believe most people will read it as a product of factorials. But there's no authority saying they are correct. – fleablood Apr 29 '18 at 6:21
• I second what @fleablood has said. You're asking the wrong question. Your goal is to communicate something (namely, [product over i of [i factorial]]), and it doesn't matter what is 'correct' so much as whether or not readers are going to understand. Parenthesis will make sure that your writing is unambiguous. – Quelklef Apr 30 '18 at 0:04
• Math is not a programming language. If it's unclear, add parentheses. It would be unreasonable for a reader to assume the latter interpretation for this particular formula, so you can get away with just $\prod i!$. – anomaly Apr 30 '18 at 2:17

## 3 Answers

The convention \begin{align*} \prod_{i \in I}i! = \prod_{i \in I}(i!)\tag{1} \end{align*} is also affirmed by the operator precedence rules stated in OEIS.

• For standard arithmetic, operator precedence is as follows:

1. Parenthesization,

2. Factorial,

3. Exponentiation,

4. Multiplication and division,

5. Addition and subtraction.

and since the product sign $\prod$ is just a short-hand for successively using the multiplication operator, the convention (1) is valid.

• I feel that this answer doesn't generalize well, at least to the practices of notation I'm familiar with; it's fairly common to see things like $\prod_{x=1}^{10}x+x^2$ or $\prod_{n=0}^{10}2n+1$ where the addition should be taken before the product - and I think this is more common than the parenthesized variant that this answer would require. (This is especially true when, as in the first product, there is a bound variable at the end, or when this occurs alone or at the end of an expression) – Milo Brandt Apr 29 '18 at 17:44
• @MiloBrandt: I disagree. We have per definition of the precedence rules for arithmetic $\prod_{x=1}^{10}x+x^2=\left(\prod_{x=1}^{10}x\right)+x^2$ with the term $x^2$ being a free variable (badly named). It is just a sloppy (admittedly often seen) bad notational style to write erroneously $\prod_{x=1}^{10}x+x^2$ if someone wants to say $\prod_{x=1}^{10}(x+x^2)$. Please see also this answer. – Markus Scheuer Apr 29 '18 at 17:52
• @MarkusScheuer: Citing your own answer isn't very convincing. In any case, if $\prod$ were to have the same precedence as multiplication, then $\prod_{x \in X}x(1-x)$ would be treated as $(\prod_{x \in X}x)(1-x)$, which is not the standard interpretation. – user2357112 Apr 30 '18 at 1:45
• I would like to mention that the OEIS page you linked also has some discussion of implied parentheses in product iterations. – Robert Soupe Apr 30 '18 at 2:15
• @RobertSoupe: The focus of my reference is the stated list. The following discussion at OEIS is regrettably partly misleading. The formulation In more complicated expressions, humans generally understand by common sense where parentheses are implied is nonsense. In order to avoid ambiguities, operator precedence rules and other arithmetic rules have been specified (based on common sense). The evaluation of arithmetic expressions is now done syntactically without any semantic overloading. – Markus Scheuer Apr 30 '18 at 8:48

This would depend on the author, but the former notation would be much more common: $$\prod_{i \in I}i! = \prod_{i \in I}(i!)$$

If the product itself was factorialized, it would most likely be written as the latter: $$\Bigg(\prod_{i \in I}i\Bigg)!$$

edit: added the bolded word much.

I would see it as $$\prod_{i \in I}i! = \prod_{i \in I}(i!)$$

Like the $\sum _i a_i^2$ which is $\sum _i (a_i^2)$ not $(\sum _i a_i)^2$

• Good analogy. The $\prod$ notation is more like the $\sum$ notation (even though they mean different things) than it is to symbol-concatenation to denote product. – Rosie F Apr 30 '18 at 7:22