## Trying to find math inside everything else

### Post Vacation Blues

The day after Spring Break is rough. Not only am I jet-lagged, but the students haven’t seen each other in over a week and thus are non-stop talking. That probably could have been fine, however, if the lesson I designed was a little stronger. While the Estimation180 intro went fine, the other activity (modeling profit and demand with quadratic and linear functions) was less so. I tried to start with a notice and wonder that mostly flopped. And then, in question 2 (see below) when I asked them to write a function, the one that was easiest to come up with was not in any of the quadratic forms we had already talked about (standard, vertex, factored), so it was less clear what to do with it. I’m going to have to revisit it tomorrow and try again. I feel like today was mostly a wash.

### Sorting Algorithms and Quadratic Functions

In my intro-level computer science class, we spent the last two weeks before break investigating sorting algorithms and search algorithms. However, because we were kinda burnt out of Java, I decided to do it computer-free. We used small decks of cards instead. To simulate the computer only comparing two values at a time (to limit the kids using their more powerful brains to speed up the process), students were only allowed to move cards that were face-up, and could only have two cards face-up at a time. The first day I had them come up with their own algorithms and count how many steps it took them, steps being flipping a card or moving a card.

In the subsequent days, I wrote up several common sorting algorithms as they would be applied to the cards. For each of them, we kept track of how many steps the process took, which was always the same for some (Selection) but we had to think about best and worst cases with the others.

We then considered how many steps they would take for 4 cards, 5, 6, 7, 8, then n. And so we wound up creating functions to represent the complexity of the algorithm. Many of these wound up being quadratic and linear functions. All of my students had previously taken Algebra and none had problems with the linear, but the quadratic functions sometimes caused problems. But we would work what exactly changes each step, find second differences, etc, to create the functions. And no one thought this was a weird place for quadratic functions to come up – it just seemed like a natural thing that arose when we started investigating the algorithms.

Below I attached the algorithms I wrote up for the sorts. Go get a set of 8 cards and try them out. Can you figure out the function? (Note: for the Worst Case of the Merge Sort and the Quick Sort, it’s a recursive function that doesn’t necessarily have a nice explicit form.)