Four states. Rather more context.

Stochastic Modeling of the First Date

SLOP1276 · Week 10 · Alex’s story

Fictional Alex’s Markov model reaches a next-date state. Neither person’s answer came from the simulator. The meeting record needs its own observations.

Investigate: What separates a model endpoint from agreement?

The engineering output

Build a Date transition model: matrix, exact calculation, seeded comparison, sensitivity and tests.

Keep a separate observation record for arrival, the bill and next-date agreement.

All probabilities and events are authored fictional teaching data.

How this pack fits the week

60 minutes · Monday’s selected lecture slides.

90 minutes · Thursday’s four practical blocks.

About 210 minutes · independent preparation, remaining examples and consolidation.

Timed selections and tasks.

The complete 180-minute route is a resource guide; its break is for a full sitting.

Confirmation is the input

Actual Week 9 export → separate authored arrival
Confirmed proposalAtrium · cover bothKeep cost version, two actors and prior handoff.
Observe arrival7 May · 17:20Both actors recorded. A plan alone leaves arrival unknown.
Meeting clock: minutes since midnight. Markov steps: no minute duration.

Define what gets counted

Four authored states · C/A/N/E order everywhere
StateMeaningRole
CConversationTransient
AAwkward silenceTransient
NAgreed next dateAbsorbing
EEnded before NAbsorbing
A is a toy label, not an inferred emotion. E is a legitimate ending.

Absorbing is a counting convention

N and E freeze the first endpoint reached by a simulated path.

A real meeting can end after agreement. A person can later withdraw.

The observation record must retain those distinctions.

N is a narrow model endpoint; E is a legitimate ending. Neither grades a person.

Read the whole matrix

P[i,j] · source row i to destination column j
From / toCANE
C0.500.200.200.10
A0.300.300.100.30
N0.000.001.000.00
E0.000.000.001.00
Rows sum to 1. N and E have a single self-loop of probability 1.

Source rows, destination columns

Use row vectors: v(next) = vP.

Component j = sum over i of v[i] × P[i,j].

Read the old vector completely before replacing it.

MIT’s matrix lecture, slides 3–4 supplies the method. The course supplies every probability.

Exercise · audit a proposed repair

5 minutes. Someone writes C = (0.50, 0.20, 0.30, 0.10).

What fails? Make one labelled repair.

Then substitute P[j,i] in the row-vector update.

Starting from C, does that change only the notation?

Answer · two different bugs

The proposed row sums to 1.10. Returning N to 0.20 restores the baseline.

With the transposed update, initial C gives (0.50, 0.30, 0, 0). Mass is lost.

This matrix’s columns need not sum to one.

A consistent column-vector reformulation is possible; mixing conventions is a bug.

One step from C

Authored distribution · v₀ = (1, 0, 0, 0)
C
0.50
A
0.20
N
0.20
E
0.10
Each track spans probability 0 to 1; total mass is 1.

Reach N in two steps

Every intermediate state contributes to two-step N
PathProductMass
C → C → N0.50 × 0.200.10
C → A → N0.20 × 0.100.02
C → N → N0.20 × 10.20
C → E → N0.10 × 00
Total = 0.32. Already-absorbed mass remains in the count.

Exercise · fill the other columns

7 minutes. Starting from C, derive the two-step probabilities of C, A and E.

Partition by all four intermediate states.

Show zero terms and the already-absorbed contribution.

Check the final distribution sums to one before opening the reference answer.

Answer · the exact oracle

Two steps from C · v₂ = v₀P²
C
0.31
A
0.16
N
0.32
E
0.21
C = 0.25 + 0.06; A = 0.10 + 0.06; N = 0.10 + 0.02 + 0.20; E = 0.05 + 0.06 + 0.10.

A denominator can change the story

Unconditional N probability at step two: 0.32.

Conditional on reaching N or E: 0.32 / 0.53 ≈ 0.6038.

The second number excludes every transient path.

Neither is an observed dating rate. Label the horizon and denominator.

Account for the remaining paths

Two steps leave almost half the model paths transient
C + A0.47Still transient at the chosen horizon.
N + E0.53First endpoint reached by step two.
Among endpoints: 0.32 / 0.53 ≈ 60.38%. Among all paths: 32% in N.

Eventual absorption asks another question

From C/A, one-step transient retention is at most 0.70.

After k steps, transient probability is at most 0.70ᵏ → 0.

Let x and y be eventual N probabilities from C and A:

x = 0.50x + 0.20y + 0.20

