Description
Multiply probability in [0, 1] by (length - averageLength)² with nonnegative lengths.
A code's symbol cost, length, overhead, and expected rate use different denominators. An ideal information budget is not necessarily the measured size of a practical encoded message.
Multiply probability in [0, 1] by (length - averageLength)² with nonnegative lengths.
When to use this tool
Use Code Length Variance One Symbol Term when you need one explicit coding-cost or redundancy component.
How to use the tool and how it works
- Enter probability, length, averageLength. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read contribution. Use the output convention below.
Multiply probability in [0, 1] by (length - averageLength)² with nonnegative lengths.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| probability | Probability in the stated interval; zero handling follows the calculation above. | Required. Finite number; minimum 0; maximum 1. |
| length | Length, count, or code length under the stated domain and unit convention. | Required. Finite number; minimum 0. |
| averageLength | Average Length | Required. Finite number; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| contribution | Single contribution under the stated weighting and unit convention. | Required. Finite number. |
{
"input": {
"probability": 0.25,
"length": 5,
"averageLength": 3
},
"output": {
"contribution": 1
}
} Limitations and assumptions
- This is one variance contribution in squared length units; the supplied average and complete distribution are not validated.
- 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
Inspect the complete codebook and format, including headers, termination, padding, and source probabilities.
References
Similar or alternative tools
- Codeword Length Symbol Cost Crosswalk
Multiply nonnegative integer length by nonnegative symbolCost for cost.
- Conditional Codebook Context Weight
Multiply contextMass in [0, 1] by nonnegative conditionalLength for weightedLength.