• incanter

hamming-distance

incanter.stats

• (hamming-distance a b)
http://en.wikipedia.org/wiki/Hamming_distance

In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. Put another way, it measures the minimum number of substitutions required to change one string into the other, or the number of errors that transformed one string into the other.

Source incanter/stats.clj:3112 top

```(defn hamming-distance
"http://en.wikipedia.org/wiki/Hamming_distance

In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. Put another way, it measures the minimum number of substitutions required to change one string into the other, or the number of errors that transformed one string into the other."
[a b]
(if (and (integer? a) (integer? b))
(hamming-distance (str a) (str b))
(let [_ (assert (= (count a) (count b)))]
(apply
tree-comp-each
+
#(bool-to-binary (not (apply = %)))
(map vector a b)))))```
Vars in incanter.stats/hamming-distance: + = and apply defn integer? let map not str vector
Used in 0 other vars