On the wikipedia article for lagrange interpolation (https://en.wikipedia.org/wiki/Lagrange_polynomial), it shows the definition for the lagrange basis functions in a strange way - well strange to me anyways.

$$\ell_j(x) := \prod_{\begin{smallmatrix}0\le m\le k\\ m\neq j\end{smallmatrix}} \frac{x-x_m}{x_j-x_m}$$

That product notation doesn't seem to indicate an explicit index or a range to operate on.

By guessing, it seems like $m$ is implicitly defined as the index, only because it is a previously undefined variable.

It also looks like $m$ should be greater than or equal to zero and less than or equal to $k$. It doesn't seem to say anything about the fact that m should go from 0 to $k$ though.

It does indicate of course to skip the value where $m=j$.

Can someone help me understand how to properly read this notation?



You’ve guessed correctly. It means the product over the set

$$\{m\in\Bbb Z:0\le m\le k\text{ and }m\ne j\}$$

of indices. Similarly,

$$\prod_{a\le n\le b}x_n$$

is synonymous with


You will occasionally see even more ‘exotic’ variants, e.g.,

$$\prod_{n\in\{2p+1:p\text{ is prime}\}}x_n$$


$$\prod_{5\le 3n+7<28}x_n\;.$$

  • $\begingroup$ oh weird, does sigma also allow that range format? $\endgroup$ – Alan Wolfe Jul 8 '15 at 4:19
  • 1
    $\begingroup$ @Alan: Yes, it does. $\endgroup$ – Brian M. Scott Jul 8 '15 at 4:19

The easiest way to read this is to say that the product extends over all indices $m$ with $m= 0, 1, \ldots, j-1,j+1, j+2, \ldots, k$. In other words, the indices go from $0$ to $k$, but you skip the index $j$.

It will be very clear if you write it out long-hand, without the $\Pi$ notation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.