Step-by-step derivation
S001 · calculation
Before
total mass numerator := sum(18, 2, 1)
After
total mass numerator = 21
Conditions: none
Nonnegative masses must sum to D to give total probability1.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001
S002 · calculation
Before
probability weight0 := div(18, 21)
After
probability weight0 = 6/7
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S001
S003 · calculation
Before
probability weight1 := div(2, 21)
After
probability weight1 = 2/21
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S002
S004 · calculation
Before
probability weight2 := div(1, 21)
After
probability weight2 = 1/21
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S003
S005 · implies
Before
values=[-17, 2, 18];weights=[6/7, 2/21, 1/21]
After
known finite probability law,not a sampled estimate
Conditions: none
This is the complete normalized probability law,so variance uses its probability weights,not an n−1 sample estimate.Retain original indices of zero-mass outcomes.
Step identifiers and dependencies
Rule: probability_variance_scope · Uses: G001, S004
S006 · calculation
Before
target variable weighted value0 := mul(6/7, -17)
After
target variable weighted value0 = -102/7
Conditions: none
Multiply aligned probabilities and values,retaining negative values and zero weights exactly.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S005
S007 · calculation
Before
target variable weighted value1 := mul(2/21, 2)
After
target variable weighted value1 = 4/21
Conditions: none
Multiply aligned probabilities and values,retaining negative values and zero weights exactly.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S006
S008 · calculation
Before
target variable weighted value2 := mul(1/21, 18)
After
target variable weighted value2 = 6/7
Conditions: none
Multiply aligned probabilities and values,retaining negative values and zero weights exactly.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S007
S009 · calculation
Before
target variable mean := sum(-102/7, 4/21, 6/7)
After
target variable mean = -284/21
Conditions: none
Add every weighted term to obtain the exact mean.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S008
S010 · calculation
Before
centered difference0 := sub(-17, -284/21)
After
centered difference0 = -73/21
Conditions: none
Subtract this variable's own exact mean.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S009
S011 · calculation
Before
centered square0 := square(-73/21)
After
centered square0 = 5329/441
Conditions: none
The squared deviation is nonnegative;do not use a signed deviation itself as a variance term.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S010
S012 · calculation
Before
centered contribution0 := mul(6/7, 5329/441)
After
centered contribution0 = 10658/1029
Conditions: none
Multiply by the aligned probability;a zero weight contributes0 even for a large deviation.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S011
S013 · calculation
Before
centered difference1 := sub(2, -284/21)
After
centered difference1 = 326/21
Conditions: none
Subtract this variable's own exact mean.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S012
S014 · calculation
Before
centered square1 := square(326/21)
After
centered square1 = 106276/441
Conditions: none
The squared deviation is nonnegative;do not use a signed deviation itself as a variance term.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S013
S015 · calculation
Before
centered contribution1 := mul(2/21, 106276/441)
After
centered contribution1 = 212552/9261
Conditions: none
Multiply by the aligned probability;a zero weight contributes0 even for a large deviation.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S014
S016 · calculation
Before
centered difference2 := sub(18, -284/21)
After
centered difference2 = 662/21
Conditions: none
Subtract this variable's own exact mean.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S015
S017 · calculation
Before
centered square2 := square(662/21)
After
centered square2 = 438244/441
Conditions: none
The squared deviation is nonnegative;do not use a signed deviation itself as a variance term.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S016
S018 · calculation
Before
centered contribution2 := mul(1/21, 438244/441)
After
centered contribution2 = 438244/9261
Conditions: none
Multiply by the aligned probability;a zero weight contributes0 even for a large deviation.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S017
S019 · implies
Before
[10658/1029, 212552/9261, 438244/9261]
After
all indexed centered-square contributions retained
Conditions: none
Retain one term for every outcome,including zeros.These are quantities of the complete probability law,not sample estimates.
Step identifiers and dependencies
Rule: complete_centered_variance_terms · Uses: G001, S018