Statement
A server receives weekly updates for n weeks. Each week there are m independent attackers; each attacker has probability p of succeeding. If at least one succeeds, the week is a breach and counts as -1; if none succeed the week is secure and counts as +1.
\[
\displaystyle q = (1-p)^m .
\]
\[
\displaystyle K\sim\mathrm{Binom}(n,q), \qquad S_n = 2K - n .
\]
Interactive simulator
Instructions
- Choose parameters and click Run simulation.
- The app will plot some sample trajectories, the empirical mean, ±sd bands and the theoretical expectation.
Numerical results
| Score Sn | Count (sim) | Prob (sim) | Prob (theor) |
|---|
Metrics
Run the simulation to see metrics here (final mean, variance, Chi², KL divergence).
Convergence sweep
Run a quick sweep to observe how Chi² behaves when varying n or the number of simulations.
Interpretation & final notes
The empirical mean approaches E[S_k]=k(2q-1). Increasing sims and n makes the empirical distribution converge to the theoretical one; changing m modifies q and shifts the regime.
References
- W. Feller, An Introduction to Probability Theory and Its Applications, Vol.1.
- S. Ross, Introduction to Probability Models.
- G. Grimmett & D. Stirzaker, Probability and Random Processes.