Archive for the 'education' Category

Teach everyone to program


The microcomputer was invented only a generation ago, it is now in hundreds of devices and gadgets in every home.

We are on the brink of a revolution. A revolution as significant as the printing press. It was hundreds of years between the press and universal literacy (still not quite achieved in the UK, our adult literacy rate is 99%), but we now live in a society where so much information is written and so much commerce and social interaction takes place in writing that you are at a severe disadvantage if you cannot read and write. We are not all writers, but we can all write. Poets can move entire Nations with carefully crafted written words, but even if most of us can’t achieve that, we can at least write a note to our milkman asking for 2 more pints on Saturday (Note 1).

Imagine if Gove (Note 2) suggests that we only teach the gifted to write. Only the playwrights, the speechwriters, the journalists, and the poets will write. After all, all the good stuff is written by them anyway. I hope you can see that this would be madness.

I feel the same way about code and programming. There is a poetry to code; the poets of programming write code with concision and precision: the structure writ clear on the fan-folded page. There is already a rich literature of programming. github overflows with the pulp fiction of the professional and amateur hack alike; likely we will find Lovecraftian horrors there too, lurking, ready to turn our minds into a pretzel. But at the moment this culture is the culture of an elite class. Everyone should be able to program. Most people will not be poets. Most people will not be programmers, but that should not stop us from teaching them to program.

In the future code will be woven into the fabric of our society, just as the written word is woven now. We don’t teach people to read and write because it will be helpful to them in their future career. We teach them because it is inconceivable that they can function without basic literacy. It is inconceivable that in the future we will be able to function without basic coding.

This is why I’m excited about teaching kids to program. Lots of grassroots initiatives to teach programming, like Software Carpentry, Raspberry Pi, Young Rewired State. Let’s build the future now. Teach everyone to program.

Note 1

I live in a quaint postcode where I can still get milk delivered to my doorstep. And I do so.

Note 2

Hello readers from the future! Gove was responsible for education policy in the United Kingdom (Note 3) for a brief period in the early 21st Century.

Note 3

Hello readers from the more distant future. The United Kingdom was a nation consisting of various bits of islands in an archipelago off the North West coast of Europe.


Multiplication, Addition, Counting, and Python


Jason Dyer’s teasing post got me thinking. About how Python could be used to give some insight into the meta-cognitive aspects of whole number multiplication. Natch.

When children solve a multiplication problem by correspondence, the objects in the multiplier set are mapped over for each object in the multiplicand set (hmm, or is it the other way around?). A typical procedure for multiplying 4 cakes by a price of £2 per cake might be to point to a cake with the left hand and then count up the 2 pounds using the right hand, then move the left hand to the next cake and repeat the count with the right hand, with the oral count continuing up; this is repeated until the left hand has exhausted all cakes.

We can model this in Python with the following program:

def mul(multiplicand, multiplier):
    count = 0
    for i in range(multiplicand):
        for j in range(multiplier):
            count += 1
    return count

Whereas children using repeated addition do something more like this:

def mul(multiplicand, multiplier):
    count = 0
    for i in range(multiplier):
        count = add(count, multiplicand)
    return count

In this case, add is a subroutine. You could define one easily enough in Python or else you could go «from operator import add».

Clearly the second program is more efficient than the first, both as a Python program and as a manual procedure performed by children; it’s more the latter that I’m interested in, I’m using Python to describe the procedures. However, the second procedure requires that add is already adopted as an internal procedure. Of particular note is that, apart from count, the second procedure uses only one state variable, i; the first procedure uses two.

At the stage where multiplication is introduced, many children will not yet be performing addition accurately without counting. Effectively add is not yet available to them as an internal procedure. This is likely to be a problem because this type of learner is unlikely to be able to accurately add the multiplicand to the count without getting confused about where in the multiplication procedure they were.

