You are here

Power-Up: Unlocking the Hidden Mathematics in Video Games

Matthew Lane
Publisher: 
Princeton University Press
Publication Date: 
2017
Number of Pages: 
264
Format: 
Hardcover
Price: 
29,95
ISBN: 
9780691161518
Category: 
General
BLL Rating: 

The Basic Library List Committee suggests that undergraduate mathematics libraries consider this book for acquisition.

[Reviewed by
David S. Mazel
, on
07/25/2017
]

A brief confession: I do not usually think about mathematics when I play computer games. Maybe others do, but I don’t. Sure, there is programming and math within the game, but I have never considered applying mathematical ideas to the play of games. Matthew Lane, the author of Power-Up, has given this thought and written a highly readable, fun, and educational book. He shows us how to apply mathematics to many different computer games and gives a tour of far-reaching mathematical ideas.

We discuss parts of four chapters from the book to give an idea of the level of mathematics Lane uses and to see the breath of his ideas.

Our first example is from the chapter titled “Repeat Offenders.” In February 2012 the game company OMGPOP released its game Draw Something for mobile devices. The game was similar to Pictionary ― players draw a picture from a selected word ― and within two months it had been downloaded over 35 million times and had 15 million daily users. It was so popular that the gaming company Zynga paid nearly $200 million for OMGPOP in March 2012. The number of daily users peaked in April 2012. After thirty days, however, the number of daily users shrunk by 40%, from 15 million to 9 million. At the end of summer 2013 Zynga closed OMGPOP despite paying close to $200 million for the company less than two years prior.

What happened to OMGPOP and its game Draw Something? Math, that’s what.

At the release of Draw Something, Justin Davis wrote a prescient article saying the game had too small a word pool to work. How small is small? The word pool was estimated at 2000 words. It may seem that 2000 words is fairly large. Lane shows the reader that 2000 words is not nearly enough. Let’s see why.

Here’s how the game is played. A player is presented with three words from the word pool, each with a varying level of difficulty to draw. The same three words are always presented together as a triplet. With an estimate of 1800 words a triplet means there are 600 unique triplets. Lane estimates daily active users saw 480 triplets over a thirty day period, including duplicates. The expected number of duplicates for 480 triplets out of a pool of 600 is given by the number: R(480, 600) where, for the general case, \[ R(k,N) = k-N \left( 1-\left(1-\frac{1}{N}\right)^k \right).\] (The author derives this expression step-by-step.) We find \( R(480, 600) = 149.4 \) duplicates, which means 30% of the selections seen over month are duplicates. After a while, players tire of the duplicates — the popularity of the game plummeted.

Our second example is “What’s in a Score?” Here we meet more lovely mathematics and Lane shows us just how deeply one can go just by looking at game scores. The player of the game Sunny Day has to jump over cars and with each jump he scores points. At the end of game, he gets bonus points. The question Lane asks is: Can you tell what the player did by looking at the score? The question seems either simple or unanswerable. It is not generally unanswerable because we see other games in the book with scoring that does, in fact, have only certain possible values. For example, Lane shows us how to recognize fictitious high scores.

In Sunny Day, however, the question is not simple. Lane shows the score is a sum of square integers. He analyzes scoring by looking at partitions of integers and shows us just how many partitions there are as the value of the integer grows. Along the way we see Hardy’s and Ramanujan’s closed-form approximation for the number of partitions and we enjoy ever more mathematics. I was amazed that Lane could take the simple idea of a score and use it to present so much mathematics.

Our third example is “Gaming Complexity.” In this chapter Mr. Lane shows us how the simple game of Tetris is actually computationally difficult. The ideas of P- and NP-complexity appear when we find some problems are difficult to solve, but easy to check if a solution is correct. Tetris, for instance, is NP-complete so we don’t have an algorithm to quickly play Tetris but if we were provided an algorithm, we could verify if it works.

An old favorite, Minesweeper, is here. Lane shows us the problem of checking the consistency of a board is NP-complete. I have played a fair share of Minesweeper and only checked local (very local!) board consistency. Yet, Minesweeper presents a fundamental idea of computation; who knew?

