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 التعلم الآلي والذكاء الاصطناعي →

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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث