Calculator Inputs
Example Data Table
| Preset | n | d | Requested | Sample Output Set | Observed Minimum Distance |
|---|---|---|---|---|---|
| Binary | 5 | 3 | 4 | 00000, 00111, 11001, 11110 | 3 |
| DNA | 4 | 2 | 6 | AAAA, AACC, CCGG, GGTT, TTAA, AGCT | 2 |
| Ternary | 4 | 2 | 5 | 0000, 0112, 1201, 2022, 2210 | 2 |
Formula Used
- Search space:
q^n, whereqis alphabet size andnis word length. - Hamming distance:
d(x, y) = number of positions where x and y differ. - Acceptance rule: a candidate enters the set when
min d(candidate, existing) ≥ d_min. - Code rate:
R = log_q(M) / n, whereMis the number of accepted code words. - Error detection:
d_min - 1detectable symbol errors. - Error correction:
floor((d_min - 1) / 2)correctable symbol errors. - Weight: the count of symbols different from the first alphabet symbol.
The generator uses a greedy selection rule. It does not guarantee the largest possible code, but it gives a practical and fast construction for study, testing, and comparison.
How to Use This Calculator
- Select a preset alphabet or enter a custom one.
- Set the word length, target minimum distance, and requested number of code words.
- Choose lexicographic mode for reproducible scanning or random mode for broader sampling.
- Add a prefix if every word must begin the same way.
- Use fixed weight when you want equal-weight code words.
- Raise the candidate check limit if the set returned is too small.
- Press the button to generate the results, metrics, graph, and exportable table.
FAQs
1) What does this calculator generate?
It builds a set of code words over a chosen alphabet. Each accepted word must satisfy the minimum Hamming distance rule against the words already in the set.
2) Why is Hamming distance important?
Hamming distance measures how different two words are. Larger minimum distance improves error detection and usually improves error correction capability as well.
3) What does code rate tell me?
Code rate compares information size to total word length. A higher rate means less redundancy, while a lower rate usually means stronger protection against errors.
4) What is fixed weight?
Fixed weight forces every generated word to contain the same number of nonzero symbols. This is useful when studying constant-weight codes and balanced structures.
5) Why did the calculator return fewer words than requested?
The distance rule, prefix filter, weight requirement, or candidate check limit may have removed too many candidates. Looser settings usually produce larger sets.
6) When should I use random mode?
Random mode helps when the search space is large or when lexicographic scanning seems too biased toward early patterns. Changing the seed gives a different sample path.
7) Is this tool suitable for real security systems?
This page is designed for mathematical exploration, classroom work, and coding theory experiments. Real communication systems usually need deeper design, proofs, and implementation checks.
8) Can I export the generated results?
Yes. Use the CSV button for spreadsheet-style output or the PDF button for a printable summary with the result table.