45 lines
1.0 KiB
JSON
45 lines
1.0 KiB
JSON
{
|
|
"name": "HammingDistance",
|
|
"summary": "How many positions of two sequences of the same length hold different letters.",
|
|
"tags": [
|
|
"sequences",
|
|
"distance"
|
|
],
|
|
"sources": [
|
|
{
|
|
"title": "Hamming, Error detecting and error correcting codes, Bell System Technical Journal 29(2), 1950",
|
|
"url": "https://doi.org/10.1002/j.1538-7305.1950.tb00463.x"
|
|
}
|
|
],
|
|
"cases": [
|
|
{
|
|
"call": "HammingDistance(\"GATTACA\", \"GACTATA\")"
|
|
},
|
|
{
|
|
"call": "HammingDistance(\"\", \"\")"
|
|
},
|
|
{
|
|
"call": "HammingDistance(\"AAAA\", \"TTTT\")"
|
|
}
|
|
],
|
|
"references": [
|
|
{
|
|
"lang": "python",
|
|
"level": "plain",
|
|
"file": "ref/python/plain.py",
|
|
"note": "The same count."
|
|
},
|
|
{
|
|
"lang": "mojo",
|
|
"level": "plain",
|
|
"file": "ref/mojo/plain.mojo",
|
|
"note": "The same count in Mojo."
|
|
}
|
|
],
|
|
"proof": {
|
|
"lang": "dafny",
|
|
"file": "proof/hamming_distance.dfy",
|
|
"note": "The loop computes the number of mismatched positions, which lies in [0, |S|]."
|
|
}
|
|
}
|