y = 0.30x + 0.30y + 0.10

Exercise · solve the endpoint probability

6 minutes. Rearrange the two first-step equations and solve for x and y.

Why can x exceed the two-step value 0.32?

What would fail if C and A each had only a probability-1 self-loop?

MIT’s absorption explanation gives the boundary-value method.

Answer · more horizons, more assumptions

Determinant 0.29. x = 16/29 ≈ 0.551724; y = 11/29 ≈ 0.379310.

Extra N mass arrives after step two. This does not recommend waiting for agreement.

A closed C/A class makes this solve singular.

Extension: expected absorption from C is 90/29 steps. Steps are not minutes.

Pause for the full route · 10 minutes

For an uninterrupted full-pack session; skip this slide in Monday’s selection.

Keep the matrix and exact vector visible in your notes.

Next: make a sampler reproduce the same mathematical model.

A repeatable result can still be repeatably wrong.

One draw selects one destination

Sample the C row with u in [0,1)
  1. C[0, 0.50)
  2. A[0.50, 0.70)
  3. N[0.70, 0.90)
  4. E[0.90, 1)
Choose the first cumulative total greater than u. Left endpoint included; right excluded.

Exercise · test the boundaries

4 minutes. Map C-row draws 0, 0.50, 0.70 and 0.90.

Then draw 0 from the N row (0, 0, 1, 0).

What breaks if “less than cumulative” becomes “less than or equal”?

Answer · zero mass stays impossible

The C-row destinations are C, A, N, E.

The N-row destination must be N, even at u = 0.

Using ≤ can choose the first zero-probability cell and escape an absorbing state.

Reject u = 1. The draw contract is [0,1).

Specify the random stream

Teaching generator: unsigned 32-bit linear congruential generator.

Advance: (1664525 × state + 1013904223) mod 2³².

Divide the new word by 2³². Seed 402010 gives first word 154701297.

Use one draw per step, including after absorption. This generator is not cryptographic.

Reset paths, keep the stream running

For each run: reset to C, take two steps, count the final state.

Do not reseed each path or carry the previous endpoint into the next path.

The ideal sampling model has independent paths. A pseudorandom stream approximates it.

Restarting the same seed for 1,000 and 10,000 runs creates nested samples.

Count before estimating

Seed 402010 · two steps · counts before proportions
State1,000 paths10,000 paths
C3103,108
A1671,606
N2973,182
E2262,104
Reset to C for each path. The smaller run is a prefix of the larger run.

Compare with the exact oracle

Absolute errors · probability units, not relative percentages
State1,000 paths10,000 paths
C0.00000.0008
A0.00700.0006
N0.02300.0018
E0.01600.0004
C's error grows from 0 to 0.0008. Correct sampling need not improve every cell.

Exercise · reject a flaky test

5 minutes. A test requires every error to shrink at 10,000 paths.

Which cell disproves it in this fixture?

Convert N’s larger-run error to percentage points.

What would reseeding every path do to the result?

Answer · repeatability is not convergence

C’s error rises to 0.0008. N’s error is 0.18 percentage points.

Reseeding every path repeats one outcome.

Under ideal independent indicators, standard deviation is √(p(1−p)/n).

For N: about 0.01475 → 0.004665. This scaling does not bound every seeded error.

Change one assumption explicitly

Move 0.10 from C→N to C→E.

New C row: (0.50, 0.20, 0.10, 0.20).

Every other row stays fixed; N and E remain absorbing.

This is a mathematical scenario, not an established effect of a conversational tactic.

Exercise · predict before simulating

7 minutes. Calculate the changed two-step vector from C.

Which coordinates stay the same?

Why might N change by more than 0.10?

Keep all path contributions and verify conservation.

Answer · exact changed distribution

Exact two-step sensitivity · change only the C row
StateBaselineChanged
C0.310.31
A0.160.16
N0.320.17
E0.210.36
N loses 0.15; E gains 0.15. C/A mass and row sums stay unchanged.

Find the missing 0.15

C → C → N changes from 0.10 to 0.05: −0.05.

C → N → N changes from 0.20 to 0.10: −0.10.

C → A → N remains 0.02.

Two affected paths give −0.15 in total. A one-row change can accumulate over steps.

Reuse the seed with its caveat

Changed 10,000-path counts: (3108, 1606, 1711, 3575).

The same draws couple baseline and changed runs; they are not independent samples.

The exact vector establishes the model difference. No causal effect on people is measured.

Extension: eventual N from C becomes 9/29. Expected absorption steps stay fixed.

What memorylessness forgets

Two histories collapse into the same current label C
History 1A first board-game question → C.
History 2A topic already declined → C.
The matrix gives both the same next row. An actual protocol must retain the boundary.

A topic transition can omit history, time remaining or a changed plan.

Adding states does not provide calibrated transition probabilities.

Do not infer attraction or discomfort from silence or eye-contact duration.

Disability and cultural difference are not anomaly scores. The A label is authored.

Exercise · supply a counterexample

5 minutes. Give two histories that end in C or A but should permit different next actions.

Name the omitted information.

Would the exercise need to collect it from real people?

What test would protect an explicit boundary?

Answer · retain the useful history

“Time remains” and “either actor has asked to leave” cannot use the same action rule.

An authored event record can preserve that distinction without observing real people.

Test that leaving keeps the complete meeting snapshot terminal.

The four-state probability model is a deliberately limited abstraction.

Make the checks fail on purpose

Transpose P[i,j] to P[j,i]: the literal one-step test must fail.

Change categorical < to ≤: the zero-mass boundary test must fail.

Assert each edit matched once. Restore and rerun.

Also test zero steps, initial A, invalid rows, N/E starts and literal seeded counts.

The “Who pays?” deadlock

“Who pays?” · a waiting protocol with no progress
Alex waitsExpect the counterpart to raise the bill.
Counterpart waitsExpect Alex to raise the bill.
wait → waiting → wait → waiting. Explicitly revisit the agreed terms; either actor can leave.

Reuse the actual cost object

Week 9 Atrium cover-both agreement · authored dollars
ContributionAlexCounterpart
Two drinks$12$0
Transport$2Unknown
Outing total$14Unknown
Compare the café bill with $12 in drinks, not Alex's $14 outing total.

Ask about the agreed terms

Current version + $12 bill + two coded acknowledgements
  1. Wait twicewaiting
  2. Ask about $12asked
  3. Alex agreesasked
  4. Other actor agreesacknowledged
No money moves. Changed or unknown bill → review. Leaving remains available.

Exercise · the bill has changed

5 minutes. The drink bill is $14, or its amount is unknown.

Can the existing $12 cost agreement allocate it?

Can the unresolved bill prevent either actor from leaving?

Is this stalemate a proven operating-system resource deadlock?

Answer · review costs, retain the exit

Changed or unknown bill → review. Clarify terms and obtain a separate renewed agreement.

No automatic split, charge or obligation to stay follows.

OSTEP §32.3 requires four resource-deadlock conditions. Our waiting exercise is a limited analogy.

A person is not a lock to acquire.

Record what was explicitly observed

Observation fields survive a meeting ending
Explicit next-date recordLabel
No relevant observationunobserved
One actor agreespending
Both actors agreeagreed
Either actor declines / withdrawsdeclined
Meeting ended and next date agreed can coexist. A simulation draw supplies neither observation.

A later withdrawal remains possible

Two explicit agreements → agreed.

A later explicit withdrawal → declined, retaining the event history.

Do not retry a declined invitation. Leaving ends this meeting record even with an unresolved bill.

Simulated N remains absorbing because it freezes a first endpoint, not a person’s future wishes.

Run eleven files offline

Save the eleven downloads from the lecture notes together.

Run node week-10-worked-examples.mjs.

The report reuses the actual Week 6–9 workflow and existing transition reference.

It prints exact/seeded results and six authored event histories. No message or payment is sent.

The tutorial’s 90 minutes

20 min · exact propagation and handwritten contributions.

30 min · categorical sampler, seed contract, counts and errors.

20 min · changed row and literal tests.

20 min · memorylessness, bill trace and observation labels.

Solo work and review are accepted. Save one reproducible Date transition model.

Hand over evidence to Week 11

Carry the exact/seeded comparison, sensitivity result and current cost version.

Keep agreed, declined, pending and unobserved distinct. Simulation endpoints are not observations.

Week 11’s 115-minute fixture is separate from model steps and the earlier itinerary.

Final validation appendix: 50% project · 28 May 2027, 5 pm.

Exit ticket · repair three claims

“Absorbing N prevents withdrawal.” → It freezes a model endpoint.

“More paths improve every error.” → Check the actual errors.

“Acknowledging the bill buys another date.” → Costs establish no such obligation.

Alex’s authored answers arrive one minute apart. Week 11 asks where the dashboard stops counting.