Exercises — Chapter 3: How Machines Learn

Part A: Conceptual Questions ⭐

A.1. Define supervised learning, unsupervised learning, and reinforcement learning in your own words. For each, provide one real-world example not mentioned in the chapter.

A.2. What is the difference between a feature and a label in supervised learning? Use the email spam example to illustrate your answer.

A.3. Why do machine learning practitioners split data into three sets (training, validation, and test)? What would go wrong if they used only one dataset for everything?

A.4. Explain overfitting using a non-technical analogy. Your analogy should make clear why overfitting leads to good performance on familiar data and poor performance on new data.

A.5. In what sense do neural networks "learn their own features"? How does this differ from the expert systems approach described in Chapter 2?

A.6. The chapter argues that machine learning "learns from patterns in data, not from understanding." What does this distinction mean, and why does the chapter call it a threshold concept?

Part B: Applied Questions ⭐⭐

B.1. For each of the following tasks, identify whether supervised learning, unsupervised learning, or reinforcement learning would be the most appropriate approach. Explain your reasoning. - (a) Grouping news articles by topic without pre-defined categories - (b) Training a robot to walk - (c) Predicting whether a loan applicant will default - (d) Identifying unusual patterns in network traffic that might indicate a cyberattack - (e) Teaching a chess-playing program to improve its strategy

B.2. A hospital trains MedAssist AI on 100,000 X-rays from patients at a large urban medical center. The system achieves 96% accuracy on test data from the same hospital. When deployed at a small rural clinic, accuracy drops to 78%. List three specific factors that might explain this drop. For each factor, identify whether it represents an overfitting problem, a data quality problem, or a generalization problem.

B.3. A music streaming service wants to create personalized playlists. It has data on what songs users play, skip, repeat, and add to their own playlists — but no explicit labels about what moods or genres users prefer. What type of machine learning would be most useful here, and why? What are the limitations of this approach?

B.4. ContentGuard is trained to identify hate speech using labeled examples from human moderators. Describe a scenario where the training data might lead ContentGuard to make systematically unfair decisions against a particular community. Be specific about what would be in the training data and how it would affect the model's behavior.

B.5. A self-driving car company uses reinforcement learning to train its vehicles. The reward function gives positive rewards for reaching the destination quickly and negative rewards for collisions. Describe a potentially dangerous behavior the system might learn. How would you redesign the reward function to prevent it?

Part C: Skills-Based Questions ⭐⭐–⭐⭐⭐

C.1. Find a news article about an AI system being deployed in a real-world setting. Based on the description, determine: - What type of machine learning it likely uses (supervised, unsupervised, reinforcement, or a combination) - What the training data probably looks like - What risks of overfitting might exist - Whether the article's description of the AI "learning" is accurate or misleading

C.2. You are explaining machine learning to a group of local city council members who are evaluating whether to adopt CityScope Predict. Write a 200-word explanation of what it means for the system to be "trained on historical crime data." Your explanation should address what the training data looks like, what the model learns from it, and what it cannot learn. Avoid all technical jargon.

C.3. Create a table comparing supervised, unsupervised, and reinforcement learning across the following dimensions: (a) type of input data needed, (b) type of feedback the system receives, (c) what the system learns, (d) what the system needs to perform well, (e) most common failure mode, and (f) one real-world example.

C.4. An AI company's website states: "Our system understands customer needs and intelligently recommends the perfect product." Rewrite this marketing copy to be technically accurate while still being appealing to potential customers. Then write a version that a regulator might prefer.

Part D: Synthesis Questions ⭐⭐⭐

D.1. The chapter presents overfitting and underfitting as the two fundamental failure modes of machine learning. Can you think of a third way machine learning might fail that doesn't fit neatly into either category? (Hint: consider what happens when the training data itself is fundamentally flawed, not just insufficient.)

D.2. Consider the threshold concept: "Machines learn from patterns in data, not from understanding." Some AI researchers argue that with enough data and enough parameters, pattern recognition becomes a form of understanding — that there's no meaningful distinction at sufficient scale. Others argue that no amount of pattern recognition can ever constitute genuine understanding. Which position do you find more persuasive, and why? Be specific about what would count as evidence for either side.

D.3. Throughout this chapter, analogies are used extensively (learning to identify dogs, sorting buttons, riding a bicycle). Choose one analogy from the chapter and identify: (a) where the analogy is helpful and illuminating, and (b) where the analogy breaks down or misleads. What does this exercise teach you about the role of analogies in AI literacy?

D.4. The chapter argues that the word "learning" means something fundamentally different when applied to machines versus humans. But does it? Consider: when a young child memorizes multiplication tables through repetition and feedback, is that closer to machine learning or to human understanding? Where exactly is the line between statistical learning and genuine understanding, and can you draw it clearly?

Part M: Mixed and Interleaved Questions ⭐⭐–⭐⭐⭐

M.1. (Connects Ch.1, Ch.2, and Ch.3) In Chapter 1, we defined AI broadly. In Chapter 2, we saw how the field's approach shifted from symbolic AI to machine learning. In this chapter, we learned how machine learning actually works. A friend asks: "If machine learning is just finding patterns in data, how is that different from what a spreadsheet does?" Using concepts from all three chapters, craft a response.

M.2. (Connects Ch.2 and Ch.3) Chapter 2 described the expert system XCON, which used hand-coded rules. Imagine rebuilding XCON today using supervised learning instead. What would you need (in terms of data, labels, and model architecture)? What problems from XCON's era would be solved? What new problems would be introduced?

M.3. (Connects Ch.2 and Ch.3) Chapter 2 described how GPUs — originally designed for video games — turned out to be essential for deep learning. This is an example of Pattern 3: "Breakthroughs come from unexpected directions." Based on what you've learned about how neural networks work in this chapter, why were GPUs particularly well-suited for training neural networks? (Hint: think about what a GPU does — process many simple calculations simultaneously — and what each neuron in a network requires.)

Part E: Extension Questions ⭐⭐⭐⭐

E.1. Research the concept of "transfer learning" — training a model on one task and then adapting it to a different but related task. How does transfer learning relate to the concepts of overfitting and generalization discussed in this chapter? Write a 300-word explanation.

E.2. The chapter's optional code trains a decision tree classifier on the Iris dataset. If you have access to Python, modify the code to use a different classifier (try RandomForestClassifier or KNeighborsClassifier from scikit-learn) and compare the results. What does the comparison teach you about the relationship between model complexity and performance?

E.3. Research one real case where an AI system's overfitting to training data caused harm or failure in deployment. (Suggestions: facial recognition systems performing poorly on certain demographic groups, medical AI performing differently across hospitals, language models failing on non-English text.) Write a 400-word analysis connecting the case to concepts from this chapter.

E.4. The chapter describes reinforcement learning agents finding "cheats" — exploiting quirks in their environment to maximize reward without performing the intended task. Research one documented example of this phenomenon (often called "reward hacking" or "specification gaming"). What does this example teach us about the challenge of defining what we want AI systems to do?