Hello! This book series is designed to take you on a journey, from counting with blocks to creating an artificial intelligence. We’ll start simple and develop each idea organically.

Written by Nick McIntyre

Edited by Isabella Tang


For my students, who teach me how to teach this stuff.


Here’s the plan: I will show you to model systems using one formal language (mathematics) so that you can explore them using another formal language (computer code). My hope for you, dear reader, is that you walk away from each exercise a little more confident that you can understand anything you see and construct anything you can imagine.

It’s not overselling it to say that modern life is entirely dependent upon math and code. More to the point, working at the intersection of these entwined fields can be a whole lot of fun.

A Little Background

The Wikipedia entry on mathematics begins by highlighting core topics like quantity, structure, space, and change. Whether you’re into creating things or exploring the limits of knowledge, mathematics is a useful lens through which to view the world.

In 1936, two mathematicians named Alonzo Church and Alan Turing wanted to determine what functions could be computed; they ended up laying the foundation of computer science. It’s fitting that computational thinking–thinking about problems in terms of systems, models, data, and algorithms–is a powerful approach to learning and applying mathematics.

The International Society for Technology in Education (ISTE) outlines the following core components in their computational thinking competencies.

Systems that enable decomposition.

\(\mapsto\)Models that distill essential features.

Data that computers can understand.

Algorithms that computers can execute.

These books emphasize these components as part of a structured problem-solving process.

About the Author

My name is Nick McIntyre and I teach mathematics and computer science in my hometown of Galveston, Texas. I love this stuff and cut my teeth simulating systems like the atmosphere and wind farms. When I’m not in the classroom, you can probably find me playing at the beach or nerding out at a coffee shop. I earned a BS in Engineering with Honors and MS in Civil and Environmental Engineering from Stanford University.

  Feel free to drop me a line!

This book’s text and images are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

This book’s code examples are licensed under the MIT License.