game theory for software developers at the boulder jug

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

Upload: matthew-mccullough

Post on 15-Apr-2017

449 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Game Theory for Software Developers at the Boulder JUG

Game Theoryfor Software Developers

by Matthew McCullough, Ambient Ideas, LLC

Page 2: Game Theory for Software Developers at the Boulder JUG

Matthew McCullough @matthewmccull

Page 3: Game Theory for Software Developers at the Boulder JUG
Page 4: Game Theory for Software Developers at the Boulder JUG

The Big Picture

Page 5: Game Theory for Software Developers at the Boulder JUG

4 Basic Elements

� Players� Strategies� Payoffs� Common knowledge

Page 6: Game Theory for Software Developers at the Boulder JUG

Games

Page 7: Game Theory for Software Developers at the Boulder JUG

Business

Page 8: Game Theory for Software Developers at the Boulder JUG

Economics

Page 9: Game Theory for Software Developers at the Boulder JUG

Game theory is...

Page 10: Game Theory for Software Developers at the Boulder JUG

Strategic interactive decision making

Page 11: Game Theory for Software Developers at the Boulder JUG

Strategy dependent on the choices of others

Page 12: Game Theory for Software Developers at the Boulder JUG

Economics as science

Page 13: Game Theory for Software Developers at the Boulder JUG

“Good fortune is what happens when opportunity meets with planning”

--Thomas Alva Edison

Page 14: Game Theory for Software Developers at the Boulder JUG

The Company

Page 15: Game Theory for Software Developers at the Boulder JUG

MacroCode

Page 16: Game Theory for Software Developers at the Boulder JUG

Consultancy

Page 17: Game Theory for Software Developers at the Boulder JUG

Underbid

Page 18: Game Theory for Software Developers at the Boulder JUG
Page 19: Game Theory for Software Developers at the Boulder JUG

Signaling

Page 20: Game Theory for Software Developers at the Boulder JUG

Stotting

Page 21: Game Theory for Software Developers at the Boulder JUG
Page 22: Game Theory for Software Developers at the Boulder JUG

Bid Low for the 1st Month

Page 23: Game Theory for Software Developers at the Boulder JUG
Page 24: Game Theory for Software Developers at the Boulder JUG

Build theNew Business

Page 25: Game Theory for Software Developers at the Boulder JUG

Decision Tree

Page 26: Game Theory for Software Developers at the Boulder JUG

C:1

Red

1/2 1:1

Raise

2:1

Meet2 -2

Pass1 -1

Fold1 -1

Black

1/2 1:2

Raise

2:1

Meet-2 2

Pass1 -1

Fold-1 1

Page 27: Game Theory for Software Developers at the Boulder JUG

C:1

Red

1/2 1:1

Raise

2:1

Meet2 -2

Pass1 -1

Fold1 -1

Black

1/2 1:2

Raise

2:1

Meet-2 2

Pass1 -1

Fold-1 1

Page 28: Game Theory for Software Developers at the Boulder JUG

C:1

Red

1/2 1:1

Raise

2:1

Meet2 -2

Pass1 -1

Fold1 -1

Black

1/2 1:2

Raise

2:1

Meet-2 2

Pass1 -1

Fold-1 1

Page 29: Game Theory for Software Developers at the Boulder JUG

C:1

Red

1/2 1:1

Raise

2:1

Meet2 -2

Pass1 -1

Fold1 -1

Black

1/2 1:2

Raise

2:1

Meet-2 2

Pass1 -1

Fold-1 1

Page 30: Game Theory for Software Developers at the Boulder JUG

Bounded Rationality

Page 31: Game Theory for Software Developers at the Boulder JUG

Beauty Contest

Page 32: Game Theory for Software Developers at the Boulder JUG

Beauty Contest Rules

� Guess between 1 and 100� Winner has the number at 70% of

the average guess

Page 33: Game Theory for Software Developers at the Boulder JUG

University Employees

Page 34: Game Theory for Software Developers at the Boulder JUG
Page 35: Game Theory for Software Developers at the Boulder JUG

The Red Button

Page 36: Game Theory for Software Developers at the Boulder JUG
Page 37: Game Theory for Software Developers at the Boulder JUG

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

Page 38: Game Theory for Software Developers at the Boulder JUG

appx. 30% push

Page 39: Game Theory for Software Developers at the Boulder JUG

Worried about retribution

Page 40: Game Theory for Software Developers at the Boulder JUG

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