As an example of what might go wrong, imagine that a learner starts by using the left hand to maintain the i variable in the second procedure (above); this hand will count from 1 to multiplier (hmm, there’s a small sleight of hand going on here, the Python counts from 0 to n-1 whereas most learners will prefer count from 1 to n). The count will be maintained orally (in other words by speaking out the successive multiples of the multiplicand). Begin by raising one finger of the left hand and uttering the multiplicand (the initial count). Now we need to add the multiplicand to the oral count. Maybe the learner can do that without using their fingers, maybe they can’t; in any case depending on the parameters chosen, at some point some learners may need to use their hands to perform the addition. So then the procedure for addition kicks in as the learner adds the multiplicand to the current count. Many learners will have personal procedure for addition that requires both hands. The addition may be performed accurately, but the i state variable will be lost. We lose track of where we were in the multiply procedure.

If the learner can accurately add the multiplicand to the count mentally, then they stand a much better chance of performing the second procedure. This is what I mean by having add available as an internal procedure.

The first procedure can be thought of as a way of simultaneously arranging to perform the multiplication and the additions required by the multiplication without having any state variables overlap. Thereby minimising the chance that confusion will result. Most learners will be capable of keeping track of the required state variables to perform the multiplication, but if left to their own devices may choose methods where the state variables overlap (in other words, they run out of hands). Thus, they can benefit by being guided towards a procedure which they can manage.

Another way to think about this is that at the sort of age where children begin to learn to multiply, their procedure for addition is leaky. It is not fully abstracted; performing addition may require the use of hands (for state variables), making the addition leak over any other use of the same hands to maintain state.

It seems to me that only when a learner can perform a typical count + multiplicand addition accurately in their head are they ready to perform multiplication as repeated addition.

Oh yeah, the original research on the whole “multiplication is/ain’t repeated addition” debate. It sucks. They test children at times t0 and t1 with a randomly chosen math related intervention in between. It seems to me that a more carefully designed study should have also included a non math-related intervention such as giving the subjects fish-oil pills or teaching them to conga. After all, if I was being tested on one day and then told that I was going to sit a similar test tomorrow, I would bone up on the material before the second test, regardless of what I was being taught. Wouldn’t you? They make no attempt to account for this effect.

Appendix for Python hackers

The first definition of mul that I give is of course completely worthless as a practical implementation in Python. However, note the following: «10*10L» is 100L but «mul(10,10L)» is 100; in other words mul returns an int if it possibly can.

Warning: Generation Green could be in a classroom near you!


British Gas sent me a link to Generation Green. A classic greenwashing move: they seem to have paid a charity to produce a load of “green” lesson plans as a way to get their trademark embedded into every classroom, and therefore also into the minds of every future energy consumer. Leaving aside, for now, the ethics of corporate sponsorship of the classroom (hint: it’s wrong), what is the content like?

I had a look at Lesson 4 – Exploring sources of energy (part 1). One of the resources for this lesson is the “Energy Source Information Cards”: a series of 10 cards, one for each source of energy (coal, nukes, wind, and so on). There’s a Word document containing these that you can download (lower right of the web page I linked to).

It is from these cards that the students will be taking the factoids and copying them onto their posters in colourful crayon so that the posters can be displayed on the corridor walls in time for the first parents’ evening of term.

So, how are they? Well, a bit poor. On the whole, I’m a bit disappointed that “facts” like these are getting fed to children (and, more worryingly, their teachers). The perfect antidote to this generationgreen nonsense would be to use David MacKay’s book, Without Hot Air (go on, it’s free!). The chapters are bite-sized (especially the earlier ones), and they contain facts, and references, and good stuff.

The howlers in the “Information Cards” are Wind (mechanism wrong way round), Biomass (written by two people that never saw each other’s work), and Wave (written by someone who has no idea where the energy in waves is).

Overall there is a confusion between power and electricity. Every card has a section on how electricity is generated using that source. The Natural Gas card points out that gas can be piped into people’s homes, but there’s no mention of the fact that this is then used for heating not electricity generation. Coal, gas, oil, and biomass can be used more efficiently for heating applications directly than via conversion to electricity, but this is never mentioned. Nor is the fact that this is only of limited use because we only exploit a limited amount of low-grade heat.

