Problem Solving — CS & DS

Lecture 31 — Strategy Under Uncertainty

Learning objectives

Case-based lecture: you attempt, we discuss, then we reveal.

Today

The plan

Key definitions

Key definitions

Explain each in one breath; the cases will do the heavy lifting.
Worked example

The Umbrella Decision: expected value with a decision tree

cs-121

Carry an umbrella (mild inconvenience, cost 2) or not. Rain ruins the day (cost 10). Forecast says 30% rain. What does expected cost say, and when does it flip?

p = 0.3
ev_carry = 2
ev_leave = p * 10
flip = 2 / 10
print(ev_carry < ev_leave, flip)

Expected: carry the umbrella (EV 2 vs 3); ranking flips below 20% rain chance

Cost: O(1) per decision; the tree's value is in forcing outcomes OUT of the prose.

Worked example

The Game Show Switch: conditional probability decides

cs-122

Three doors, one prize. You pick door 1; the host opens door 3 (empty). Should you switch to door 2?

stay_wins = switch_wins = 0
for prize in (1, 2, 3):
    if prize == 1:
        stay_wins += 1
    else:
        switch_wins += 1
print(stay_wins, switch_wins)

Expected: switch: wins 2/3 vs staying 1/3

Cost: O(1) enumeration; the simulation version is O(trials) and validates the tally.

Worked example

The Insurance Riddle: why a bad bet is still rational

cs-123

Insurance costs 50; the insured event (probability 1%) costs 4000. EV says decline (-50 vs -40 expected loss). Why do rational people buy, and what decision rule are they using?

ev_buy = -50
ev_skip = 0.01 * -4000
print(ev_buy, ev_skip, ev_buy < ev_skip)

Expected: EV(buy) -50 vs EV(skip) -40: insurance loses on EV, wins on ruin-avoidance

Cost: O(1); the hard part is admitting which rule you chose.

Case attempt · lecture 31
Case cs-121 · Beginner

The Umbrella Decision

Carry an umbrella or not under a 30% rain chance with asymmetric costs. Payoff table, expected values, and why the bigger loss dominates.

⏱ 5 minutes — attempt now

Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.

Discussion

cs-121 — discuss

Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-121 — not embedded in this deck.

Case attempt · lecture 31
Case cs-122 · Foundational

The Game Show Switch

The three-door switch-or-stay problem, argued with an outcome table and then by simulation. Updating on new information.

⏱ 5 minutes — attempt now

Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.

Discussion

cs-122 — discuss

Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-122 — not embedded in this deck.

Case attempt · lecture 31
Case cs-123 · Intermediate

The Insurance Riddle

Insurance costs more than expected loss. Why rational people still buy: variance, ruin, and utility in plain language. EV as a tool, not a god.

⏱ 5 minutes — attempt now

Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.

Discussion

cs-123 — discuss

Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-123 — not embedded in this deck.

Case attempt · lecture 31
Case cs-124 · Advanced

The Auction Bluff

A sealed-bid popup quiz auction for the last textbook. Reason one level up from naive bids; introduce thinking about others' thinking.

⏱ 5 minutes — attempt now

Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.

Discussion

cs-124 — discuss

Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-124 — not embedded in this deck.

Check yourself

Common misconceptions

Summary

Summary & exit question

Exit question (choose one, 60 seconds)

  1. What does expected value compare, and what does it ignore?
  2. Why does switching win in cs-122?
  3. When is a dominated strategy visible instantly?
Expected answers (instructor): average outcomes; it ignores variance (risk) unless you add it the host's reveal leaks information; 2/3 of outcomes favour switching one option's payoffs are worse in every column of the table
→ / space: next · ←: back · Home/End: jump · Ctrl+P → PDF