Page 41: Game Theory for Software Developers at the Boulder JUG

appx. 70% push

Page 42: Game Theory for Software Developers at the Boulder JUG

Framed as defense

Page 43: Game Theory for Software Developers at the Boulder JUG

Bilateral Anterior Insular Cortex

Page 44: Game Theory for Software Developers at the Boulder JUG
Page 45: Game Theory for Software Developers at the Boulder JUG

� 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?

Page 46: Game Theory for Software Developers at the Boulder JUG

Hiring

Page 47: Game Theory for Software Developers at the Boulder JUG

Incentives

Page 48: Game Theory for Software Developers at the Boulder JUG

Motivating others to do what we want them to with rewards

Page 49: Game Theory for Software Developers at the Boulder JUG
Page 50: Game Theory for Software Developers at the Boulder JUG

Aligning the other player's desires with ours

Page 51: Game Theory for Software Developers at the Boulder JUG
Page 52: Game Theory for Software Developers at the Boulder JUG

credibleincredible

vs

Page 53: Game Theory for Software Developers at the Boulder JUG

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

Page 54: Game Theory for Software Developers at the Boulder JUG
Page 55: Game Theory for Software Developers at the Boulder JUG

$20 per resume

Page 56: Game Theory for Software Developers at the Boulder JUG
Page 57: Game Theory for Software Developers at the Boulder JUG
Page 58: Game Theory for Software Developers at the Boulder JUG

$1000 if hired

Page 59: Game Theory for Software Developers at the Boulder JUG
Page 60: Game Theory for Software Developers at the Boulder JUG
Page 61: Game Theory for Software Developers at the Boulder JUG

One shot?

Page 62: Game Theory for Software Developers at the Boulder JUG

Iterative?

Page 63: Game Theory for Software Developers at the Boulder JUG
Page 64: Game Theory for Software Developers at the Boulder JUG

Rules

Page 65: Game Theory for Software Developers at the Boulder JUG

Don't push changes after Thursday

Page 66: Game Theory for Software Developers at the Boulder JUG

Don't disable your anti-virus software

Page 67: Game Theory for Software Developers at the Boulder JUG

Must have 100% test coverage

Page 68: Game Theory for Software Developers at the Boulder JUG

Unintended Consequences

� Some quantity of rules are what make a game playable

� Don't capriciously create new rules at the last moment

Page 69: Game Theory for Software Developers at the Boulder JUG

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

Page 70: Game Theory for Software Developers at the Boulder JUG
Page 71: Game Theory for Software Developers at the Boulder JUG

Team Colors

Page 72: Game Theory for Software Developers at the Boulder JUG

Penny Altruism

Page 73: Game Theory for Software Developers at the Boulder JUG

Ultimatum Game

Page 74: Game Theory for Software Developers at the Boulder JUG

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

Page 75: Game Theory for Software Developers at the Boulder JUG
Page 76: Game Theory for Software Developers at the Boulder JUG

Alice Bob

Bank

Page 77: Game Theory for Software Developers at the Boulder JUG

Ultimatum

Offer 100

Accept

100,0

Decline

0,0

Offer 99 Offer 98 Offer 30 Offer 10

Accept Decline Accept DeclineAccept DeclineAccept Decline

99,1 0,0 0,010,900,030,700,098,2

Alic

eBo

b

Page 78: Game Theory for Software Developers at the Boulder JUG

Fair

Page 79: Game Theory for Software Developers at the Boulder JUG

70/30 split

Page 80: Game Theory for Software Developers at the Boulder JUG

Observed

Page 81: Game Theory for Software Developers at the Boulder JUG

Commission

Page 82: Game Theory for Software Developers at the Boulder JUG

Between ages of 3 & 5

Page 83: Game Theory for Software Developers at the Boulder JUG
Page 84: Game Theory for Software Developers at the Boulder JUG

Anonymously

Page 85: Game Theory for Software Developers at the Boulder JUG
Page 86: Game Theory for Software Developers at the Boulder JUG

Offer: 1 to 10

Page 87: Game Theory for Software Developers at the Boulder JUG

No Way Back

Page 88: Game Theory for Software Developers at the Boulder JUG
Page 89: Game Theory for Software Developers at the Boulder JUG
Page 90: Game Theory for Software Developers at the Boulder JUG

Strategically removing options

Page 91: Game Theory for Software Developers at the Boulder JUG

