Contents
Guide
Pagebreaks of the print version
The author and publisher have provided this e-book to you for your personal use only. You may not make this e-book publicly available in any way. Copyright infringement is against the law. If you believe the copy of this e-book you are reading infringes on the authors copyright, please notify the publisher at: us.macmillanusa.com/piracy.
To Diana and to Anne.
NP
To my grandparents, to Margaret Aiken, and to the golden guinea.
JS
WE TEACH DATA science to hundreds of students per year, and theyre all fascinated by artificial intelligence. And they ask great questions. How does a car learn to drive itself? How does Alexa understand what Im saying? How does Spotify pick such good playlists for me? How does Facebook recognize my friends in the photos I upload? These students realize that AI isnt some sci-fi droid from the future; its right here, right now, and its changing the world one smartphone at a time. They all want to understand it, and they all want to be a part of it.
And our students arent the only ones enthusiastic about AI. Theyre joined in their exaltation by the worlds largest companiesfrom Amazon, Facebook, and Google in America to Baidu, Tencent, and Alibaba in China. As you may have heard, these big tech firms are waging an expensive global arms race for AI talent, which they judge to be essential to their future. For years weve seen them court freshly minted PhDs with offers of $300,000 + salaries and much better coffee than we have in academia. Now were seeing many more companies jump into the AI recruiting frayfirms sitting on piles of data in, say, insurance or the oil business, who are coming along with whopping salary offers and fancy espresso machines of their own.
Yet while this arms race is real, we think theres a much more powerful trend at work in AI todaya trend of diffusion and dissemination, rather than concentration. Yes, every big tech company is trying to hoard math and coding talent. But at the same time, the underlying technologies and ideas behind AI are spreading with extraordinary speed: to smaller companies, to other parts of the economy, to hobbyists and coders and scientists and researchers everywhere in the world. That democratizing trend, more than anything else, is what has our students today so excited, as they contemplate a vast range of problems practically begging for good AI solutions.
Who would have thought, for example, that a bunch of undergraduates would get so excited about the mathematics of cucumbers? Well, they did when they heard about Makoto Koike, a car engineer from Japan whose parents own a cucumber farm. Cucumbers in Japan come in a dizzying variety of sizes, shapes, colors, and degrees of pricklinessand based on these visual features, they must be separated into nine different classes that command different market prices. Koikes mother used to spend eight hours per day sorting cucumbers by hand. But then Koike realized that he could use a piece of open-source AI software from Google, called TensorFlow, to accomplish the same task, by coding up a deep-learning algorithm that could classify a cucumber based on a photograph. Koike had never used AI or TensorFlow before, but with all the free resources out there, he didnt find it hard to teach himself how. When a video of his AI-powered sorting machine hit YouTube, Koike became an international deep-learning/cucumber celebrity. It wasnt merely that he had given people a feel-good story, saving his mother from hours of drudgery. Hed also sent an inspiring message to students and coders across the world: that if AI can solve problems in cucumber farming, it can solve problems just about anywhere.
That message is now spreading quickly. Doctors are now using AI to diagnose and treat cancer. Electrical companies use AI to improve power-generating efficiency. Investors use it to manage financial risk. Oil companies use it to improve safety on deep-sea rigs. Law enforcement agencies use it to hunt terrorists. Scientists use it to make new discoveries in astronomy and physics and neuroscience. Companies, researchers, and hobbyists everywhere are using AI in thousands of different ways, whether to sniff for gas leaks, mine iron, predict disease outbreaks, save honeybees from extinction, or quantify gender bias in Hollywood films. And this is just the beginning.
We see the real story of AI as the story of this diffusion: from a handful of core math concepts stretching back decades, or even centuries, to the supercomputers and talking/thinking/cucumber-sorting machines of today, to the new and ubiquitous digital wonders of tomorrow. Our goal in this book is to tell you that story. It is partly a story of technology, but it is mainly a story of ideas , and of the people behind those ideaspeople from a much earlier age, people who were just keeping their heads down and solving their own problems involving math and data, and who had no clue about the role their solutions would come to play in inventing the modern world. By the end of that story, youll understand what AI is, where it came from, how it works, and why it matters in your life.
What Does AI Really Mean?
When you hear AI, dont think of a droid. Think of an algorithm .
An algorithm is a set of step-by-step instructions so explicit that even something as literal-minded as a computer can follow them. (You may have heard the joke about the robot who got stuck in the shower forever because of the algorithm on the shampoo bottle: Lather. Rinse. Repeat.) On its own, an algorithm is no smarter than a power drill; it just does one thing very well, like sorting a list of numbers or searching the web for pictures of cute animals. But if you chain lots of algorithms together in a clever way, you can produce AI: a domain-specific illusion of intelligent behavior. For example, take a digital assistant like Google Home, to which you might pose a question like Where can I find the best breakfast tacos in Austin? This query sets off a chain reaction of algorithms:
One algorithm converts the raw sound wave into a digital signal.
Another algorithm translates that signal into a string of English phonemes, or perceptually distinct sounds: brek-fust-tah-koze.
The next algorithm segments those phonemes into words: breakfast tacos.
Those words are sent to a search engineitself a huge pipeline of algorithms that processes the query and sends back an answer.
Another algorithm formats the response into a coherent English sentence.
A final algorithm verbalizes that sentence in a non-robotic-sounding way: The best breakfast tacos in Austin are at Julios on Duval Street. Would you like directions?
And thats AI. Pretty much every AI systemwhether its a self-driving car, an automatic cucumber sorter, or a piece of software that monitors your credit card account for fraudfollows this same pipeline-of-algorithms template. The pipeline takes in data from some specific domain, performs a chain of calculations, and outputs a prediction or a decision.
There are two distinguishing features of the algorithms used in AI. First, these algorithms typically deal with probabilities rather than certainties. An algorithm in AI, for example, wont say outright that some credit card transaction is fraudulent. Instead, it will say that the probability of fraud is 92%or whatever it thinks, given the data. Second, theres the question of how these algorithms know what instructions to follow. In traditional algorithms, like the kind that run websites or word processors, those instructions are fixed ahead of time by a programmer. In AI, however, those instructions are learned by the algorithm itself, directly from training data. Nobody tells an AI algorithm how to classify credit card transactions as fraudulent or not. Instead, the algorithm sees lots of examples from each category (fraudulent, not fraudulent), and it finds the patterns that distinguish one from the other. In AI, the role of the programmer isnt to tell the algorithm what to do. Its to tell the algorithm how to train itself what to do, using data and the rules of probability.