We want to be able to talk about the distance between two strings.

In other words, we want to be able to describe how different they are,

how many differences there are.

But we have to define exactly what we mean by distance.

So the first kind of distance we'll define is called hamming distance.

So if you have two strings, X and Y, that are of the same length,

we can define the hamming distance between X and Y as the minimal number of

substitutions we need to make to turn one of the strings into the other.

So in this example we would need, let's see,

one, two, three substitutions.

To turn X into Y or vice versa.

So we would say that there's a hamming distance of three between these

two strings.