Let the alphabet from which characters are taken is of size 'k'
If a string S1 contains 'n' characters
String S2 contains 'm' characters (m << n)
What is the probability of a character in S1 is equal to a character in S2 ?
Let the alphabet from which characters are taken is of size 'k'
If a string S1 contains 'n' characters
String S2 contains 'm' characters (m << n)
What is the probability of a character in S1 is equal to a character in S2 ?
If you mean the corresponding character should be equal: the alphabet contains of $k$ characters, there is for each position a probability of $1/k$ of a match. The probability that there is no match equals $(1-\frac{1}{k})^{\min(m,n)}$, hence the probability of at least one match is $1-(1-\frac{1}{k})^{\min(m,n)}$.
Given an alphabet of $k$ characters, the probability of there being $any$ match between $any$ character in $S1$ and $any$ character in $S2$ given $equal$ probability of each character, is $$ 1 - (\frac{1}{k} \frac{1}{k-1} ... \frac{1}{k-m})^n $$
xes, for example, then the probability is 1 unless one of the strings is empty. – MJD Mar 07 '14 at 18:46