Description
Return exp(-length × ln(radix)) for integer length 0-1000 and radix at least two.
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.
Return exp(-length × ln(radix)) for integer length 0-1000 and radix at least two.
When to use this tool
Use Information: Kraft Single Codeword Term when you need one prefix relationship or code-length contribution.
How to use the tool and how it works
- Enter length, radix. 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.
Return exp(-length × ln(radix)) for integer length 0-1000 and radix at least two.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| length | Length, count, or code length under the stated domain and unit convention. | Required. Safe integer. |
| radix | Radix | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.kraftContribution | Kraft Contribution | Calculated result member: number. |
{
"input": {
"length": 3,
"radix": 2
},
"output": {
"result": {
"kraftContribution": 0.125
}
}
} Limitations and assumptions
- This is one Kraft contribution, not a codeword or complete sum; large lengths and radices may underflow to zero.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Validate the complete codebook and alphabet before making a decoding or feasibility claim.
References
Similar or alternative tools
- Kraft Single Length Change Delta
Return alphabet^-newLength minus alphabet^-oldLength for integer lengths 0-1000 and alphabet 2-256.
- 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.