Original question and givens
S={0,…,7}, F=P(S), masses=[9, 0, 2, 0, 0, 0, 0, 0], D=11, and w_i=mass_i/D. Masses are nonnegative and sum exactly to D; uniform weights are not assumed. X=[0, 101, 9, 103, 104, 105, 106, 107] in index order. Use the X value at the first positive-mass index as reference. Return the first positive-mass index with a different X value, or none; indices start at 0.
G001 — S={0,…,7}, F=P(S), masses=[9, 0, 2, 0, 0, 0, 0, 0], D=11, and w_i=mass_i/D. Masses are nonnegative and sum exactly to D; uniform weights are not assumed. X=[0, 101, 9, 103, 104, 105, 106, 107] in index order. Use the X value at the first positive-mass index as reference. Return the first positive-mass index with a different X value, or none; indices start at 0.
Step-by-step derivation
S001 · calculation
Before
total mass numerator := sum(9, 0, 2, 0, 0, 0, 0, 0)
After
total mass numerator = 11
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(9, 11)
After
probability weight0 = 9/11
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(0, 11)
After
probability weight1 = 0
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(2, 11)
After
probability weight2 = 2/11
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S003
S005 · calculation
Before
probability weight3 := div(0, 11)
After
probability weight3 = 0
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S004
S006 · calculation
Before
probability weight4 := div(0, 11)
After
probability weight4 = 0
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S005
S007 · calculation
Before
probability weight5 := div(0, 11)
After
probability weight5 = 0
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S006
S008 · calculation
Before
probability weight6 := div(0, 11)
After
probability weight6 = 0
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S007
S009 · calculation
Before
probability weight7 := div(0, 11)
After
probability weight7 = 0
Conditions: none
Divide the indexed mass by the common positive denominator D.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S008
S010 · implies
Before
values=[0, 101, 9, 103, 104, 105, 106, 107];weights=[9/11, 0/1, 2/11, 0/1, 0/1, 0/1, 0/1, 0/1]
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, S009
S011 · implies
Before
index=0;mass=9;X=0;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S010
S012 · implies
Before
index=1;mass=0;X=101;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S011
S013 · implies
Before
index=2;mass=2;X=9;anchor X=0
After
positive-mass mismatch=Yes
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S012
S014 · implies
Before
index=3;mass=0;X=103;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S013
S015 · implies
Before
index=4;mass=0;X=104;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S014
S016 · implies
Before
index=5;mass=0;X=105;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S015
S017 · implies
Before
index=6;mass=0;X=106;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S016
S018 · implies
Before
index=7;mass=0;X=107;anchor X=0
After
positive-mass mismatch=No
Conditions: none
A mismatch requires both positive mass and a different value.Arbitrary values at zero-weight outcomes do not change this positive-support test.
Step identifiers and dependencies
Rule: positive_support_mismatch_row · Uses: G001, S017
S019 · implies
Before
first positive index=0;all eligible mismatch indices=[2]
After
2
Conditions: none
Choose the first original0-based mismatch index,not the smallest X-value.No mismatch means X is constant on its positive support.
Step identifiers and dependencies
Rule: first_positive_support_mismatch · Uses: G001, S018