RSS
 

Posts Tagged ‘math’

Programming in Middle School?

16 Jul

Eating breakfast in the hotel the other morning, my father mentioned a Twitter conversation he had to join about programming courses in schools and math curricula.

Programming and math education? I just had to get involved, too.

Ben Grey and Colleen K had started talking about the value of programming courses in school. Ben and my father (initially) were against it, concerned that the skills would be obsolete before they could be used, and were not particularly transferable to most fields. Colleen and I took the pro side.

Ben and my father both pointed out that languages go extinct, which is true. But judiciously chosen languages have staying power. Basic can be run in a browser, but is obviously a fine starting point. C has been around since 1972, and it isn’t going anywhere soon. JavaScript has been around since the mid-90s and seems to hold a secure point.

What of transferability? How many professional programmers still work in the first language they learn. Anyone? Anyone? Beuller? My first language was Perl, which helped me learn JavaScript and PHP, which helped me learn Java and C. People older than me probably started with Basic. People much older than me may have used ALGOL—which was on its fourth generation by the time C was born.

But what about the majority of students who don’t want to be programmers?

Programming is a powerful, concrete interface to the two mathematical concepts that cause the most problems for students in K-12: variables and functions.

In the US, our K-12 math curriculum covers three broad areas—numbers, variables and functions. These roughly correspond to primary math (counting, operations, fractions, equalities) algebra and geometry, and (pre-)calculus.

Most students can wrap their heads around numbers, even fractions. They are relatively concrete. Some students struggle with operations like multiplying and exponents, but this is the lowest hump, the bunny hill. The majority make it down unscathed.

When does your school start losing people in the math program? It’s probably around 8th grade. That’s when most schools begin the dreaded algebra. Variables are intuitive to some, but abstract and meaningless to others. If you believe Myers and Briggs, some of us are predisposed to abstractions and generalizations (*NTJ) but is there a biological reason others are lost here? Or do math teachers and curricula need to change?

Of the people who survive algebra without hating math, how many make it past “pre-calculus” or “FST”? I’ve heard the story a dozen times myself: “I was good at math until my calculus class.” If numbers are the bunny hill of K-12 math, then variables are the green circle, and functions are the double black diamond.

Again, functions may be completely intuitive to a few of us, but they can strike terror in the heart of even the most dedicated students.

Too often, when they reach a jump in complexity and struggle, students are told “it’s OK.” They are “not ‘math people.’” This can come from parents (“I was never good at math, either.”) or even well-intentioned teachers (“Maybe you’re just right-brained!”). There is a deeply held belief in this country that “math” is some innate ability, a genetic gift, and either you’re the next Will Hunting, or you may as well not try.

How does this relate to programming? How did you learn programming? Here’s a common roadmap:

  1. Imperative programming; no functions or abstractions; lots of constants; instructions in linear order.
  2. Using variables for input or consistency/ease-of-maintenance.
  3. Using functions and subroutines to encapsulate repeated operations.
  4. Using someone else’s functions—you probably don’t see the implementation.
  5. Branch off to more advanced ideas like object-oriented or functional programming; lots and lots and lots of abstractions.

A remarkably parallel route. And instead of saying “x is a number,” you can say “var name holds the name the user enters!” The results are far more immediate and interactive. Play is cheap. (“What if I change this line? Oh it doesn’t work, better undo that.”) Instead of limiting functions to scary numbers and equations, more pedestrian words can be used as arguments and return values.

Programming is applied mathematics. Teachers spend much of their lives looking for new examples, better applications, to drive home the theory, when there is already a wealth of application available.

There is also a two-pronged economic argument. To paraphrase Mr. Friedman: anything that can be outsourced, will, and the new jobs created here will require deeper interaction with computers. A cursory understanding of the programming techniques underneath will benefit all students as they enter the job market, and the exposure may mean more prepared students entering computer science programs. Basically: we need more talented, creative programmers—how many art students harbor latent programming skills—and even non-programmers will benefit from the exposure and understanding.

And of course, the math skills. No subject (that is taught) is taught as badly as math in our schools. On the personal level, this translates to people who misunderstand interest and get themselves in trouble with debt; on a national level, it certainly doesn’t help when a subprime mortgage market bubbles and pops.

Even if you don’t use “math” on a day-to-day basis, it is another way of thinking, of solving problems. Algorithmic thinking, epitomized in computer programming, provides a layer of cognitive flexibility, and every layer we can add, we should.

I don’t expect every student to become a master programmer, or even explicitly use those skills—or other skills in their math courses—every day. But I do expect schools to use every tool they have to make these methods of thinking and courses of study available to everyone. We wouldn’t allow a future programmer to skip his English class, why would we allow a future writer to skip his math and programming class?

 
5 Comments

Posted in Articles

 

The Fallacy of the “Singularity”

10 Jul

Singularity” is a nice buzzword. It sounds so scientific and futuristic. It plays on a great fear of our time: obsolescence by machines.

It’s a fear as old as the Industrial Revolution, when a single machine began doing the work of a man. Then two. Then ten. Now complex robots can not only do work instead of a person—instead of many, many people—they can actually perform tasks that a human could not.

It’s a fear sensationalized in 2001, Terminator, and Blade Runner.

But is it remotely rational?

The basic version is this: eventually we will build a computer “smart” enough to design a smarter computer. At that moment, we humans will no longer be able to stop the forward march of computers and robots, who will surely build homicidal androids and lead a bloody revolution.

Computers, however, have not really gotten “smarter” in any meaningful sense. Ever. They’ve gotten much, much faster.

Programmers have gotten smarter, and have learned, invented, discovered new techniques for solving problems, new problems, new solutions, and so on. New instruction sets have been added to processors to encompass complex, but common, tasks and simplify programs. More transistors allow more data to go through, and new materials mean that we will continue to cram more information into fewer electrons with less friction—though we can never really pass one bit/lepton. 64-bit processors mean we can keep more of those bits in RAM and 128-bit file systems can store more data than will ever exist on earth (at least without boiling the oceans).

Shelly Blake-Plock asked “what do we mean by smart?” when we talk about computers? It’s an important question.

Since computers are not capable of independent thought—a human is the ultimate source of all their “thoughts”—I think the best definition of “smart” relates to the kinds of problems it can solve. If computer A can solve more problems than computer B, then it is “smarter.” Right?

Except, by that definition, computers haven’t gotten any smarter since the 1930s!

The two important classes of problems are undecidable problems, like the Halting Problem, and NP-complete problems, like the Traveling Salesman.

For undecidable problems, no computer will ever be able to come up with an answer, unless we undergo a fundamental shift in computing, and then there will probably just be a different set of undecidable problems.

For NP-complete problems, new computers are able to work on them faster, and reach new solutions, but only because we were too impatient to wait for the old ones. Sometimes, people come up with solutions to solve a particular NP-complete problem, or a particular instance of it, a little faster, it is likely that there is an absolute limit on this. (That is if NP≠P, as seems likely.)

The trick is that all computers are less powerful than abstract machines like Universal Turing machines or RASPs. Given enough time, a simple, abstract Universal Turing machine could solve any problem the most advanced super-computer could solve. And these mathematical limitations apply to perfect, abstract machines with literally infinite storage (way more than 128-bit) and infinite time. These mathematical limitations define the word “computable” itself.

So really, computers haven’t gotten one bit (or byte) smarter. Ever.

I think we’re safe from the robot revolution.

Now, if someone builds a machine that runs at one kilohertz, but can think for itself, we’re in trouble.

 
Comments Off

Posted in Articles