Terms Developed in Context
The terms below connect the mathematical model, implementation choices, computed diagnostics, and limits of the scientific claim.
- Monte Carlo estimator
A sample-derived statistic used to approximate an expectation or probability. In this lecture it is used to address How many photon histories are required to resolve a transmission probability?
Model connection: Read the term against Random seed and the governing relation \(\hat p=\frac{k}{N},\quad SE(\hat p)=\sqrt{\frac{\hat p(1-\hat p)}{N}}\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A fixed seed reproduces a stream only within a compatible software/bit-generator setup; NumPy does not guarantee stream compatibility across versions. Seed and package versions are both part of provenance. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Random seed
An input that initializes a pseudorandom number generator and supports repeatable streams. In this lecture it is used to address How many photon histories are required to resolve a transmission probability?
Model connection: Read the term against Bernoulli trial and the governing relation \(\hat p=\frac{k}{N},\quad SE(\hat p)=\sqrt{\frac{\hat p(1-\hat p)}{N}}\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A fixed seed reproduces a stream only within a compatible software/bit-generator setup; NumPy does not guarantee stream compatibility across versions. Seed and package versions are both part of provenance. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Bernoulli trial
A two-outcome random experiment represented by zero or one. In this lecture it is used to address How many photon histories are required to resolve a transmission probability?
Model connection: Read the term against Standard error and the governing relation \(\hat p=\frac{k}{N},\quad SE(\hat p)=\sqrt{\frac{\hat p(1-\hat p)}{N}}\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A fixed seed reproduces a stream only within a compatible software/bit-generator setup; NumPy does not guarantee stream compatibility across versions. Seed and package versions are both part of provenance. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Standard error
The sampling standard deviation of an estimator across repeated independent datasets. In this lecture it is used to address How many photon histories are required to resolve a transmission probability?
Model connection: Read the term against Convergence rate and the governing relation \(\hat p=\frac{k}{N},\quad SE(\hat p)=\sqrt{\frac{\hat p(1-\hat p)}{N}}\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A fixed seed reproduces a stream only within a compatible software/bit-generator setup; NumPy does not guarantee stream compatibility across versions. Seed and package versions are both part of provenance. This distinction separates numerical behavior from physical accuracy and model adequacy.
- Convergence rate
The scaling of estimator uncertainty with sample size, here typically proportional to N to the minus one-half. In this lecture it is used to address How many photon histories are required to resolve a transmission probability?
Model connection: Read the term against Monte Carlo estimator and the governing relation \(\hat p=\frac{k}{N},\quad SE(\hat p)=\sqrt{\frac{\hat p(1-\hat p)}{N}}\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.
Interpretive limit: A fixed seed reproduces a stream only within a compatible software/bit-generator setup; NumPy does not guarantee stream compatibility across versions. Seed and package versions are both part of provenance. This distinction separates numerical behavior from physical accuracy and model adequacy.
Problem and physical meaning
Monte Carlo estimates expectations by sampling a probability law. Independent Bernoulli transmission trials have standard error approximately sqrt[p(1-p)/N], so precision improves only as N^-1/2.
How many photon histories are required to resolve a transmission probability? Begin from the scientific observable or state variable, and name what is directly specified versus inferred. The model should be simple enough to validate, but not quietly presented as the entire astrophysical system.
Model and derivation
The governing expression for this lecture is:
Define the symbols and the independent variable before numerical evaluation. Dimensional analysis checks that both sides have matching units; if the model is dimensionless, state the adopted scale factors and the transformation back to physical units.
Monte Carlo estimates expectations by sampling a probability law. Independent Bernoulli transmission trials have standard error approximately sqrt[p(1-p)/N], so precision improves only as N^-1/2.
Numerical implementation
Use NumPy Generator with an explicit seed; generate exponential interaction distances or Bernoulli transmission outcomes; calculate uncertainty; repeat at increasing N; report seed, estimator, and stopping criterion.
Keep physical quantities and numerical arrays conceptually separate. Convert units at well-defined boundaries, preserve raw inputs, and record dtype, solver, tolerances/timestep, grid, and software versions. A numerical method is part of the model evidence, not an invisible implementation detail.
Worked, programmatically computed example
For tau=2, analytic transmission is 0.135335; the seeded N=20000 estimate is 0.137800 +/- 0.002437 (one standard error).
These values are generated in src/astr474_computations.py, then shared with lecture/lab/assignment renderers. Re-run the generator after changing an input; do not hand-edit a displayed result without recomputing dependent artifacts.
At least one independent check is required: an analytic solution, a second numerical method, a conservation law, or a controlled convergence sequence. When these disagree, diagnose units, frame, discretization, source terms, and model scope before selecting a result.
Error budget and limitations
A fixed seed reproduces a stream only within a compatible software/bit-generator setup; NumPy does not guarantee stream compatibility across versions. Seed and package versions are both part of provenance.
Classify each uncertainty before combining terms: local/global solver error, timestep or spatial discretization, Monte Carlo sampling, parameter uncertainty, measurement uncertainty, and model discrepancy are not interchangeable. Conservation can test internal consistency but does not prove the model is physically complete.
Connection to evidence and research practice
Lab 06 measures seeded transmission convergence and checks whether the known analytic probability lies within sampling uncertainty.
For real parameters, the source record distinguishes the fetched product and epoch from derived values. For synthetic experiments, the initial conditions, generator, seed, and exact file are recorded. A simulation is not an observation, even when its parameters resemble a real object.
Misconceptions to avoid
- More displayed digits do not imply more physical accuracy.
- A successful solver exit or smooth plot does not establish convergence.
- Agreement between two solvers with the same wrong model is not independent physical validation.
- A formal covariance or Monte Carlo interval is conditional on the adopted model and noise process.
Study and review questions
- How many photon histories are required to resolve a transmission probability?
- Which numerical parameter would you vary first, what observable would you track, and how would you know the sequence reached an asymptotic regime?
- Design one independent check and state what failure would change your scientific interpretation.
Preparation for the next lecture: explain how this method's assumptions change when the problem becomes more coupled, stochastic, or data-driven.
Lecture-specific derivation and assumptions
For independent Bernoulli transmission indicators X_i with probability p=e^-tau, E[X_i]=p and Var(X_i)=p(1-p). The sample mean p_hat has variance p(1-p)/N and estimated standard error sqrt(p_hat(1-p_hat)/N). Therefore doubling precision requires about four times as many independent histories. A fixed seed makes a run repeatable in a recorded environment; it does not turn one realization into a confidence guarantee or ensure identical streams across arbitrary library versions.
Algorithm trace and computed-output interpretation
For tau=2, compute p analytically, then use the seeded 20,000-trial vector and inspect its nested prefixes at N=100, 500, 2,000, and 20,000. For each N report k, p_hat, plug-in standard error, and absolute deviation from p. Repeat with independent seeds and compare empirical spread with the predicted N^-1/2 scaling; do not mistake a one-standard-error band for a 68% guarantee at small counts.
Computed result: For tau=2, analytic transmission is 0.135335; the seeded N=20000 estimate is 0.137800 +/- 0.002437 (one standard error).
The nested-prefix estimates are correlated because they reuse earlier trials; their differences are not independent replications. The Bernoulli standard error is an asymptotic plug-in estimate, while exact binomial intervals are preferable near p=0 or p=1. Record the seed, generator, package version, N, and event definition.
Two-meeting teaching arc
Each weekly module is taught in two 75-minute meetings. The sequence below includes a formative check in each meeting and is intended to use the lecture's worked computation, not merely present it.
- Meeting 1 (75 min): 10 min stochastic transport framing; 20 min derive Bernoulli expectation/variance; 20 min standard-error scaling; 20 min seed and random-stream behavior; 5 min sample-size estimate.
- Meeting 2 (75 min): 10 min recap; 20 min analyze nested seeded prefixes; 25 min independent-seed replication; 15 min exact interval/rare-event caveats; 5 min distinguish reproducibility from accuracy.
Targeted study questions
- Why does standard error scale as N^-1/2 rather than N^-1?
- How would you construct an exact binomial interval for a zero-success run?
- Which design makes repeated seed runs independent rather than nested?
References and provenance: course reference log. Generated 2026-09-27.