There is also confusion about cost. Sometimes high capital cost (hydro) is mentioned, sometimes it isn’t (nukes). Often zero running cost is mentioned (wave) without mentioning capital. The important cost, total cost per kWh over the entire lifetime of the plant, is never mentioned.

There is also some confusion about pollution and global warming. Pollution is bad, global warming is bad. But these things are completely separate. There’s a tendency in the cards to assume that anything emitted into the air is bad, because of global warming and pollution; they’re not always specific enough about which it is.

Perhaps you can pick a different lesson and mock that, then at the end we can collect all our answers together and have a chat and make a nice poster?

Page 1 – Traditional Coal

This card is basically fine. The only things worth mentioning:

“Hard black substance that is found buried deep underground.”

Coal is not always hard (anthracite is, but it’s not the only form of coal), and it’s not always buried deep underground (I have picked it up on beaches).

Page 2 – Natural Gas

Basically fine.

Page 3 – Crude Oil

Typo: “most well knows” should be “most well known”.

There’s a double count in the disadvantages: “Burning oil pollutes the air”, and “Burning crude oil produces other emissions e.g. sulphur dioxide”. The “other emissions” are the pollution from burning oil. Perhaps better would be “Burning oil pollutes the air with sulphur dioxide and other emissions” (as does coal, by the way).

Page 4 – Wind Energy

“Wind is the effect of air flowing from low pressure to high pressure.” No, no, no, no, no. Bzzt. You’re wrong. Following is “The air in the warm regions rises and the cool air rushes in to replace it and this is what we know as wind”. A somewhat simplistic explanation, but that’s okay. The “this” is a horribly ambiguous reference; “this movement of air” would be better.

“As one of the windiest countries in Europe, it is perfect for our climate”. Yes, assuming we want to carpet bomb the British Isles with wind turbines. David MacKay’s ludicrously optimistic sketch of using 1/3 of our offshore coast for wind power (including uneconomical deep offshore wind) and carpeting 10% of our land (!) with onshore wind gives 58 kWh/day per person, or nearly half of the UK consumption. Perfect.

“Once it is built the fuel costs nothing”. Not true: offshore wind turbines need frequent replacement of the gear boxes due to sea-salt corrosion (and this should go in the disadvantages section).

Page 5 – Geothermal

Basically fine.

Page 6 – Biomass

In advantages: “It supports farmers because they can sell their crops for biomass fuel”. Whilst this is true it is seems silly to single out farmers. An advantage of wind energy is that it supports turbine blade manufacturers because they can sell their turbine blades as parts; an advantage of crude oil is that it supports oil drillers because they can sell their oil for fuel. It’s just a silly argument. What if crack cocaine was a fuel, would we be saying “it supports drug dealers because they can sell their stash for fuel”?

The “advantages” contradict the “disadvantages”. “Biomass fuel tends to be cheap” versus “Biomass can be relatively expensive compared to other sources of energy”. “Burning biomass produces carbon dioxide gas which contributes towards global warming”, strictly true but as the same card explains in the “advantages” section: “Although carbon dioxide is released when biomass is burned, it is still a carbon neutral source of energy. The amount of carbon dioxide that is released when biomass fuel is burnt is the same as the amount of carbon dioxide absorbed by the plants when they were growing.”

Page 7 – Uranium

“It does not contribute to the greenhouse effect because it does not produce smoke or carbon dioxide”. Mentioning “smoke” is absurd. The smoke produced by other sorts of power generation does not contribute to the greenhouse effect, quite the opposite. Smoke is an aerosol that has a cooling effect. Smoke is of course a pollutant, so nukes avoid air pollution, which is worth mentioning.

In advantages: “It produces small amounts of waste”. True, but so misleading. They make up for it in the disadvantages.

“It is not renewable; when the uranium is used it can not be replaced”. True, but worth mentioning the possibility of sea-dissolved uranium, which is replaced (er, I think).

“It is very difficult to turn off a nuclear power station”. Again, true, but it would be good to say a little bit on why this is a disadvantage. The reason it’s a problem is that no-one wants electricity at night but the nuclear power stations generate it anyway; you have to throw it away.

Page 8 – Solar Energy

