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 머신러닝 및 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 poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기