Independence symbol (double perp) in LaTeX (\perp\!\!\!\perp)
- LaTeX command
\perp\!\!\!\perp- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
Where it is used
Two \perp signs overlapped with negative spaces, the usual hand-built symbol for statistical independence.
Probabilists write X \perp\!\!\!\perp Y for independent random variables and X \perp\!\!\!\perp Y \mid Z for conditional independence, notation popularized by graphical models and causal inference. Three \! negative thin spaces pull the second \perp almost onto the first, creating a double-stemmed upside-down T. Because it is assembled by hand, its exact look varies a little between fonts; define a macro such as \newcommand{\indep}{\mathrel{\perp\!\!\!\perp}} so it also gets relation spacing. A single \perp is used for independence in some texts, but it collides with orthogonality.
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Independence symbol (double perp): $\perp\!\!\!\perp$
\[ X \perp\!\!\!\perp Y \mid Z \]
\end{document}Related symbols
- Conditional
\mid - Perpendicular
\perp - Given
P(A \mid B) - Normal Distribution
\mathcal{N}(\mu, \sigma^2) - Rho
\rho - Similar To
\sim
Frequently asked questions
- How do I write Independence symbol (double perp) in LaTeX?
- Type \perp\!\!\!\perp in math mode, for example $X \perp\!\!\!\perp Y \mid Z$. It works in plain LaTeX without loading any package.
- Which package do I need for \perp\!\!\!\perp?
- None. \perp\!\!\!\perp is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \perp\!\!\!\perp in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\perp\!\!\!\perp$ 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