Original question and givens
S={0,…,2}, F=P(S), masses=[20, 2, 1], D=23, and w_i=mass_i/D. Masses are nonnegative and sum exactly to D; uniform weights are not assumed. X=[-19, 2, 20] in index order and Y=[1, -1, -19] on the same S and weights, with no independence premise. Find E[X]−E[Y], equivalently E[X−Y]. Use exact reduced fractions with positive denominators, retaining /1 for integers.
G001 — S={0,…,2}, F=P(S), masses=[20, 2, 1], D=23, and w_i=mass_i/D. Masses are nonnegative and sum exactly to D; uniform weights are not assumed. X=[-19, 2, 20] in index order and Y=[1, -1, -19] on the same S and weights, with no independence premise. Find E[X]−E[Y], equivalently E[X−Y]. Use exact reduced fractions with positive denominators, retaining /1 for integers.
Step-by-step derivation
S001 · calculation
Before
total mass numerator := sum(20, 2, 1)
After
total mass numerator = 23
Conditions: none
Nonnegative integer masses must sum to D for normalized weights.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001
S002 · implies
Before
indexed masses=[20, 2, 1];D=23
After
probabilities=[20/23, 2/23, 1/23]
Conditions: none
Outcome indices start at0 and align masses with X and Y values.Retain zero-mass outcomes;negative random-variable values are allowed.
Step identifiers and dependencies
Rule: indexed_normalized_expectation_model · Uses: G001, S001
S003 · calculation
Before
X weighted numerator0 := mul(20, -19)
After
X weighted numerator0 = -380
Conditions: none
Multiply the mass by the value at the same index;deleting zero masses must not shift alignment.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S002
S004 · calculation
Before
X contribution0 := div(-380, 23)
After
X contribution0 = -380/23
Conditions: none
Divide by the common positive denominator,retaining the index position of a zero contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S003
S005 · calculation
Before
X weighted numerator1 := mul(2, 2)
After
X weighted numerator1 = 4
Conditions: none
Multiply the mass by the value at the same index;deleting zero masses must not shift alignment.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S004
S006 · calculation
Before
X contribution1 := div(4, 23)
After
X contribution1 = 4/23
Conditions: none
Divide by the common positive denominator,retaining the index position of a zero contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S005
S007 · calculation
Before
X weighted numerator2 := mul(1, 20)
After
X weighted numerator2 = 20
Conditions: none
Multiply the mass by the value at the same index;deleting zero masses must not shift alignment.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S006
S008 · calculation
Before
X contribution2 := div(20, 23)
After
X contribution2 = 20/23
Conditions: none
Divide by the common positive denominator,retaining the index position of a zero contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S007
S009 · calculation
Before
X expectation := sum(-380/23, 4/23, 20/23)
After
X expectation = -356/23
Conditions: none
Add every indexed expectation contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S008
S010 · calculation
Before
Y weighted numerator0 := mul(20, 1)
After
Y weighted numerator0 = 20
Conditions: none
Multiply the mass by the value at the same index;deleting zero masses must not shift alignment.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S009
S011 · calculation
Before
Y contribution0 := div(20, 23)
After
Y contribution0 = 20/23
Conditions: none
Divide by the common positive denominator,retaining the index position of a zero contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S010
S012 · calculation
Before
Y weighted numerator1 := mul(2, -1)
After
Y weighted numerator1 = -2
Conditions: none
Multiply the mass by the value at the same index;deleting zero masses must not shift alignment.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S011
S013 · calculation
Before
Y contribution1 := div(-2, 23)
After
Y contribution1 = -2/23
Conditions: none
Divide by the common positive denominator,retaining the index position of a zero contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S012
S014 · calculation
Before
Y weighted numerator2 := mul(1, -19)
After
Y weighted numerator2 = -19
Conditions: none
Multiply the mass by the value at the same index;deleting zero masses must not shift alignment.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S013
S015 · calculation
Before
Y contribution2 := div(-19, 23)
After
Y contribution2 = -19/23
Conditions: none
Divide by the common positive denominator,retaining the index position of a zero contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S014
S016 · calculation
Before
Y expectation := sum(20/23, -2/23, -19/23)
After
Y expectation = -1/23
Conditions: none
Add every indexed expectation contribution.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S015
S017 · calculation
Before
difference of expectations := sub(-356/23, -1/23)
After
difference of expectations = -355/23
Conditions: none
Subtract the weighted sums in the same model to obtain the expectation of the difference.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S016
S018 · implies
Before
E[X]=-356/23;E[Y]=-1/23
After
E[X]−E[Y]=E[X−Y]=-355/23
Conditions: none
Distributivity of the finite weighted sum gives linearity;independence is unnecessary.
Step identifiers and dependencies
Rule: expectation_linearity_without_independence · Uses: G001, S017