<commit_before>---
title: "Using the computer as a tool for thinking in discrete mathematics"
excerpt: "What is computational thinking? What does it look like in discrete mathematics courses? And what are good tools for helping get this done?"
comments: true
share: true
tags:
  - Computational thinking
  - Discrete structures
  - Python
  - Jupyter
  - Programming
---

_This article summarizes and extends a talk given at the AMS/MAA Joint Meetings on January 7, 2017. The website for the talk, with slides and links to resources, is at [http://bit.ly/ctdiscrete](http://bit.ly/ctdiscrete)._

**Mathematics is a deep, broad, and beautiful subject that says profound things about our world**. If that sentence causes cognitive dissonance with you, if it sounds like the complete opposite of your own concept of the subject, it's probably because the "mathematics" you learned in school isn't actually mathematics but some pale, impoverished cover version of mathematics. It might have looked instead like this:

+ Memorizing facts without context
+ Employing computational procedures without understanding the concepts
+ Jumping from one fact or algorithm to another without grasping the connections
+ Doing all this in an environment hermetically sealed from real life, or even just interesting questions

That's what it looked like for me, right up until the end of my secondary schooling. I could _do_ the things my teachers were asking me to do; I had OK grades in math classes. I could even be motivated at times to get good grades in those classes. But my idea about the subject went no farther than the list above describes.

It wasn't until my senior year of high school in 1987, when I was taking AP Calculus, that a crack in that image formed, and I could see something a lot deeper through it.

## How mathematicians are made

Two things happened. First, I had a teacher (<NAME>) who had the gift so rare among teachers of knowing when to stop talking and let students try things on their own. Her classes were like workshops, where we kids had the time and space to try things, explore, make mistakes, and figure things out on our own terms. Second, during that year, I received what at the time was a revolutionary piece of technology:

![HP 28S](/assets/images/28ss.jpg)

This is the [Hewlett Packard HP-28S graphing calculator](https://en.wikipedia.org/wiki/HP-28_series). It has a tiny letterbox screen that was just big enough to graph $y = \sin(x)$. (And it uses [reverse Polish notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation) which is also amazing, but that's another story.) It was easy to program, even for people like me who didn't really know how to program, and more importantly the graphing screen made it easy to screw around with ideas and see what transpired. For example, I'd graph $y = \sin(x)$. Then I'd wonder, _What would happen if you graphed $y = \sin(2x)$ on top of it?_ Add in the new function, graph it side-by-side, and look at the results --- and then ask more questions. What about $\sin(3x)$? Or $\sin(4x)$? Or $\sin(-x)$? Pretty soon I'd have a theory of what's going on, and I could say something definitive about it and check my theory just as easily. And once I'd done all this, I wanted (even _needed_) to tell other people about it, and explain what I was seeing and why it worked.

I think I became a mathematician in Mrs. Allen's AP Calculus class. The confluence of being in an environment that stressed student exploration, and having the tools that made exploration systematic and easy, brought me to see that math is a lot more than algorithms and carrying out algorithms without screwing up. In fact screwing up _honestly_ and _scientifically_ is fundamental to the discipline. Mathematics, it turns out, is a way of creating new knowledge about the world and expressing that knowledge in a clear, logical, and ultimately _true_ way. And I was hooked.

## Computational thinking

I didn't know it then, but the process that I was discovering in Mrs. Allen's class with my HP-28S, that consists of coming up with a question to investigate and then:

1. Exploring that question by **decomposing** it into individual instances that can be run, checked and analyzed separately,
2. Then **finding patterns** among the individual instances,
3. Then forming an **abstraction** that attempts to give precise phrasing to the patterns I was seeing, and then finally
4. **Designing an algorithm or explanation** that explains why my abstraction was right,<commit_msg>Delimiters?<commit_after>---
title: "Using the computer as a tool for thinking in discrete mathematics"
excerpt: "What is computational thinking? What does it look like in discrete mathematics courses? And what are good tools for helping get this done?"
comments: true
share: true
tags:
  - Computational thinking
  - Discrete structures
  - Python
  - Jupyter
  - Programming
---

_This article summarizes and extends a talk given at the AMS/MAA Joint Meetings on January 7, 2017. The website for the talk, with slides and links to resources, is at [http://bit.ly/ctdiscrete](http://bit.ly/ctdiscrete)._

**Mathematics is a deep, broad, and beautiful subject that says profound things about our world**. If that sentence causes cognitive dissonance with you, if it sounds like the complete opposite of your own concept of the subject, it's probably because the "mathematics" you learned in school isn't actually mathematics but some pale, impoverished cover version of mathematics. It might have looked instead like this:

+ Memorizing facts without context
+ Employing computational procedures without understanding the concepts
+ Jumping from one fact or algorithm to another without grasping the connections
+ Doing all this in an environment hermetically sealed from real life, or even just interesting questions

That's what it looked like for me, right up until the end of my secondary schooling. I could _do_ the things my teachers were asking me to do; I had OK grades in math classes. I could even be motivated at times to get good grades in those classes. But my idea about the subject went no farther than the list above describes.

It wasn't until my senior year of high school in 1987, when I was taking AP Calculus, that a crack in that image formed, and I could see something a lot deeper through it.

## How mathematicians are made

Two things happened. First, I had a teacher (<NAME>) who had the gift so rare among teachers of knowing when to stop talking and let students try things on their own. Her classes were like workshops, where we kids had the time and space to try things, explore, make mistakes, and figure things out on our own terms. Second, during that year, I received what at the time was a revolutionary piece of technology:

![HP 28S](/assets/images/28ss.jpg)

This is the [Hewlett Packard HP-28S graphing calculator](https://en.wikipedia.org/wiki/HP-28_series). It has a tiny letterbox screen that was just big enough to graph $y = \sin(x)$. (And it uses [reverse Polish notation](https://en.wikipedia.org/wiki/Reverse_Polish_notation) which is also amazing, but that's another story.) It was easy to program, even for people like me who didn't really know how to program, and more importantly the graphing screen made it easy to screw around with ideas and see what transpired. For example, I'd graph $$y = \sin(x)$$ test. Then I'd wonder, _What would happen if you graphed $y = \sin(2x)$ on top of it?_ Add in the new function, graph it side-by-side, and look at the results --- and then ask more questions. What about $\sin(3x)$? Or $\sin(4x)$? Or $\sin(-x)$? Pretty soon I'd have a theory of what's going on, and I could say something definitive about it and check my theory just as easily. And once I'd done all this, I wanted (even _needed_) to tell other people about it, and explain what I was seeing and why it worked.

I think I became a mathematician in Mrs. Allen's AP Calculus class. The confluence of being in an environment that stressed student exploration, and having the tools that made exploration systematic and easy, brought me to see that math is a lot more than algorithms and carrying out algorithms without screwing up. In fact screwing up _honestly_ and _scientifically_ is fundamental to the discipline. Mathematics, it turns out, is a way of creating new knowledge about the world and expressing that knowledge in a clear, logical, and ultimately _true_ way. And I was hooked.

## Computational thinking

I didn't know it then, but the process that I was discovering in Mrs. Allen's class with my HP-28S, that consists of coming up with a question to investigate and then:

1. Exploring that question by **decomposing** it into individual instances that can be run, checked and analyzed separately,
2. Then **finding patterns** among the individual instances,
3. Then forming an **abstraction** that attempts to give precise phrasing to the patterns I was seeing, and then finally
4. **Designing an algorithm or explanation** that explains why my abstraction was right,
{'fraction_non_alphanumeric': 0.05504688361831219, 'fraction_numerical': 0.005736348593491451, 'mean_word_length': 4.422248803827751, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1372036', 'n_tokens_mistral': 2297, 'n_tokens_neox': 2159, 'n_words': 1430}