Given an alphabet $Q$ with $k$ letters, consider the set $W(n, k)$ of all words in $Q$ with exactly $n$ letters.
In $W(n, k)$ we can define a distance by $dist(x,y) = \#\{ \text{Places where $x$ and $y$ differ}\}$
I am interested in obtaining a set of words $S$, as big as possible, such that for each two words $x, y \in S$ one has $dist(x, y) >= c$ for some specific value of $c$. I have two questions about it:
- Is there a closed formula for the maximum possible size of such a set?
- Is there an algorithm (apart from randomized search) that provides a maximal set, or at least a reasonable approximation?
I have already tried randomized search and the results are very poor, for example in 4-letter words in two symbols it never finds more than 3 or 4 words in the set, but I managed to show there is a set with 8.
In case you are wondering, this comes from a real world "problem":
I am trying to design randomized coursework/exams for my students. I have 8 topics I want to ask them about, and I can write multiple questions for each topic. I want to give each one of them a different assignment, but making sure that no two assignments have more than two repeated questions; i.e. I want words of length 8, at a minimum distance of 6 from each other. My problem is finding out how many different options I have to write for each question so that I have enough assignments, and then finding out an adequate set of words which is at least as big as whatever the size of the class I have!