Probability Distribution in LaTeX (p(x))

p(x)p(x)
LaTeX command
p(x)
Package
No package needed: built into LaTeX
Mode
Text and math mode

Where it is used

Probability (density or mass) of x under a distribution p, the basic notation for a distribution in ML.

Lowercase p(x) denotes a density or mass function, while uppercase P(X = x) or \Pr is often reserved for probabilities of events. Machine learning overloads p freely, letting the argument decide which distribution is meant, as in p(x) versus p(z); when this gets confusing, add subscripts like p_\theta(x) or p_{\text{data}}(x). Normalization requires \sum_x p(x) = 1 or \int p(x)\,dx = 1, with a thin space \, before dx. Sampling is written x \sim p(x), using \sim.

Minimal compilable example

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

∫−∞∞p(x) dx=1,x∼p(x)\int_{-\infty}^{\infty} p(x)\, dx = 1, \quad x \sim p(x)
\documentclass{article}
\begin{document}
Probability Distribution: $p(x)$

\[ \int_{-\infty}^{\infty} p(x)\, dx = 1, \quad x \sim p(x) \]
\end{document}

Related symbols

All Pembelajaran Mesin & AI →

Frequently asked questions

How do I write Probability Distribution in LaTeX?
Type p(x) in math mode, for example $\int_{-\infty}^{\infty} p(x)\, dx = 1, \quad x \sim p(x)$. It works in plain LaTeX without loading any package.
Which package do I need for p(x)?
None. p(x) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use p(x) in text mode, or only in math mode?
Both. p(x) compiles in running text as well as inside $...$; in a formula keep it in math mode so it gets math fonts and spacing.
Math poweredTulis LaTeX menggunakan AI

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