My heads-up matches against DeepStack

Yesterday, Andrew Brokos and I had the pleasure of playing some of the first heads-up matches against DeepStack, a product of the Computer Poker Research Group at the University of Alberta.

While I don't have time to write a full (or fully eloquent) summary of the experience, here is a quick summary of the bot's play.

The striking features of the AI are, to my meatbag mind, unified by the concept of _board coverage_. Whatever the runout, it seems that DeepStack can hit it. Good human players quite generally work to achieve board coverage preflop and, to some extent, on the flop, but DeepStack does this much more. It is the expert electronic analogue of the player who "can be holding any two cards."

More specifically:

(1) DeepStack makes some very light calls preflop, both in and out of position. So, for example, it calls at least sometimes with J2s in the big blind against a 3x raise, and it calls with weak suited hands (say, K7s) against pos-sized or larger three-bets (again, at least sometimes).

The connection here to board coverage should be obvious; one clear effect here is that DeepStack holds more threes and deuces out of position than most human opponents do.

(2) DeepStack does not overbet as much as I expected it to, or at much as I see expert players do in the training videos I watch. That said, it chooses full-pot bets instead of half-pot bets perhaps more often than most humans.

Again, there is a clear connection to board coverage. The tendency not to overbet is intelligible in terms of an expectation that both players will cover boards, because overbetting most commonly arises when a runout hits one player much better than the other. As board coverage improves, cards tend not to favor any opponent as much, and canonical overbetting spots won't arise as much.

One exception: We played a pot where DeepStack limped and I checked the BB with 92o. The flop came Ts9s5x, and I check-called a pot-sized bet. The turn was a ten and it went check-check. The river was an offsuit 5; I checked and DeepStack bet ~17k into 2400. (I folded; if I recall correctly, DeepStack had J2, and neither of us held a spade.)

