MATHEMATICAL MODELING WORKSHOP / 04
Local choices, collective patterns
Can changing the update schedule change an emergent pattern?
Learning objectives & prerequisites
Arrays, probability, sampling and Python loops.
- Specify agents, neighborhoods and update conventions explicitly.
- Distinguish a single realization from replicated evidence.
- Avoid interpreting abstract types as measured social categories.
01 / 08 · 10 MIN
Observe
Two abstract agent types occupy a square grid with vacancies. Colors encode types rather than real demographic groups. Agents with too few same-type occupied neighbors relocate. A picture can be striking, but a scientific comparison needs an explicit score and replicated runs.
Describe a spatial pattern you expect and define a measurable quantity that captures it.
02 / 08 · 10 MIN
Ask
Ask whether sequential updates and snapshot updates produce different mean same-type-neighbor fractions. This comparison isolates a scheduling assumption. The score describes local similarity; it does not directly measure welfare, prejudice or causal effects in society.
State the two update rules and a comparison metric before viewing the grids.
03 / 08 · 15 MIN
Assume
Use a periodic Moore neighborhood: eight surrounding sites wrap around the edges. Vacancies are excluded from the denominator. An isolated agent has fraction one by convention. A dissatisfied agent moves to a uniformly sampled empty site without requiring that destination to be better.
Explain how each convention changes behavior. Which one would you challenge first?
04 / 08 · 20 MIN
Formulate
Write the local fraction, compare it with threshold θ and specify a relocation rule. Sequential decisions use the evolving grid. Snapshot decisions use the grid at the start of a sweep and reserve initially empty destinations without collisions. The same preference rule therefore operates on different information.
For a 3×3 grid with two occupied neighbors, one of each type, calculate the center agent's fraction.
05 / 08 · 15 MIN
Design
Give both modes the same seed for each replication. For each run record d=sequential score−snapshot score. Report the mean difference and an approximate interval mean±1.96 SE. With few replications this is a rough normal approximation, not an exact coverage guarantee.
Design a paired experiment varying only threshold. Explain the benefit and limit of shared seeds.
06 / 08 · 25 MIN
Experiment
Complete student_model to return the neighborhood fraction. Inspect the initial grid, your final grid, the reference snapshot grid and the sweep animation. The replication summary compares the two reference schedules; your grid and local-rule checks are shown separately.
Run θ=0, 0.5 and 0.8. Compare 6 and 24 replications and record how the uncertainty interval changes.
07 / 08 · 25 MIN
Challenge
At θ=0 no agent needs to move. Agent counts must remain fixed for both schedules. A single attractive grid cannot show that a difference is robust. A trend may also depend on vacancy fraction, grid size or the treatment of isolated agents.
Change one boundary or isolation convention in a downloaded notebook and specify what must still be conserved.
08 / 08 · 15 MIN
Communicate
Describe the rules, score, seed scheme, run budget and distribution of outcomes. Explain that an abstract mechanism can establish logical possibility without identifying causes in real communities. Keep a failed robustness result in the report.
Write a mechanism-level conclusion and name the empirical evidence needed before making a social claim.
Need a little guidance?
1. Concept hint
List eight offset pairs, wrap indices modulo grid size, and remove zero-valued neighbors.
2. Mathematical / algorithm hint
Divide same-type count by occupied count; return 1.0 when the occupied count is zero.
3. Reference implementation guide
Compare with the reference neighborhood rule and trace it on the 3×3 hand example.
Compare the reasoning before applying it. Your current code is backed up before replacement.
Experiment protocol: comparison, failure & extension
Required comparison
Compare sequential and snapshot schedules at the same seeds and population composition.
Failure experiment
Treating one grid as universal evidence, or counting vacancies as unlike agents, changes the claim or model.
Research extension
Study finite-size effects at a fixed vacancy fraction and predefine a convergence criterion.
PYTHON WORKBENCH
Predict. Then run.
Parameters & random seed
Edit directly above or open the syntax-highlighting editor. The starter's unfinished student_model should fail relevant checks; use your derivation to complete it.
The runtime downloads only when started. Each experiment uses a fresh namespace and a 30-second limit.
Unable to load? Download the standalone notebook and run it in Python with NumPy, SciPy and Matplotlib. Reference notebook
Connect this lesson to your bookshelf.
Lecture & writing Notes
- Monte Carlo and Discrete-Event Simulation
- Game Theory and Strategic Modeling
- Probability Essentials for Modeling and Simulation
- Paper Architecture and Judge Navigation
- The Summary — Claim, Evidence, and Decision
- Building Trust — Assumptions, Validation, and Sensitivity
- Academic Prose — Precision, Flow, and Evidence
- Visual Evidence, LaTeX, and Submission Engineering
Book chapters (PDF and print pages separated)
- Smaldino — Modeling Social Behavior
3: Schelling; 8: Scientific process; 10: Models and reality
PDF 72–73; 242–243; 312–313 · Print 53–54; 223–224; 293–294