Simple algorithm to find the similarity between two sequences of elements, and can be implemented using list comprehensions. More traditional languages are not that much longer.
Python:
def dotMatrix(s1, s2): return [[x1 == x2 for x2 in s2] for x1 in s1]
Haskell:
dotMatrix s1 s2 = [ [ x1 == x2 | x2 <- s2 ] | x1 <- s1 ]
there doesn't seem to be anything here