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 التعلم الآلي والذكاء الاصطناعي →

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 poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث