Showing posts with label Computers. Show all posts
Showing posts with label Computers. Show all posts

Sunday, October 28, 2018

Book Review: The Book of Why

The Book of Why: The New Science of Cause and Effect
Judea Pearl
Mathematics, computers, statistics

The Book of Why reminded me strongly of The Evolution of Beauty.
  • The author has a Theory, referred to with Capital Letters (here, the Causal Revolution; there, that Beauty Happens).
  • The Theory was actually discovered long ago, but it has been forgotten.
  • Mainstream investigators have sneered at, pooh-poohed, and generally neglected the Theory.
  • Fie on them.
  • They are enslaved to their own outdated notions, which lead them to more and more outlandish convolutions to explain things that the Theory explains quite simply.
  • The Theory is nothing less than revolutionary, and has profound implications.
  • The assertions of significance are maybe a little more extravagant than the book can establish.
There's even a shared villain of sorts, the statistician R. A. Fisher.

Among the differences is that The Book of Why is more technical. I won't say it's written for a specialist audience, but to get a lot out of it you should have at least a basic understanding of probability and statistics. (Bonus points for knowing what Bayes' Theorem is.) You'll need to do some simple probability math if you want to verify what Pearl is saying. 

Put it another way: if you're not familiar with the stock phrase "correlation is not causation," this isn't the book for you--because this is exactly what Pearl is arguing about. Specifically, The Book of Why argues for the power of making inferences based on causal diagrams, and demonstrates rigorous ways to manipulate them to draw powerful conclusions. 

This sounds hazy, so let's go with an example from the book: the low-birth-weight paradox. We've all learned that smoking is bad, and that it's especially bad for pregnant mothers. And yet: babies with low birth weight do better if their mothers were smokers. This isn't a fluke; the statistics establish correlation quite firmly. What gives?

What gives, says Pearl, is that we're settling for a correlational answer when we need a causal one. Specifically, we need to understand that low birth weight may have different causes. Smoking can cause it. But so can developmental defects, or malnutrition. What the paradox show is that babies whose birth weight is low because their mothers smoked do better than babies whose birth weight is low because of other, much more serious conditions. Which makes perfect sense.

Interesting stuff. On the other hand, classical statisticians have good ways to talk about this sort of effect without resorting to Pearl's "Causal Revolution." Maybe it's clearer and simpler with causal calculus--I'm inclined to believe that--but The Book of Why rather implies a stronger claim.

Moreover, Pearl seems to tack sideways around one of the standard arguments against causal thinking. When you create a causal model, you're making assumptions. All the graph-theoretical rigor in the world won't help you answer questions if your graph is wrong--if, say, you assume that plowing the prairie causes rain (don't laugh, people did this), you'll have an incorrect diagram. Sure, this is often trivial--snowy weather causes traffic accidents, not the other way around--but when it's that trivial, why do you need a causal model in the first place?

The power of standard statistics is to tease out correlations that you didn't expect. That's why statisticians, AI researchers, and machine-learning people love it: you dump in a bunch of data, push a button, and poof! you learn something. (In practice, I haven't found it to work that way, but the notion is seductive.) Causal modeling seems like an interesting and powerful approach to quantifying what it is that you've learned. As to whether it merits the designation of "revolution," though, I'm still agnostic.

Monday, September 25, 2017

Book Review: A Mind at Play

A Mind a Play: How Claude Shannon Invented the Information Age
Jimmy Soni, Rob Goodman
Biography, computers

Claude Shannon was the Isaac Newton of information theory--and that's not an exaggeration; he reified and measured the concept of "information" much as Newton made sense of force and acceleration. Unlike Newton, he seems to have been a genuinely playful and sweet-natured man. After revolutionizing communication, he rode unicycles, taught himself to juggle, and built whimsical machines--like the box with the switch on top; when the switch was turned on, a mechanical arm emerged, turned off the switch, and retracted.


A Mind at Play is not a super-dense book, either as biology or as mathematics. Its core is a very nice summary, very light on mathematics, of just what it was that Shannon did. I think the authors missed a couple of tricks for the more knowledgeable reader--the deep connections between information entropy and physical entropy go unacknowledged--but the book is well-written and provides a good, sympathetic character portrait.

Among the good books that overlap with A Mind at Play are:

  • The Innovators, Walter Isaacson
  • The Idea Factory, Jon Gertner
  • The Information, James Gleick (much more technically rich)

Monday, December 7, 2015

Book Review: Digital Gold

Digital Gold: Bitcoin and the Inside Story of the Misfits and Millionaires Trying to Reinvent Money
Nathaniel Popper
Economics, computers

Some people have a stereotypical idea of what constitutes a Bitcoin zealot in their minds. Some people, indeed, probably imagine:
  • Technical brilliance combined with Asperger's syndrome or the like
  • Thin, worryingly intense men with beady eyes
  • Parents' basements
  • Orthodox Libertarians waving their copies of Mao's Little Red Book Atlas Shrugged in quasi-religious fervor
  • Scammers, fast-talkers, Machiavellians, suck-ups, and narcissists generally
Some people are, broadly speaking, correct. No one person in Digital Gold incorporates all of the stereotype, but even so a certain ... composite portrait ... emerges. (Two other facts are worth noting: 100% of the actors are male, and 98% of them seem to be jerks. One of the few exceptions lives in my home town, for what that's worth.)

Also, there are a lot of them. That's one of Digital Gold's main weaknesses. There are just too many characters, and they tend to drift into and out of the story, making it hard to remember who's who. A cast of characters, right up-front, would have been helpful; a timeline would not have come amiss. As it is, the book is a bit herky-jerky. The pieces are fine, and might stand on their own as newspaper articles, but as a whole it's a bit slice-of-life-ish.

This is, in part, because Nathaniel Popper chose to concentrate on the people rather than on the technology. I understand why.  I imagine that there are relatively few readers who will abandon the book because it's short on eye-watering engineering detail. That doesn't mean I don't miss it, though. There's only a short and shallow technical appendix, which isn't nearly enough.

Still, it's a pretty enjoyable read. The conclusion is a bit of a downer: the idealists go up against the System, and the System wins. But, as with the large and shifting cast, that's real life for you.

Sunday, March 1, 2015

Book Review: Geek Sublime

Geek Sublime: The Beauty of Code, the Code of Beauty
Vikram Chandra
Aesthetics, software

Software developers talk a lot about a piece of code being "beautiful" or "ugly". Mathematicians do something similar: "Beauty is the first test: there is no permanent place in the world for ugly mathematics", wrote the great number theorist G. H. Hardy. Scientists, too, use the language of beauty to describe their work. And many people (myself among them) think that engineering designs and engineered objects can be beautiful in their own right--there's even a "movement", sometimes called Machine Art or Precisionism, to that effect.




Suspended Power, Charles Sheeler. Image from the Dallas Museum of Art

On the other hand, it's a commonplace to observe that there is a deep cultural divide between humanists and scientists (and engineers). Vikram Chandra, who's both a software developer and an award-winning novelist, wrote this book to try to explore whether and how these ideas of beauty cross that divide.

As you'd expect, the book is wide-ranging. It's got some (largely non-technical) discussion of software and the software writing process in it, but it also has a good chunk of fascinating autobiography, and a deep dive into Sanskrit language and classical Indian aesthetic theory. The latter is particularly novel to a western reader, and in some ways quite extraordinary.

As you'd also expect, it's beautifully written. In fact, it's so beautifully written that it took me a while to realize that its various parts don't always cohere very well. The discussion of the lowest level of the computer (the logic gate) is very clear, for example, but it's not clear what it has to do with the rest of the book. Similarly, the dearth of women in U.S. computer science compared to India is a very interesting topic; I'm just not sure what it's doing in this book.

But if we're talking about "the beauty of code", cohesion is vital. So, ultimately, Geek Sublime left me a little unsatisfied; I'm not entirely sure what conclusion Chandra really reaches, if any.

So I'll favor you with my own conclusions instead. For reference, I am a practicing software engineer. Although I'm not an award-winning novelist, I write both fiction and non-fiction for pleasure. I do artwork and illustration (they're not the same, although they're related). I've composed and performed music, to my own satisfaction and occasionally to others'. 

In my subjective experience, there is certainly a connection between beautiful code and good writing—a connection which I can only describe as a shape. Good code and good prose both have a definable structure, a sense of which is almost a kinesthetic experience; I find myself waving my hands around in the air, as if molding invisible clay words, when I'm trying to describe it. In a work with a good shape, everything relates to everything else. Nothing is missing. Nothing is wasted.

The difference, thought, is that in engineering a lovely shape is never enough. An engineered design, like an equation or a scientific theory, has to work. No code can be beautiful if it doesn't do anything, or if it does something wrong. For a book or a poem or a painting, beauty does not serve function; to be beautiful is the function.