{
  "problem": "Newcomb's problem: clear box 1,000 dollars; opaque box 1,000,000 dollars if one box was predicted, else empty",
  "payoffs_dollars": {
    "one box, one predicted": 1000000,
    "one box, two predicted": 0,
    "two boxes, one predicted": 1001000,
    "two boxes, two predicted": 1000
  },
  "exact": {
    "rule": "expected value with the chance that the prediction matches your choice, p, the same whichever box you take",
    "ev_one_box": "1000000 * p",
    "ev_two_boxes": "1000 + 1000000 * (1 - p)",
    "threshold_p": "1001/2000",
    "threshold_percent": 50.05,
    "expected_value_at_threshold_dollars": 500500,
    "one_box_higher_when": "p > 1001/2000",
    "second_method": "sum over the four outcomes with exact bisection: same threshold"
  },
  "dominance": {
    "rule": "contents fixed before the choice; compare the acts within each state",
    "one_predicted": {
      "one_box": 1000000,
      "two_boxes": 1001000,
      "two_boxes_ahead_by": 1000
    },
    "two_predicted": {
      "one_box": 0,
      "two_boxes": 1000,
      "two_boxes_ahead_by": 1000
    }
  },
  "uneven_predictor": {
    "rule": "expected value given your choice, with the predictor right about one-boxers with chance a and about two-boxers with chance b",
    "one_box_higher_when": "a + b > 1001/1000",
    "checked_grid": "101 x 101 pairs (a, b in steps of 0.01)",
    "rows": [
      {
        "right_about_one_boxers": "0.9",
        "right_about_two_boxers": "0.9",
        "sum": "9/5",
        "ev_one_box": 900000,
        "ev_two_boxes": 101000,
        "higher": "one box"
      },
      {
        "right_about_one_boxers": "0.99",
        "right_about_two_boxers": "0.5",
        "sum": "149/100",
        "ev_one_box": 990000,
        "ev_two_boxes": 501000,
        "higher": "one box"
      },
      {
        "right_about_one_boxers": "0.6",
        "right_about_two_boxers": "0.402",
        "sum": "501/500",
        "ev_one_box": 600000,
        "ev_two_boxes": 599000,
        "higher": "one box"
      },
      {
        "right_about_one_boxers": "0.6",
        "right_about_two_boxers": "0.4",
        "sum": "1",
        "ev_one_box": 600000,
        "ev_two_boxes": 601000,
        "higher": "two boxes"
      },
      {
        "right_about_one_boxers": "0.5",
        "right_about_two_boxers": "0.5",
        "sum": "1",
        "ev_one_box": 500000,
        "ev_two_boxes": 501000,
        "higher": "two boxes"
      }
    ]
  },
  "expected_value_with_fixed_chance_of_full_box": {
    "rule": "the opaque box is full with chance q, the same whichever act you take",
    "rows": [
      {
        "q_box_full": "0",
        "ev_one_box": 0,
        "ev_two_boxes": 1000,
        "two_minus_one": 1000
      },
      {
        "q_box_full": "0.25",
        "ev_one_box": 250000,
        "ev_two_boxes": 251000,
        "two_minus_one": 1000
      },
      {
        "q_box_full": "0.5",
        "ev_one_box": 500000,
        "ev_two_boxes": 501000,
        "two_minus_one": 1000
      },
      {
        "q_box_full": "0.75",
        "ev_one_box": 750000,
        "ev_two_boxes": 751000,
        "two_minus_one": 1000
      },
      {
        "q_box_full": "1",
        "ev_one_box": 1000000,
        "ev_two_boxes": 1001000,
        "two_minus_one": 1000
      }
    ],
    "result": "two boxes ahead by exactly 1,000 dollars for every q"
  },
  "simulation": {
    "rounds_per_act_per_p": 1000000,
    "seed": 20261031,
    "tolerance_percentage_points": 0.5,
    "largest_match_rate_gap_pp": 0.0933,
    "largest_payoff_gap_pp_of_1000000": 0.0933,
    "note": "at p = 1001/2000 the exact difference is 0, so the simulated difference there is noise around zero",
    "rows": [
      {
        "p": "1/2",
        "p_percent": 50.0,
        "one_box": {
          "rounds": 1000000,
          "prediction_matched": 500126,
          "match_rate_percent": 50.013,
          "mean_payoff_dollars": 500126.0,
          "exact_expected_value_dollars": 500000.0,
          "gap_percentage_points_of_1000000": 0.0126
        },
        "two_boxes": {
          "rounds": 1000000,
          "prediction_matched": 499067,
          "match_rate_percent": 49.907,
          "mean_payoff_dollars": 501933.0,
          "exact_expected_value_dollars": 501000.0,
          "gap_percentage_points_of_1000000": 0.0933
        },
        "one_minus_two_simulated_dollars": -1807.0,
        "one_minus_two_exact_dollars": -1000.0,
        "same_sign_as_exact": true
      },
      {
        "p": "1001/2000",
        "p_percent": 50.05,
        "one_box": {
          "rounds": 1000000,
          "prediction_matched": 500311,
          "match_rate_percent": 50.031,
          "mean_payoff_dollars": 500311.0,
          "exact_expected_value_dollars": 500500.0,
          "gap_percentage_points_of_1000000": 0.0189
        },
        "two_boxes": {
          "rounds": 1000000,
          "prediction_matched": 500432,
          "match_rate_percent": 50.043,
          "mean_payoff_dollars": 500568.0,
          "exact_expected_value_dollars": 500500.0,
          "gap_percentage_points_of_1000000": 0.0068
        },
        "one_minus_two_simulated_dollars": -257.0,
        "one_minus_two_exact_dollars": 0.0,
        "same_sign_as_exact": null
      },
      {
        "p": "3/5",
        "p_percent": 60.0,
        "one_box": {
          "rounds": 1000000,
          "prediction_matched": 599630,
          "match_rate_percent": 59.963,
          "mean_payoff_dollars": 599630.0,
          "exact_expected_value_dollars": 600000.0,
          "gap_percentage_points_of_1000000": 0.037
        },
        "two_boxes": {
          "rounds": 1000000,
          "prediction_matched": 599334,
          "match_rate_percent": 59.933,
          "mean_payoff_dollars": 401666.0,
          "exact_expected_value_dollars": 401000.0,
          "gap_percentage_points_of_1000000": 0.0666
        },
        "one_minus_two_simulated_dollars": 197964.0,
        "one_minus_two_exact_dollars": 199000.0,
        "same_sign_as_exact": true
      },
      {
        "p": "3/4",
        "p_percent": 75.0,
        "one_box": {
          "rounds": 1000000,
          "prediction_matched": 750009,
          "match_rate_percent": 75.001,
          "mean_payoff_dollars": 750009.0,
          "exact_expected_value_dollars": 750000.0,
          "gap_percentage_points_of_1000000": 0.0009
        },
        "two_boxes": {
          "rounds": 1000000,
          "prediction_matched": 750398,
          "match_rate_percent": 75.04,
          "mean_payoff_dollars": 250602.0,
          "exact_expected_value_dollars": 251000.0,
          "gap_percentage_points_of_1000000": 0.0398
        },
        "one_minus_two_simulated_dollars": 499407.0,
        "one_minus_two_exact_dollars": 499000.0,
        "same_sign_as_exact": true
      },
      {
        "p": "9/10",
        "p_percent": 90.0,
        "one_box": {
          "rounds": 1000000,
          "prediction_matched": 900410,
          "match_rate_percent": 90.041,
          "mean_payoff_dollars": 900410.0,
          "exact_expected_value_dollars": 900000.0,
          "gap_percentage_points_of_1000000": 0.041
        },
        "two_boxes": {
          "rounds": 1000000,
          "prediction_matched": 899900,
          "match_rate_percent": 89.99,
          "mean_payoff_dollars": 101100.0,
          "exact_expected_value_dollars": 101000.0,
          "gap_percentage_points_of_1000000": 0.01
        },
        "one_minus_two_simulated_dollars": 799310.0,
        "one_minus_two_exact_dollars": 799000.0,
        "same_sign_as_exact": true
      },
      {
        "p": "99/100",
        "p_percent": 99.0,
        "one_box": {
          "rounds": 1000000,
          "prediction_matched": 989891,
          "match_rate_percent": 98.989,
          "mean_payoff_dollars": 989891.0,
          "exact_expected_value_dollars": 990000.0,
          "gap_percentage_points_of_1000000": 0.0109
        },
        "two_boxes": {
          "rounds": 1000000,
          "prediction_matched": 990021,
          "match_rate_percent": 99.002,
          "mean_payoff_dollars": 10979.0,
          "exact_expected_value_dollars": 11000.0,
          "gap_percentage_points_of_1000000": 0.0021
        },
        "one_minus_two_simulated_dollars": 978912.0,
        "one_minus_two_exact_dollars": 979000.0,
        "same_sign_as_exact": true
      }
    ]
  }
}
