← Learning map

MATHEMATICAL MODELING WORKSHOP / 04

Local choices, collective patterns

Can changing the update schedule change an emergent pattern?

About 150 minutesSynthetic teaching experimentv1.0.0Reading local draft…
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.

YOUR TURN

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.

YOUR TURN

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.

YOUR TURN

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.

fi=same-type occupied neighborsoccupied neighbors,move if fi<θ,SE(dˉ)=sd/Rf_i=\frac{\text{same-type occupied neighbors}}{\text{occupied neighbors}},\quad \text{move if }f_i<\theta,\qquad \mathrm{SE}(\bar d)=s_d/\sqrt{R}
YOUR TURN

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.

YOUR TURN

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.

YOUR TURN

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.

YOUR TURN

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.

YOUR TURN

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.

Confirm draft change

Baseline and my run

The baseline uses the specified synthetic data; the right column shows only your last completed run.