(3) DeepStack tends not to inflate the pot out of position, especially with deep stacks. It doesn't three-bet very aggressively preflop; it doesn't check-raise flops often; and it rarely "donks out" on the flop. (Again, I'm talking about deep-stacked play, but these features are striking even at 30 to 40 big blinds.)

One obvious lesson here is that position matters a lot; all serious poker players know this, but there's a lot of implicit disagreement about just how much "a lot" is.

Again, when I think about this, I return to the idea of board coverage; by keeping more hands in a calling (or check-calling, or checking) range, DeepStack covers more runouts--and, crucially, strengthens these ranges in order to protect the weak hands with which one must continue if one wants to cover all runouts. So, for example, DeepStack will often peel with hands like K7 and K6 on a board like Q83, especially to half-pot bets but even for larger bets. (Perhaps it doesn't do this with 100% of the combinations of these hands, but this is a striking feature of its play.) Keeping more strong top-pair (and better) hands in a check-call range--and, farther back, in a preflop calling range--surely helps DeepStack make these calls effectively.

(4) DeepStack makes more hero-folds and -checks than I expected, and somewhat fewer hero-calls, especially in big pots. Quite often, I thought one of my betting ranges was weaker than DeepStack did.

Please note that this is relative to my expectations. DeepStack is still far more aggressive than most human players. My expectations were formed in light of some surprising results from _Mathematics of Poker_, the loose play of certain experts, and so on. DeepStack still put me in plenty of tough spots with flop check-raises, for example.

(5) DeepStack avoids jam-fold strategies even with very short stacks. It often limps with fewer than 10 big blinds, and it even minraised (before calling a jam) with J6s when the effective stack was less than five big blinds. I imagine that there is not a very big difference in EV per hand between these strategies and optimal jam-fold strategies, but these situations are so common, especially in tournaments, that I expect players to continue to question the conventional wisdom about jamming with roughly 10 to 15 big blinds. (Because of these inquiries, it is perhaps no longer quite right even to call jam-fold play the "conventional wisdom" unqualifiedly.)

I hope to expand this post as I have more time to expand on these thoughts and to study the hand histories from the matches. For now, please excuse any errors and infelicities.

UPDATE: My co-host Andrew has written up his thoughts on the matches here.

On solving the wrong problem

NFL "survivor" pools are an ideal form of gambling. A bunch of people enter, everyone picks a team every week, and if your team loses, you're out. You can't pick the same team twice. The last person standing wins.

A quick Web search suggests that a lot of people begin by asking the first question I asked: Given some interval of the NFL season, which set of picks gives you the best chance of getting through that interval without losing a game?

A compressed version of my work on this question is:

  1. Recognize that this is a graph problem (there are different ways to approach this, but I've found it easiest to treat every permissible prefix of games--that is, every way of picking the first N games, for N from 1 to the length of the interval--as a node). The goal is to find a path to the node corresponding to the highest cumulative probability, among all nodes representing full pick sets (prefixes as long as the interval).
  2. Recall that problems where we need to maximize products can be converted into problems where we need to maximize sums (just take the logarithm of each factor and exploit the fact that the sum of logarithms is the logarithm of the product; see, e.g., section 6.1.7 of the second edition of Skeina's The Algorithm Design Manual, or use a slide rule until this is intuitive).
  3. Figure out, either by estimation or by trying it, that brute forcing this problem will make you look at way too many nodes.
  4. Decide to implement A* search, which requires an admissible heuristic.
  5. Implement a first, very naive heuristic: put a lower bound on the distance between a node and the goal by calculating the path cost if, from that node, there were a path including only games with the biggest possible favorite (in the NFL these are something like 15-1 to 20-1 favorites).
  6. When the search is still too slow, try a stronger heuristic: for each node, calculate the cost of a path corresponding to the best games for each remaining week in the interval, but excluding games in which you've already chosen the favorite. That is, pretend that, at any node, you are barred in the future from picking any team you've already picked, but you don't have to worry about whether those future picks conflict with each other. This takes a bit longer to calculate, but it turns out to be far more effective: it runs through the whole season in roughly half a second on my computer, and that's in Python and without taking much care to optimize anything.

This makes for a fun and straightforward project. The goal is easy to define and the problem can be solved by combining a few fundamental ideas, finding a happy "middle ground" heuristic that is easy to calculate but also sufficiently informative, and taking care of some implementation details. (For example, we can choose any node corresponding to a full pick set, so there's not a single goal node we know in advance if we describe the graph as above. One way to get around this problem is to calculate shortest paths to every node, but this graph is too big for that to be a good idea. There are several alternatives here, but my preferred one is to add a dummy Week 18 in which there is only one game, in which the Browns or a fake team are huge favorites, and to call any node including that game a goal.)

What's most important, though, is not to fool yourself into mistaking the easily defined question for the right one. If this is your whole analysis, you will be making very big mistakes in any survivor pool! There are many reasons for this:

  1. You don't know in advance how many games you need to pick correctly to win.
  2. Your estimates of win probabilities will change between now and future weeks (a whole bunch of the lines will move significantly, even if you don't know which direction they're going to move in).
  3. Most importantly, there is value in picking games that other people don't pick: when an upset wipes out a lot of the field but you picked a different game, that's a big windfall for you. The process I described above entirely ignores this effect, which drives correct strategy in survivor pools.

Because of this, I've come to think of this as a nerd sniping scenario. (In the metaphor, you are you, the resistance problem is the probability-maximizing problem, and the truck is the consequences of making gambling decisions without considering the effects of your opponents' choices.)

The A* search technique is still useful: It helps you estimate the value of picking one week correctly (how much does having picked that team handicap your ability to choose high-value paths after that?); it is useful in endgame scenarios (though in those cases, brute-force search will do fine); and it can be useful for estimating how many weeks the pool is likely to take. As so often happens, when you're answering a hard question ("Which team do I pick in the survivor pool?"), it can be useful to answer a related and simpler one ("Which team allows me the best chance at sweeping the season?"), but only if that doesn't cause you to make mistakes that matter more than the answer you find.

Poker and the future of insurance

Many poker players will have a natural interest in insurance, which is in some sense the most popular form of gambling we have. On this subject a recent Andreessen Horowitz podcast episode is worth checking out. A few points of particular interest, greatly simplified, are that:

(1) Insurers and the insured have a common interest in promoting the well-being of the insured; the insurer doesn't want to pay out, and the insured doesn't want the bad thing triggering the payout to happen.

(2) Insurers are more able to learn about their clients than they used to be, especially insofar as they can get access to their clients' smartphone data.

(3) We should expect future data-rich and data-savvy insurers to use their data in two ways: First, they will offer different prices and different products to different clients. Less risky clients will no longer have to suffer so much of a penalty by virtue of their not being able to distinguish themselves form more risky clients, and more risky clients will be less able to hide in large, undifferentiated populations. Second, because of (1), they will bundle insurance with various kinds of assistance. There are already examples of this (such as health insurers subsidizing gym memberships), but we will see more diverse, nuanced, and personalized kinds of assistance.

One might think that people will object to handing over data to insurance companies for reasons of privacy. I don't think this would prevent insurance arrangements involving frequent data transfers from coming into being. People seem very willing to trade lots of privacy for a little bit of money, especially when it comes with the prospect of being demonstrated superior to one's neighbors by a big company.

So far, these are mostly hypothetical suggestions, but there are non-hypothetical models that can help us think about these future scenarios and their likelihood. The poker staking marketplace is, I think, one such model. Its evolution seems to me to suggest that (3)-type scenarios are likely to become the status quo.

There are many kinds of staking arrangements, but they generally involve a backer putting up the money for a player (the "horse") to buy in with; in exchange, the backer is entitled to some fraction of the player's winnings over a certain time period. There are many possible benefits to the horse of such an arrangement, and among them is being shielded off from the worst effects of a big downswing; it's not his own money he's lost. In this way, backing arrangements, although they have functions other than insurance, share important features with insurance.

I have been watching these deals play out since 2003 or so, and it's striking to me how much the market has shifted to include arrangements such as are predicted in (3) above. The most common form of this is bundling staking and coaching; many of the biggest and most successful "stables" require horses to take coaching along with the backing. This takes many forms, some of which are semi-personalized (PowerPoint lectures from a teacher to students of a certain type) and others of which are highly personalized (one-on-one hand history reviews, close observation of a horse by a backer, and other kinds of one-on-one coaching).

Stables also tend to track and audit their horses more diligently than was common ten years ago. So, for example, they are more likely to require tournament receipts, submission of online hand histories, or good answers to text-message spot checks. This encourages horses not to get sloppy with their play and not to play drunk, and it makes it harder for them to lose their backers' money at blackjack while pretending they are suffering bad luck at the poker tables.

Different backers do all this differently, of course. For some case studies in modern backing, you can listen to Thinking Poker Podcast interviews with Chad Power, Mike Leah, and Danny Noseworthy.

These arrangements tend to play out in ways that we would predict. First, insuring only horses who are willing to participate in coaching allows backers to keep from insuring the laziest and most stubborn players. Second, the coaching and other monitoring allows backers to get rid of horses who don't improve fast enough or who simply don't play well enough. Third, getting high-quality coaching along with backing induces horses to agree to terms that are otherwise less favorable to them. In this way, both the backers and the horses benefit from economies of scale in offering coaching that are available to the backers.

Fourth, extra data and better record-keeping allow for mutually beneficial dissolutions of staking deals: Occasionally a stable will be able to, with the horse's permission, sell the rights to an underperforming horse's action. This usually happens when there is a risk of moral hazard if the horse continues to play under the current arrangement, when the horse could use a metaphorical change of scenery, or when the environment of a different stable is better for the horse. It seems to me that this sort of thing is more common now than it used to be, and that the increased availability of and reliance on data keeps the horse-transfer market from being a pure "market for lemons."

In this way, the market seems to me to have evolved in ways consistent with what Frank Chen and Mike Paulus's suggestions on the podcast. While I don't have access to backers' results, I strongly suspect that backers who have been innovative about bundling insurance with other products and who have been diligent about collecting and managing data have done very well, compared to their competitors. 

Music from the Brad Willis interview

I recently mentioned on Twitter that Brad Willis is the first Thinking Poker Podcast guest to inspire a Spotify playlist.

Here is that playlist. I've found Sturgill Simpson's Metamodern Sounds in Country Music particularly eye-opening.

Note that Ha Ha Tonka is not actually a Willis recommendation, but it seemed to fit, and it did come up on the show.

Finally, I mentioned Ellix Powers on the show as a paradigm of the color and fun of the Boom Era in poker. I didn't yet know that he had recently passed away. RIP.

Recent nonfiction reading

1.  This Republic of Suffering, Drew Gilpin Faust

A readable, informative, and credible book about death and the Civil War. It covers the causes, reactions to, culture surrounding, and political legacy of Civil War deaths. Although a few of its conclusions are reached hastily, the vast majority of its analysis is well-grounded and fascinating. The book also deserves praise for its lack of clutter: it is easy to fill up a book on this subject with superfluous numbers, names of places, and citations. Faust keeps the information density high without letting hard-to-read items distract the reader from the narrative and argument. Recommended.

2.  How Asia Works, Joe Studwell

Studwell argues that successful Asian economies are distinguished from unsuccessful ones by their having adopted three main policies. They incentivized gardening rather than plantation-style farming in early stages of development; later, they enforced "export discipline" to ensure that their industries, however deeply subsidized, were facing the tests of the global market; and they implemented fiscal policies supporting the first two goals.

I am not in a position to assess the argument, but it is hard not to think that Studwell has isolated important causes of economic success and failure, even if they are not quite as much of the story as he would have you believe. The case studies are presented in detail and are gripping.

The book is also valuable as a contribution to discussions of inequality, even though it is not always framed as such. I found it far more useful than Piketty (which I read and enjoyed) in this respect. Finally, this book is a good tool for improving one's grasp of distinctions that are easy to conflate. The distinction between being state-controlled and non-state-controlled is not the distinction between being free-market and non-free-market, which in turn is not the same as the distinction between public and private, and so on. Perhaps this is obvious, but it can be very easy to confuse these things.

3.  Bird by Bird, Anne Lamott

A very fine book about writing that had been on my list for over a decade. It's honest, fun, and useful. Whereas On Writing Well (my favorite popular book about writing) is mainly about improving one's skill as a prose stylist, Bird by Bird has more to say about managing the psychological and professional aspects of a life spent writing. Although some of its early-nineties advice is probably dated in its portrayal of publishing, I'd still recommend it.

4.  Up, Up, and Away, Jonah Keri

The best-researched mainstream baseball book I've read in a long time. Keri does well to balance colorful portraits with enough cultural and economic history to do justice to the book as a book about the whole lifespan, and fate, of the Expos. The book is so successful at telling the story of the Expos that the personal stories Keri tells about his fandom, while quite charming, occasionally seem out of place.

Keri doesn't do quite as well as Faust (see above) at keeping numbers and facts from interfering with his prose, but this is still a very readable and well-edited book. I don't hesitate to stop reading this sort of book partway through, but I finished this one happily and without hesitation.

5.  Antietam: Crossroads of Freedom, James McPherson

McPherson argues that Antietam was a "crossroads" in roughly the sense that it made and changed the course of history, rather than merely expressing or continuing trends or inevitabilities that were already there. (So, things happened at Antietam that didn't need to have happened, and things might have happened there that didn't.)

Quite a bit of what seems to be presented as evidence for this claim seems not to be evidence for or against this thesis, but it is very hard to argue such a point rigorously in a 150-page book for a general audience. This is an informative history of the battle and a plausible argument for a set of important claims. I'm glad to have read it.

Answering Tango's question about MVP voting

This morning, the esteemed Tom Tango asked a question about this year's MVP voting. Specifically, he wants to know who had the worst ballot, as measured by eight criteria (all of which measure a ballot's agreement with the full set of ballots).

Although I don't care much about MVP voting (and I care even less about calling voters out for voting a certain way), I thought it'd be a nice quick exercise in using Pandas. I answered the question by writing code that is available here.

Three notes about the code:

  1. It is not particularly elegant. Hopefully it is clear enough to use. The data is so small that inelegant methods work fine.
  2. If you generate your tab-separated files by copy/pasting from the BWWAA's Google Sheets (links: AL / NL), you must delete tabs in two of the lines (Jeff Wilson's and Alex Pavlovic's).
  3. I have run a few ad hoc tests on the code, and I have double-checked some important things (e.g., that sub-processes give the right total voting scores), but I haven't written an exhaustive test suite or anything.

Using the code, we can generate lists of all voters who did not score a perfect 8/8 by Tango's criteria. Again, please note that I made these lists only to answer the question, not to shame anyone or to express any opinion about good and bad ways to cast MVP ballots. And, again, it's possible (but unlikely) that there are errors.


George A. King III 4
Chris Assenheimer 6
Gerry Fraley 7
John McGrath 7
Paul Hoynes 7
Wallace Matthews 7
La Velle E. Neal III 7


Paul Newberry 3
Patrick Saunders 3
Todd Rosiak 4
Craig Davis 4
Marc Carig 5
Jack Etkin 5
Dennis Lin 6
Robert Nightengale 6
Bruce Miles 6
Tim B. Kurkjian 6
Mark Saxon 6
Rick Hummel 7
Jim Salisbury 7
Tom Haudricourt 7
J.P. Hoornstra 7
John Fay 7
Gordon Wittenmyer 7
Mark Zuckerman 7

Addendum: Here is a first draft of a list of scores for the metric Tom proposes on comment #4 to the post:


Bob Elliott 	51.5
Ken Rosenthal 	50.5
Ryan Divish 	49.5
Chris McCosky 	49.0
Marc Topkin 	49.0
Roger Mooney 	49.0
Mike Berardino 	48.5
Michael Silverman 	48.0
Evan Drellich 	46.5
Jesus Ortiz 	46.5
Richard Griffin 	46.5
Peter Abraham 	46.0
Anthony Fenech 	45.5
Joe Posnanski 	45.5
Naoko Sato 	45.5
John Hickey 	45.0
Tim Brown 	45.0
Wallace Matthews 	44.5
Susan Slusser 	44.5
Rich Dubroff 	43.5
Jeff Wilson 	43.0
Pedro Moura 	41.0
Gerry Fraley 	40.0
John McGrath 	38.0
Scot Gregor 	38.0
La Velle E. Neal III 	37.5
Paul Hoynes 	35.5
Sam Mellinger 	35.0
Chris Assenheimer 	32.5
George A. King III 	29.0


Jayson Stark 	51.0
Tom Haudricourt 	49.5
Clark Spencer 	49.5
Bill Brink 	48.5
Jim Salisbury 	48.0
Alex Pavlovic 	47.5
Scott Miller 	46.5
Derrick Goold 	46.5
Mark Zuckerman 	46.0
Bruce Miles 	46.0
Rob Biertempfel 	44.0
Jack Etkin 	43.5
Joe Kay 	43.5
Charles Odum 	43.5
Henry Schulman 	43.0
J.P. Hoornstra 	43.0
John Fay 	43.0
Marc Carig 	43.0
Dennis Lin 	42.0
Gordon Wittenmyer 	41.5
Mike Puma 	41.0
Tim B. Kurkjian 	40.5
Todd Rosiak 	40.5
Robert Nightengale 	40.0
Rick Hummel 	39.5
Nick Piecoro 	39.5
Craig Davis 	38.5
Paul Newberry 	38.0
Mark Saxon 	37.5
Patrick Saunders 	34.5

Rounders: Teddy KGB's hand

On Episode 149 of the Thinking Poker Podcast, Andrew and I discuss Rounders with Brian Koppelman, one of the movie's co-writers. One question that comes up is whether Teddy's hole cards, in the climactic hand, are briefly visible on screen. Andrew has asked me to post the screen shots to which I was referring.

On the show, Brian claims that the cards aren't visible. He's arguably right about that insofar as what appears on screen (or at least what appears below) doesn't provide conclusive evidence for any specific pair of cards.

They occur at roughly the 1:50:33 time stamp on Netflix. Here they are:

Making and distributing podcasts

Listeners and prospective podcasters often ask Andrew Brokos and me about the tools we use for the Thinking Poker Podcast. Happily, podcasting requires plenty of effort but little capital: The necessary software is free or cheap, and there's no need to use a fancy computer in any part of the process.These tools have served us well:

Recording. We record our interviews with Skype. I record the Skype calls with Audio Hijack. (I use a Mac, so many Skype-related programs are not available to me.) 

Editing. We used Audacity when we edited the show ourselves. It was not too hard for an amateur to learn, and its features are (I'm told) robust enough that experts should be satisfied with it also. It's free. Now we hire a freelance editor, whom we're happy with.

Equipment. Andrew and I each have a Yeti Blue microphone. For a long time, the $100 I spent on it was the only money I'd put into the show.

Distribution. Andrew handles this, so the details could have changed without my knowing about it, but I believe he uploads the show to It was not difficult to get our show listed in the iTunes directory, but it was harder to get them to list it in the correct category.

Seven nonfiction books

A couple months ago I resolved to read more and especially to do substantial non-blog reading every day. Since then, I've finished these non-fiction books:

  1. My Struggle, Volume 3, Karl Ove Knausgaard

    There are things one can do in a novel that aren't possible in other forms. The brief periods where the narrator reflects on his childhood as an adult are hypercharged in part because they're set up by so much description of his childhood from "within childhood." And everything is so much more poignant because we know (some of) what happens to him and to his father already. This volume not only exhibits the virtues of line-by-line narrative and insight of the first two, but also establishes Knausgaard's excellence in more macro-level aspects of structure that are important in a series of this length.
  2. The Kite Runner, Khaled Hosseini

    Nine years ago, a drunk person in a cab line outside the Bellagio in Las Vegas made me promise that I'd read The Kite Runner. I have now fulfilled the promise. It's a gripping and well-told story, but it's hard to recommend as the one book (out of every book in the world) to read right now.
  3. My Struggle, Volume 4, Karl Ove Knausgaard

    Still great, and perhaps the saddest of the first four. Particularly good at describing places and at illuminating the ways in which our internal lives affect our perceptions of place and of space, but without going too far in the direction of making any city or natural setting a mere object of reflection or opportunity for metaphor.
  4. The Last Rock Star Book: or, Liz Phair: A Rant, Camden Joy

    Another book I read because of a long-ago recommendation (it was Kevin Goldstein's chosen book for the Up and In Book Club; that podcast episode came out in November 2010). It's as good as Kevin said it would be (also, it's dark, brash, and funny).
  5. All the Pretty Horses, Cormac McCarthy

    A while ago a Very Serious poet and student of literature claimed that McCarthy belonged on a very short list of the canonical greats. Now I understand why he said that.

    It's useful to have a good dictionary or an Internet connection handy as you read this; between the bits of Spanish and the horse-related technical vocabulary, there is a lot of text that a non-Spanish-speaking, non-horse-knowing person won't understand at first. But don't let that stop you from reading this novel.
  6. The Power and the Glory, Graham Greene

    Yet another book I read because of a long-ago comment from someone I respect. (I can be convinced to read things, but it might take me many years to do so.) A friend told me that although The End of the Affair is good, this book is better; he's right. Both an excellent adventure story and a worthwhile meditation on virtue and on life's meaning.
  7. The Elegance of the Hedgehog, Muriel Barbery

    A story told as a series of meditations from one of two protagonists. Satisfying both in its small meditations (on the metaphysics of doors and on the aesthetics of athletics, for example) and for its larger plot.

Some books I read this year

It's been a good year for reading. Here, in no order, are a few books I enjoyed:

(1) My Struggle (vol. 1), Karl Ove Knausgaard.

Breathtaking. There's a good chance you've read glowing reviews elsewhere by now, so here are a few reactions that are more personal: Among other things the book is a work of applied epistemology, and is masterful in this respect. I enjoyed the discussions of Western culture, and how things like masculinity get expressed in that culture, that are not as heavily influenced by American culture as most of what I read. The book is structured remarkably well: it's easy to judge novels by the quality of their set pieces or most interesting passages, and Knausgaard scores very well on such metrics, but the book is also wonderfully composed on a macro level.

(2) The Hard Thing About Hard Things, Ben Horowitz.

Informative, insightful, and fun. It reads like an unevenly polished brain dump, which I don't mean as a criticism. I'll pay for as many of these as Ben Horowitz wants to dump and unevenly polish. It's a constant stream of good advice presented plainly and clearly.

Horowitz made the interesting choice to address the reader as a CEO--that is, to make a startup CEO the formal audience of the book. Surely the vast majority of the book's readers are not CEOs. Of course, the information is useful for anyone, and especially anyone at a startup, but perhaps the reader learns the book better after assuming the CEO role for the sake of the narrative. The line between fiction and nonfiction sometimes blurs.

(3) The Namesake, Jhumpa Lahiri.

It's funny; I agree with almost every criticism I've ever heard of Lahiri (William Deresiewicz's comments are the best of the Lahiri-bashing genre), but I still read her with engagement and interest. This book was no different; its Boston setting probably helped.

(4) Addiction by Design, Natasha Dow Schüll.

It's a book about slot machines, discussing the relevant psychology, history, economics, and much more in great detail. It's thorough and well-researched, but always interesting. Schüll should be commended for never letting fact-recitation distract her from the book's big questions: What makes people play slot machines? How does it feel to play one, and to play one as an addict? (And how different is the addict's experience)? And so on.

Fantasy baseball: how good is PFM at using PECOTA?

Although I’m a baseball fan first and a fantasy baseball player second, I do play fantasy vigorously. As I’ve transitioned into being a professional computer/data guy, I’ve used baseball as a way to learn tools and practice “data science” skills. One nice feature for a beginner is that there’s enough data-cleaning work to give me a small taste of what it’s like, but not nearly as much as in other domains. With all the excellent data sets out there, I can get to the fun stuff quickly without completely neglecting data collection.

Valuing fantasy baseball players divides, as a first approximation, into two projects: predicting players’ outputs and using those outputs to generate fantasy values. I know many serious fantasy players do their own projections, but at least for now I’m guessing I can help myself more by working on the second step than on the first. I’ll make some obvious adjustments for injuries and similar news, but that’s about it for now.

That second step, generating fantasy values from projected statistics, is complicated, but my league’s (fairly common) structure lets me make certain simplifications. It’s a head-to-head league in which each of twelve categories is worth a point, and whoever gets the most points wins.

The suppositions I’ve chosen to make so far are:

(1)    That a player’s fantasy value is, for each category, proportional to the sum of the probabilities that his contributions to a given category cause a fantasy team to win that category.

(2)    That this value is proportional to the standard deviation of the distribution of team scores in that category in the fantasy league.

(3)    That a player’s output in a category can be represented by his average projected weekly output in that category.

(4)    That the means and standard deviations I’ve derived from my league’s last two years of results are a fair guide to how the league will play this year.

One could criticize these suppositions in many ways. The last one, for example, is particularly suspect. It might be better to create a model based on 2014 projections and estimate the values that way, but there are some advantages to my method. One advantage is that it was great fun to scrape all the results from (Many complications arose here, but BeautifulSoup and Requests were enough for the bulk of the work.)

(2) and (3) are similarly approximate. Supposition (2) might cause me to overvalue Billy Hamilton, for example, who will get many of his stolen bases when his fantasy teams have already locked up the category for the week. Using supposition (3) leads me to ignore differences in variance of outcomes between players, which is probably an oversimplification. And criticisms like these could be multiplied.

All that said, I think that a very useful first approximation results from this kind of strategy: use the projections to guess at what a player will contribute every week, use standard deviations to estimate the number of category wins that those contributions will add, and add those category-wins up.

Nothing I’ve described is statistically or technologically difficult, and I’ve chosen a similarly simple-but-reasonable method for adjusting player values at each position. (Estimate how many players n will be drafted at each position and set the n+1th-best player at that position’s value to zero, adjusting everyone else accordingly.)

My results are already surprising: they differ significantly from Baseball Prospectus’ Player Forecast Manager. What’s surprising about this is that I’m using the same PECOTA projections that BP’s tool is, so that any differences in our fantasy valuations are not due to differences in projections, only to differences in deriving fantasy value from projections. (I’ve also configured the tool to use the same categories that my league uses.) Even differences in determining positional value can’t account for too much of the differences, because even filtering each set of results by position leaves wide disparities. (I can’t give many examples here, because PECOTA and PFM data are subscriber-only, but two of the many claims that result from my method are that BP is--for my fantasy league--overvaluing Starlin Castro and undervaluing Jason Kipnis.)

Perhaps metarationality requires me to defer to BP completely here; it seems clear that I at least ought to partially adjust my beliefs once I see that a company of very smart people, plenty of whom get hired away by MLB teams, disagree with me. However I decide to weight my own results and PFM's come draft day, right now I’m left with a disjunctive conclusion. I think one of these must be true:

(1) BP’s calculations are way better than mine. This would be interesting as an example of a situation where a sensible basic method diverges enormously from the best method.

(2) The only major league feature that PFM does not explicitly account for--that my league is head-to-head--makes a big difference to player values. This would be interesting as a fact about fantasy baseball.

(3) BP’s calculations are not way better than mine. This would be interesting for many reasons. Although I’m not at all sure that my algorithm is better than or even roughly as good as theirs, this is a possibility worth at least considering. If it were true, it might mean that my league is idiosyncratic and that I’m doing a good job of adjusting to it; it might also mean that I got lucky to choose a different and better basic approach from PFM’s.

There’s much more to say here, but I’ll say it better after I work harder to find patterns in the differences between my results and PFM’s, and after I work to improve my algorithms. (The answer to the title question is currently: I don't know.) For now I’ll simply suggest that serious fantasy players might do better to spend less time projecting players and more time valuing players based on projections.

Review: Poker's 1% by Ed Miller

Some good poker books are ones I'm glad I've read; others are ones I think my opponents would benefit from reading. Those categories don't always overlap: I got better by working to understand the examples from Mathematics of Poker, but I don't spend much time worrying that my opponents will have read it. Meanwhile, the various Harrington books were probably valuable to other players, but only the first tournament book affected my game much. Ed Miller's Poker's 1% fits both categories. I think I'm already a better player for having read it, and working through the book's suggested training regimen will certainly help much more. Meanwhile, I can easily think of dozens of friends and opponents whom I think would benefit even more than I have.

With that said, this is one of the most unusual poker books I've ever read, and working with it will for most readers require a leap of faith. The book can be read as an extended argument for structuring your thinking about poker in a certain way. Ed's approach is roughly this:

(1) Identify a property of ideal poker strategies: namely, that they obey certain principles about bluffing frequencies and street-to-street folding (and not-folding) frequencies;

(2) Estimate these frequencies with a combination of Mathematics of Poker-style theory, informal argument, and good old-fashioned guesswork (that's where the leap of faith needs to come);

(3) Explain how one goes about instantiating this strategy and identifying exceptions to it;

(4) Give lots of examples of the strategy.

The result might be Ed's best book, and that's saying something. It is, I think, his most epistemically explicit: he is admirably clear about what is deduction, what is guesswork, and what is approximation. And the book would have been much worse otherwise. Though Ed has obviously done his theoretical homework, which equally obviously informs his frequency recommendations, not much is proven. It is to Ed's credit that he makes it clear that, however theoretically motivated his recommendations are, only some of them are given airtight arguments. That doesn't stop Poker's 1% from being a very good book, although Ed's most motivated readers will want to read it in tandem with Mathematics of Poker in order to solidify their theoretical understanding of such subjects as street-to-street folding frequencies.

Much excellent work in mathematics and philosophy (and indeed every other subject with which I'm familiar) begins with a fairly simple, easily justified claim and gets as much mileage out of that claim as possible. This book can be read in the same way. It's informative and fun to let Ed begin with something every student of the game already believes--once you're in the pot, you can't give up too often--and draw out consequence after consequence of that claim. You probably know that "fit or fold" is a bad way to play, but Ed will show you just how bad it is, and how to take a broader and more useful view of "fitting" a board. You probably know that elite players look "hyper-aggressive" and "sticky," and you'll get a better sense of why they play that way. You probably know that when the board hasn't been particularly helpful to either player, both players have to fight for it, but Ed will help you figure out how much to fight, and how hard.

The examples Ed gives deserve careful study. They are thoroughly explained, usefully surprising, and accompanied by nice graphics. If you read the book you might be tempted to skip them to get on to the next surprising bit of general advice. Resist that temptation.

Although Poker's 1% has plenty to say about how to continue in a hand, it focuses more on how often to continue in a hand. I found myself wanting more material on check-calling vs. double-barreling, raising vs. calling, and so on. A book can only contain so much, though, and what Ed says on these subjects is more than enough to give me a nice extra advantage against my usual $2-5 and $5-10 opponents.

I imagine some of my opponents will get much better by reading this book, but others might get worse. I think this book will be widely misread, mostly by people who skim it once, never do the requisite study the book recommends, and interpret Ed as advocating maniacal play. Others will, I think, feel out of control at the table, not knowing when to replace basic methods of hand-reading with "frequency-based" considerations. Others will have trouble dividing up their "continuing" ranges (as I mentioned in the paragraph above). Still others face the risk of playing more big pots than they're used to and giving off tells in them (due to nerves and situation-specific inexperience).

Though readers will risk being led astray, careful ones will benefit. I agree with Ed that this book contains a basic plan for reorienting oneself to the game and adopting patterns of thought like those of the best players. Time and careful study will bring me to a more refined view of just how good Ed's various approximations are, of whether Ed does enough to describe exceptions to his various rules, and so on. Even now, however, it's clear that Ed has produced a unique, exciting, and thoroughly readable book that will reward its most careful students tremendously (much more than the $50 on the sticker). It might be the anti-Ace on the River: Barry Greenstein claimed that his book would help any player move up one level, and I suspect that the readers of Poker's 1% will--depending on their aptitude and the care with which they read and study--improve either not at all or a whole lot.

Getting Things Done: two months later

Two months ago I wrote a glowing review of Getting Things Done. I’m still happily using the system (which, for whatever it’s worth, is little more than a commitment to keeping a list of your projects and the next sub-projects you need to do for each of them). Its most surprising benefit is that “switching costs” are much lower than they used to be. Knowing that I’m not going to forget an important task makes it easy for me to focus on what I’m doing now even if I just started doing it.

Some of the book’s advice, though, is either incomplete or outdated. Here is a small addendum to the system:

(1) Not all projects cleave neatly into next actions, on the one hand, and everything else, on the other. Much of my work is coding and writing. It is not convenient, and usually not helpful, to put “write the next paragraph” on a list and then replace it with a similar item when the paragraph is done. Code is similarly difficult and inconvenient to plan like this.

Rather than abandon the system for these projects, I just try to list all the project-parts that could be done next, updating and deleting as the project progresses. It’s not perfect, but here metaphysics simply doesn’t agree with the system.

(2) David Allen recommends sorting tasks into “contexts” in which sets of them will be appropriate to do: e.g., one for tasks that require a phone. Many of us today, though, have few different physical contexts for work: we work at computers from which almost everything we do is accessible. Now it’s probably better to optimize your next-action-grouping for fast search, not for context-appropriateness. I group mine by rough similarity and relatedness of parent projects; I also have “writing” and “coding” lists for time I’ve devoted to those or just find myself in the appropriate frame of mind.

(3) Many of the tools Allen recommends are amusingly out-of-date. (The technical resources he mentions would make for a nice round of trivia.) I find that Trello is a great way to manage my tasks; it can do the job of most of the technology Allen recommends.

The economics of poker: current events

Two small poker notes: First, I've been asked about the recent Borgata tournament that was cancelled because they found fake chips in it. This incident is interesting to me largely because I've long believed that we're in for a rash of cheating incidents as our collective memory of cheating and knowledge of poker security fades. Wherever there is money there are people trying to steal it. Many players (and staff) don't know how to protect the game, and I think we're collectively out of equilibrium. In five years I think we'll see a little more security diligence and I think we'll be better off for it. Keep in mind, of course, that this happened at one of the best-staffed poker rooms in the world.

What to do with the 27 remaining players at the Borgata is a difficult question--it depends heavily, I think, on what we learn about the extent of the cheating. The more disruptive the fake chips were to the tournament, the less sensitive the eventual resolution should be to the current chip counts.

What to do more generally is to be more diligent about chip sets and chip security in general. The World Series of Poker does not keep the ratio of the starting stack to the buy-in constant--in the Little One for One Drop, for example, you get 4,000 chips for your $1,000 (plus rake). I also remember the final tables of shootouts beginning with equal stacks much larger than the average stacks the players had won the previous day. While this sort of security worry is somewhat mitigated in this context--you can count the chips at the end of the day, and there are only a few suspects if any have gone missing--it is very dangerous in general to put millions of devalued chips in play at the WSOP.

Second, Lee Jones has recently written that tournament poker players ought to dress better, and that we stand to make big money in sponsorships and added money if we do. Lee is an awesome and insightful guy, and I imagine that there would indeed be more money in poker tournaments if final tables looked snazzier.

I disagree, though, that players would see much of that money. It is a fundamental economic lesson that such influxes of money are not divided equally but captured by those most able to capture it. Here, even though there would be money coming in to poker, it's the tournament hosts who would be able to capture it. Way back in the day--2003 or so--I remember Howard Lederer predicting that there would be lots of added money in poker tournaments because the game was booming. Eventually, players realized some nice gains: we saw satellites with some overlay and we had some nice inducements to wear poker site patches. The vast majority of the money that came into tournament poker from sponsors, however, was captured by tournament hosts. This should not have surprised the economically literate.

One possible equilibrium here is for tournament hosts to offer modest inducements for players to commit to dressing well if they make a final table, for sponsorship money to increase a bit, and for the hosts (and perhaps a few famous players) to pocket the vast majority of that sponsorship money. The more likely equilibrium is for the status quo to persist. Lee might be right that this would be good for poker, but I disagree that players stand to gain much.

Stuff I wrote elsewhere in 2013

2013: What I've been reading

I'm not the sort of person who produces particularly good "best books of the year" lists. I simply don't read enough new stuff. Also, my new job has caused me to read more about biology and computers, and to do more of my book-consumption in the subway or via audiobook as I commute. That, in turn, has shifted some of my reading from fiction to nonfiction, which feels less distorted by the audiobook format. The best stuff I read this year was King Lear, Pride and Prejudice, and The Great Gatsby. But that doesn't make for much of an end-of-the-year list. (If you want a new discovery, I quite like Pierce Gleeson, who posts a bunch of his stories here.)

Predictably, much of my 2013 nonfiction consumption was not of books I read front to back. There were lots of blog posts, textbook chapters, and MOOC lectures--I generally use MOOCs like libraries and not like courses.

Even so, however, here are ten nonfiction books that were new to me and that I found valuable this year, in no order:

  • Average is Over. The most thoughtful work of economics and the most exciting "futurist" thing I read this year.
  • It turns out that Web design is less exciting to me than most other kinds of coding, but I still think Jennifer Robbins' book on the subject is good.
  • I am currently devouring The Structure and Interpretation of Computer Programs, available for free here.
  • Another old, great computer book that was new to me: The C Programming Language.
  • Among poker books, PLO Quick Pro was probably the best one I read (no link in case you don't want the video that plays automatically on the book's Web site). Among strategy books that do not cost $400, I thought Playing the Player was the best I read (though I didn't read as many new poker books as in years past).
  • I learned lots from the information-dense and usefully opinionated Engineering Long-Lasting Software.
  • David Allen's Getting Things Done has made me significantly more productive. I reviewed the book here.
  • How To Cook Everything Vegetarian made my food life better.
  • So did Classic Indian Cooking.
  • In my dissertation work I read a lot of excellent work on Plato's Theaetetus. I gained new respect for David Sedley's book on the dialogue, which I already liked.

Review: Getting Things Done

It's been a week since I implemented the system David Allen outlines in Getting Things Done. It's been the most productive week I can remember, and I don't think that's just placebo effect. A central thesis of the book is that one does well to focus on "next actions" in one's projects. Whatever you want to do, figure out what the exact next actionable step in that project is. Then create an organizational structure supporting lists of those next actions. Do it properly, and you don't get stuck on projects, you don't neglect anything important, your file systems and calendar contain only what they ought to, and you are ready to spring into productive action in any situation where you might find yourself ready to work.

It's a simple but powerful idea. Allen focuses on the way in which it keeps your brain from doing something it's pretty bad at (remembering and retrieving all your projects and the tasks necessary for each) and frees it to do what it's good at (addressing a given task once you know what it is). I agree that much of Allen's system's value derives from that, but I wonder how much of the system's value comes simply from forcing you to spend more time thinking about what can be done, now, to concretely advance your plans. There are kinds of working-in-circles and self-deception that simply can't happen if you're following Allen's advice.

From the book's cover I wasn't expecting a work of philosophy, and while it's certainly not as incisive or intellectually nourishing as Epictetus's Encheiridion, it is a contribution to what we might call "applied philosophy of mind." Allen's craft is getting people to use their brains more effectively, and he is a thoughtful observer of human psychology (so, from the chapter on the long process of going through all your stuff to figure out what all your projects are: "Keep in mind that some potential anxiousness is going to surface as you make your stuff more conscious to you than it's been. Create whatever supports you need."). More often than I expected, discussions of paperclips and how to subdivide lists included quite general insights into cognitive functioning.

This isn't a motivational book in that it's dense with statements that are supposed to motivate you; it's a motivational book in that it's about how to improve your life given the nature of human motivation and cognition. On this subject I find myself returning to the David Foster Wallace's late work, especially The Pale King, which is also a book about what human psychology is like and how to live as well as possible given what is true about psychology. In some sense it's a fictional (and, yes, more profound) complement to Allen's book--both are about distraction and being able to focus completely on what's in the moment. Interestingly, Wallace's late work is also largely about the value of transcending boredom and (literally) finding value in whatever task is at hand, no matter how routine. The heroes of The Pale King would heartily approve of long attention spent on one's paperclips.

There's room for a course to be taught on the philosophy of the mundane. There's plenty of material in the ancient Greeks, though Wallace benefits greatly from being able to tailor his work to contemporary culture. There would be room in such a course for some notes on Getting Things Done: a book which, despite (and because of) its long discussions of, e.g., filing cabinets, has much to say not only on how to harness your cognition but what your cognition is like in the first place.

Contemporary philosophy and coding

The other week I was talking to a recently graduated, poker-playing philosophy major who is trying to learn about computers as he looks for a job. (We were introduced by a mutual acquaintance who, I gather, had a very easy time deciding the two of us would find something to talk about.) The conversation turned to the ways in which philosophy can prepare one (or not) for work with computers. He thought my remarks on the subject were more interesting than I thought they were, which prompted me to think a bit longer about it. I had surprised my interlocutor by claiming that philosophy was quite directly relevant to coding; further reflection not only reinforced that belief but revealed a further, surprising aspect of that relevance.

Though I wouldn't claim that studying philosophy helps you learn to code more than studying computer science or math does, I'm very confident that the connections are real and deep, and go beyond the basic observation that the clear thinking demanded by good philosophy pays off in any subject. Studying the mechanisms of language is now a central and unavoidable task for a student of philosophy. I've spent long hours spent thinking about sense vs. reference, the relationship between utterances and states of affairs, what makes something a complete statement, and so on. I imagine anyone who has done this will have an easy time understanding, say, the distinction between passing by value and by reference.

I first learned the lambda calculus (from this book) in a philosophy course, and that's directly applicable to coding even if you aren't doing heavy-duty functional programming. Distinguishing various functions of verbs of being prepares one to use distinct symbols to check for equality and to make things equal. Logic courses, required in many philosophy programs and encouraged in many more, are of obvious importance. And, of course, UX is largely just a subfield of applied epistemology, and various ethical subjects inform every part of a coder's work...

...But what surprised me at the end of this train of thought is that it's not just the cognitive strengths trained by philosophy or even specific healthy patterns of thought that help a coder. Even the discipline's more problematic features have helped me. If anything, contemporary philosophy is too focused on language, but that focus has been a great benefit to my career (see above). I've also long suspected that academic philosophers have started to value logical consistency too much, and that we might be better off if we asked philosophers to spend a little less time worrying about the ways their definitions interconnect and a little more time thinking about whether those definitions are worth worrying about in the first place. Again, though, this is plausibly a benefit to those of us who now spend lots of time thinking about the properties of unusual data structures. And reading technical documentation is easier when you've read lots of journal articles that are optimized, even over-optimized, for proving and communicating logical features of a theory.

Some of those remarks are quite controversial (though I'm far from alone in believing them, and would be willing to defend them at length). Notice, though, that even if I'm wrong to think that some of these are problematic features or emphases of the discipline, those features and emphases would still be useful training for coding. Of course, I do believe that philosophy is a wonderful and noble thing, that academic philosophy is in many ways flourishing and at its historical peak of quality, and that philosophy's best features help its students in many careers, including mine. But the value of philosophy to computer work seems to me slightly more independent of the quality of the state of the discipline than I would have expected.

"I wouldn't have learned this anyway!"

I work in genomics and bioinformatics now. As an undergrad I was a math major and took plenty of writing and philosophy classes on the side. I haven't taken a (non-MOOC) biology or computer science class since high school. An obvious question to ask myself is whether I regret not having devoted more of my undergraduate career to stuff I'm working on now. It would be nice to have had more of a head start in the various subjects that intersect in bioinformatics--but I was an undergrad from 2001 to 2005. Back then, next-generation sequencing did not exist (or barely existed, depending on one's definition). So much of modern bioinformatics is an attempt to solve the questions set by this technology, and that fact puts a hard limit on how much I could possibly have learned about my work back then.

As for the computer stuff: yes, some extra work in algorithms and extra practice debugging would have helped. But, as I've written elsewhere, computer science and programming is probably the best subject for self-study today (I wrote a little bit about my experience here). And--crucially--some of the most important computer skills are not things you learn as a CS major. Working in a shared repository; reading and debugging others' code; finding the right libraries to use in your own project and making sure the license permits you to do so... there are, as far as I know, not so many places in which a CS student spends a lot of time doing these things, and very few in which these are requirements of a CS major. A good friend of mine was a diligent, smart CS major who still uses his computer skills hourly in his work. He does not have a GitHub account.

So, looking back, those poetry and math and philosophy courses look pretty good. This is not only because they constituted a liberal arts education that is good to have regardless of its precise relationship to one's career, but because they--at least arguably--have been at least as relevant to my computational biology career than either computer science or biology classes would have been.

One year later

It was about a year ago this time when I started Project Euler as a way to brush up on some math and perhaps learn something about computers along the way. This was a perfect complement to my dissertation-writing. These were small projects that I could solve any way I wanted--some hardly even required a computer--and for which the costs of failure were small. Computer work and philosophy remain ideal twin pursuits, but the balance between them has shifted: I'm now a full-time worker at a genomics startup. Like everyone at a new-ish startup, I do too many things for a job title to communicate much about my job, but there's a lot of coding and other technical stuff involved. Somehow my whirlwind tour of Ruby, Python, SaaS, Ruby on Rails, Django, algorithms, C, C++, SQL, and assorted front-end stuff (and various small study projects I'm forgetting) ended in bioinformatics... which is perfect for me. I constantly need to learn new tools and technology, which I think is great fun, and the underlying subject matter is fascinating. Genomes behave in stunning ways.

I can't imagine a better topic than coding (broadly understood) for Internet self-study. Free and cheap resources are everywhere, from books to auto-gradable projects. Even if I hadn't wound up benefiting professionally from my studies, my life would still have become more efficient, more informed, and more fun.

I've been through a (virtual) mountain of books, tutorials, podcasts, blog posts, essays, and Tweets this past year. Perhaps there is some future benefit, to me or other people, to my listing a few resources that have been most helpful.

Engineering Software as a Service. The introductory chapters are one of the best introductions to, and defenses of, agile development. More than any other book or blog post, it has helped me to think about SaaS accurately and effectively. (Not that I don't have a long way to go to really understand SaaS.) I've also watched a bunch of Armando Fox's freely available class videos, and his lecturing style is excellent: blunt, content-rich, and serious, but with a sense of fun.

The Zipfian Academy's blog post on data science resources may or may not be comprehensive, but it's led me to a bunch of the most useful online courses, books, and other resources. And the structure of the post itself contains some useful lessons about the structure of the discipline. has been an incredible bargain for me. Kevin Skoglund's courses are particularly good. It's been pleasantly surprising how useful the videos are as not just as courses but as quick references. Not infrequently, remembering and returning to where I learned something on is the fastest way for me to access some solution, technique, or even command. (And I'm pretty good at Googling.)

Kernighan and Ritchie's seminal book on C is even better than its reputation led me to expect--not least because the prose is remarkably clean, effective, and readable. They do the reader the service of allowing one to think about C, not about untangling sloppy sentences.

Bill Howe's Coursera course on data science is the most useful one I've tried on the subject. The lectures might charitably be called "minimum viable" from a production perspective, but Howe has obviously thought carefully about how to teach the material, and the viewer frequently benefits from the breadth of his knowledge of the subject. He frequently discusses how a subject or tool fits in to the whole current landscape: whether there's something better for a given task, what prompted its development, what misconceptions might be causing people to misuse or misunderstand it, and so on. Also, the exercises are much better than average, and well worth doing.