Description
Test both prefix directions, equality, and prefixConflict when either direction holds.
A prefix-free code prevents any distinct codeword from beginning with another complete codeword. Kraft terms describe length budgets, while actual prefix relationships depend on the codewords themselves.
Test both prefix directions, equality, and prefixConflict when either direction holds.
When to use this tool
Use Information: Codebook Single Prefix Conflict Check when you need one prefix relationship or code-length contribution.
How to use the tool and how it works
- Enter firstCodeword, secondCodeword. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Require binary codeword strings, allowing emptiness. Test both prefix directions, equality, and prefixConflict when either direction holds.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstCodeword | First Codeword | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| secondCodeword | Second Codeword | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.firstPrefixesSecond | First Prefixes Second | Calculated result member: boolean. |
| result.secondPrefixesFirst | Second Prefixes First | Calculated result member: boolean. |
| result.equal | Equal | Calculated result member: boolean. |
| result.prefixConflict | Prefix Conflict | Calculated result member: boolean. |
{
"input": {
"firstCodeword": "01",
"secondCodeword": "011"
},
"output": {
"result": {
"firstPrefixesSecond": true,
"secondPrefixesFirst": false,
"equal": false,
"prefixConflict": true
}
}
} Limitations and assumptions
- Equal words and an empty prefix conflict in this pairwise test; no full codebook or unique-decoding analysis is performed.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Validate the complete codebook and alphabet before making a decoding or feasibility claim.
References
Similar or alternative tools
- Prefix Code Termination Ambiguity Witness
Search ordered distinct pairs and return the first shorter-prefix witness when one codeword starts with another; otherwise return prefixFree true and an empty witness.
- Information: Kraft Single Codeword Term
Return exp(-length × ln(radix)) for integer length 0-1000 and radix at least two.