{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-expectation-01",
  "mko_id": "mko-expectation",
  "title": {
    "zh-Hant": "有限模型的期望值：線性性的證明與相依變數的實例",
    "en": "Expectation in finite models: proving linearity, with an instance of dependent variables"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-expectation-01",
    "source": {
      "mko_id": "mko-expectation",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "71bc68faf69ca0df9cdd11d093055262aa277d07abd77982d0aa1afd849daf3c",
      "english_sha256": "636015fa1e3a6d9eae6091042ae3dd70c6cb996ecd9a409c890060a5b503333a"
    },
    "mode": "theorem_proof",
    "audience_prerequisites": [
      "finite_sum_rules",
      "distributive",
      "function_def",
      "prob_axioms",
      "numeric_evaluation"
    ],
    "goal": {
      "zh-Hant": "在非空有限樣本空間 S、非負且總和為 1 的權重 w_s 下，證明 E[c]=c、E[aX+b]=aE[X]+b、E[X+Y]=E[X]+E[Y]（X、Y 定義在同一個 S 上，不假設獨立）。再在 S={1,2,3}、w₁=1/2、w₂=1/4、w₃=1/4，X=(2,−2,0)、Y=(1,3,−1) 上計算 E[X]、E[Y]、E[X+Y]、E[−3X+5]，說明 X、Y 不獨立而線性性仍成立，並以 E[XY]≠E[X]E[Y] 說明線性性不推出乘積公式。",
      "en": "For a nonempty finite sample space S with nonnegative weights w_s summing to 1, prove E[c]=c, E[aX+b]=aE[X]+b and E[X+Y]=E[X]+E[Y] (X, Y on the same S, independence not assumed). Then on S={1,2,3} with w₁=1/2, w₂=1/4, w₃=1/4, X=(2,−2,0), Y=(1,3,−1), compute E[X], E[Y], E[X+Y] and E[−3X+5], show that X and Y are not independent while linearity still holds, and use E[XY]≠E[X]E[Y] to show that linearity does not give a product formula."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "一般模型：S 非空有限，對所有 s 有 w_s≥0，Σ_{s∈S} w_s=1；X、Y:S→ℝ 在同一個 S 上總定義；a、b、c 為實數。",
          "en": "General model: S is nonempty and finite, w_s≥0 for all s, Σ_{s∈S} w_s=1; X, Y:S→ℝ are total on the same S; a, b, c are reals."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "實例：S={1,2,3}，w₁=1/2、w₂=1/4、w₃=1/4。",
          "en": "Instance: S={1,2,3}, w₁=1/2, w₂=1/4, w₃=1/4."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "X(1)=2、X(2)=−2、X(3)=0；Y(1)=1、Y(2)=3、Y(3)=−1。",
          "en": "X(1)=2, X(2)=−2, X(3)=0; Y(1)=1, Y(2)=3, Y(3)=−1."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "pointwise_rv"
        ],
        "before_tex": "Z:S\\to\\mathbb{R}",
        "after_tex": "E[Z]=\\sum_{s\\in S}w_sZ(s)",
        "relation": "definition",
        "rule": "mko_expectation_def",
        "conditions": [
          "w_s\\ge0,\\ \\sum_s w_s=1"
        ],
        "explanation": {
          "zh-Hant": "依 MKO 定義期望值：每個結果的值乘上它的權重，再對全部結果相加。aX+b、X+Y、XY 與常數 c 都是同一個 S 上逐點定義的隨機變數，所以也都有期望值。",
          "en": "Define expectation as in the MKO: multiply the value at each outcome by its weight and add over all outcomes. aX+b, X+Y, XY and the constant c are random variables defined pointwise on the same S, so they all have expectations."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "mko_expectation_def",
            "pointwise_rv"
          ],
          "explanation": {
            "zh-Hant": "只是定義；需要的前提是權重合法與 S 有限，使和式有意義。",
            "en": "This is only a definition; it presupposes valid weights and a finite S so that the sum makes sense."
          }
        },
        "leaf_basis": "mko_expectation_def + pointwise_rv"
      },
      {
        "id": "S02",
        "uses": [
          "G2"
        ],
        "before_tex": "w_1=\\tfrac12,\\ w_2=\\tfrac14,\\ w_3=\\tfrac14",
        "after_tex": "w_s\\ge0,\\ \\sum_s w_s=1",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "先驗實例的權重：三者都為正，總和 1/2+1/4+1/4=1。MKO 要求先驗權重再計算期望。",
          "en": "Validate the instance's weights first: all three are positive and 1/2+1/4+1/4=1. The MKO asks for the weights to be checked before any expectation is computed."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G2",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "精確有理數計算，可獨立重算。",
            "en": "Exact rational arithmetic, independently recomputable."
          }
        },
        "leaf_basis": "numeric_evaluation"
      },
      {
        "id": "S03",
        "uses": [
          "S01"
        ],
        "before_tex": "E[c]",
        "after_tex": "c",
        "relation": "equivalent",
        "rule": "L_const",
        "conditions": [
          "\\sum_s w_s=1"
        ],
        "explanation": {
          "zh-Hant": "依引理 L_const，常數的期望就是該常數。證明在 S03.1，關鍵是權重總和恰為 1。",
          "en": "By Lemma L_const, the expectation of a constant is that constant. The proof is in S03.1; the key is that the weights sum to exactly 1."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_const"
          ],
          "explanation": {
            "zh-Hant": "這是數值相等，兩邊表示同一個數，雙向可替換。",
            "en": "This is an equality of numbers; both sides name the same number and can replace each other."
          }
        },
        "leaf_basis": "finite_sum_rules + mul_one"
      },
      {
        "id": "S03.1",
        "uses": [
          "S01",
          "G1",
          "finite_sum_rules"
        ],
        "before_tex": "\\sum_{s\\in S}w_s\\,c",
        "after_tex": "c\\sum_{s\\in S}w_s=c\\cdot 1=c",
        "relation": "equivalent",
        "rule": "finite_sum_rules",
        "conditions": [
          "\\sum_s w_s=1"
        ],
        "explanation": {
          "zh-Hant": "依有限和規則提出常數 c：Σ w_s c=cΣ w_s；再用 G1 的 Σ w_s=1 得 c·1=c。若權重總和不是 1，結果會是 c 乘以總和，而不是 c。此步證得引理 L_const。",
          "en": "By the finite-sum rule, factor out the constant c: Σ w_s c=cΣ w_s; then Σ w_s=1 from G1 gives c·1=c. If the weights did not sum to 1, the result would be c times the total, not c. This step proves Lemma L_const."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "finite_sum_rules",
            "mul_one",
            "G1"
          ],
          "explanation": {
            "zh-Hant": "每一個等號都是恆等式或代入已知值，雙向成立。",
            "en": "Each equals sign is an identity or the substitution of a known value, so the step holds both ways."
          }
        },
        "leaf_basis": "finite_sum_rules + mul_comm + mul_one"
      },
      {
        "id": "S04",
        "uses": [
          "S01"
        ],
        "before_tex": "E[aX+b]",
        "after_tex": "aE[X]+b",
        "relation": "equivalent",
        "rule": "L_affine",
        "conditions": [
          "\\sum_s w_s=1"
        ],
        "explanation": {
          "zh-Hant": "依引理 L_affine，仿射變換的期望等於期望的仿射變換。證明分三個子步：逐點展開、拆開和式、代回定義與歸一化。",
          "en": "By Lemma L_affine, the expectation of an affine transform is the affine transform of the expectation. The proof has three sub-steps: expand pointwise, split the sum, and fold back the definition with normalization."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_affine"
          ],
          "explanation": {
            "zh-Hant": "引理的每個子步都是等式，串起來仍是等式。",
            "en": "Each sub-step of the lemma is an equation, and chaining them gives an equation."
          }
        },
        "leaf_basis": "distributive + finite_sum_rules + def_unfold"
      },
      {
        "id": "S04.1",
        "uses": [
          "S01",
          "pointwise_rv",
          "distributive"
        ],
        "before_tex": "\\sum_{s}w_s\\,(aX(s)+b)",
        "after_tex": "\\sum_{s}\\bigl(a\\,w_sX(s)+b\\,w_s\\bigr)",
        "relation": "equivalent",
        "rule": "distributive",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依逐點定義，(aX+b)(s)=aX(s)+b；對每個 s 用分配律與乘法交換律：w_s(aX(s)+b)=a·w_sX(s)+b·w_s。每一項都換成相等的式子。",
          "en": "By the pointwise definition, (aX+b)(s)=aX(s)+b; for each s, distributivity and commutativity give w_s(aX(s)+b)=a·w_sX(s)+b·w_s. Each term is replaced by an equal expression."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "distributive",
            "mul_comm",
            "eq_replace"
          ],
          "explanation": {
            "zh-Hant": "逐項等值代換，和式不變，雙向成立。",
            "en": "Term-by-term replacement of equals leaves the sum unchanged, so it holds both ways."
          }
        },
        "leaf_basis": "distributive + mul_comm + mul_assoc + eq_replace"
      },
      {
        "id": "S04.2",
        "uses": [
          "S04.1",
          "finite_sum_rules"
        ],
        "before_tex": "\\sum_{s}\\bigl(a\\,w_sX(s)+b\\,w_s\\bigr)",
        "after_tex": "a\\sum_{s}w_sX(s)+b\\sum_{s}w_s",
        "relation": "equivalent",
        "rule": "finite_sum_rules",
        "conditions": [],
        "explanation": {
          "zh-Hant": "有限和可拆成兩個和（Σ(u_s+v_s)=Σu_s+Σv_s），常數可提出（Σ c·u_s=cΣu_s）。",
          "en": "A finite sum splits into two sums (Σ(u_s+v_s)=Σu_s+Σv_s), and constants factor out (Σ c·u_s=cΣu_s)."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "finite_sum_rules"
          ],
          "explanation": {
            "zh-Hant": "兩條有限和規則都是等式，可雙向使用。",
            "en": "Both finite-sum rules are equations and can be used in either direction."
          }
        },
        "leaf_basis": "finite_sum_rules"
      },
      {
        "id": "S04.3",
        "uses": [
          "S04.2",
          "S01",
          "G1"
        ],
        "before_tex": "a\\sum_{s}w_sX(s)+b\\sum_{s}w_s",
        "after_tex": "aE[X]+b\\cdot1=aE[X]+b",
        "relation": "equivalent",
        "rule": "def_unfold",
        "conditions": [
          "\\sum_s w_s=1"
        ],
        "explanation": {
          "zh-Hant": "第一個和依定義正是 E[X]；第二個和由 G1 等於 1。S04.1 至 S04.3 合起來證得引理 L_affine。常數 b 被乘上的是總權重 1，不是結果個數。",
          "en": "The first sum is E[X] by definition; the second equals 1 by G1. S04.1 to S04.3 together prove Lemma L_affine. The constant b is multiplied by the total weight 1, not by the number of outcomes."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "def_unfold",
            "G1",
            "mul_one"
          ],
          "explanation": {
            "zh-Hant": "折回定義與代入已知值都是等值替換，雙向成立。",
            "en": "Folding back the definition and substituting a known value are replacements of equals and hold both ways."
          }
        },
        "leaf_basis": "def_unfold + mul_one"
      },
      {
        "id": "S05",
        "uses": [
          "S01"
        ],
        "before_tex": "E[X+Y]",
        "after_tex": "E[X]+E[Y]",
        "relation": "equivalent",
        "rule": "L_sum",
        "conditions": [
          "X,Y\\ \\text{on the same}\\ S"
        ],
        "explanation": {
          "zh-Hant": "依引理 L_sum，和的期望等於期望的和。證明只用到 X、Y 定義在同一個 S 上，沒有用到任何關於 X、Y 聯合行為的假設，所以不需要獨立性。",
          "en": "By Lemma L_sum, the expectation of a sum is the sum of the expectations. The proof uses only that X and Y are defined on the same S and no assumption about their joint behavior, so independence is not needed."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_sum"
          ],
          "explanation": {
            "zh-Hant": "引理由兩個等式子步證成，串起來仍是等式。",
            "en": "The lemma is proved by two equational sub-steps, and their chain is an equation."
          }
        },
        "leaf_basis": "distributive + finite_sum_rules + def_unfold"
      },
      {
        "id": "S05.1",
        "uses": [
          "S01",
          "pointwise_rv",
          "distributive"
        ],
        "before_tex": "\\sum_{s}w_s\\,(X(s)+Y(s))",
        "after_tex": "\\sum_{s}\\bigl(w_sX(s)+w_sY(s)\\bigr)",
        "relation": "equivalent",
        "rule": "distributive",
        "conditions": [
          "X,Y\\ \\text{on the same}\\ S"
        ],
        "explanation": {
          "zh-Hant": "因 X、Y 在同一個 S 上，(X+Y)(s)=X(s)+Y(s) 對每個 s 都有定義；再對每項用分配律。若兩者定義在不同樣本空間上，逐點和根本沒有意義。",
          "en": "Since X and Y live on the same S, (X+Y)(s)=X(s)+Y(s) is defined for every s; then apply distributivity to each term. If they were defined on different sample spaces, the pointwise sum would not make sense."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "distributive",
            "pointwise_rv",
            "eq_replace"
          ],
          "explanation": {
            "zh-Hant": "逐項等值代換，雙向成立。",
            "en": "Term-by-term replacement of equals; it holds both ways."
          }
        },
        "leaf_basis": "distributive + pointwise_rv + eq_replace"
      },
      {
        "id": "S05.2",
        "uses": [
          "S05.1",
          "finite_sum_rules",
          "S01"
        ],
        "before_tex": "\\sum_{s}\\bigl(w_sX(s)+w_sY(s)\\bigr)",
        "after_tex": "\\sum_{s}w_sX(s)+\\sum_{s}w_sY(s)=E[X]+E[Y]",
        "relation": "equivalent",
        "rule": "finite_sum_rules",
        "conditions": [],
        "explanation": {
          "zh-Hant": "拆開有限和，兩個和依定義分別是 E[X] 與 E[Y]。S05.1 與 S05.2 合起來證得引理 L_sum；整個過程沒有出現 P(X=x 且 Y=y)，所以與獨立與否無關。",
          "en": "Split the finite sum; by definition the two sums are E[X] and E[Y]. S05.1 and S05.2 together prove Lemma L_sum; P(X=x and Y=y) never appears in the argument, so it does not matter whether X and Y are independent."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "finite_sum_rules",
            "def_unfold"
          ],
          "explanation": {
            "zh-Hant": "拆和與折回定義都是等式，雙向成立。",
            "en": "Splitting the sum and folding back the definition are equations and hold both ways."
          }
        },
        "leaf_basis": "finite_sum_rules + def_unfold"
      },
      {
        "id": "S06",
        "uses": [
          "S01",
          "S02",
          "G3"
        ],
        "before_tex": "E[X]",
        "after_tex": "\\tfrac12\\cdot2+\\tfrac14\\cdot(-2)+\\tfrac14\\cdot0=\\tfrac12",
        "relation": "equivalent",
        "rule": "mko_expectation_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "代入定義：1/2·2+1/4·(−2)+1/4·0=1−1/2+0=1/2。注意 1/2 不是 X 的任何一個可能值（X 只取 2、−2、0）。",
          "en": "Substitute into the definition: 1/2·2+1/4·(−2)+1/4·0=1−1/2+0=1/2. Note that 1/2 is not one of the possible values of X (X takes only 2, −2 and 0)."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "mko_expectation_def",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "定義展開與精確計算，兩邊表示同一個數。",
            "en": "Unfolding the definition and exact arithmetic; both sides name the same number."
          }
        },
        "leaf_basis": "mko_expectation_def + numeric_evaluation"
      },
      {
        "id": "S07",
        "uses": [
          "S01",
          "S02",
          "G3"
        ],
        "before_tex": "E[Y]",
        "after_tex": "\\tfrac12\\cdot1+\\tfrac14\\cdot3+\\tfrac14\\cdot(-1)=1",
        "relation": "equivalent",
        "rule": "mko_expectation_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "同理：1/2+3/4−1/4=1。",
          "en": "Likewise: 1/2+3/4−1/4=1."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "mko_expectation_def",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "定義展開與精確計算。",
            "en": "Unfolding the definition and exact arithmetic."
          }
        },
        "leaf_basis": "mko_expectation_def + numeric_evaluation"
      },
      {
        "id": "S08",
        "uses": [
          "S05",
          "S06",
          "S07",
          "G3"
        ],
        "before_tex": "E[X+Y],\\ X+Y=(3,1,-1)",
        "after_tex": "E[X+Y]=\\tfrac32=E[X]+E[Y]",
        "relation": "implies",
        "rule": "L_sum",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 S05，E[X+Y]=E[X]+E[Y]=1/2+1=3/2。直接核對：X+Y 的逐點值為 3、1、−1，1/2·3+1/4·1+1/4·(−1)=3/2，兩者一致。",
          "en": "By S05, E[X+Y]=E[X]+E[Y]=1/2+1=3/2. Direct check: the pointwise values of X+Y are 3, 1, −1, and 1/2·3+1/4·1+1/4·(−1)=3/2, which agrees."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "S06",
            "S07"
          ],
          "explanation": {
            "zh-Hant": "結論由一般引理得到；直接計算只是交叉核對，不是證明的來源。",
            "en": "The conclusion comes from the general lemma; the direct computation is a cross-check, not the source of the proof."
          }
        },
        "leaf_basis": "mko_expectation_def + numeric_evaluation"
      },
      {
        "id": "S09",
        "uses": [
          "S04",
          "S06",
          "G3"
        ],
        "before_tex": "E[-3X+5],\\ -3X+5=(-1,11,5)",
        "after_tex": "E[-3X+5]=-3\\cdot\\tfrac12+5=\\tfrac72",
        "relation": "implies",
        "rule": "L_affine",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 S04（a=−3、b=5）：E[−3X+5]=−3·(1/2)+5=7/2。直接核對：逐點值 −1、11、5，1/2·(−1)+1/4·11+1/4·5=−1/2+4=7/2。",
          "en": "By S04 (a=−3, b=5): E[−3X+5]=−3·(1/2)+5=7/2. Direct check: pointwise values −1, 11, 5, and 1/2·(−1)+1/4·11+1/4·5=−1/2+4=7/2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "S06"
          ],
          "explanation": {
            "zh-Hant": "負係數 a 也適用，因引理對所有實數 a、b 成立；直接計算只是核對。",
            "en": "A negative coefficient a is fine because the lemma holds for all real a, b; the direct computation is only a check."
          }
        },
        "leaf_basis": "mko_expectation_def + numeric_evaluation"
      },
      {
        "id": "S10",
        "uses": [
          "G2",
          "G3",
          "indep_def"
        ],
        "before_tex": "P(X=2,\\,Y=1)=w_1=\\tfrac12,\\ P(X=2)P(Y=1)=\\tfrac14",
        "after_tex": "X,Y\\ \\text{not independent}",
        "relation": "implies",
        "rule": "indep_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "只有結果 1 有 X=2，也只有結果 1 有 Y=1，所以 P(X=2)=1/2、P(Y=1)=1/2，而 P(X=2 且 Y=1)=w₁=1/2。乘積 1/4≠1/2，獨立的定義在 x=2、y=1 失敗，X、Y 不獨立。然而 S08 仍成立：線性性不需要獨立。",
          "en": "Only outcome 1 has X=2 and only outcome 1 has Y=1, so P(X=2)=1/2 and P(Y=1)=1/2, while P(X=2 and Y=1)=w₁=1/2. The product 1/4≠1/2, so the definition of independence fails at x=2, y=1 and X, Y are not independent. Yet S08 holds: linearity does not need independence."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "indep_def",
            "numeric_evaluation",
            "quantifier_negation"
          ],
          "explanation": {
            "zh-Hant": "獨立要求對所有 x、y 成立，一組 (x,y) 失敗就足以否定。",
            "en": "Independence requires the identity for all x, y; one failing pair (x,y) suffices to refute it."
          }
        },
        "leaf_basis": "indep_def + quantifier_negation + numeric_evaluation"
      },
      {
        "id": "S11",
        "uses": [
          "S01",
          "S06",
          "S07",
          "G3"
        ],
        "before_tex": "XY=(2,-6,0)",
        "after_tex": "E[XY]=-\\tfrac12\\neq\\tfrac12=E[X]E[Y]",
        "relation": "implies",
        "rule": "mko_expectation_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "逐點乘積 XY 的值為 2·1=2、(−2)·3=−6、0·(−1)=0，E[XY]=1/2·2+1/4·(−6)+1/4·0=1−3/2=−1/2。但 E[X]E[Y]=1/2·1=1/2。所以由線性性不能推出 E[XY]=E[X]E[Y]；期望也可以是負數。",
          "en": "The pointwise product XY has values 2·1=2, (−2)·3=−6 and 0·(−1)=0, so E[XY]=1/2·2+1/4·(−6)+1/4·0=1−3/2=−1/2. But E[X]E[Y]=1/2·1=1/2. So linearity does not give E[XY]=E[X]E[Y]; an expectation can also be negative."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "mko_expectation_def",
            "pointwise_rv",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "一個反例就足以否定「乘積期望總等於期望乘積」；本步不討論獨立時乘積公式是否成立。",
            "en": "One counterexample suffices to refute 'the expectation of a product always equals the product of expectations'; the step does not discuss whether the product formula holds under independence."
          }
        },
        "leaf_basis": "mko_expectation_def + pointwise_rv + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "S06",
          "G3"
        ],
        "before_tex": "\\tfrac{2+(-2)+0}{3}=0",
        "after_tex": "0\\neq\\tfrac12=E[X]",
        "relation": "implies",
        "rule": "mko_expectation_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "若把三個值當成等可能而取普通平均，得 0，與 E[X]=1/2 不同。題目給的權重是 1/2、1/4、1/4，不是各 1/3，所以普通平均不是本模型的期望值。",
          "en": "Treating the three values as equally likely and taking the plain average gives 0, which differs from E[X]=1/2. The given weights are 1/2, 1/4, 1/4, not 1/3 each, so the plain average is not this model's expectation."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S06",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "這裡只是比較本例的兩個數。對所有實值 X 都保證普通平均等於期望值，當且僅當每個權重都等於 1/|S|；對單一 X，非均勻權重也可能偶合相等（例如常數 X）。",
            "en": "This compares the two numbers in this instance. The plain average is guaranteed to equal the expectation for every real-valued X if and only if every weight is 1/|S|; for a particular X, equality can also occur with nonuniform weights (for example, a constant X)."
          }
        },
        "leaf_basis": "mko_expectation_def + numeric_evaluation"
      },
      {
        "id": "S13",
        "uses": [
          "S03",
          "S04",
          "S05",
          "S08",
          "S09",
          "S10",
          "S11"
        ],
        "before_tex": "\\text{S03 to S12}",
        "after_tex": "E[c]=c,\\ E[aX+b]=aE[X]+b,\\ E[X+Y]=E[X]+E[Y];\\ E[XY]\\neq E[X]E[Y]\\ \\text{here}",
        "relation": "implies",
        "rule": "and_intro_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "整理：三條線性性質對所有有限合法模型成立（S03 至 S05）；實例中 E[X]=1/2、E[Y]=1、E[X+Y]=3/2、E[−3X+5]=7/2，X、Y 相依而線性性照樣成立，E[XY]=−1/2 則不等於 E[X]E[Y]=1/2。",
          "en": "Summary: the three linearity properties hold in every finite valid model (S03 to S05); in the instance E[X]=1/2, E[Y]=1, E[X+Y]=3/2 and E[−3X+5]=7/2, X and Y are dependent while linearity still holds, and E[XY]=−1/2 differs from E[X]E[Y]=1/2."
        },
        "reverse_audit": {
          "kind": "sufficient_goal_reduction",
          "required_ids": [
            "S03",
            "S04",
            "S05",
            "S08",
            "S09",
            "S10",
            "S11",
            "and_intro_elim"
          ],
          "explanation": {
            "zh-Hant": "目標 G 為 goal 中的證明與計算；足夠條件 H 為各步結論的合取，皆已正向證成，H⇒G 只用合取引入。",
            "en": "Goal G is the proofs and computations in the goal; the sufficient condition H is the conjunction of the step results, all proved forwards, and H⇒G uses only conjunction introduction."
          }
        },
        "leaf_basis": "and_intro_elim"
      }
    ],
    "result": {
      "zh-Hant": "在任何非空有限、權重非負且總和為 1 的模型上，E[c]=c、E[aX+b]=aE[X]+b、E[X+Y]=E[X]+E[Y]，證明只用有限和規則與同一樣本空間上的逐點運算，不需獨立性。實例中 E[X]=1/2、E[Y]=1、E[X+Y]=3/2、E[−3X+5]=7/2；X、Y 不獨立；E[XY]=−1/2≠1/2=E[X]E[Y]；X 值的普通平均 0 不是 E[X]。",
      "en": "In every nonempty finite model with nonnegative weights summing to 1, E[c]=c, E[aX+b]=aE[X]+b and E[X+Y]=E[X]+E[Y]; the proof uses only finite-sum rules and pointwise operations on one sample space, with no independence. In the instance E[X]=1/2, E[Y]=1, E[X+Y]=3/2, E[−3X+5]=7/2; X and Y are not independent; E[XY]=−1/2≠1/2=E[X]E[Y]; the plain average 0 of the values of X is not E[X]."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "E[X]=(2+(−2)+0)/3=0",
          "en": "E[X]=(2+(−2)+0)/3=0"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "權重不相等；E[X]=1/2·2+1/4·(−2)+1/4·0=1/2。",
          "en": "The weights are not equal; E[X]=1/2·2+1/4·(−2)+1/4·0=1/2."
        }
      },
      {
        "claim": {
          "zh-Hant": "E[X+Y]=E[X]+E[Y] 在此成立，所以 X、Y 獨立",
          "en": "E[X+Y]=E[X]+E[Y] holds here, so X and Y are independent"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "線性性對任何同模型變數都成立；P(X=2 且 Y=1)=1/2≠1/4=P(X=2)P(Y=1)，X、Y 不獨立。",
          "en": "Linearity holds for any variables on the same model; P(X=2 and Y=1)=1/2≠1/4=P(X=2)P(Y=1), so X and Y are not independent."
        }
      },
      {
        "claim": {
          "zh-Hant": "E[XY]=E[X]E[Y]=1/2",
          "en": "E[XY]=E[X]E[Y]=1/2"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "直接計算 E[XY]=1/2·2+1/4·(−6)+1/4·0=−1/2。",
          "en": "Direct computation gives E[XY]=1/2·2+1/4·(−6)+1/4·0=−1/2."
        }
      },
      {
        "claim": {
          "zh-Hant": "E[−3X+5]=−3E[X]=−3/2",
          "en": "E[−3X+5]=−3E[X]=−3/2"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "漏了常數項：E[−3X+5]=−3/2+5=7/2。",
          "en": "The constant term was dropped: E[−3X+5]=−3/2+5=7/2."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "finite_sum_rules",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "有限和：Σ_{i=1}^{0} a_i=0、Σ_{i=1}^{n+1} a_i=Σ_{i=1}^{n} a_i + a_{n+1}；Σ(a_i+b_i)=Σa_i+Σb_i；Σ c·a_i=c·Σa_i。",
          "en": "Finite sums: Σ_{i=1}^{0} a_i=0 and Σ_{i=1}^{n+1} a_i=Σ_{i=1}^{n} a_i + a_{n+1}; Σ(a_i+b_i)=Σa_i+Σb_i; Σ c·a_i=c·Σa_i."
        }
      },
      {
        "id": "distributive",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "分配律：u(v+w)=uv+uw；配合乘法交換律也有 (v+w)u=vu+wu。",
          "en": "Distributivity: u(v+w)=uv+uw; with commutativity also (v+w)u=vu+wu."
        }
      },
      {
        "id": "function_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "函數：f:A→B 對每個 a∈A 指定恰好一個 f(a)∈B。兩函數相等 ⇔ 定義域、對應域相同且對每個 a 都有相同值。",
          "en": "Function: f:A→B assigns to each a∈A exactly one f(a)∈B. Two functions are equal ⇔ they have the same domain and codomain and agree at every a."
        }
      },
      {
        "id": "prob_axioms",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "機率公理：P(A)≥0；P(Ω)=1；兩兩互斥事件的（可數）聯集機率等於各機率之和。由此 P(∅)=0、P(Aᶜ)=1−P(A)。",
          "en": "Probability axioms: P(A)≥0; P(Ω)=1; the probability of a (countable) union of pairwise disjoint events is the sum of their probabilities. Hence P(∅)=0 and P(Aᶜ)=1−P(A)."
        }
      },
      {
        "id": "numeric_evaluation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "明確整數或有理數算式的精確求值；可以獨立重算。",
          "en": "Exact evaluation of an explicit integer or rational expression; independently recomputable."
        }
      },
      {
        "id": "mul_one",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法單位元：1·u=u。",
          "en": "Multiplicative identity: 1·u=u."
        }
      },
      {
        "id": "mul_comm",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法交換律：uv=vu（在交換的數系中，例如 ℤ、ℚ、ℝ、ℂ）。",
          "en": "Commutativity of multiplication: uv=vu (in commutative number systems such as ℤ, ℚ, ℝ, ℂ)."
        }
      },
      {
        "id": "def_unfold",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "展開定義：把一個已定義的詞換成它的定義內容（或反向收回），命題的真假不變。",
          "en": "Unfolding a definition: replacing a defined term by its definition (or folding it back) does not change whether a statement is true."
        }
      },
      {
        "id": "mul_assoc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法結合律：(uv)w=u(vw)。",
          "en": "Associativity of multiplication: (uv)w=u(vw)."
        }
      },
      {
        "id": "eq_replace",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等值代換：命題中的一個式子可換成與它相等的式子，命題的真假不變。",
          "en": "Replacement of equals: an expression inside a statement may be replaced by an equal expression without changing whether the statement is true."
        }
      },
      {
        "id": "quantifier_negation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "量詞否定：¬(∀x, P(x)) 等價於 ∃x, ¬P(x)；¬(∃x, P(x)) 等價於 ∀x, ¬P(x)。",
          "en": "Negating quantifiers: ¬(∀x, P(x)) is equivalent to ∃x, ¬P(x), and ¬(∃x, P(x)) is equivalent to ∀x, ¬P(x)."
        }
      },
      {
        "id": "and_intro_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "合取：由 P 與 Q 得 P∧Q；由 P∧Q 可分別得 P 與 Q。",
          "en": "Conjunction: from P and Q infer P∧Q; from P∧Q infer P and infer Q."
        }
      },
      {
        "id": "mko_expectation_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-expectation",
          "sha256": "71bc68faf69ca0df9cdd11d093055262aa277d07abd77982d0aa1afd849daf3c",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "對非空有限 S、歸一化非負權重 w_s 與實值隨機變數 X，定義 E[X]=Σ_(s∈S)w_s X(s)。在同一機率模型上 E[aX+b]=aE[X]+b、E[X+Y]=E[X]+E[Y]，不需假設 X、Y 獨立；常數 c 的期望為 c。",
          "en": "For nonempty finite S, normalized nonnegative weights w_s, and a real random variable X, define E[X]=Σ_(s∈S)w_s X(s). On the same probability model, E[aX+b]=aE[X]+b and E[X+Y]=E[X]+E[Y] without assuming independence of X and Y; a constant c has expectation c."
        }
      },
      {
        "id": "pointwise_rv",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "同一個 S 上的隨機變數逐點運算：(aX+b)(s)=aX(s)+b，(X+Y)(s)=X(s)+Y(s)，(XY)(s)=X(s)Y(s)；常數 c 是函數 s↦c。",
          "en": "Random variables on the same S are combined pointwise: (aX+b)(s)=aX(s)+b, (X+Y)(s)=X(s)+Y(s), (XY)(s)=X(s)Y(s); the constant c is the function s↦c."
        }
      },
      {
        "id": "indep_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "有限模型中 X 與 Y 獨立，指對所有實數 x、y 有 P(X=x 且 Y=y)=P(X=x)P(Y=y)，其中每個機率是符合條件的結果權重之和。",
          "en": "In a finite model, X and Y are independent when P(X=x and Y=y)=P(X=x)P(Y=y) for all reals x, y, each probability being the sum of the weights of the qualifying outcomes."
        }
      },
      {
        "id": "L_const",
        "kind": "lemma",
        "proved_in": [
          "S03.1"
        ],
        "statement": {
          "zh-Hant": "在 G1 的模型中，對常數 c：E[c]=c。",
          "en": "In the model of G1, for a constant c: E[c]=c."
        }
      },
      {
        "id": "L_affine",
        "kind": "lemma",
        "proved_in": [
          "S04.1",
          "S04.2",
          "S04.3"
        ],
        "statement": {
          "zh-Hant": "在 G1 的模型中：E[aX+b]=aE[X]+b。",
          "en": "In the model of G1: E[aX+b]=aE[X]+b."
        }
      },
      {
        "id": "L_sum",
        "kind": "lemma",
        "proved_in": [
          "S05.1",
          "S05.2"
        ],
        "statement": {
          "zh-Hant": "在 G1 的模型中，X、Y 定義在同一個 S 上：E[X+Y]=E[X]+E[Y]。",
          "en": "In the model of G1, with X and Y on the same S: E[X+Y]=E[X]+E[Y]."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S02",
        "lhs": "1/2+1/4+1/4",
        "rhs": "1"
      },
      {
        "id": "N2",
        "step": "S06",
        "lhs": "1/2*2+1/4*(-2)+1/4*0",
        "rhs": "1/2"
      },
      {
        "id": "N3",
        "step": "S07",
        "lhs": "1/2*1+1/4*3+1/4*(-1)",
        "rhs": "1"
      },
      {
        "id": "N4",
        "step": "S08",
        "lhs": "1/2*3+1/4*1+1/4*(-1)",
        "rhs": "3/2"
      },
      {
        "id": "N5",
        "step": "S08",
        "lhs": "1/2+1",
        "rhs": "3/2"
      },
      {
        "id": "N6",
        "step": "S09",
        "lhs": "1/2*(-1)+1/4*11+1/4*5",
        "rhs": "7/2"
      },
      {
        "id": "N7",
        "step": "S09",
        "lhs": "-3*(1/2)+5",
        "rhs": "7/2"
      },
      {
        "id": "N8",
        "step": "S10",
        "lhs": "1/2*1/2",
        "relation": "!=",
        "rhs": "1/2"
      },
      {
        "id": "N9",
        "step": "S11",
        "lhs": "1/2*2+1/4*(-6)+1/4*0",
        "rhs": "-1/2"
      },
      {
        "id": "N10",
        "step": "S11",
        "lhs": "-1/2",
        "relation": "!=",
        "rhs": "1/2*1"
      },
      {
        "id": "N11",
        "step": "S12",
        "lhs": "(2+(-2)+0)/3",
        "relation": "!=",
        "rhs": "1/2"
      },
      {
        "id": "N12",
        "step": "S04",
        "vars": [
          "a",
          "b",
          "x1",
          "x2",
          "x3"
        ],
        "degree": 1,
        "lhs": "1/2*(a*x1+b)+1/4*(a*x2+b)+1/4*(a*x3+b)",
        "rhs": "a*(1/2*x1+1/4*x2+1/4*x3)+b"
      },
      {
        "id": "N13",
        "step": "S05",
        "vars": [
          "x1",
          "x2",
          "x3",
          "y1",
          "y2",
          "y3"
        ],
        "degree": 1,
        "lhs": "1/2*(x1+y1)+1/4*(x2+y2)+1/4*(x3+y3)",
        "rhs": "(1/2*x1+1/4*x2+1/4*x3)+(1/2*y1+1/4*y2+1/4*y3)"
      },
      {
        "id": "N14",
        "step": "S03",
        "vars": [
          "c"
        ],
        "degree": 1,
        "lhs": "1/2*c+1/4*c+1/4*c",
        "rhs": "c"
      },
      {
        "id": "N15",
        "step": "S09",
        "lhs": "-3*(1/2)+5*3",
        "rhs": "27/2"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "限定 MKO 的有限已知機率模型：權重非負且總和恰為 1，變數在同一個有限 S 上總定義，一般有限和性質容許 G1 的實數係數 a、b、c 與非負歸一化權重；具體例子採整數係數與明示有理權重，全部精確計算（a1、a2）。一般性質以有限和證明；實例只作驗證與反例。不處理樣本平均、長期收斂、無限樣本空間或可積性；不改動 canonical MKO 或英文 edition。",
      "en": "Stays inside the MKO's finite known probability model: weights nonnegative and summing exactly to 1, variables total on the same finite S, the general finite-sum properties allow the real coefficients a,b,c and normalized nonnegative weights of G1; the worked example uses integer coefficients and explicit rational weights, all computed exactly (a1, a2). The general properties are proved with finite sums; the instance serves only as verification and counterexample. Sample means, long-run convergence, infinite sample spaces and integrability are not treated; the canonical MKO and its English edition are not changed."
    },
    "md_symbols": [
      [
        "w_s",
        "結果 s 的權重",
        "the weight of outcome s"
      ],
      [
        "E[Z]=\\sum_{s\\in S}w_sZ(s)",
        "Z 的期望值",
        "the expectation of Z"
      ],
      [
        "X,Y",
        "同一個 S 上的兩個隨機變數",
        "two random variables on the same S"
      ],
      [
        "a,b,c",
        "實數常數",
        "real constants"
      ],
      [
        "XY",
        "逐點乘積 s↦X(s)Y(s)",
        "the pointwise product s↦X(s)Y(s)"
      ]
    ],
    "md_error_controls": [
      {
        "title": "未給等可能就不能平均所有值 / Do not average the values when equal likelihood is not given",
        "zh": "MKO 的誤解之一是不看權重、直接平均所有值。X 的值 2、−2、0 的普通平均是 0，但權重是 1/2、1/4、1/4，E[X]=1/2（S12）。期望值是加權和，每個結果的值乘它自己的機率。",
        "en": "One misconception identified in the MKO is averaging all values without looking at the weights. The plain average of the values 2, −2, 0 of X is 0, but the weights are 1/2, 1/4, 1/4 and E[X]=1/2 (S12). Expectation is a weighted sum: each outcome's value is multiplied by its own probability."
      },
      {
        "title": "線性性不需要、也不推出獨立 / Linearity neither needs nor implies independence",
        "zh": "另一個誤解是由線性期望推論獨立或乘積公式。S10 顯示 X、Y 不獨立，但 E[X+Y]=E[X]+E[Y] 仍成立；S11 顯示 E[XY]=−1/2≠E[X]E[Y]=1/2。線性性只是有限和的拆分，與聯合分布無關。",
        "en": "The other misconception is to infer independence or a product formula from linearity. S10 shows X and Y are not independent, yet E[X+Y]=E[X]+E[Y] holds; S11 shows E[XY]=−1/2≠E[X]E[Y]=1/2. Linearity is only the splitting of a finite sum and has nothing to do with the joint distribution."
      },
      {
        "title": "常數項乘的是總權重 1 / The constant term is multiplied by the total weight 1",
        "zh": "E[aX+b] 的 b 來自 bΣw_s=b·1（S04.3）。漏掉 b 會得 −3/2，把 b 乘以結果個數 3 會得 −3/2+15=27/2，兩者都錯；正確值是 7/2。",
        "en": "The b in E[aX+b] comes from bΣw_s=b·1 (S04.3). Dropping b gives −3/2, and multiplying b by the number of outcomes 3 gives −3/2+15=27/2; both are wrong, and the correct value is 7/2."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "N12 至 N14 只對本例的權重向量 (1/2,1/4,1/4) 驗證恆等式（多項式格點核對）；一般情形的證明是 S03 至 S05。",
        "en": "N12 to N14 verify the identities only for this instance's weight vector (1/2,1/4,1/4) (polynomial grid checks); the general proofs are S03 to S05."
      },
      {
        "zh-Hant": "本稿不處理無限樣本空間的期望、可積性或樣本平均的收斂。",
        "en": "This guide does not treat expectation on infinite sample spaces, integrability, or convergence of sample means."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "cbd356d320de275e46ebf0ed79aac7280e62a2b5e5520a5d0e1191b563a74da0",
    "original_source_sha256": "ca19ba2c31a91326145232e902b561b1b278b0b43f616dd43820b730b9a8e002",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [
      "BR-M015"
    ],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
