Image

Humanizing Factorials

Annos-Mysterious-Multiplying-Jar

With The Tower of Hanoi, I had fun with the evil powers of recursion. But I’m not actually learning code to teach my son to become a dictator, even a benevolent one, bearing brownies.   While we’re learning recursion, it’s probably not such a bad idea to bring up the some of the consequences of creating formulas that make work and data collection efficient, but potentially dehumanizing.

A few years back a friend gave Ben a lovely book that shows both ends of the spectrum of rich creativity and mechanistic abstraction. Anno’s Mysterious Multiplying Jar was written and illustraed in 1999 by the Japanese  father and son team, Mitsumasa and Masaichiro Anno.  It tells a simple story of factorial development that starts with a jar,  large enough to contain an ocean.

In this ocean is an island and on this island are two countries:

In each country are three mountains.  On each mountain, four walled kingdoms.  In each kingdom, five villages.  In each village, six houses.  In each house, seven rooms, in each room eight cupboards.  In each cupboard, nine boxes.  In each box, ten jars like the first.

The question at the end of the story is how many jars are contained inside the jar?   The answer is ,of course,  3,628,800  a.k.a.  10 factorial or !10.

The first part of the story is filled with richly illustrated picture of villages, houses, rooms, cupboards, all with their unique, individual characteristics.  The second part retells the story with dots instead.  It goes as far as a two page spread representing !8, or 40,320 dots.   The Annos don’t venture past that, since they’re writing a children’s book, not a heavy tome full of dots.

But the point, so to say, is made.

Tower of Hanoi

Subliminal hint, in German

An old school software engineer showed me a computational thinking exercise the other day that finally helped me understand recursion. Or at least brought me a step closer to figuring it out.

The Tower of Hanoi is a classic math puzzle.

Go work on it. I’m going to assume you’re smart enough to figure it out eventually. Come back when you’ve done that. And don’t come back until then.

**Hanoi tiger mom locks blog door**

Have you figured it out?  Oh really. So how many moves would it take to move a ten disk tower?  If you don’t know that, then you didn’t really figure it out! Get out of here!

**Locks door again (secretly bakes brownies)**

Figured it out?

Of course you did.  Have a brownie.

Now we can talk about your adventure. Remember that joyful moment of insight, when you realized that you could move a tower that reached the sky, if you wanted to, because you’d figured out the simple formula! (Start by moving the top 3 disks, then move the fourth disk on to the empty rod, then move the  3 disk tower back on top of the 4th disk, then move the 5th disk onto the empty rod, then move the 4 disk tower back on to that, then move the 6th disk onto the empty rod. Repeat forever.)  But then there was the  horrific realization of how much work that would involve, since every time you add a disk, the number of moves increases exponentially (the formula for figuring out the moves is actually (2 number of disks -1))

Welcome to a secret truth of civilization. Engineering has a simple solution to almost any problem, except where to find the slaves to actually do the totally tedious work!

A recursive formula is basically a formula that repeats the same work over and over, but always adding a little something else—or taking something away–so that the work is actually producing some kind of change.

Crack that and you’ve cracked a major concept in programming.

Now you just have to find slaves! Here bring them some brownies.

rasberry pi….I want some!

Just found out about this really cool UK project called rasberry pi.  This is a $25 computer, the size or a credit card. It’s basically just a minimalist linux platform with a USB port.  The purpose of it is to teach kids to program by stripping the computer down to its punk rock roots.  Look how cute it is:

Image

How Coding is like French

Polemical article here by Canadian novelist/developer Jon Evans in Tech Crunch on why hipsters shouldn’t waste their time learning to code.  His argument is essentially, what’s the point, to be truly proficient at it, you should start learning it, like he did, at age 10.

Interesting that he compares learning to code just for the sake of learning code, to learning French when you may never go to Paris.

I’d be curious how his French is.

French is one of Canada’s two official languages. Outside of Quebec,however, few people are really fluent, or even functional in it. This creates political tension, but on a practical level it doesn’t make much difference.

I grew up in Quebec, however, where over the course of my lifetime, French became the official language of business, government and basically, life.  I saw what happened to an entire generation of people who weren’t functional enough in French to get a job even working in a restaurant.

Americans are anxious. As they should be. They grew up believing that English was going to be the dominant language of business forever. And it probably will be for a long time.  But  anyone who  can’t see that computer code is becoming the dominant language of trade in the world, is blind to the future or kinda has their head in the sand.

Does this mean that anyone who doesn’t have senior developer skills will be unemployed? No. The soft skills–conversation, social networking, etc.–will always be essential.  But deciding not to learn code because  you may never build an app, is like deciding to not learn French because you’ll never be fluent—except  you’re living in Quebec, not potentially vacationing in Paris.

In the future, we may not know when we’re going to need a functional knowledge of code.  But I have no doubt we’re going to need it.