Skip to Content
Puzzles for Programmers and Pros
book

Puzzles for Programmers and Pros

by Dennis E. Shasha
May 2007
Intermediate to advanced
240 pages
5h 20m
English
Wrox
Content preview from Puzzles for Programmers and Pros

1.7. Social Games

Since Adam Smith observed that the "invisible hand" of the free market would force self-interested manufacturers to offer low prices to consumers, governments and politics have never been the same. It took almost two more centuries, however, to achieve a proper mathematical analysis of the consequences of selfish behavior beginning with Morgenstern's and Von Neumann's game theory and the work of John Nash. (You may recall Nash as the mathematician who was the subject of the movie A Beautiful Mind.)

This puzzle explores game theory as it applies to social goods. Let's start with the invisible hand.

Bob and Alice are competitive manufacturers. If they fix their prices at a high level, then they will share the market and each will receive a profit of 3. If Alice decides to lower prices while Bob doesn't, then Alice will enjoy a profit of 4 while Bob gets a profit of 0, because nobody will buy from him. At that point, Bob will lower his price to receive at least a profit of 1. Similarly, Bob receives 4 and Alice 0 if the roles are reversed. Simply following their self-interest, both will lower their prices and their profits will drop to 1 each.

This arrangement can be expressed in the following table, where Bob's profit is shown on the left in each pair and Alice's profit is on the right. So, the upper right corner, for example, represents the state in which Bob charges a high price (and receives a profit of 0) and Alice charges a low price (and receives a profit ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Mazes for Programmers

Mazes for Programmers

Jamis Buck

Publisher Resources

ISBN: 9780470121689Purchase book