Buying Options

Unlimited reading. Over 2 million titles. Learn more
Read for £0.00
This title is available to read for £0.00 for Prime members. Learn More
Kindle Price: £3.99

These promotions will be applied to this item:

Some promotions may be combined; others are not eligible to be combined with other offers. For details, please see the Terms & Conditions associated with these promotions.

Deliver to your Kindle or other device

Buy for others

Give as a gift or purchase for a group.
Learn more

Buying and sending Kindle Books to others

Select quantity
Choose delivery method and buy Kindle Books
Recipients can read on any device

These Kindle Books can only be redeemed by recipients in your country. Redemption links and Kindle Books cannot be resold.

This item has a maximum order quantity limit.

Deliver to your Kindle or other device

Share <Embed>
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet or computer - no Kindle device required. Learn more.

Read instantly on your browser with Kindle Cloud Reader.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Algorithms to Live By: The Computer Science of Human Decisions by [Brian Christian, Griffiths]

Follow the Authors

Something went wrong. Please try your request again later.

Algorithms to Live By: The Computer Science of Human Decisions Kindle Edition

4.5 out of 5 stars 2,925 ratings

Amazon Price
New from Used from
Kindle Edition

Product description


"A remarkable book... A solid, research-based book that's applicable to real life. The algorithms the authors discuss are, in fact, more applicable to real-life problems than I'd have ever predicted.... It's well worth the time to find a copy of Algorithms to Live By and dig deeper."

"By the end of the book, I was convinced. Not because I endorse the idea of living like some hyper-rational Vulcan, but because computing algorithms could be a surprisingly useful way to embrace the messy compromises of real, non-Vulcan life."
--The Guardian (UK)

"I absolutely reveled in this book... It's the perfect antidote to the argument you often hear from young math students: 'What's the point? I'll never use this in real life!'... The whole business, whether it's the relative simplicity of the 37% rule or the mind-twisting possibilities of game theory, is both potentially practical and highly enjoyable as presented here. Recommended."
--Popular Science (UK)

"An entertaining, intelligently presented book... Craftily programmed to build from one good idea to the next... The value of being aware of algorithmic thinking--of the thornier details of 'human algorithm design, ' as Christian and Griffiths put it--is not just better problem solving, but also greater insight into the human mind. And who doesn't want to know how we tick?"
--Kirkus Reviews

"Compelling and entertaining, Algorithms to Live By is packed with practical advice about how to use time, space, and effort more efficiently. And it's a fascinating exploration of the workings of computer science and the human mind. Whether you want to optimize your to-do list, organize your closet, or understand human memory, this is a great read."
--Charles Duhigg, author of The Power of Habit

"In this remarkably lucid, fascinating, and compulsively readable book, Christian and Griffiths show how much we can learn from computers. We've all heard about the power of algorithms--but Algorithms to Live By actually explains, brilliantly, how they work, and how we can take advantage of them to make better decisions in our own lives."
--Alison Gopnik, coauthor of The Scientist in the Crib

"I've been waiting for a book to come along that merges computational models with human psychology--and Christian and Griffiths have succeeded beyond all expectations. This is a wonderful book, written so that anyone can understand the computer science that runs our world--and more importantly, what it means to our lives."
--David Eagleman, author of Incognito: The Secret Lives of the Brain

--This text refers to an out of print or unavailable edition of this title.

Excerpt. © Reprinted by permission. All rights reserved.

Algorithms to Live By

The Computer Science of Human Decisions

By Brian Christian, Tom Griffiths

Henry Holt and Company

Copyright © 2016 Brian Christian and Tom Griffiths
All rights reserved.
ISBN: 978-1-62779-036-9


Title Page,
Copyright Notice,
Algorithms to Live By,
1 Optimal Stopping Optimal Stopping When to Stop Looking,
2 Explore/Exploit The Latest vs. the Greatest,
3 Sorting Making Order,
4 Caching Forget About It,
5 Scheduling First Things First,
6 Bayes's Rule Predicting the Future,
7 Overfitting When to Think Less,
8 Relaxation Let It Slide,
9 Randomness When to Leave It to Chance,
10 Networking How We Connect,
11 Game Theory The Minds of Others,
Computational Kindness,
Also by Brian Christian,
About the Authors,


Optimal Stopping

When to Stop Looking

Though all Christians start a wedding invitation by solemnly declaring their marriage is due to special Divine arrangement, I, as a philosopher, would like to talk in greater detail about this ... — JOHANNES KEPLER

If you prefer Mr. Martin to every other person; if you think him the most agreeable man you have ever been in company with, why should you hesitate? — JANE AUSTEN, EMMA

It's such a common phenomenon that college guidance counselors even have a slang term for it: the "turkey drop." High-school sweethearts come home for Thanksgiving of their freshman year of college and, four days later, return to campus single.

An angst-ridden Brian went to his own college guidance counselor his freshman year. His high-school girlfriend had gone to a different college several states away, and they struggled with the distance. They also struggled with a stranger and more philosophical question: how good a relationship did they have? They had no real benchmark of other relationships by which to judge it. Brian's counselor recognized theirs as a classic freshman-year dilemma, and was surprisingly nonchalant in her advice: "Gather data."

The nature of serial monogamy, writ large, is that its practitioners are confronted with a fundamental, unavoidable problem. When have you met enough people to know who your best match is? And what if acquiring the data costs you that very match? It seems the ultimate Catch-22 of the heart.

As we have seen, this Catch-22, this angsty freshman cri de coeur, is what mathematicians call an "optimal stopping" problem, and it may actually have an answer: 37%.

Of course, it all depends on the assumptions you're willing to make about love.

The Secretary Problem

In any optimal stopping problem, the crucial dilemma is not which option to pick, but how many options to even consider. These problems turn out to have implications not only for lovers and renters, but also for drivers, homeowners, burglars, and beyond.

The 37% Rule derives from optimal stopping's most famous puzzle, which has come to be known as the "secretary problem." Its setup is much like the apartment hunter's dilemma that we considered earlier. Imagine you're interviewing a set of applicants for a position as a secretary, and your goal is to maximize the chance of hiring the single best applicant in the pool. While you have no idea how to assign scores to individual applicants, you can easily judge which one you prefer. (A mathematician might say you have access only to the ordinal numbers — the relative ranks of the applicants compared to each other — but not to the cardinal numbers, their ratings on some kind of general scale.) You interview the applicants in random order, one at a time. You can decide to offer the job to an applicant at any point and they are guaranteed to accept, terminating the search. But if you pass over an applicant, deciding not to hire them, they are gone forever.

The secretary problem is widely considered to have made its first appearance in print — sans explicit mention of secretaries — in the February 1960 issue of Scientific American, as one of several puzzles posed in Martin Gardner's beloved column on recreational mathematics. But the origins of the problem are surprisingly mysterious. Our own initial search yielded little but speculation, before turning into unexpectedly physical detective work: a road trip down to the archive of Gardner's papers at Stanford, to haul out boxes of his midcentury correspondence. Reading paper correspondence is a bit like eavesdropping on someone who's on the phone: you're only hearing one side of the exchange, and must infer the other. In our case, we only had the replies to what was apparently Gardner's own search for the problem's origins fiftysome years ago. The more we read, the more tangled and unclear the story became.

Harvard mathematician Frederick Mosteller recalled hearing about the problem in 1955 from his colleague Andrew Gleason, who had heard about it from somebody else. Leo Moser wrote from the University of Alberta to say that he read about the problem in "some notes" by R. E. Gaskell of Boeing, who himself credited a colleague. Roger Pinkham of Rutgers wrote that he first heard of the problem in 1955 from Duke University mathematician J. Shoenfield, "and I believe he said that he had heard the problem from someone at Michigan."

"Someone at Michigan" was almost certainly someone named Merrill Flood. Though he is largely unheard of outside mathematics, Flood's influence on computer science is almost impossible to avoid. He's credited with popularizing the traveling salesman problem (which we discuss in more detail in chapter 8), devising the prisoner's dilemma (which we discuss in chapter 11), and even with possibly coining the term "software." It's Flood who made the first known discovery of the 37% Rule, in 1958, and he claims to have been considering the problem since 1949 — but he himself points back to several other mathematicians.

Suffice it to say that wherever it came from, the secretary problem proved to be a near-perfect mathematical puzzle: simple to explain, devilish to solve, succinct in its answer, and intriguing in its implications. As a result, it moved like wildfire through the mathematical circles of the 1950s, spreading by word of mouth, and thanks to Gardner's column in 1960 came to grip the imagination of the public at large. By the 1980s the problem and its variations had produced so much analysis that it had come to be discussed in papers as a subfield unto itself.

As for secretaries — it's charming to watch each culture put its own anthropological spin on formal systems. We think of chess, for instance, as medieval European in its imagery, but in fact its origins are in eighth-century India; it was heavy-handedly "Europeanized" in the fifteenth century, as its shahs became kings, its viziers turned to queens, and its elephants became bishops. Likewise, optimal stopping problems have had a number of incarnations, each reflecting the predominating concerns of its time. In the nineteenth century such problems were typified by baroque lotteries and by women choosing male suitors; in the early twentieth century by holidaying motorists searching for hotels and by male suitors choosing women; and in the paper-pushing, male-dominated mid-twentieth century, by male bosses choosing female assistants. The first explicit mention of it by name as the "secretary problem" appears to be in a 1964 paper, and somewhere along the way the name stuck.

Whence 37%?

In your search for a secretary, there are two ways you can fail: stopping early and stopping late. When you stop too early, you leave the best applicant undiscovered. When you stop too late, you hold out for a better applicant who doesn't exist. The optimal strategy will clearly require finding the right balance between the two, walking the tightrope between looking too much and not enough.