Prisoner's Dilemma

Page 92: Game Theory for Software Developers at the Boulder JUG
Page 93: Game Theory for Software Developers at the Boulder JUG

Alice Defects Alice Stays Silent

Bob Defects -4,-4 0,-5

Bob Stays Silent -5,0 -1,-1

Page 94: Game Theory for Software Developers at the Boulder JUG

Dev Tests Dev Shirks

QA Tests -1,-1 -1,0

QA Shirks 0,-1 -2,-2

Page 95: Game Theory for Software Developers at the Boulder JUG

Testing

Page 96: Game Theory for Software Developers at the Boulder JUG

Centipede Game

Page 97: Game Theory for Software Developers at the Boulder JUG

100% Test Coverage

Page 98: Game Theory for Software Developers at the Boulder JUG

Monty Hall

Page 99: Game Theory for Software Developers at the Boulder JUG

Bayes Formula

Page 100: Game Theory for Software Developers at the Boulder JUG

Birthday Attack

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

Page 101: Game Theory for Software Developers at the Boulder JUG

Birthday Attack

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

Page 102: Game Theory for Software Developers at the Boulder JUG

Retailer Selection

Page 103: Game Theory for Software Developers at the Boulder JUG

Red/Black Cards

Page 104: Game Theory for Software Developers at the Boulder JUG
Page 105: Game Theory for Software Developers at the Boulder JUG

Red/Black Negotiations

� 23 Red Cards with instructor� 23 Cards with students� What kind of deal do you hold out

for?

Page 106: Game Theory for Software Developers at the Boulder JUG

Alice loses three cards

Page 107: Game Theory for Software Developers at the Boulder JUG

Red/Black Negotiations

� 20 Red Cards with instructor� 23 Cards with students� What kind of deal do you hold out

for?

Page 108: Game Theory for Software Developers at the Boulder JUG

Acquisition

Page 109: Game Theory for Software Developers at the Boulder JUG

No!

Page 110: Game Theory for Software Developers at the Boulder JUG

Threat?

Page 111: Game Theory for Software Developers at the Boulder JUG

Commitment

Page 112: Game Theory for Software Developers at the Boulder JUG

Doomsday Device

Page 113: Game Theory for Software Developers at the Boulder JUG

Poison Pill

Page 114: Game Theory for Software Developers at the Boulder JUG

Brinksmanship

Page 115: Game Theory for Software Developers at the Boulder JUG

Chicken

Page 116: Game Theory for Software Developers at the Boulder JUG

What is it?

� Playing at high stakes� By not offering any small response,

scaring the other player of the consequences of the big response

Page 117: Game Theory for Software Developers at the Boulder JUG
Page 118: Game Theory for Software Developers at the Boulder JUG

Chicken

� Best way to play is to throw out the steering wheel

� But the other player must visibly take notice of that action

Page 119: Game Theory for Software Developers at the Boulder JUG
Page 120: Game Theory for Software Developers at the Boulder JUG

Partnerships

Page 121: Game Theory for Software Developers at the Boulder JUG

Incremental value

Page 122: Game Theory for Software Developers at the Boulder JUG

Shapley Value

Page 123: Game Theory for Software Developers at the Boulder JUG

Factory

Page 124: Game Theory for Software Developers at the Boulder JUG

Factory Sizes

� Small: $60,000� Medium: $90,000� Large: $130,000

Page 125: Game Theory for Software Developers at the Boulder JUG

Advertising

Page 126: Game Theory for Software Developers at the Boulder JUG

Warranty

Page 127: Game Theory for Software Developers at the Boulder JUG

Signaling

Page 128: Game Theory for Software Developers at the Boulder JUG

Quality

Page 129: Game Theory for Software Developers at the Boulder JUG

Lifetime

Page 130: Game Theory for Software Developers at the Boulder JUG

Google Adwords

Page 131: Game Theory for Software Developers at the Boulder JUG
Page 132: Game Theory for Software Developers at the Boulder JUG
Page 133: Game Theory for Software Developers at the Boulder JUG

Price

Page 134: Game Theory for Software Developers at the Boulder JUG

Thomas Schelling

Page 135: Game Theory for Software Developers at the Boulder JUG

Schelling points

Page 136: Game Theory for Software Developers at the Boulder JUG

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

Page 137: Game Theory for Software Developers at the Boulder JUG

How do they occur?

� Publicity � Competition� Frequency� Tradition

