Slide 1

Slide 1 text

Game Theory for Software Developers by Matthew McCullough, Ambient Ideas, LLC

Slide 2

Slide 2 text

Matthew McCullough @matthewmccull

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

The Big Picture

Slide 5

Slide 5 text

4 Basic Elements Players Strategies Payoffs Common knowledge

Slide 6

Slide 6 text

Games

Slide 7

Slide 7 text

Business

Slide 8

Slide 8 text

Economics

Slide 9

Slide 9 text

Game theory is...

Slide 10

Slide 10 text

Strategic interactive decision making

Slide 11

Slide 11 text

Strategy dependent on the choices of others

Slide 12

Slide 12 text

Economics as science

Slide 13

Slide 13 text

“Good fortune is what happens when opportunity meets with planning” --Thomas Alva Edison

Slide 14

Slide 14 text

The Company

Slide 15

Slide 15 text

MacroCode

Slide 16

Slide 16 text

Consultancy

Slide 17

Slide 17 text

Underbid

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Signaling

Slide 20

Slide 20 text

Stotting

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Bid Low for the 1st Month

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

Build the New Business

Slide 25

Slide 25 text

Decision Tree

Slide 26

Slide 26 text

C:1 Red 1/2 1:1 Raise 2:1 Meet 2 -2 Pass 1 -1 Fold 1 -1 Black 1/2 1:2 Raise 2:1 Meet -2 2 Pass 1 -1 Fold -1 1

Slide 27

Slide 27 text

C:1 Red 1/2 1:1 Raise 2:1 Meet 2 -2 Pass 1 -1 Fold 1 -1 Black 1/2 1:2 Raise 2:1 Meet -2 2 Pass 1 -1 Fold -1 1

Slide 28

Slide 28 text

C:1 Red 1/2 1:1 Raise 2:1 Meet 2 -2 Pass 1 -1 Fold 1 -1 Black 1/2 1:2 Raise 2:1 Meet -2 2 Pass 1 -1 Fold -1 1

Slide 29

Slide 29 text

C:1 Red 1/2 1:1 Raise 2:1 Meet 2 -2 Pass 1 -1 Fold 1 -1 Black 1/2 1:2 Raise 2:1 Meet -2 2 Pass 1 -1 Fold -1 1

Slide 30

Slide 30 text

Bounded Rationality

Slide 31

Slide 31 text

Beauty Contest

Slide 32

Slide 32 text

Beauty Contest Rules Guess between 1 and 100 Winner has the number at 70% of the average guess

Slide 33

Slide 33 text

University Employees

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

The Red Button

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

The $2 Button: Rules Gather 100 friends Everyone starts with a $100 prize Everyone gets a button If you push, it deletes $2 from everyone else's prize Everyone gets one button push

Slide 38

Slide 38 text

appx. 30% push

Slide 39

Slide 39 text

Worried about retribution

Slide 40

Slide 40 text

The $2 Button: New Rules Gather 100 random players Everyone starts with a $100 prize Everyone gets a button If you push, it deletes $2 from everyone else's prize Everyone gets one button push If you push, you cut your losses in half

Slide 41

Slide 41 text

appx. 70% push

Slide 42

Slide 42 text

Framed as defense

Slide 43

Slide 43 text

Bilateral Anterior Insular Cortex

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

What if everyone had a meet and greet in advance? What if everyone knew each other? What if everyone was a family member? Red Button Coalitions?

Slide 46

Slide 46 text

Hiring

Slide 47

Slide 47 text

Incentives

Slide 48

Slide 48 text

Motivating others to do what we want them to with rewards

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Aligning the other player's desires with ours

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

credible incredible vs

Slide 53

Slide 53 text

Big sale, 80% off for a limited time only!**

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

$20 per resume

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

$1000 if hired

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

One shot?

Slide 62

Slide 62 text

Iterative?

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

Rules

Slide 65

Slide 65 text

Don't push changes after Thursday

Slide 66

Slide 66 text

Don't disable your anti-virus software

Slide 67

Slide 67 text

Must have 100% test coverage

Slide 68

Slide 68 text

Unintended Consequences Some quantity of rules are what make a game playable Don't capriciously create new rules at the last moment

Slide 69

Slide 69 text

Scoring for the other Team 1994: Barbados vs. Grenada Must win by 2 goals to advance B2:G1 Goals count double in overtime Grenada began defending Barbados' goal

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

Team Colors

Slide 72

Slide 72 text

Penny Altruism

Slide 73

Slide 73 text

Ultimatum Game

Slide 74

Slide 74 text

Ultimatum Game Rules The purse is provided by a bank Players are not allowed to communicate There is only one decision to be made There are 100 strategies

Slide 75

Slide 75 text

No content

Slide 76

Slide 76 text

Alice Bob Bank

Slide 77

Slide 77 text

Ultimatum Offer 100 Accept 100,0 Decline 0,0 Offer 99 Offer 98 Offer 30 Offer 10 Accept Decline Accept Decline Accept Decline Accept Decline 99,1 0,0 0,0 10,90 0,0 30,70 0,0 98,2 Alice Bob