“Every second, the Sun turns millions of tonnes of hydrogen into energy”. Well intuitively this didn’t seem right to me, but it turns out to be both right and wrong. The sun converts mass into energy at the rate of 4.4e9 kg per second (or 4.4 million tonnes, if you’d rather), and of course that mass is hydrogen. But it’s a little bit misleading not to mention the 600e9 kg of hydrogen that get converted to helium in the process. In other words every second, the Sun turns 600 million tonnes of hydrogen into helium, producing some energy in the process.

Only talks about PV, doesn’t mention solar concentration electricity generation such as the 11 MW PS10 tower in Spain (warning, EU press release).

Page 9 – Hydroelectric Energy

Hmm, it says here “Solar power can be used to create electricity in remote places where it might be very hard to get
electricity through cables”. Oh rly? What’s that got to do with hydro? Nothing, that’s what. Cut-and-paste hack-job.

Then the voice changes. Suddenly we see “we”: “We can control when the electricity is made by opening and closing the dam gates.”, and “Electricity can be generated 24 hours a day as long as we have the water”. It just hasn’t been proofread.

Disadvantages: “It is very expensive to build a dam”. Oh rly? Well, it is very expensive to build a nuclear reactor, and very expensive to build a wind farm the size of Wales, but you didn’t seem to mention that. Just casting about for disadvantages were we?

Another disadvantage: “There can be negative environmental impacts as water quality and quantity downstream can be affected and have a knock on effect on wildlife”. True, but there can be a positive effect on wildlife as well, as water habitats are created upstream of the dam and they are exploited by suitable species.

Page 10 – Wave Energy

“Wave energy is harnessed from the movement of the surface water of lakes, rivers and oceans.” Wrong. Should read “oceans” for “lakes, rivers, and oceans”. You cannot get usable energy from a wave on a lake. And as for rivers, stop laughing at the back. “Turbines can be placed by the shore, where the movement is at its strongest.” The latter bit, “where the movement is at its strongest” seems like a dubious claim to me. Surely the Atlantic waves have just as much movement a few miles offshore? The advantage of shore placement is shorely (sorry!) shorter cables?

“The wave acts like a piston that pushes air up and down an oscillating water column.” Well, that’s one way to get energy out of a wave, and it’s (kind of) how the Islay LIMPET works, but there are many other ways. Pelamis works by using the flexion of a linear body floating on the surface to drive hydraulic rams. CETO works by having a submerged buoy drive a piston to pump seawater inland at high pressure which then drives generating turbines. Salter’s Duck works, as far as I can tell, a bit like a self-winding watch.

“As an island we have lots of access to the coast and therefore could harness a lot of wave energy.” Yeah man, a lot of energy. According to MacKay, the total Atlantic wave energy hitting Great Britain amounts to 16 KWh/d per person or about 1/8 of our total consumption. If we exploited all of that then the Newquay tourism industry would be very annoyed (a disadvantage not mentioned, incidentally).

“It can be unreliable because it depends on the waves – sometimes you’ll get loads of energy, sometimes nothing”. Ah, no. Wave power is about the most reliable source of energy derived from a moving mass. Thousands of kilometres of Atlantic fetch can’t be wrong. There are always waves.

“Some designs can be very noisy”. Surely bogus, because no-one is proposing living next to them. Visually distracting, maybe, and a menace to fishing and shipping, but those disadvantages aren’t mentioned.

That’s all folks! Don’t forget your homework now, pick a lesson and tear it apart!

Ofsted: satisfactory doublethink


Maybe you’ve read the BBC article “how maths teaching is not good enough”? Perhaps you should read the Oftsted report. Perhaps I should.

41% of the maths teaching (in secondary schools) is satisfactory. The tone of the news article is that this is not good enough.

This is characterised by the section headline in the Ofsted report (section 26): «What is not good enough about ‘satisfactory’ teaching?»

I have news for Ofsted. “satisfactory” means almost the same thing as “good enough”. If you’re not satisfied with “satisfactory” teaching, then you set your assessment criteria incorrectly. How unsatisfactory.