-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMontyHall.vg
More file actions
26 lines (24 loc) · 1.08 KB
/
MontyHall.vg
File metadata and controls
26 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Monty Hall game: Guest tries to find the car
// Distribution semantics with quit punishment (pot = 40 wei, deposits = 20 each)
//
// Payoff structure:
// - Fair play: Winner gets 40 (all), loser gets 0
// * Winner utility: +20, Loser utility: -20
// * Note: In this betting game, loser loses entire deposit (no partial recovery)
// - Quit punishment: Quitter gets 0 (loses 100% of deposit, utility -20)
// * Non-quitter gets 40 (utility +20)
// * Quitting has same outcome as losing, but triggers abandonment
//
// This is a zero-sum betting game where partial deposit recovery doesn't make sense.
type door = {0, 1, 2}
game main() {
join Host() $ 20;
join Guest() $ 20;
commit Host(car: door) || { Guest -> 40 };
yield Guest(d: door) || { Host -> 40 };
yield Host(goat: door) where Host.goat != Guest.d || { Guest -> 40 };
yield Guest(switch: bool) || { Host -> 40 };
reveal Host(car: door) where Host.goat != Host.car;
withdraw { Guest -> ((Guest.d != Host.car) <-> Guest.switch) ? 40 : 0; // Fair play
Host -> ((Guest.d != Host.car) <-> Guest.switch) ? 0 : 40 }
}