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 機械学習・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 poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得