mc_convergencia_1d
Estimate a 1D integral via mean-value Monte Carlo and track how the cumulative average converges as samples increase; optionally plot the running average.
Instructions
Show how the mean-value Monte Carlo estimate converges as samples accumulate.
Args: func_str: Math expression in x. a, b: Integration limits (b > a). N: Total number of samples. seed: Optional RNG seed. precision: Rounding digits. plot: When True, also return a PNG of the running average.
Returns:
Dict with the cumulative running average over the samples. With
plot=True a list [dict, Image] is returned instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| N | No | ||
| a | Yes | ||
| b | Yes | ||
| plot | No | ||
| seed | No | ||
| func_str | Yes | ||
| precision | No |