MC Sample Count Guidelines

# Monte Carlo Sample Count Guidelines

**Date:** 2026-06-15

## Tiered Configuration

| Use case | `mc_samples` | Avg error | Max error | Theory SE (√0.25/M) | 95% CI |
|----------|-------------:|----------:|----------:|--------------------:|-------:|
| **Quick tests** (code default) | 10,000 | ±0.12% | ±0.80% | 0.50% | ±1.0% |
| **Deep tests / sweeps** | 20,000 | ±0.10% | ±0.55% | 0.35% | ±0.7% |
| **Production** (live play) | 50,000 | ±0.08% | ±0.45% | 0.22% | ±0.45% |

Accuracy measured empirically across 6 hands × 5 seed pairs × 5 opponents (flop, uniform multi-way MC).

## How to Set

The `mc_samples` parameter is configurable via TOML on the postflop strategy block:

```toml
[[strategies]]
type = "g2_postflop_rollout_v4"   # or g3_postflop_rollout
mc_samples = 50000                  # override for production
mc_seed = 42                        # for reproducibility
```

- **Code default** (no override): 10,000 — used by quick smoke tests, integration tests, ad-hoc sims
- **Sweep configs**: override to 20,000 for parameter sweeps where accuracy matters but speed is still important
- **Production bot configs** (`cash_gen2_v4.toml`, `cash_gen3.toml`): set to 50,000 — in live play there is only one bot instance and wall-clock time per decision is not critical

## Performance Impact

Timing for 10-max, 1000 hands, release build (all bots use MC multi-way):

| `mc_samples` | Wall time |
|-------------|-----------|
| 10,000 | ~1.5s |
| 20,000 | ~2.6s |
| 50,000 | ~5.5s |

In live play (single bot, ~3 postflop decisions per hand), even 50K samples adds only ~15ms per decision — negligible.

## Accuracy Methodology

Error = |MC_run1 - MC_run2| across independent seed pairs on the same hand. This isolates pure MC noise from structural differences (e.g., multi-way vs single-opponent equity).

The theoretical worst-case SE is √(0.25/M), derived from the variance of a Bernoulli proportion at p=0.5. Empirical noise is lower because most real hands are not 50/50 coin-flips — dominated hands have lower variance.

## What "error" means for decisions

MC noise affects the equity estimate (hs, ppot, npot), which feeds into threshold comparisons. A ±0.8% error at 10K samples means:
- Hands near a threshold (e.g., hs ≈ 0.83 call_threshold) may flip call/fold
- Hands clearly above/below thresholds are unaffected
- Over many hands, the noise averages out — expected EV impact is minimal

## Recommendation

- **Don't go below 10,000** — at 1,000 samples (±2.75% max error), too many decisions flip
- **Don't go above 50,000** for play — diminishing returns; 100K (±0.5%) costs 5× more for ~0.1% accuracy gain
- **100,000** is useful only for research/analysis where you need a near-exact reference

id: 198ba92f26a344f4a429e49b4eb14081
parent_id: 1246bbc3bb4948fc8329079b84b4ae3d
created_time: 2026-06-15T07:30:38.636Z
updated_time: 2026-06-15T07:30:38.636Z
is_conflict: 0
latitude: 0.00000000
longitude: 0.00000000
altitude: 0.0000
author: 
source_url: 
is_todo: 0
todo_due: 0
todo_completed: 0
source: joplin-desktop
source_application: net.cozic.joplin-desktop
application_data: 
order: 1781508638636
user_created_time: 2026-06-15T07:30:38.636Z
user_updated_time: 2026-06-15T07:30:38.636Z
encryption_cipher_text: 
encryption_applied: 0
markup_language: 1
is_shared: 0
share_id: 
conflict_original_id: 
master_key_id: 
user_data: 
deleted_time: 0
type_: 1