If your aim is finding the very best applicant, settling for nothing less, it's clear that as you go through the interview process you shouldn't even consider hiring somebody who isn't the best you've seen so far. However, simply being the best yet isn't enough for an offer; the very first applicant, for example, will of course be the best yet by definition. More generally, it stands to reason that the rate at which we encounter "best yet" applicants will go down as we proceed in our interviews. For instance, the second applicant has a 50/50 chance of being the best we've yet seen, but the fifth applicant only has a 1-in-5 chance of being the best so far, the sixth has a 1-in-6 chance, and so on. As a result, best-yet applicants will become steadily more impressive as the search continues (by definition, again, they're better than all those who came before) — but they will also become more and more infrequent.

Okay, so we know that taking the first best-yet applicant we encounter (a.k.a. the first applicant, period) is rash. If there are a hundred applicants, it also seems hasty to make an offer to the next one who's best-yet, just because she was better than the first. So how do we proceed?

Intuitively, there are a few potential strategies. For instance, making an offer the third time an applicant trumps everyone seen so far — or maybe the fourth time. Or perhaps taking the next best-yet applicant to come along after a long "drought" — a long streak of poor ones.

But as it happens, neither of these relatively sensible strategies comes out on top. Instead, the optimal solution takes the form of what we'll call the Look-Then-Leap Rule: You set a predetermined amount of time for "looking" — that is, exploring your options, gathering data — in which you categorically don't choose anyone, no matter how impressive. After that point, you enter the "leap" phase, prepared to instantly commit to anyone who outshines the best applicant you saw in the look phase.

We can see how the Look-Then-Leap Rule emerges by considering how the secretary problem plays out in the smallest applicant pools. With just one applicant the problem is easy to solve — hire her! With two applicants, you have a 50/50 chance of success no matter what you do. You can hire the first applicant (who'll turn out to be the best half the time), or dismiss the first and by default hire the second (who is also best half the time).

Add a third applicant, and all of a sudden things get interesting. The odds if we hire at random are one-third, or 33%. With two applicants we could do no better than chance; with three, can we? It turns out we can, and it all comes down to what we do with the second interviewee. When we see the first applicant, we have no information — she'll always appear to be the best yet. When we see the third applicant, we have no agency — we have to make an offer to the final applicant, since we've dismissed the others. But when we see the second applicant, we have a little bit of both: we know whether she's better or worse than the first, and we have the freedom to either hire or dismiss her. What happens when we just hire her if she's better than the first applicant, and dismiss her if she's not? This turns out to be the best possible strategy when facing three applicants; using this approach it's possible, surprisingly, to do just as well in the three-applicant problem as with two, choosing the best applicant exactly half the time.

Enumerating these scenarios for four applicants tells us that we should still begin to leap as soon as the second applicant; with five applicants in the pool, we shouldn't leap before the third.

As the applicant pool grows, the exact place to draw the line between looking and leaping settles to 37% of the pool, yielding the 37% Rule: look at the first 37% of the applicants, choosing none, then be ready to leap for anyone better than all those you've seen so far.

As it turns out, following this optimal strategy ultimately gives us a 37% chance of hiring the best applicant; it's one of the problem's curious mathematical symmetries that the strategy itself and its chance of success work out to the very same number. The table above shows the optimal strategy for the secretary problem with different numbers of applicants, demonstrating how the chance of success — like the point to switch from looking to leaping — converges on 37% as the number of applicants increases.

A 63% failure rate, when following the best possible strategy, is a sobering fact. Even when we act optimally in the secretary problem, we will still fail most of the time — that is, we won't end up with the single best applicant in the pool. This is bad news for those of us who would frame romance as a search for "the one." But here's the silver lining. Intuition would suggest that our chances of picking the single best applicant should steadily decrease as the applicant pool grows. If we were hiring at random, for instance, then in a pool of a hundred applicants we'd have a 1% chance of success, and in a pool of a million applicants we'd have a 0.0001% chance. Yet remarkably, the math of the secretary problem doesn't change. If you're stopping optimally, your chance of finding the single best applicant in a pool of a hundred is 37%. And in a pool of a million, believe it or not, your chance is still 37%. Thus the bigger the applicant pool gets, the more valuable knowing the optimal algorithm becomes. It's true that you're unlikely to find the needle the majority of the time, but optimal stopping is your best defense against the haystack, no matter how large.

Lover's Leap

The passion between the sexes has appeared in every age to be so nearly the same that it may always be considered, in algebraic language, as a given quantity. — THOMAS MALTHUS

I married the first man I ever kissed. When I tell this to my children they just about throw up. — BARBARA BUSH

Before he became a professor of operations research at Carnegie Mellon, Michael Trick was a graduate student, looking for love. "It hit me that the problem has been studied: it is the Secretary Problem! I had a position to fill [and] a series of applicants, and my goal was to pick the best applicant for the position." So he ran the numbers. He didn't know how many women he could expect to meet in his lifetime, but there's a certain flexibility in the 37% Rule: it can be applied to either the number of applicants or the time over which one is searching. Assuming that his search would run from ages eighteen to forty, the 37% Rule gave age 26.1 years as the point at which to switch from looking to leaping. A number that, as it happened, was exactly Trick's age at the time. So when he found a woman who was a better match than all those he had dated so far, he knew exactly what to do. He leapt. "I didn't know if she was Perfect (the assumptions of the model don't allow me to determine that), but there was no doubt that she met the qualifications for this step of the algorithm. So I proposed," he writes.

"And she turned me down."

Mathematicians have been having trouble with love since at least the seventeenth century. The legendary astronomer Johannes Kepler is today perhaps best remembered for discovering that planetary orbits are elliptical and for being a crucial part of the "Copernican Revolution" that included Galileo and Newton and upended humanity's sense of its place in the heavens. But Kepler had terrestrial concerns, too. After the death of his first wife in 1611, Kepler embarked on a long and arduous quest to remarry, ultimately courting a total of eleven women. Of the first four, Kepler liked the fourth the best ("because of her tall build and athletic body") but did not cease his search. "It would have been settled," Kepler wrote, "had not both love and reason forced a fifth woman on me. This one won me over with love, humble loyalty, economy of household, diligence, and the love she gave the stepchildren."

"However," he wrote, "I continued."

Kepler's friends and relations went on making introductions for him, and he kept on looking, but halfheartedly. His thoughts remained with number five. After eleven courtships in total, he decided he would search no further. "While preparing to travel to Regensburg, I returned to the fifth woman, declared myself, and was accepted." Kepler and Susanna Reuttinger were wed and had six children together, along with the children from Kepler's first marriage. Biographies describe the rest of Kepler's domestic life as a particularly peaceful and joyous time.

Both Kepler and Trick — in opposite ways — experienced firsthand some of the ways that the secretary problem oversimplifies the search for love. In the classical secretary problem, applicants always accept the position, preventing the rejection experienced by Trick. And they cannot be "recalled" once passed over, contrary to the strategy followed by Kepler.

In the decades since the secretary problem was first introduced, a wide range of variants on the scenario have been studied, with strategies for optimal stopping worked out under a number of different conditions. The possibility of rejection, for instance, has a straightforward mathematical solution: propose early and often. If you have, say, a 50/50 chance of being rejected, then the same kind of mathematical analysis that yielded the 37% Rule says you should start making offers after just a quarter of your search. If turned down, keep making offers to every best-yet person you see until somebody accepts. With such a strategy, your chance of overall success — that is, proposing and being accepted by the best applicant in the pool — will also be 25%. Not such terrible odds, perhaps, for a scenario that combines the obstacle of rejection with the general difficulty of establishing one's standards in the first place.

(Continues...)Excerpted from Algorithms to Live By by Brian Christian, Tom Griffiths. Copyright © 2016 Brian Christian and Tom Griffiths. Excerpted by permission of Henry Holt and Company.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

--This text refers to an out of print or unavailable edition of this title.

Product details

  • ASIN ‏ : ‎ B015DLA0LE
  • Publisher ‏ : ‎ William Collins (19 April 2016)
  • Language ‏ : ‎ English
  • File size ‏ : ‎ 2722 KB
  • Text-to-Speech ‏ : ‎ Enabled
  • Screen Reader ‏ : ‎ Supported
  • Enhanced typesetting ‏ : ‎ Enabled
  • X-Ray ‏ : ‎ Enabled
  • Word Wise ‏ : ‎ Enabled
  • Print length ‏ : ‎ 369 pages
  • Customer reviews:
    4.5 out of 5 stars 2,925 ratings

About the authors

Follow authors to get new release updates, plus improved recommendations.

Customer reviews

4.5 out of 5 stars
4.5 out of 5
2,925 global ratings

Top reviews from United Kingdom

Reviewed in the United Kingdom on 12 April 2021
7 people found this helpful
Report abuse
Reviewed in the United Kingdom on 27 August 2018
16 people found this helpful
Report abuse
Reviewed in the United Kingdom on 7 June 2022
One person found this helpful
Report abuse
Reviewed in the United Kingdom on 1 January 2022
One person found this helpful
Report abuse
Reviewed in the United Kingdom on 27 August 2017
21 people found this helpful
Report abuse
Reviewed in the United Kingdom on 29 December 2021
2 people found this helpful
Report abuse
Reviewed in the United Kingdom on 23 May 2017
16 people found this helpful
Report abuse
Reviewed in the United Kingdom on 26 April 2020
2 people found this helpful
Report abuse
Report an issue

Does this item contain inappropriate content?
Do you believe that this item violates a copyright?
Does this item contain quality or formatting issues?