Questions tagged [hamming-distance]

The Hamming distance is a mathematical distance function for a pair of strings (sequences) that can be computed with a binary calculation. It counts the number of symbols in the string that are different. Posts that are not about implementation may belong on https://math.stackexchange.com.

For the special case of two binary strings, it may be implemented as the bitcount of their XOR:

int H(int a, int b){
    return popcount(a^b);
}
291 questions
-2
votes
2 answers

How to sort a list while being resistant to spelling mistakes?

I m looking for a sorting algorithm tolerant to errors. Suppose I have a list A and a list B with some spelling errors. Here zanana instead of banana: A = ["raspberry","apple", "banana", "peach"] B = ["raspberry","apple", "zanana", "peach"] I…
dridk
  • 180
  • 2
  • 13
-2
votes
1 answer

Determine the maximum of combinations which satisfy a given hamming distance

What would be the best way to determine a set of numbers which satisfies a given hamming distance Say I had a 5bit number and I needed to identify the numbers which have a hamming distance >= 2. Below is how far I have gotten. What I believe I need…
Naib
  • 999
  • 7
  • 20
-2
votes
1 answer

Get combinations of elements in different folders but not combine the elements in the same folder, python

I am a beginner in Python and tried hard to find an answer here before I ask this question. I have different designs that have a couple of photos, and I want to compare their hamming distances. But I don't wanna compare the images of same design…
-2
votes
2 answers

Special Binary Codes

Find n binary codes of length n such that distance between each pair is n/2 , where n is a even number , if possible?How to generate all codes? for example n=4 we have 1110,1101,1011,0111 each pair have distance 2. Distance between a pair of code…
-2
votes
1 answer

shuffling the string code in any language

I am trying to code a program to shuffle the dna sequence as much as possible to destroy the order in the sequence. i have written matlab code but its too slow. Also i was looking into hamming distance measure or levenstein measure, also how…
samar
  • 15
  • 8
-4
votes
1 answer

How to generate this series?

What type of series it is and how to generate this by php program? 0 1 3 2 6 7 5 4 12 13 15 14 ... Observation: The successive difference of the entity is 1 Example: Difference of 0 and 1 is 1 Difference of 3 and 2 is 1 Difference of 6 and 7 is…
1 2 3
19
20