# Contact analysis (cryptanalysis)

Although in a sense contact analysis can be considered a type of frequency analysis, most discussions of frequency analysis concern themselves with the simple probabilities of the symbols in the text: $P(X_i=a)$ or $P(X_i=a \cap X_{i+1}=b)$
Contact analysis is based on the conditional probability that certain letters will precede or succeed other letters: $P(X_i=b \mid X_{i-1}=a)$, or $P(X_i=c \mid X_{i-2}=a \cap X_{i-1}=b)$, or even $P(X_i \sub S \mid X_{i-1}\sub T \cap X_{i+1} \sub T)$, where $S$ and $T$ are subsets of the alphabet being used.