Product Over Samples in LaTeX (\prod_{i=1}^{N})

∏i=1N\prod_{i=1}^{N}
LaTeX command
\prod_{i=1}^{N}
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Product over samples i from 1 to N, typically the likelihood of an i.i.d. dataset.

For independent samples, the likelihood factorizes as \prod_{i=1}^{N} p(x_i \mid \theta), and taking the log converts it into a sum. \prod is the big-operator capital pi, sized for display; do not substitute \Pi, the Greek letter, which stays small and has no limits. Display math places the limits above and below, while inline text puts them to the side; \prod\limits overrides that. For a coproduct, \coprod is the upside-down counterpart. Long products are numerically unstable in practice, which is another reason papers often switch to the log form.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

L(θ)=∏i=1Np(xi∣θ)L(\theta) = \prod_{i=1}^{N} p(x_i \mid \theta)
\documentclass{article}
\begin{document}
Product Over Samples: $\prod_{i=1}^{N}$

\[ L(\theta) = \prod_{i=1}^{N} p(x_i \mid \theta) \]
\end{document}

Related symbols

All Machine Learning & AI →

Frequently asked questions

How do I write Product Over Samples in LaTeX?
Type \prod_{i=1}^{N} in math mode, for example $L(\theta) = \prod_{i=1}^{N} p(x_i \mid \theta)$. It works in plain LaTeX without loading any package.
Which package do I need for \prod_{i=1}^{N}?
None. \prod_{i=1}^{N} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \prod_{i=1}^{N} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\prod_{i=1}^{N}$ in running text.
Math poweredSchrijf LaTeX met AI

Beste AI LaTeX Editor, Overleaf Alternatief

Octree helpt onderzoekers van 15+ universiteiten sneller onderzoeksartikelen schrijven met AI

  • Genereer mooie TikZ-diagrammen met AI
  • Upload afbeelding en converteer naadloos naar LaTeX
  • Krijg directe hulp bij het schrijven en opmaken van onderzoeksartikelen