Our fourth and final example is “Order in Chaos.” Here we find mathematical billiards when Lane shows us games with bouncing projectiles to demonstrate chaotic dynamics. We see square configurations with projectiles having non-chaotic trajectories and we also see elliptical configurations so projectiles have chaotic trajectories. The author provides excellent explanations and more examples to leave the reader with an insightful understanding the ideas.

There are more games and surprises to be had, we have only touched on a few. Overall the book is excellent. Lane has written a high readable text with colorful illustrations. You won’t regret reading it and maybe Power Up will add a new level of insight to your computer gaming.


David S. Mazel is a practicing engineer in Washington, DC. He welcomes your thoughts and feedback. He can be reached at mazeld at gmail dot com.

Acknowledgments xi
Introduction 1
1. Let's Get Physical 7
1.1 Platforming Perils 7
1.2 Platforming in Three Dimensions 10
1.3 LittleBigPlanet: Exploring Physics through Gameplay 12
1.4 From 2D to 3D: Bending Laws in Portal 14
1.5 Exploring Reality with A Slower Speed of Light 18
1.6 Exploring Alternative Realities 21
1.7 Beyond Physics: Minecraft or Mine Field? 26
1.8 Closing Remarks 27
1.9 Addendum: Describing Distortion 29
2. Repeat Offenders 34
2.1 Let's Play the Feud! 34
2.2 Game Shows and Birthdays 36
2.3 Beyond the First Duplicate 39
2.4 The Draw Something Debacle 41
2.5 Delayed Repetition: Increasing N 46
2.6 Delayed Repetition:Weight Lifting 48
2.7 The Completionist's Dilemma 53
2.8 Closing Remarks 55
2.9 Addendum: In Search of a Minimal k 55
3. Get Out the Voting System 58
3.1 Everybody Votes, but Not for Everything 58
3.2 Plurality Voting: An Example 60
3.3 Ranked-Choice Voting Systems and Arrow's Impossibility Theorem 61
3.4 An Escape from Impossibility? 66
3.5 Is There a "Best" System? 68
3.6 What Game Developers Know that Politicians Don't 71
3.7 The Best of the Rest 76
3.8 Closing Remarks 82
3.9 Addendum: TheWilson Score Confidence Interval 83
4. Knowing the Score 86
4.1 Ranking Players 86
4.2 Orisinal Original 87
4.3 What's in a Score? 91
4.4 Threes! Company 98
4.5 A Mathematical Model of Threes! 100
4.6 Invalid Scores 105
4.7 Lowest of the Low 109
4.8 Highest of the High 116
4.9 Closing Remarks 121
5. The Thrill of the Chase 122
5.1 I'ma GonnaWin! 122
5.2 Shell Games 123
5.3 Green-Shelled Monsters 125
5.4 Generalizations and Limitations 129
5.5 Seeing Red 131
5.6 Apollonius Circle Pursuit 134
5.7 Overview of aWinning Strategy 136
5.8 Pinpointing the Intersections 141
5.9 Blast Radius 145
5.10 The Pursuer and Pursued in Ms. Pac-Man 148
5.11 Concluding Remarks 153
5.12 Addendum: The Pursuit Curve for Red Shells and a Refined Inequality 153
6. Gaming Complexity 158
6.1 From Russia with Fun 158
6.2 P, NP, and Kevin Bacon 160
6.3 Desktop Diversions 165
6.4 Platforming Problems 169
6.5 Fetch Quests: An Overview 170
6.6 Fetch Quests and Traveling Salesmen 175
6.7 Closing Remarks 183
7. The Friendship Realm 184
7.1 Taking It to the Next Level 184
7.2 Friendship as Gameplay: The Sims and Beyond 186
7.3 A Game-Inspired Friendship Model 190
7.4 Approximations to the Model 193
7.5 The Cost of Maintaining a Friendship 195
7.6 From Virtual Friends to Realistic Romance 198
7.7 Modeling Different Personalities 200
7.8 Improving the Model (Again!) 203
7.9 Concluding Remarks 209
8. Order in Chaos 210
8.1 The Essence of Chaos 210
8.2 Love in the Time of Chaos 211
8.3 Shell Games Revisited 216
8.4 How's theWeather? 223
8.5 Concluding Remarks 225
9. The Value of Games 227
9.1 More Important Than Math 227
9.2 Why Games? 230
9.3 What Next? 242
Notes 244
Bibliography 269
Index 273