The technique of comparing two patterns in order to say how similar they are, or of comparing one pattern with a set of patterns in order to say to which member of the set it is most similar. This usually implies that a numerical value can be computed, as a function of two patterns, by means of a pattern matching algorithm. The patterns concerned may be purely logical (i.e. data structures) or physical (e.g. one-, two-, or three-dimensional images, represented as arrays). The term is commonly used where the patterns are expressions represented either abstractly or as strings. When the patterns are physical images, the term pattern recognition is more common.