Product Over Samples in LaTeX (\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.
\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
- L1 Norm
\| \theta \|_1 - Sum Over Classes
\sum_{c=1}^{C} - L2 Norm
\| \theta \|_2 - Conditional Probability
p(y | x) - Frobenius Norm
\| \mathbf{W} \|_F - Probability Distribution
p(x)
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.
Editor LaTeX AI Terbaik, Alternatif Overleaf
Octree membantu penyelidik dari 15+ universiti menulis kertas penyelidikan dengan lebih cepat menggunakan AI
- Jana diagram TikZ yang cantik menggunakan AI
- Muat naik imej dan tukar ke LaTeX dengan lancar
- Dapatkan bantuan segera untuk menulis dan memformat kertas penyelidikan