{
  "schemaVersion": 1,
  "generatedOn": "2026-09-04",
  "generatedBy": "scripts/generate-poker-stat-sample-size-data.mjs",
  "title": "Poker-stat opportunity counts and Wilson interval reference",
  "scope": "Teaching examples for a binary poker action counted only when the player had an eligible opportunity.",
  "method": {
    "name": "Wilson score interval without continuity correction",
    "confidenceLevel": 0.95,
    "zTwoSided": 1.959963984540054,
    "formula": "(p_hat + z^2/(2n) +/- z*sqrt(p_hat*(1-p_hat)/n + z^2/(4n^2))) / (1 + z^2/n)",
    "unitOfAnalysis": "Eligible opportunities, not total hands dealt.",
    "interpretationBoundary": "A 95% confidence interval is a repeated-sampling procedure; it is not a 95% posterior probability that this fixed interval contains the player’s true rate."
  },
  "nistBenchmark": {
    "successes": 8,
    "opportunities": 30,
    "confidenceLevel": 0.95,
    "publishedWilsonLowerSixDecimals": 0.141827,
    "publishedWilsonUpperSixDecimals": 0.44448,
    "computedWilsonLower": 0.141826633196,
    "computedWilsonUpper": 0.444479616952,
    "sourceUrl": "https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/propconf.htm",
    "sourceAccessed": "2026-09-04"
  },
  "sameObservedRate": {
    "description": "The observed action rate is fixed at 25%; only eligible opportunity count changes.",
    "rows": [
      {
        "successes": 5,
        "opportunities": 20,
        "observedRate": 0.25,
        "wilson95Lower": 0.111861701408,
        "wilson95Upper": 0.468700877619,
        "widthPercentagePoints": 35.683918
      },
      {
        "successes": 10,
        "opportunities": 40,
        "observedRate": 0.25,
        "wilson95Lower": 0.141871186391,
        "wilson95Upper": 0.401939614208,
        "widthPercentagePoints": 26.006843
      },
      {
        "successes": 25,
        "opportunities": 100,
        "observedRate": 0.25,
        "wilson95Lower": 0.175452113623,
        "wilson95Upper": 0.343044635481,
        "widthPercentagePoints": 16.759252
      },
      {
        "successes": 50,
        "opportunities": 200,
        "observedRate": 0.25,
        "wilson95Lower": 0.195081680068,
        "wilson95Upper": 0.31434098312,
        "widthPercentagePoints": 11.92593
      },
      {
        "successes": 125,
        "opportunities": 500,
        "observedRate": 0.25,
        "wilson95Lower": 0.214048496748,
        "wilson95Upper": 0.289763673483,
        "widthPercentagePoints": 7.571518
      },
      {
        "successes": 250,
        "opportunities": 1000,
        "observedRate": 0.25,
        "wilson95Lower": 0.224153098984,
        "wilson95Upper": 0.277760280259,
        "widthPercentagePoints": 5.360718
      }
    ]
  },
  "zeroEvents": {
    "description": "Zero observed actions do not imply a zero underlying action rate. The two-sided Wilson endpoint and exact one-sided binomial upper limit are different procedures and are reported separately.",
    "exactOneSidedFormula": "1 - alpha^(1/n), with alpha = 0.05",
    "ruleOfThreeBoundary": "The 3/n approximation to the exact one-sided zero-event upper limit is shown only when n > 30.",
    "rows": [
      {
        "successes": 0,
        "opportunities": 10,
        "observedRate": 0,
        "wilson95TwoSidedUpperEndpoint": 0.277532799863,
        "exactBinomial95OneSidedUpper": 0.258865550893,
        "ruleOfThreeApplicable": false,
        "ruleOfThreeUpperApproximation": null
      },
      {
        "successes": 0,
        "opportunities": 25,
        "observedRate": 0,
        "wilson95TwoSidedUpperEndpoint": 0.133192250939,
        "exactBinomial95OneSidedUpper": 0.112928145007,
        "ruleOfThreeApplicable": false,
        "ruleOfThreeUpperApproximation": null
      },
      {
        "successes": 0,
        "opportunities": 50,
        "observedRate": 0,
        "wilson95TwoSidedUpperEndpoint": 0.071347599133,
        "exactBinomial95OneSidedUpper": 0.058155079117,
        "ruleOfThreeApplicable": true,
        "ruleOfThreeUpperApproximation": 0.06
      },
      {
        "successes": 0,
        "opportunities": 100,
        "observedRate": 0,
        "wilson95TwoSidedUpperEndpoint": 0.036993498207,
        "exactBinomial95OneSidedUpper": 0.029513049607,
        "ruleOfThreeApplicable": true,
        "ruleOfThreeUpperApproximation": 0.03
      },
      {
        "successes": 0,
        "opportunities": 250,
        "observedRate": 0,
        "wilson95TwoSidedUpperEndpoint": 0.015133299495,
        "exactBinomial95OneSidedUpper": 0.011911419715,
        "ruleOfThreeApplicable": true,
        "ruleOfThreeUpperApproximation": 0.012
      }
    ]
  },
  "contextSplit": {
    "description": "A simulated teaching example showing how a pooled 25% rate can hide two unlike contexts.",
    "actionDefinition": "Illustrative binary action when eligible; not observed player data.",
    "rows": [
      {
        "key": "context_a",
        "label": "Context A",
        "successes": 20,
        "opportunities": 50,
        "observedRate": 0.4,
        "wilson95Lower": 0.276083897303,
        "wilson95Upper": 0.538185622524,
        "simulated": true
      },
      {
        "key": "context_b",
        "label": "Context B",
        "successes": 5,
        "opportunities": 50,
        "observedRate": 0.1,
        "wilson95Lower": 0.043475764932,
        "wilson95Upper": 0.213602314375,
        "simulated": true
      },
      {
        "key": "pooled",
        "label": "Pooled result",
        "successes": 25,
        "opportunities": 100,
        "observedRate": 0.25,
        "wilson95Lower": 0.175452113623,
        "wilson95Upper": 0.343044635481,
        "simulated": true
      }
    ]
  },
  "decisionThresholdIllustration": {
    "description": "Synthetic comparison against an arbitrary 30% threshold declared before looking at the examples.",
    "boundary": "The cutoff is a study illustration, not poker truth, advice, or a player-type boundary.",
    "rows": [
      {
        "successes": 5,
        "opportunities": 20,
        "observedRate": 0.25,
        "wilson95Lower": 0.111861701408,
        "wilson95Upper": 0.468700877619,
        "predeclaredThreshold": 0.3,
        "relationToThreshold": "crosses",
        "simulated": true
      },
      {
        "successes": 125,
        "opportunities": 500,
        "observedRate": 0.25,
        "wilson95Lower": 0.214048496748,
        "wilson95Upper": 0.289763673483,
        "predeclaredThreshold": 0.3,
        "relationToThreshold": "below",
        "simulated": true
      }
    ]
  },
  "opportunityPlanning": {
    "description": "Under independent opportunity arrivals at a stable assumed eligibility rate, expected total hands equals target eligible opportunities divided by that rate.",
    "expectationBoundary": "These values are expectations, not promises or stopping guarantees; actual opportunity arrival varies.",
    "rows": [
      {
        "targetOpportunities": 20,
        "assumedEligibilityRate": 0.05,
        "expectedTotalHands": 400
      },
      {
        "targetOpportunities": 20,
        "assumedEligibilityRate": 0.1,
        "expectedTotalHands": 200
      },
      {
        "targetOpportunities": 20,
        "assumedEligibilityRate": 0.25,
        "expectedTotalHands": 80
      },
      {
        "targetOpportunities": 20,
        "assumedEligibilityRate": 0.5,
        "expectedTotalHands": 40
      },
      {
        "targetOpportunities": 100,
        "assumedEligibilityRate": 0.05,
        "expectedTotalHands": 2000
      },
      {
        "targetOpportunities": 100,
        "assumedEligibilityRate": 0.1,
        "expectedTotalHands": 1000
      },
      {
        "targetOpportunities": 100,
        "assumedEligibilityRate": 0.25,
        "expectedTotalHands": 400
      },
      {
        "targetOpportunities": 100,
        "assumedEligibilityRate": 0.5,
        "expectedTotalHands": 200
      },
      {
        "targetOpportunities": 500,
        "assumedEligibilityRate": 0.05,
        "expectedTotalHands": 10000
      },
      {
        "targetOpportunities": 500,
        "assumedEligibilityRate": 0.1,
        "expectedTotalHands": 5000
      },
      {
        "targetOpportunities": 500,
        "assumedEligibilityRate": 0.25,
        "expectedTotalHands": 2000
      },
      {
        "targetOpportunities": 500,
        "assumedEligibilityRate": 0.5,
        "expectedTotalHands": 1000
      }
    ]
  },
  "waldComparison": {
    "description": "The unadjusted Wald interval is included only to expose its small-sample and boundary failures.",
    "rows": [
      {
        "successes": 0,
        "opportunities": 10,
        "observedRate": 0,
        "wilson95Lower": 0,
        "wilson95Upper": 0.277532799863,
        "wald95LowerRaw": 0,
        "wald95UpperRaw": 0,
        "waldProducesImpossibleBound": false,
        "waldCollapsesAtBoundary": true
      },
      {
        "successes": 1,
        "opportunities": 10,
        "observedRate": 0.1,
        "wilson95Lower": 0.017876213095,
        "wilson95Upper": 0.404150026795,
        "wald95LowerRaw": -0.085938509691,
        "wald95UpperRaw": 0.285938509691,
        "waldProducesImpossibleBound": true,
        "waldCollapsesAtBoundary": false
      },
      {
        "successes": 5,
        "opportunities": 20,
        "observedRate": 0.25,
        "wilson95Lower": 0.111861701408,
        "wilson95Upper": 0.468700877619,
        "wald95LowerRaw": 0.060227303218,
        "wald95UpperRaw": 0.439772696782,
        "waldProducesImpossibleBound": false,
        "waldCollapsesAtBoundary": false
      },
      {
        "successes": 8,
        "opportunities": 30,
        "observedRate": 0.26666666666666666,
        "wilson95Lower": 0.141826633196,
        "wilson95Upper": 0.444479616952,
        "wald95LowerRaw": 0.108424382618,
        "wald95UpperRaw": 0.424908950715,
        "waldProducesImpossibleBound": false,
        "waldCollapsesAtBoundary": false
      },
      {
        "successes": 25,
        "opportunities": 100,
        "observedRate": 0.25,
        "wilson95Lower": 0.175452113623,
        "wilson95Upper": 0.343044635481,
        "wald95LowerRaw": 0.165131069944,
        "wald95UpperRaw": 0.334868930056,
        "waldProducesImpossibleBound": false,
        "waldCollapsesAtBoundary": false
      },
      {
        "successes": 125,
        "opportunities": 500,
        "observedRate": 0.25,
        "wilson95Lower": 0.214048496748,
        "wilson95Upper": 0.289763673483,
        "wald95LowerRaw": 0.212045460644,
        "wald95UpperRaw": 0.287954539356,
        "waldProducesImpossibleBound": false,
        "waldCollapsesAtBoundary": false
      }
    ]
  },
  "sources": [
    {
      "name": "NIST/SEMATECH e-Handbook: Confidence intervals",
      "url": "https://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm",
      "accessed": "2026-09-04",
      "use": "Wilson formula, comparison with the unadjusted normal interval, and interval boundaries."
    },
    {
      "name": "NIST Dataplot: Proportion Confidence Limits",
      "url": "https://www.itl.nist.gov/div898/software/dataplot/refman1/auxillar/propconf.htm",
      "accessed": "2026-09-04",
      "use": "Independent published 8-of-30 Wilson benchmark and method comparison."
    },
    {
      "name": "PokerTracker 4: Advanced HUD Guide",
      "url": "https://docs.pokertracker.com/pt4/tutorials/the-hud/advanced-hud-guide/",
      "accessed": "2026-09-04",
      "use": "Documented occurrences/opportunities display and position filters for poker statistics."
    },
    {
      "name": "Brown, Cai, and DasGupta (2001), Interval Estimation for a Binomial Proportion",
      "url": "https://projecteuclid.org/journals/statistical-science/volume-16/issue-2/Interval-Estimation-for-a-Binomial-Proportion/10.1214/ss/1009213286.full",
      "accessed": "2026-09-04",
      "use": "Primary statistical comparison of binomial-proportion interval procedures."
    },
    {
      "name": "Hanley and Lippman-Hand (1983), If Nothing Goes Wrong, Is Everything All Right?",
      "url": "https://jhanley.biostat.mcgill.ca/Reprints/If_Nothing_Goes_1983.pdf",
      "accessed": "2026-09-04",
      "use": "Primary source for the exact one-sided zero-event limit and its rough 3/n approximation."
    },
    {
      "name": "NIST CSRC: Binomial Distribution",
      "url": "https://csrc.nist.gov/glossary/term/Binomial_Distribution",
      "accessed": "2026-09-04",
      "use": "Definition of the fixed-probability independent-Bernoulli model used by the examples."
    }
  ],
  "limitations": [
    "The intervals model independent binary opportunities with one stable underlying rate; table dynamics, opponent adaptation, selection, and strategy drift can violate that model.",
    "A narrower interval does not establish that a poker read is strategically relevant, causal, or profitable.",
    "The context rows are deliberately simulated and do not describe a real player, population, network, or product.",
    "Total-hand planning requires an assumed eligibility rate; rare situations may arrive unevenly or in clusters.",
    "Repeatedly inspecting many stats, filters, or stopping points introduces selection issues that these single-interval examples do not correct."
  ]
}
