What Do Socks Have to Do With Computers?
An experiment with computational thinking. Plus, ever heard of contronyms?
Issue No. 30
PSA: A good way to lift your spirits after a long week, I’ve found, is to watch The Great British Baking Show. It airs Fridays in the US, and it just feels so nice to spend an hour right before the weekend with these contestants. (Now if only I could find a way to watch it on repeat every hour of every day, I think that would keep me stress-free.)
Of the side quests I’ve gone on in my life, my favorite one was the one around computational thinking1 (how to think like a computer scientist), where I was trying to figure out how to make something that’s abstract—computer science—interesting to a five-year-old. Computational thinking seemed like the perfect bridge between a technical field and everyday life.
A bridge not only to the present day, but also to ancient history. As far back as the ancient Babylonians, we see people writing down their procedures for determining things like compound interest or the width and length of a cistern given its height and volume.2 And they did that using what we might today call algorithms—a list of instructions with clear inputs and outputs.
The idea for me began as a, well, let’s call it a buffet-style story where you’d get to see a catalog of decomposed story parts in front of you (scene, plot, characters, writing style) and you could combine them in novel ways to make a personalized story. Then it morphed into a more defined arc about a tailor who gets sucked into a, gosh, I can’t even remember anymore, with hidden lessons scattered throughout. And then finally it took the form of a collection of vignettes and explanations.
I don’t know if I succeeded with five-year-olds, but I think the approach is still pretty interesting. And so I figured I’d share one of those vignettes with you all today and tie it to a few practical takeaways on story-based teaching.
Matching socks
One day, right after taking a pile of clothes out of the dryer and plopping it on the bed, I asked my daughter who was five at the time, Say we wanted to match the socks in this pile, how would you do it?
She picked up a sock from the pile right away and then rummaged through it looking for the sock’s match. And when she found it she said, There.
We then chatted about an alternative way, which was to pick out a sock, put it to one side, and then pick out another sock and see if we could match it to something that we’d already come across. There was less rummaging this way. It felt more orderly.
The useful thing about this second method was that we potentially achieved our objective of finding a match in fewer steps, since we only ever touched a sock in the pile no more than once. With the first method, we’d potentially touch a sock multiple times.
Try it yourself if you haven’t.
If you were to ask a computer scientist or a mathematician to model those two methods, you might get something like the chart below, where the bottom axis shows the number of socks that we have in the pile—fewer on the left and more on the right. And the left axis shows roughly how long it takes us to match all the socks. And the shape of the line tells us how the method’s performance changes as the number of socks goes up.
So if we’re optimizing for faster, we’re ideally looking for methods that have lines that stay close to the bottom axis.3
So far, this precocious five-year-old (let’s make her ten, actually) will have been equipped with 1) a frame of reference and 2) a model for comparisons.
I’ve given her those two things. Now it’s time to ask for something in return. And what I’d ask for is the patience to bear with me as I tie those two things to three ideas in computer science that are hopefully a bit more vivid than they would have been.
1 Memory. It’s a useful feature. You experience something, you store it, and then you retrieve it when the time is right. It beats experiencing something and then not doing anything useful with that experience because the time isn’t right. We use it in our example when we keep unmatched socks to one side instead of throwing them back into the pile. We take it for granted that most of us have short- and long-term memory built into us. But imagine if that withers, how debilitating that can be.
2 Hash tables. The process of putting things to one side and doing frequent lookups against that side is to an extent analogous to a concept in computing called hash tables. Much better than rummaging for something in a pile of things. It makes our apps faster, it keeps our devices from overheating, and it keeps costs down if we’re using a service that charges for usage.
3 Premature optimization. If you’re licking a single stamp and sticking it to an envelope, do you need to think about how to optimize that task? Probably not. It’s one stamp. But what if you have 100, or what if it’s your job to stick stamps to envelopes? At that point, automating and optimizing are worth your while. When we’re reasoning about alternative ways of doing something, instead of waving our hands and saying one alternative seems better than the other, thinking in terms of rates of growth helps us stay focused on which alternative is actually better. That in turn ensures we stay pragmatic and don’t prematurely optimize.
Takeaways
Make it relatable. Making a lesson stick in someone’s mind is such a privilege. It shouldn’t be taken for granted. We can give something that’s technical, niche, or seemingly esoteric a better chance at sticking by moving it to familiar territory and connecting it to something a person can relate to. 4
Disarm with a story or demo. We can make technical concepts more memorable by starting with vignettes, small moments, tiny stories, or short demos. What made me love physics in high school was Paul G. Hewitt’s series of videos where he’d demonstrate a concept instead of pick it apart or just talk about it. Before writing anything on the blackboard behind him with chalk (chalk is an old-school stylus that would get shorter the more you used it and didn’t need to be charged), he’d show you why the concept was important.
Thinking like a [blank] is useful. Interesting things happen when you take concepts from one discipline (computer science, medicine, the arts, …) and either apply them to another or attempt to generalize them. Every one of us sees the world through a lens that’s tinted by whatever it was we were trained in. It’s a really rewarding experience when we take concepts out of their natural habitat and see how they react to new surroundings. I’d highly recommend it.
🦉 Want to feature your product here? Email 💌 press@almossawi.com. Thank you for supporting the newsletter.
Contronyms: words that have opposite meanings
You’ve heard of antonyms—words that have opposite meanings. And synonyms—words that have similar meanings. And homophones—words that sound similar, but mean different things. And homonyms—words that are spelled the same, but mean different things.
But how about contronyms? A contronym5 is a word that has two opposite meanings. A big part of communicating clearly is being precise with our words, and I remembered one time being amused that the word egregious had two meanings. One archaic, meaning really good, and one in common use meaning really bad.
Egregious wouldn’t be a contronym, as far as I’m aware, because its meaning has evolved over time. As in, its two meanings aren’t both in current use. But there are words that do have contradictory meanings in current use. Here are a few examples.
Left
Remaining (She was the only one left.)
Departed (She left the room.)
Dust
To remove dust (She dusted the room.)
To cover in dust or powder (She dusted the cake with sugar.)
Cleave
To split or sever (She cleaved the wood.)
To stick to or adhere (She cleaved to her beliefs.)
Sanction
To approve or permit (The committee sanctioned the project.)
To penalize or punish (We’ll be imposing sanctions on them.)
Bolt
To secure or fasten (Bolt the door shut.)
To flee or run away (The cat bolted.)
Buckle
To secure (Buckle your seatbelt.)
To collapse under pressure (The bridge buckled under the weight.)
Screen
To show (They screened the movie.)
To hide (Trees screened the house from view.)
Clip
To cut (She clipped her nails.)
To attach (She clipped the paper to the board.)
Weather
To withstand or endure (They weathered the storm.)
To erode or wear away (Rocks weather over time.)
Trim
To cut or reduce (He trimmed his beard.)
To add decorations (They trimmed the tree.)
Seed
To plant seeds (Farmers seed their fields in spring.)
To remove seeds (She seeded the watermelon.)
Fast
To move quickly (He ran fast.)
To not move (The rope was fast to the pole.)
Overlook
To disregard (She overlooked his mistakes.)
To watch over (The balcony overlooks the garden.)
Strike
To hit (He struck the ball.)
To miss (He struck out in the game.)
I remember being struck by a photograph I saw of the Spanish ultra athlete Azara García, who has a tattoo on her leg that reads (in Spanish): The Devil whispered in my ear: ‘You’re not strong enough to withstand the storm.’ I whispered back: ‘I am the storm.’
—Adharanand Finn (The Rise of the Ultra Runners)
Until next time, be kind to yourselves and to each other.
And be well,
Ali
https://www.cs.cmu.edu/~15110-s13/Wing06-ct.pdf
https://web.archive.org/web/20160303185340/https://steiner.math.nthu.edu.tw/disk5/js/computer/1.pdf
More accurately, in the case of matching socks, the chart would actually look like this. The way we’d read this chart is by saying that both methods are fast when we have a few items (see the circled area in the left chart), but the second method is much faster when we have lots of items (see the circled areas in the right chart). The second method doesn’t grow as quickly as the first one.
I used “in a nutshell” in an early draft of this section. I figured I’d keep this footnote since it’s an interesting fact: Did you know that though Shakespeare used the idiom “in a nutshell” in Hamlet, it originated in a work by Pliny in 77 AD: “Cicero hath recorded, that the poem of Homer, called The Iliad, written on parchment, was enclosed within a nutshell.” (source)
Also called auto-antonyms.