// LabGameTheorySimSpecs.swift. 11/6/2020, import Foundation class LabGameTheorySpecs { let strGameTheorySpecs :String = """ `` Lab Specs // Probability scrollbars for players A and B 0.00 1.00 0.10 .50 // 0: Player A 1.00 0.00 -0.10 .50 // 1: Player B 2 // 2: Number of decimals for probabilities `` Prob Specs ` Problem 0 Start Screen 1 - Pure Strategy Game: Prisoner's Dilemma // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Min // 2: Min or Max // Player A info Adam // 3: Name Confess Do_not_confess // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Beth // 6: Name Confess Do_not_confess // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 10 10 0 20 20 0 5 5 // 9: Player A strategy - Player B strategy 0 // 10: Payoff decimals ` Text Start // 11: Text `RED`BLDObjective:`BLD Illustrate the Nash equilibrium in the Prisoner's Dilemma game.`BLK `BLDDefinition:`BLD A Nash equilibrium exists when neither party has an incentive to change strategies assuming the the other party does not change strategies. `BLDSetting the scene:`BLD Adam and Beth are charged with a crime. The police have strong evidence and their fates depend on whether or not each confess: `0x2022 If both confess, each will receive a 10 year sentence. `0x2022 If neither confesses, both will receive a 5 year sentence. `0x2022 If only one confess, the confessor is freed while the other receives a 20 year sentence. The payoff matrix above illustrates the scenairos. We begin by considering the scenario in which Adam confesses and Beth does not. `0x2022 `BLDQuestion:`BLD If Beth does not change her strategy, does Adam have an incentive to change his strategy? Explain. `0x2022 `BLDQuestion:`BLD If Adam does not change his strategy, does Beth have an incentive to change her strategy? Explain. One of the partners has an incentive to change strategies. Use that partner's scrollbar to implement the change. Next, we consider the new scenario and ask the same questions. `0x2022 `BLDQuestion:`BLD If Beth does not change her strategy, does Adam have an incentive to change his strategy? Explain. `0x2022 `BLDQuestion:`BLD If Adam does not change his strategy, does Beth have an incentive to change her strategy? Explain. Again, one of the partners has an incentive to change strategies. Use that partner's scrollbar to implement the change. Continue this process. Show that we eventually come to a point at which neither has an incentive to change strategies assuming that the other will not change. This is a Nash equilibrium. `BLDQuestion:`BLD Is this Nash equilibrium efficient? That is, is there a scenario in which both Adam and Beth could be better off? Explain. ` Prob End ` Problem 1 Start Screen 2 - Pure Strategy Game: Matching Pennies Game // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Heads Tails // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Beth // 6: Name Heads Tails // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 1 -1 -1 1 -1 1 1 -1 // 9: Player A strategy - Player B strategy 0 // 10: Payoff decimals ` Text Start // 11: Text `RED`BLDObjective:`BLD Show that some games do not have a pure strategy Nash equilibrium.`BLK `BLDSetting the scene:`BLD Adam and Beth decide to play the matching penny game. Each decide secretly to place his/her penny heads up or tails up. The winner of the penny is determined by whether their coins match (both heads or both tails) or not (one head and one tail): `0x2022 If the coins match, Adam wins the penny. `0x2022 If the coins do not match, Beth wins the penny. Initially, Adam places his coin heads up and Beth tails up. Who wins the coin? To determine if this is a Nash equilibrium, we pose two questions. `0x2022 `BLDQuestion:`BLD If Beth does not change her strategy, does Adam have an incentive to change his strategy? Explain. `0x2022 `BLDQuestion:`BLD If Adam does not change his strategy, does Beth have an incentive to change her strategy? Explain. Adjust the scrollbars to see if any combination of strategies is a Nash equilibrium. `BLDQuestion:`BLD Must all games have a pure strategy Nash equilibrium? ` Prob End ` Problem 2 Start Screen 3 - Mixed Strategy Game: Matching Pennies Game // 0: Title // Type of game and expected value calculations if mixed Mixed F // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Heads Tails // 4: Strategies 0.1 0.5 // 5: Slider prob increment and default // Player B info Beth // 6: Name Heads Tails // 7: Strategies -0.1 0.5 // 8: Slider prob increment and default // Payoff information by cell 1 -1 -1 1 -1 1 1 -1 // 9: Player A strategy - Player B strategy 1 // 10: Payoff decimals ` Text Start // 11: Text `RED`BLDObjective:`BLD Show that the matching penny game has a mixed strategy Nash equilibrium.`BLK `BLDSetting the scene:`BLD In a mixed strategy game, each player vacillates between placing their coins heads up and tails up. Probability is key here. The players decide on the probabilities of placing their coins heads up and therefore tails up. `BLDQuestion:`BLD Can we find probabilities for each player that result in a Nash equilibrium. That is, can we find probabilities so that neither Adam nor Beth have an incentive to change strategies assuming that the other did not? By default, the lab specifies the probabilities of Adam placing his coin heads up at .50 and tails up as .50. The default specifications for Beth is also .50 and .50. Next, calculate the expected value of each player's payoff. `0x2022 Half the time both coins will be heads up or tails up: Adam wins $1 and Beth loses $1. `0x2022 Half the time one coin would heads up and one tails up: Adam loses $1 and Beth wins $1. Each player would expect to break even; the expected value for each player is 0. `BLDClaim:`BLD The default probabilities constitute a Nash equilibrium. To justify this claim, we pose two questions. `BLDQuestion:`BLD First, Does Adam have an incentive to change his probabilities assuming that Beth doesn't change hers? To answer this question use Adam's vertical scrollbar to adjust his probabilities. `BLDQuestion:`BLD Second, return Adam's probabilities to .50 and .50. Does Beth have an incentive to change her probabilities assuming that Adam doesn't change his? To answer this question use Beth's horizontal scrollbar to adjust her strategy. `BLDQuestion:`BLD Do the default probabilities .50 and .50 for both Adam and Beth constitute a Nash equilibrium? ` Prob End """ } ` Problem 3 Start Screen 4 - Pure Strategy Game: Battle of the Sexes // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Min // 2: Min or Max // Player A info Wife // 3: Name Ballet Boxing // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Husband // 6: Name Ballet Boxing // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 1 2 3 3 4 4 2 1 // 9: Player A strategy - Player B strategy 0 // 10: Payoff decimals ` Text Start // 11: Text `RED`BLDObjective:`BLD Show that a game can have multiple pure Nash equilibria.`BLK Setting the scene: This game involves a husband and wife. The first priority of each is to enjoy the evening together. But now there is a difference. The husband has a preference to spend it with his wife at a boxing match while the wife would prefer to spend the evening at a ballet. The following table ranks the possibilities for each spouse from best to worst where 1 is best and 4 is worst: Husband:1 and Wife:2 - Both attend boxing match Husband:2 and Wife:1 - Both attend ballet Husband:3 and Wife:3 - Husband attends boxing match and wife ballet Husband:4 and Wife:4 - Husband attends ballet and wife boxing match Adjust the scroll bars to search for Nash equilibria. If you find any, what are they and explain why each is a Nash equilibrium. ` Prob End ` Problem 4 Start Screen 5 - Mixed Strategy Game: Battle of the Sexes // 0: Title // Type of game and expected value calculations if mixed Mixed T // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Wife // 3: Name Ballet Boxing // 4: Strategies .1666666 0.6667 // 5: Slider prob increment and default // Player B info Husband // 6: Name Ballet Boxing // 7: Strategies -.1666666 0.3333 // 8: Slider prob increment and default // Payoff information by cell 2 1 0 0 0 0 1 2 // 9: Player A strategy - Player B strategy 2 // 10: Payoff decimals ` Text Start // 11: Text `RED`BLDObjective:`BLD Show that a game may not only have multiple equilibria, both pure and mixed strategy equilibria.`BLK Explain why a Nash equilibrium exists when the probability of the husband choosing ballet is .67 wife choosing ballet is .33. ` Prob End ` Problem x Start Screen x - Pure Strategy Game: Prisoner's Dilemma // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Rat Silent // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Beth // 6: Name Rat Silent // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 1 1 3 0 0 3 2 2 // 9: Player A strategy - Player B strategy 0 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: Utility Objective: Each player seeks to maximize his/her utility Pure strategy Nash equilibrium - Adam: Fink Beth: Fink Pareto move from Nash equilibrium - Adam: Silent Beth: Silent ` Prob End ` Problem x Start Screen x - Pure Strategy Game: Battle of the Sexes // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Min // 2: Min or Max // Player A info Husband // 3: Name Soccer Ballet // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Wife // 6: Name Soccer Ballet // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 1 2 3 3 4 4 2 1 // 9: Player A strategy - Player B strategy 0 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: 1 best outcome, 4 worst outcome 1: Be w/ spouse and attend your preferred activity 2: Be w/ spouse and attend your spouse's preferred activity 3: Be w/o spouse and attend your preferred activity 4: Be w/o spouse and attend your spouse's preferred activity `RED`BLDObjective:`BLD Each player seeks to obtain his/her best outcome. Two pure strategy Nash equilibria - Adam: Soccer Beth: Soccer and Adam: Ballet Beth: Ballet ` Prob End ` Problem x Start Screen x - Mixed Strategy Game: Serena vs Venus // 0: Title // Type of game and expected value calculations if mixed Mixed T // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Serena // 3: Name Down_the_line Cross_court // 4: Strategies 0.1 0.5 // 5: Slider prob increment and default // Player B info Venus // 6: Name Down_the_line Cross_court // 7: Strategies -0.1 0.5 // 8: Slider prob increment and default // Payoff information by cell .5 .5 .2 .8 .1 .9 .8 .2 // 9: Player A strategy - Player B strategy 2 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: The probability of winning the point for each player Objective: Each player seeks to maximize her probability of winning the point. Nash equilibrium: Serena: DownLineProb=.7 Venus: DownLineProb=.6 ` Prob End ` Problem 5 Start Screen 6 - Pure Strategy Game: Chicken // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Min // 2: Min or Max // Player A info Adam // 3: Name Swerve Straight // 4: Strategies 1.0 0.0 // 5: Slider prob increment and default // Player B info Beth // 6: Name Swerve Straight // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 2 2 3 1 1 3 4 4 // 9: Player A strategy - Player B strategy 0 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: 1 best outcome, 4 worst outcome 1: Win game 2: Tie game 3: Lose game 4: Death Objective: Each player seeks to obtain his/her best outcome. Two pure strategy Nash equilibria - Adam: Straight Beth: Swerve and Adam: Swerve Beth: Straight ` Prob End ` Problem 6 Start Screen 7 - Pure Strategy Game: Hawk-Dove // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Hawk Dove // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Beth // 6: Name Hawk Dove // 7: Strategies -1.0 1.0 // 8: Slider prob increment and default // Payoff information by cell -1 -1 8 0 0 8 4 4 // 9: Player A strategy - Player B strategy 2 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: Number of net calories each player receives from an 8 calorie . Objective: Each player seeks to maximize his/her calories. Hawk meets Hawk: Fight ensues and each expends 1 calorie Hawk meets Dove: No fight and Hawk takes all 8 calories Dove meets Dove: No fight and the split the 8 calories equally Two pure strategy Nash equilibria - Adam: Hawk Beth: Dove and Adam: Dove Beth: Hawk ` Prob End ` Problem 7 Start Screen 8 - Mixed Strategy Game: Hawk-Dove // 0: Title // Type of game and expected value calculations if mixed Mixed T // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Hawk Dove // 4: Strategies 0.1 0.5 // 5: Slider prob increment and default // Player B info Beth // 6: Name Hawk Dove // 7: Strategies -0.1 0.5 // 8: Slider prob increment and default // Payoff information by cell -1 -1 8 0 0 8 4 4 // 9: Player A strategy - Player B strategy 2 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: Number of net calories each player receives from an 8 calorie . Objective: Each player seeks to maximize his/her calories. Hawk meets Hawk: Fight ensues and each expends 1 calorie Hawk meets Dove: No fight and Hawk takes all 8 calories Dove meets Dove: No fight and the split the 8 calories equally Mixed strategy Nash equilibrium - Adam: HawkProb=.80 Beths: HawkProb=.80 ` Prob End ` Problem 8 Start Screen 9 - Pure Strategy Game: Speeding // 0: Title // Type of game and expected value calculations if mixed Pure F // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Speed No_Speed // 4: Strategies 1.0 1.0 // 5: Slider prob increment and default // Player B info Police // 6: Name Speed_trap No speed_trap // 7: Strategies -1.0 0.0 // 8: Slider prob increment and default // Payoff information by cell 25 5 5 15 10 10 10 0 // 9: Player A strategy - Player B strategy 2 // 10: Payoff decimals ` Text Start // 11: Text Payoff matrix: Net costs for Adam and the police Driver: SpeedTicket=20 TravelCostSpeeding=5 TravelCostNotSpeeding=10 Police: SpeedTrapCosts=10 SpeedExtern=15 TicketRev=20 Objective: Each player seeks to minimize net costs. No pure strategy Nash equilibrium ` Prob End ` Problem 9 Start Screen 10 - Mixed Strategy Game: Speeding // 0: Title // Type of game and expected value calculations if mixed Mixed T // 1: Pure/Mixed T/F // Objective of game Max // 2: Min or Max // Player A info Adam // 3: Name Speed No_speed // 4: Strategies 0.05 0.5 // 5: Slider prob increment and default // Player B info Police // 6: Name Speed_trap No speed_trap // 7: Strategies -0.05 0.5 // 8: Slider prob increment and default // Payoff information by cell 25 5 5 15 10 10 10 0 // 9: Player A strategy - Player B strategy 2 // 10: Payoff decimals ` Text Start // 11: Text No_speed_trap .05 .05 25 5 5 15 10 10 10 0 2 Payoff matrix: Net costs for Adam and the police Driver: SpeedTicket=20 TravelCostSpeeding=5 TravelCostNotSpeeding=10 Police: SpeedTrapCosts=10 SpeedExtern=15 TicketRev=20 Objective: Each player seeks to minimize net costs. Mixed strategy Nash equilibrium: Adam: SpeedProb=.5 Police: SpeedTrapProb=.25 ` Prob End