Probability in LaTeX (\mathbb{P})
- LaTeX command
\mathbb{P}- Package
- Add to your preamble:
\usepackage{amssymb} - Mode
- Math mode only
- Copy the Unicode character
- ℙ
U+2119
Where it is used
Blackboard-bold P, the probability measure applied to events.
Measure-theoretic probability writes \mathbb{P}(A) for the probability of event A, with axioms such as \mathbb{P}(\Omega) = 1. The blackboard style separates the measure from a plain P that might name a matrix, a polynomial or a partition. With the standard fonts \mathbb works only on capital letters, so lowercase input produces wrong glyphs. Pair it with \mathbb{E} and an upright Var for a consistent style. A probability space is the triple (\Omega, \mathcal{F}, \mathbb{P}), with calligraphic F for the sigma-algebra. Some authors use \Pr, a predefined upright operator, instead.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Probability: $\mathbb{P}$
\[ \mathbb{P}(A \cup B) = \mathbb{P}(A) + \mathbb{P}(B) - \mathbb{P}(A \cap B) \]
\end{document}Related symbols
- Probability of A
P(A) - Expectation
\mathbb{E}[X] - Expectation (E)
E[X] - Variance
\text{Var}(X) - Covariance
\text{Cov}(X,Y) - Sigma
\sigma
Frequently asked questions
- How do I write Probability in LaTeX?
- Type \mathbb{P} in math mode, for example $\mathbb{P}(A \cup B) = \mathbb{P}(A) + \mathbb{P}(B) - \mathbb{P}(A \cap B)$. Load amssymb first with \usepackage{amssymb}.
- Which package do I need for \mathbb{P}?
- \mathbb{P} needs amssymb: add \usepackage{amssymb} to your preamble before the document starts.
- Can I use \mathbb{P} in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\mathbb{P}$ in running text. If you only need the glyph in text, paste the Unicode character ℙ instead (with XeLaTeX or LuaLaTeX and a font that has it).
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث