Skip to main content
SLOP1276 Applied Algorithmic Romance & Profile OptimizationSemester 1, 2027

Week 10 Tutorial: Stochastic Modeling of the First Date

Propagate a fictional conversation through a Markov chain, check a simulation against exact probabilities and resolve the Who pays deadlock.

13 May 2027

Inputs

Bring the Offline handover plan and Communication state machine, including the current cost version and explicit stop boundaries. Use the Week 10 notes and eleven-file offline workbook. The report constructs the actual earlier snapshots and confirms Week 9’s authored Atrium proposal; it then records arrival separately. A confirmed plan does not prove arrival, and arrival does not remove the stop state.

All transition probabilities, bills and responses are authored. No real meeting, private messages, payment or personal disclosure is needed. The event fixture continues Friday 7 May’s fictional plan; the tutorial remains Thursday 13 May. Model steps have no duration in minutes.

Finish with The simulator has booked a second date: the interactive quiz. Six new cases include a transition matrix, sampling diagram, seeded counts and meeting branches. Apply the week’s model and observation rules, then submit all six responses to unlock the score and worked explanations. The quiz is practice and carries no course marks.

Follow the 60-minute lecture selection and independent-work plan. Complete the preparation and open the workbook before Thursday. The four blocks below are the entire 90-minute tutorial; use existing lecture or study working for review and refinement. Remaining pack material belongs to the week’s independent study allocation.

90-minute tutorial

  1. 20 minutes — propagate exactly. Spend five minutes defining source rows and destination columns, ten deriving all two-step contributions, and five checking conservation. Starting at C, verify (0.31, 0.16, 0.32, 0.21) with the reference model. Keep already-absorbed mass in N/E. Explain why discarding C/A gives a different denominator.
  2. 30 minutes — simulate. Spend ten minutes tracing half-open categorical intervals, twelve implementing 1,000 and 10,000 two-step paths, and eight comparing errors. Reset each path to C; the ideal model assumes independent paths. Use seed 402010 and the supplied unsigned LCG for the literal checkpoint. Consume two draws per path, including after absorption. Record seed, generator, horizon, counts and absolute errors. Restarting the same seed makes the small run a prefix of the large run, not an independent replication.
  3. 20 minutes — test sensitivity. Spend eight minutes moving 0.10 from C→N to C→E and recomputing exactly, six comparing changed simulation counts, and six testing a deliberate mutation and restoration. Preserve row sums and absorbing states. Explain the 0.15 change in two-step N using separate paths. A matrix change is an assumption, not evidence that a topic causes better outcomes.
  4. 20 minutes — observation review and quiz. Use ten minutes to review your prepared records: three checking the confirmed handover and separate arrival, four checking the “Who pays?” trace through its actual costs, and three comparing observation labels and your memoryless counterexample. Include leaving with an unresolved bill and withdrawing a previous next-date agreement. Explain why eye contact cannot be a consent flag and why bill acknowledgement is not payment or an obligation to meet again. Use the final ten minutes for the six-case quiz: about eight minutes to respond and two to review the explanations after all cases are answered.

Worked checkpoints

Use C/A/N/E order consistently. Errors below are absolute differences in probability units.

CheckLiteral expected result
One step from C(0.50, 0.20, 0.20, 0.10)
Two steps from C(0.31, 0.16, 0.32, 0.21)
Two steps from A(0.24, 0.15, 0.19, 0.42)
1,000 paths, seed 402010Counts (310, 167, 297, 226); errors (0, 0.007, 0.023, 0.016).
10,000 paths, same seedCounts (3108, 1606, 3182, 2104); errors (0.0008, 0.0006, 0.0018, 0.0004).
Changed two-step vector(0.31, 0.16, 0.17, 0.36)
Changed 10,000-path counts(3108, 1606, 1711, 3575)
Transient mass at step two0.47 in both scenarios.
Bill tracewaiting → waiting → asked → asked → acknowledged.

C’s simulation error grows from zero to 0.0008 in the larger run. A correct sampler need not improve every cell on every seed. N’s larger-run baseline error is 0.18 percentage points. Keep the counts as well as rounded estimates so another student can reproduce the table.

Review the bill and observation record

Call the existing Week 9 export on a currently confirmed handover. The meeting initially remains awaiting-arrival; record both authored arrivals before proceeding. Keep week-09-v1:atrium-cover: Alex covers $12 in drinks and $2 transport, $14 total. Counterpart drinks are $0; counterpart transport is unknown. The café bill should be compared with $12, not Alex’s whole outing cost.

Replay the two waits, the explicit question about $12 and the two actor/version acknowledgements. Acknowledged records the supplied answers; it does not take payment. Change the drink bill to $14 or unknown: status becomes review. Do not allocate the difference using stale terms. Clarify and obtain a separate renewed agreement; either actor can leave while the bill remains unresolved.

Keep meeting status separate from next-date status: no relevant observation gives unobserved, one agreement pending, two distinct agreements agreed, and an explicit decline or withdrawal declined. “Nice time”, eye contact and simulated N are not agreement events. A decline cannot be retried. Leaving keeps the complete meeting snapshot terminal.

The absorbing N/E convention freezes the first endpoint in the probability exercise. It does not make a person’s agreement irrevocable. Discuss two histories mapped to C that need different next actions, such as a topic being new versus explicitly declined. Use authored examples; adding a state does not justify inventing its probabilities.

Make one check fail

Temporarily transpose P[i,j] in the row-vector update, asserting the edit matched. The literal one-step result must fail: initial C would become (0.50, 0.30, 0, 0). Restore and verify the passing result.

Alternatively replace categorical < with <=. A draw of zero from (0, 0, 1, 0) must still choose N; the mutation incorrectly selects a zero-mass destination. Restore it and retain the failure and passing output. Also test zero steps, invalid probabilities, N/E starts, missing arrival, stale versions, duplicate actors and terminal snapshots.

If you finish early, solve the first-step absorption equations. Eventual N from C is 16/29, changing to 9/29 in the sensitivity case. Expected absorption from C is 90/29 steps, not minutes. Explain why the finite-horizon vector answers a different question.

Deliverable: Date transition model

Save the state definitions and matrix, handwritten exact calculation, seeded code with draw contract, both count/error tables, sensitivity result, conservation and absorbing-state tests, one mutation/restoration result and one memorylessness critique. Include the actual cost version, arrival observation and bill/next-date trace. These form one Date transition model, not an extra essay or assessment.

Week 11 uses the distinction between mutually agreed, declined, pending and unobserved outcomes while retaining the fact that the meeting ended. It does not treat your simulated distribution as measured romantic evidence. Its separate 115-minute time log must not be replaced by model steps or the earlier 90-minute itinerary. Keep this exact/seeded comparison for the final project’s existing validation appendix.

Interactive quiz · 6 cases · about 8 minutes + 2 to review

The simulator has booked a second date

Six debugging tickets. Nobody told the simulator it cannot make plans.

Make a decision in every case, then select Reveal answers. You can change any response before submitting. Scores and explanations stay hidden until the whole quiz is answered.

All matrices, bills and observations are fictional teaching inputs. Cases 1–4 share a new matrix, with a different starting state specified in Case 4. C means conversation continues; A is the supplied “awkward silence” label; N and E freeze the first model endpoint: next date agreed or meeting ended. Steps are not minutes. Cases 5–6 use separate observation records, not simulated outcomes. Practice only: no course marks. Responses stay on this page; reloading starts a fresh attempt.

The cases are readable without JavaScript. Enable JavaScript to navigate, submit your responses and unlock the explanations.

Case 01 / 06The columns apply for a promotion

Check matrix orientation and conservation

A teammate stores source states in rows and destinations in columns, but uses next[j] = sum_i current[i] × P[j,i]. Starting at C, their first update returns (0.375, 0.25, 0, 0). They suggest dividing by its sum to hide the missing mass.

New authored matrix · C/A/N/E order on both axes
From / toCANE
C0.3750.250.250.125
A0.250.250.1250.375
N0010
E0001

Which repair preserves the supplied model?

Case 02 / 06The random draw sits on the fence

Apply half-open categorical intervals

Use the new C row (0.375, 0.25, 0.25, 0.125). One path has draw u = 0.625 at C. On its next step, sample the selected state with u = 0. A teammate changes the sampler from < to <= because “boundaries should count”.

Half-open intervals for the new C row: C from 0 inclusive to 0.375 exclusive; A from 0.375 inclusive to 0.625 exclusive; N from 0.625 inclusive to 0.875 exclusive; E from 0.875 inclusive to 1 exclusive.
Input intervals for one C transition. A left endpoint belongs to its interval; a right endpoint does not.

Model supplied
Scan destinations in C/A/N/E order, accumulating probability. Select the first destination for which u is strictly less than the cumulative total. N has row (0, 0, 1, 0); E has row (0, 0, 0, 1).

Which two-step trace and boundary rule are correct?

Case 03 / 06The endpoint forgets everyone already there

Sum all two-step paths into an absorbing state

Start a fresh distribution at C and use the same new matrix. A draft report counts only paths entering N for the first time on step two, dropping paths that reached N on step one. You need the unconditional probability of being in N after exactly two updates.

Same authored matrix · source rows, destination columns
From / toCANE
C0.3750.250.250.125
A0.250.250.1250.375
N0010
E0001

Model supplied
Partition by the intermediate state: C→C→N, C→A→N, C→N→N and C→E→N. Multiply along each path and add. Keep all initial paths in the denominator, including those still in C or A.

What is the probability of being in N after two steps, as a percentage? Enter the number only, without a % sign.

Enter one number. A calculator and your lecture notes are welcome.

Case 04 / 06More paths demand a better mark

Compare reproducible counts with an exact oracle

This separate run resets every path to A, using the same matrix for two steps. Its exact N probability is 0.21875. Both runs restart the workbook’s unsigned LCG at seed 202710, consuming two draws per path even after absorption. The teammate claims doubling paths must reduce every cell’s error.

Reproducible synthetic counts · C/A/N/E order
PathsC / A / N / E counts
800120 / 97 / 177 / 406
1,600243 / 208 / 345 / 804

Model supplied
Estimate N as its count divided by all paths. Absolute error in percentage points is 100 × |estimate − 0.21875|. A calculator is welcome.

Which interpretation matches both the arithmetic and the draw contract?

Case 05 / 06The café adds a line item to the agreement

Review changed costs without blocking departure

A separate confirmed split-drinks plan, quiz-date-v2, specifies two $8 drinks and $2 of Alex’s bus travel. Counterpart transport is unknown. Both arrivals are recorded at 17:20. After two waits, an ask-bill event names quiz-date-v2 but reports an $18 café bill. Alex wants to leave before any revised terms are agreed.

What should the bill check and meeting record do?

Case 06 / 06The absorbing state refuses to hear a withdrawal

Export observations without reviving an ended meeting

Each independent branch begins with the same confirmed cost version and both arrivals already recorded at 17:20. All listed observations have distinct IDs and chronological times. The simulation team also reports N, but no simulation state is an observation event.

Three authored branches · agreements name the responding actor
BranchRecorded sequence
AAlex agrees 17:35; counterpart agrees 17:36, then withdraws 17:37; Alex leaves 17:40.
BNo next-date response; counterpart leaves 17:40.
CAlex agrees 17:35; counterpart leaves 17:40; queued counterpart agreement arrives 17:41.

Which Week 11 export preserves the observed outcomes and stop boundaries?

Answer all 6 cases to unlock your score and the worked explanations.

The spec

Before you finish, check your engineering artefact against these requirements.

Teaching team