No. 18 - Pancake sorting 🥞 Dates and history 🔩Shortage of chips

Working with a spatula

My name is Linda. I write a bi-weekly newsletter about computer science, childhood and culture - and there are 9447 of you listening. If you enjoy this issue, please share it with anyone you think may find it useful.


Last week we shot a short talk about home-cooked software. My manager had access to a kitchen studio and the idea of doing a technology talk, but in the style of a cooking video, was born.

The talk is about a lot of things: what we can learn from recipes, Samin Nosrat, rooftop gardens, caloric surplus and the idea of developing a palate and what that means for software engineering. But one of the most fun to shoot segments was demonstrating the pancake sorting algorithm.

This is an algorithm to sort a disordered stack of pancakes in order of size in the smallest number of steps. There’s a lot of varieties to both the problem and the solution, but in essence what we shot was bringing always the largest pancake not yet sorted to the top with one flip and taking it down to its final position with one more flip. And then repeating this process for the remaining pancakes.

Unless you’re very well versed in algorithms, you probably need to read that sentence a few times. And odds are it still doesn’t make much sense. Experimenting with this interactive version might help a little bit. But still, slow, at least for me.

I’ve written earlier about the role of touch in learning and once again I was reminded how much my fingertips help in understanding. Working with the spatula I don’t think I’ll ever forget the algorithm. I own it.

Try it out. Find seven different sized objects and really try moving through the sequence of steps in the instructions. It’s a joy. I’ve made something similar in the past with bubblesort algorithm, there’s a worksheet to try out.

(Once your fingers are all greasy and gross playing with the pancakes it might occur to you where this algorithm is used. Well, for example in parallel computing to calculate shortest paths between processors - which in turn is what powers scientific research, game engines, AI calculations.. anything that requires a LOT of computing power.)


Linked List

In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. But here it is a selection of things I’ve been reading lately.

  • Geography is the chessboard of history. Makes (among other things) the argument that our focus on teaching dates when it comes to history is.. weirdly trivial and mostly useful because dates are easy to grade. Makes me think what are the things we teach in computer science that are equally esoteric.

  • This internal combustion engine website made the rounds earlier and I obviously love it. Wish someone made an electric circuits - logic gates - ALU version that would start with the step by step approach of Code by Charles Petzold. (That should probably be me.)

  • I’ve been following the global shortage of microchips with much fascination. When everything becomes a computer, turns out it’s not only software we need. The entire field of semiconductors and talent as a geopolitical resource has this sense of 1960s, and transistors at the heart of it being both a physical thing and a mathematical operation is a metaphor I keep thinking about.


Classroom

I’m hoping to surface and share stories from all of you and I’d love to see your creations!

A post shared by @helloruby.world

Loading more posts…