Mutual Information in LaTeX (I(X; Y))

I(X;Y)I(X; Y)
LaTeX command
I(X; Y)
Package
No package needed: built into LaTeX
Mode
Text and math mode

Where it is used

Mutual information between X and Y: how much knowing one random variable reduces uncertainty about the other.

Mutual information is I(X; Y) = H(X) - H(X \mid Y) = D_{\text{KL}}(p(x,y) \| p(x)p(y)), and it is zero exactly when X and Y are independent. The semicolon is conventional and separates the two arguments, which may themselves be lists, as in I(X_1, X_2; Y); a comma would be ambiguous. TeX treats ; as punctuation and adds a thin space after it automatically. Conditional mutual information is written I(X; Y \mid Z). It underlies the information bottleneck, InfoNCE contrastive losses, and feature selection.

Minimal compilable example

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

I(X;Y)=H(X)−H(X∣Y)I(X; Y) = H(X) - H(X \mid Y)
\documentclass{article}
\begin{document}
Mutual Information: $I(X; Y)$

\[ I(X; Y) = H(X) - H(X \mid Y) \]
\end{document}

Related symbols

All 機械学習・AI →

Frequently asked questions

How do I write Mutual Information in LaTeX?
Type I(X; Y) in math mode, for example $I(X; Y) = H(X) - H(X \mid Y)$. It works in plain LaTeX without loading any package.
Which package do I need for I(X; Y)?
None. I(X; Y) is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use I(X; Y) in text mode, or only in math mode?
Both. I(X; Y) 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に変換
  • 論文の執筆とフォーマットに即座にサポートを取得