1 Learning math with code


This chapter covers

  • Solving lucrative problems with math and software
  • Avoiding common pitfalls in learning math
  • Building on intuition from programming to understand math
  • Using Python as a powerful and extensible calculator

Math is like baseball, or poetry, or fine wine. Some people are so fascinated by math that they devote their whole lives to it, while others feel like they just don’t get it. You’ve probably already been forced into one camp or another by twelve years of compulsory math education in school.

What if we learned about fine wine in school like we learned math? I don’t think I’d like wine at all if I got lectured on grape varietals and fermentation techniques for an hour a day, five days a week. Maybe in such a world, I’d need to consume three or four glasses for homework as assigned by the teacher. Sometimes this would be a delicious educational experience, but sometimes I might not feel like getting loaded on a school night. My experience in math class went something like that, and it turned me off of the subject for a while. Like wine, mathematics is an acquired taste, and a daily grind of lectures and assignments is no way to refine one’s palate.

1.1 Solving lucrative problems with math and software

1.1.1 Predicting financial market movements

1.1.2 Finding a good deal

1.1.3 Building 3D graphics and animations

1.1.4 Modeling the physical world

1.2 How not to learn math

1.2.1 Jane wants to learn some math

1.2.2 Slogging through math textbooks

1.3 Using your well-trained left brain

1.3.1 Using a formal language

1.3.2 Build your own calculator

1.3.3 Building abstractions with functions