Slide 78

Slide 78 text

Fair

Slide 79

Slide 79 text

70/30 split

Slide 80

Slide 80 text

Observed

Slide 81

Slide 81 text

Commission

Slide 82

Slide 82 text

Between ages of 3 & 5

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

Anonymously

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

Offer: 1 to 10

Slide 87

Slide 87 text

No Way Back

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

Strategically removing options

Slide 91

Slide 91 text

Prisoner's Dilemma

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

Alice Defects Alice Stays Silent Bob Defects -4,-4 0,-5 Bob Stays Silent -5,0 -1,-1

Slide 94

Slide 94 text

Dev Tests Dev Shirks QA Tests -1,-1 -1,0 QA Shirks 0,-1 -2,-2

Slide 95

Slide 95 text

Testing

Slide 96

Slide 96 text

Centipede Game

Slide 97

Slide 97 text

100% Test Coverage

Slide 98

Slide 98 text

Monty Hall

Slide 99

Slide 99 text

Bayes Formula

Slide 100

Slide 100 text

Birthday Attack With 26 people in the room, what is the chance that someone has January 1st as their birthday?

Slide 101

Slide 101 text

Birthday Attack With 26 people in the room, what is the chance that any two share a birthday?

Slide 102

Slide 102 text

Retailer Selection

Slide 103

Slide 103 text

Red/Black Cards

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

Red/Black Negotiations 23 Red Cards with instructor 23 Cards with students What kind of deal do you hold out for?

Slide 106

Slide 106 text

Alice loses three cards

Slide 107

Slide 107 text

Red/Black Negotiations 20 Red Cards with instructor 23 Cards with students What kind of deal do you hold out for?

Slide 108

Slide 108 text

Acquisition

Slide 109

Slide 109 text

No!

Slide 110

Slide 110 text

Threat?

Slide 111

Slide 111 text

Commitment

Slide 112

Slide 112 text

Doomsday Device

Slide 113

Slide 113 text

Poison Pill

Slide 114

Slide 114 text

Brinksmanship

Slide 115

Slide 115 text

Chicken

Slide 116

Slide 116 text

What is it? Playing at high stakes By not offering any small response, scaring the other player of the consequences of the big response

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

Chicken Best way to play is to throw out the steering wheel But the other player must visibly take notice of that action

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

Partnerships

Slide 121

Slide 121 text

Incremental value

Slide 122

Slide 122 text

Shapley Value

Slide 123

Slide 123 text

Factory

Slide 124

Slide 124 text

Factory Sizes Small: $60,000 Medium: $90,000 Large: $130,000

Slide 125

Slide 125 text

Advertising

Slide 126

Slide 126 text

Warranty

Slide 127

Slide 127 text

Signaling

Slide 128

Slide 128 text

Quality

Slide 129

Slide 129 text

Lifetime

Slide 130

Slide 130 text

Google Adwords

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

No content

Slide 133

Slide 133 text

Price

Slide 134

Slide 134 text

Thomas Schelling

Slide 135

Slide 135 text

Schelling points

Slide 136

Slide 136 text

Schelling Points Grand Central Station in New York 99¢ on the App Store $39.95 for FPS games DVD releases on Tuesday Comic books releases on Wednesday Theater film releases on Friday

Slide 137

Slide 137 text

How do they occur? Publicity Competition Frequency Tradition

Slide 138

Slide 138 text

Google

Slide 139

Slide 139 text

Etsy

Slide 140

Slide 140 text

No content

Slide 141

Slide 141 text

Schelling Number

Slide 142

Slide 142 text

Schelling Number Write down an two-digit odd number in which both the digits are different

Slide 143

Slide 143 text

Vendor Trouble

Slide 144

Slide 144 text

Late

Slide 145

Slide 145 text

Fire them?

Slide 146

Slide 146 text

We need 10 of 12

Slide 147

Slide 147 text

Lemons

Slide 148

Slide 148 text

George Akerlof

Slide 149

Slide 149 text

Balancing Act Peaches Lemons Peaches Peaches Pay

Slide 150

Slide 150 text

Balancing Act Peaches Lemons Peaches Peaches Pay

Slide 151

Slide 151 text

Balancing Act Peaches Lemons Peaches Peaches Pay

Slide 152

Slide 152 text

Balancing Act Peaches Lemons Peaches Pay

Slide 153

Slide 153 text

Balancing Act Peaches Lemons Peaches Pay Lemons

Slide 154

Slide 154 text

Balancing Act Pay Peaches Lemons Peaches Lemons

Slide 155

Slide 155 text

Balancing Act Peaches Lemons Peaches Pay Lemons

Slide 156

Slide 156 text

Grim Trigger

Slide 157

Slide 157 text

This is going to be our last project...

Slide 158

Slide 158 text

Alice Betrays Alice Co-operates Bob Betrays 5,5 0,5 Bob Co-operates 5,0 1,1

Slide 159