Page 138: Game Theory for Software Developers at the Boulder JUG

Google

Page 139: Game Theory for Software Developers at the Boulder JUG

Etsy

Page 140: Game Theory for Software Developers at the Boulder JUG
Page 141: Game Theory for Software Developers at the Boulder JUG

Schelling Number

Page 142: Game Theory for Software Developers at the Boulder JUG

Schelling Number

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

Page 143: Game Theory for Software Developers at the Boulder JUG

Vendor Trouble

Page 144: Game Theory for Software Developers at the Boulder JUG

Late

Page 145: Game Theory for Software Developers at the Boulder JUG

Fire them?

Page 146: Game Theory for Software Developers at the Boulder JUG

We need 10 of 12

Page 147: Game Theory for Software Developers at the Boulder JUG

Lemons

Page 148: Game Theory for Software Developers at the Boulder JUG

George Akerlof

Page 149: Game Theory for Software Developers at the Boulder JUG

Balancing Act

PeachesLemons PeachesPeaches

Pay

Page 150: Game Theory for Software Developers at the Boulder JUG

Balancing Act

PeachesLemons PeachesPeaches

Pay

Page 151: Game Theory for Software Developers at the Boulder JUG

Balancing Act

Peaches

Lemons

PeachesPeaches

Pay

Page 152: Game Theory for Software Developers at the Boulder JUG

Balancing Act

PeachesLemons Peaches

Pay

Page 153: Game Theory for Software Developers at the Boulder JUG

Balancing Act

PeachesLemons Peaches

Pay

Lemons

Page 154: Game Theory for Software Developers at the Boulder JUG

Balancing Act

Pay

Peaches

LemonsPeaches

Lemons

Page 155: Game Theory for Software Developers at the Boulder JUG

Balancing Act

PeachesLemons Peaches

Pay

Lemons

Page 156: Game Theory for Software Developers at the Boulder JUG

Grim Trigger

Page 157: Game Theory for Software Developers at the Boulder JUG

This is going to be our last project...

Page 158: Game Theory for Software Developers at the Boulder JUG

AliceBetrays

AliceCo-operates

BobBetrays 5,5 0,5

BobCo-operates 5,0 1,1

Page 159: Game Theory for Software Developers at the Boulder JUG

make it sequential

Page 160: Game Theory for Software Developers at the Boulder JUG

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

Page 161: Game Theory for Software Developers at the Boulder JUG

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

Page 162: Game Theory for Software Developers at the Boulder JUG

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

Page 163: Game Theory for Software Developers at the Boulder JUG

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

Page 164: Game Theory for Software Developers at the Boulder JUG

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

Page 165: Game Theory for Software Developers at the Boulder JUG

Co-operate Co-operate Co-operate Betray

Page 166: Game Theory for Software Developers at the Boulder JUG

Co-operate Co-operate Betray

Page 167: Game Theory for Software Developers at the Boulder JUG

Co-operate Betray

Page 168: Game Theory for Software Developers at the Boulder JUG

Betray

Page 169: Game Theory for Software Developers at the Boulder JUG

Simultaneous Shoe Bidding

Page 170: Game Theory for Software Developers at the Boulder JUG

What would you bid for this pair of shoes?

Page 171: Game Theory for Software Developers at the Boulder JUG

What would you bid if you only had a 50% chance of

getting the other shoe?

Page 172: Game Theory for Software Developers at the Boulder JUG
Page 173: Game Theory for Software Developers at the Boulder JUG

XKCD 601: Game Theory

Page 174: Game Theory for Software Developers at the Boulder JUG

Game Theoryfor Software Developers

by Matthew McCullough, Ambient Ideas, LLC

Page 175: Game Theory for Software Developers at the Boulder JUG

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/

Page 176: Game Theory for Software Developers at the Boulder JUG

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 UniversityJames 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

Page 177: Game Theory for Software Developers at the Boulder JUG

References: Blogs

� Mind Your Decisions� http://mindyourdecisions.com/blog/

� Game Theory Strategies� http://www.gametheorystrategies.com/

� Twitter, Barry Hughes� https://twitter.com/#!/gamethry

Page 178: Game Theory for Software Developers at the Boulder JUG

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

Page 179: Game Theory for Software Developers at the Boulder JUG

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

Page 180: Game Theory for Software Developers at the Boulder JUG

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

Page 181: Game Theory for Software Developers at the Boulder JUG

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