Thomas Piacentini
← Workshop

04 / 15 · 60–90 min

Move between states.

How does uncertainty propagate across three areas?

Choose a laboratory
Check my intuition

01 · Predict

Before changing the settings.

The robot is certainly in A. From A it stays in A with probability 0.8 and goes to B with probability 0.2. What is the probability of being in B after one transition?

A hint

Only one matrix row is needed for the first step.

02 · Experiment and compare

Put the model to the test.

Compare one transition with twenty. Vary the chance of staying in A and then the robot count. Distinguish an exact probability from an observed frequency.

A54.8 %B27.2 %C18 %Exact probabilities (solid) and sampled frequencies (outline)
Solid bars: exact calculation. Outlined bars: simulated frequencies.

8 transitions, 1000 simulated robots. P(C) = 0.18.

Area A
54.80 %
Area B
27.16 %
Sample / exact distance
1.24 %
Compare A and B →

Read values as a table
StepP(A)P(B)P(C)
0.001.000.000.00
1.000.800.140.06
2.000.680.210.11
3.000.620.240.14
4.000.580.260.16
5.000.560.260.17
6.000.560.270.18
7.000.550.270.18
8.000.550.270.18
Understand the calculations

03 · Connect the diagram to calculations

The numbers behind motion.

The row vector p contains probabilities for three areas. Each row of P describes departures from one area and sums to 1. Departures are split between the other two areas. Exact calculation propagates p; simulation draws a zone for each robot. Reducible or periodic chains do not necessarily converge to a unique distribution.

pₖ₊₁ = pₖ P
Σⱼ Pᵢⱼ = 1 ; Pᵢⱼ ≥ 0
distance = ½ Σⱼ |pⱼ − fréquenceⱼ|

Current transition matrix

[ 0.80   0.14   0.06 ]
[ 0.12   0.60   0.28 ]
[ 0.42   0.18   0.40 ]
A few lines to reconstruct
next_p = [sum(p[i] * P[i][j] for i in range(3)) for j in range(3)]

The notebook provides one function per laboratory, hand-calculated examples and tests. Exercises isolate components; these pages run the complete simulations.

Keep an observation

04 · Record

What changed?

Compare two settings. Record the effect, your explanation and a case where the model might fail. Saving keeps the current settings and seed, not a certification of competence.

Open my notebook →

atomsh / lab