Slide 159 text

make it sequential

Slide 160

Slide 160 text

Co-operate Co-operate Co-operate Co-operate Co-operate Co-operate Co-operate Co-operate

Slide 161

Slide 161 text

Co-operate Co-operate Co-operate Co-operate Co-operate Co-operate Co-operate Betray

Slide 162

Slide 162 text

Co-operate Co-operate Co-operate Co-operate Co-operate Co-operate Betray

Slide 163

Slide 163 text

Co-operate Co-operate Co-operate Co-operate Co-operate Betray

Slide 164

Slide 164 text

Co-operate Co-operate Co-operate Co-operate Betray

Slide 165

Slide 165 text

Co-operate Co-operate Co-operate Betray

Slide 166

Slide 166 text

Co-operate Co-operate Betray

Slide 167

Slide 167 text

Co-operate Betray

Slide 168

Slide 168 text

Betray

Slide 169

Slide 169 text

Simultaneous Shoe Bidding

Slide 170

Slide 170 text

What would you bid for this pair of shoes?

Slide 171

Slide 171 text

What would you bid if you only had a 50% chance of getting the other shoe?

Slide 172

Slide 172 text

No content

Slide 173

Slide 173 text

XKCD 601: Game Theory

Slide 174

Slide 174 text

Game Theory for Software Developers by Matthew McCullough, Ambient Ideas, LLC

Slide 175

Slide 175 text

References: Software Gambit http://www.gambit-project.org/doc/index.html http://www.gambit-project.org/doc/samples.html Game Theory Explorer http://gametheoryexplorer.appspot.com/builder/

Slide 176

Slide 176 text

References: Research The Teaching Company: Game Theory Video Course http://www.thegreatcourses.com/tgc/courses/Course_Detail.aspx?cid=1426 Professor Scott P. Stevens, Ph.D. The Pennsylvania State University James Madison University Bookmarks http://www.delicious.com/matthew.mccullough/gametheory Range Voting http://rangevoting.org/TBlecture.html Market for Lemons http://en.wikipedia.org/wiki/Market_for_lemons http://nobelprize.org/nobel_prizes/economics/laureates/2001/akerlof-article.html http://www.springerlink.com/content/h3h8530156276515/ http://hydrogen.its.ucdavis.edu/eec/education/EEC-classes/eeclimate/class- readings/akerlof-the%20market%20for%20lemons.pdf

Slide 177

Slide 177 text

References: Blogs Mind Your Decisions http://mindyourdecisions.com/blog/ Game Theory Strategies http://www.gametheorystrategies.com/ Twitter, Barry Hughes https://twitter.com/#!/gamethry

Slide 178

Slide 178 text

References: Books Theory of Games and Economic Behavior http://en.wikipedia.org/wiki/Theory_of_Games_and_Economic_Behavior http://press.princeton.edu/titles/7802.html http://www.amazon.com/Economic-Behavior-Commemorative-Princeton-Editions/ dp/0691130612/ref=sr_1_1?ie=UTF8&qid=1310015156&sr=8-1 Rock, Paper, Scissors: Game Theory in Everyday Life http://www.amazon.com/Rock-Paper-Scissors-Theory-Everyday/dp/0465009387/ ref=sr_1_2?ie=UTF8&qid=1310490759&sr=8-2 The Art of Strategy: A Game Theorist's Guide to Success in Business and Life http://www.amazon.com/Art-Strategy-Theorists-Success-Business/dp/0393337170/ ref=pd_bxgy_b_text_c Co-Opetition : A Revolution Mindset That Combines Competition and Cooperation : The Game Theory Strategy That's Changing the Game of Business http://www.amazon.com/Co-Opetition-Revolution-Combines-Competition- Cooperation/dp/0385479506/ref=pd_sim_b_1

Slide 179

Slide 179 text

References: People John von Neumann http://en.wikipedia.org/wiki/John_von_neumann Thomas Schelling http://en.wikipedia.org/wiki/Thomas_Schelling John Forbes Nash http://en.wikipedia.org/wiki/John_Forbes_Nash John Harsanyi http://en.wikipedia.org/wiki/John_Harsanyi

Slide 180

Slide 180 text

Photo Credits 100 Dollar Bill Roll http://www.flickr.com/photos/85473033@N00/3367543296 Pennies http://flic.kr/p/6ucLDE http://flic.kr/p/6u8BEa Earth http://flic.kr/p/9DTDXi Dice http://flic.kr/p/9g1aZc Cards http://flic.kr/p/4UwZc6 http://flic.kr/p/6FKnGu http://flic.kr/p/4V67rx Happy Hour http://www.flickr.com/photos/beleaveme/3276175127/ Prison http://flic.kr/p/38wBWq

Slide 181

Slide 181 text

Other Ideas Bounded Rationality 2-3 event horizon Typing Pooling or separating equilibria Prisoner's Dilemma with an Arbiter Tragedy of the Commons Air pollution Mass transit tickets Overfishing Volunteer's Dilemma Witnessing a crime