A combined WW2 history, binary maths, computing, code-breaking lesson

I used the 70th anniversary of D-Day as a starting point for an investigation into binary arithmetic, code breaking, computer error correction, and computer programming.

I began by showing children pictures of soldiers about to land in Normandy, a German Enigma machine, and women operating the Colossus computer in Bletchley Park in WW2. I found out what children knew about D-Day and we watched a short BBC Newsround report about the 70th anniversary. We talked about the importance of intelligence, codes and code-breaking in the preparations for the D-Day landings.

We then moved on to how computers store information: everything whether it’s text, pictures, music or video is stored as numbers, specifically binary numbers.

This began our investigation of binary maths, using the ‘Binary Numbers’ activity on p4/5 of the excellent Computer Science Unplugged.

Each pair of children had a set of cards like these:

binary cards

binary cards

The children noticed that each card was double the one next to it. I explained that it’s vital to keep the cards in this order, explaining that these represent the columns of numbers in binary numbers. Instead of units, tens, hundreds, in binary we have 1s, 2s, 4s, 8s, 16s. I asked the children to predict what the next columns/cards would be: 32s, 64s, 128s, 256s etc.

I then got them to make different numbers by turning the cards over so that the right numbers of dots were showing, and to write a 1 underneath cards that were facing up, and a 0 under cards that were facing down. Using this we converted decimal numbers 6, 15 and 21 into binary:

Converting decimal 15 into binary

Converting decimal 15 into binary

15 = 8 + 4 + 1 = 1101 in binary

We talked about how this isn’t ‘one thousand one hundred and eleven’ as we have left tens, hundreds and thousands behind in decimal numbers. In binary we just read this number as ‘one one zero one.’

I then asked the children what the smallest number is we could encode using 5 cards (0), and the largest (31). I then asked if there were any numbers between 0 and 31 we could not encode this way. Children had various ideas: 19, 13. We continued the investigation and established that you can show any number like this. We then talked about why this is important for computers: if you order 19 pencils, or your test score is 13/15, you want the computer to be able to remember any number.

A child then asked how computers store letters. This brought us perfectly to the coded message activity (page 8 of Computer Science Unplugged). Children use their binary number cards to read the message Tom is trying to send by turning on lights in the windows of a building where he is trapped.

Each row of lights represents one letter, by showing a binary number which you convert to decimal to find the letter in the key.

Junior code-breakersThis combined what we’d learned about binary numbers with code-breaking skills (linking back to WW2 and the importance of the work at Bletchley Park in winning the war). As soon as children noticed that the first letter was ‘H’ they deduced from the context that the first word was probably ‘help’. Children then noticed the rows where no lights were on, and deduced this probably meant a space, so the 1st word had 4 letters and therefore was even more likely to be ‘help’. We talked about how context, knowledge of likely content of messages (such as weather reports) and spotting patterns were the same skills used by code-breakers in WW2.

Children then made up their own codes for partners to read, using the same system. Here an accusation of ‘cheating’ was used as a starting point for a discussion about espionage and intelligence. The Enigma codes were broken because a machine was stolen, and because sometimes operators were careless, sending the same message more than once, or even sending it unencoded (in ‘plaintext’). If you’re writing a secret message, you had better destroy the original – or better still, don’t write it down at all.

junior code-breaker

If GCHQ are reading this (and hey, I’d be really disappointed if you’re not), I’ve got some possible recruits for you in about 10 years’ time…

We then consolidated out knowledge of binary arithmetic by playing the checksum card trick (p31 of Computer Science Unplugged). I used the interactive resource I made in Scratch to play this on the big screen. This shows the children how computers spot mistakes and correct them. We then used this as jumping-off point for an introductory lesson on Scratch as a tool for learning computer programming, using the first activity from Code Club (These resources are based on a newer version of Scratch which has some differences from the one we use in school).

One of the children was already familiar with Scratch, so she continued to work on her own project while others worked through the project to make a game. Considering they hadn’t used Scratch before, and we only had a very short introduction (taught by the girl who already knew about it), the children learnt a lot in a very short space of time about designing games, coding and the importance of telling computers exactly what you want them to do, in the right order. They fixed mistakes by debugging their code, using trial and improvement until they were ready to move onto the next step of building the game. In about an hour, most children had written code for a playable game from, ahem, scratch.

Posted in computers, education, ICT | Tagged , , , , , , , | Leave a comment

Making MakeyMakey instruments in class

Having proved the concept with the Colanderphone (© Felix Glenn), today I taught a combined DT / music / ICT / science lesson in Year 5.

In the first lesson, I introduced the MakeyMakey and got the children each to design (on paper) a control surface for a musical instrument. The design brief was that it had to resemble a real musical instrument, it had to have only 3 notes, and it needed to make a complete electrical circuit.

I followed m’colleague Mr Glenn’s excellent idea: get the whole class, 30 children, to make a human circuit round the room by one child touching the earth on the MakeyMakey, all holding hands round the room, with the last child touching a pin on the MakeyMakey to trigger a sound on GarageBand. We found that if 2 children stopped holding hands, the circuit was broken and it didn’t work. So there’s a science lesson on electric circuits.

Today, in groups of 6 they had to vote for the best design to go forward to the prototyping stage. We made mock-ups so children could experiment with different materials and get a grasp on the need to make a complete circuit, have buttons we could clip a MakeyMakey onto, and ensure the wiring for each button didn’t short.

We had a LOT of guitars in the original design, so I encouraged them to diversify, and we now have 2 guitars, a drum machine and this rather amazing saxophone:

The earth is the mouthpiece made of tin foil. You then press the foil buttons to play the sax – we wired it up to a sax on GarageBand, and it worked!

At the end of the lesson, I asked the children to think about what they’d learnt from the prototyping process. Various things, from using stronger materials, to putting the buttons closer together so it’s possible to play chords more easily.

I’m hoping that when we have 5 instruments made we can attempt some kind of performance – although I only have access to 3 MakeyMakeys at the moment. Anyone fancy lending us a couple?!

Posted in Uncategorized | Tagged , , | Leave a comment

Making beautiful music with a MakeyMakey

The MakeyMakey is a gizmo that allows you to control computers by touching anything that conducts a small amount of electricity: PlayDoh, fruit, vegetables, even graphite pencil.

As you may know, I’ve been playing tunes on potatoes and making Scratch projects to play music using things wired up to a MakeyMakey

Well, here at BlogMyWiki Labs, we’ve just taken it to a whole new level. My colleague Felix Glenn and I discovered that you can use GarageBand (up to a point) with the standard MakeyMakey. This means: true polyphony, and a huge range of amazing-sounding instruments, from trumpets to 80s synths, via drumkits and strings.

The trick is to use the musical typing feature in GarageBand – this maps musical notes to letters on your normal keyboard. This is handy, because the computer thinks the MakeyMakey is just a normal USB keyboard.

The standard MakeyMakey only gives us access to the W A S D F letters, which I had thought ruled it out – not so. This is where the musical genius of m’colleague Felix comes in handy. He knows you can get kids making music with just 3 notes. Here’s my attempt with a bunch of carrots and a GarageBand Arp synth arpeggiator:

Felix’s next stroke of genius was to start to experiment with how we can use this to get the children (primary-aged) to make their own musical instruments that are in fact control surfaces for electronic instruments. Here the 3 note limit becomes a positive advantage, as it makes construction of the physical instrument simpler: you only need to wire 3 things back to the MakeyMakey (plus the earth).

As well as DT and music, there’s science learning going to happen here: you have to make a complete electrical circuit to trigger a note.

And now, ladies and gentlemen, we present the world premiere of the ColanderPhone:

Take a bow, Mr Glenn.

We can’t wait to see where the children take this: flutes you earth by putting the tip in your mouth, drumkits made out of cutlery or vegetables, maybe even a double bass – we’ll report back!

Next steps: how about I reprogram a MakeyMakey so that it can access at least 8 notes – I’m going to need help, though… anyone any good at that?

Posted in Arduino, computers | Tagged , , | Leave a comment

Big list of internet radio stations

I’ve been tinkering with my PiRadio tonight. I loaded someone else’s code, which unfortunately included the command mpc clear – this wiped my playlist of internet radio stations, and I had to add them again manually. The upside of this was finding this web site, which has a really good list of internet radio stations: http://www.dronkert.net/rpi/radio.html. I especially like that it includes what looks like streams for the BBC World Service UK stream AND the World Service 24 hour news stream – what I knew as ENNWS when I worked there. And GYB (Grey Bars) before that. I digress…

You can add stations to your RaspberryPi internet radio with the command
mpc add http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3
for example.

I’ve also tweaked the code for my PiRadio with the Arduino-driven LCD display. It now shows the radio’s IP address if you press SEL to pause and then press the LEFT button. There are a few other minor tweaks. It assumes you have MPD and MPC installed and that you’ve got 11 stations set up. It plays station 10 by default, which is the mighty fip on my radio. You can download it here.

Here’s my own pick of internet stations:

BBC Radio 1 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_radio1_p

Radio 2 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_radio2_p

Radio 3 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_radio3_p

Radio 4 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_radio4_p

R4 Extra http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_radio4extra_p

5Live http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_5live_p

6music http://bbcmedia.ic.llnwd.net/stream/bbcmedia_intl_he_6music_p

BBC World Service UK stream http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk

BBC World Service News stream http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-einws

fip http://mp3.live.tv-radio.com/fip/all/fiphautdebit.mp3

North West Public Radio (US)

Posted in radio, Raspberry Pi | Tagged , | Leave a comment

The morning after the week before

A few bleary-eyed thoughts on the European elections…

The Greens
The Greens did astonishingly well in Lewisham, coming second. They got 10228 votes to Labour’s 32507. UKIP, however, actually did quite well on 8720 votes, beating the Conservatives into 4th place on 8161. Labour won all but one council seat in Lewisham last Thursday – if we had proportional representation for council elections, might we have UKIP councilors even in Lewisham?
Nationally, things aren’t so rosy for the Greens – they have 3 MEPs, but it seems that in London and the South West of England they may owe those seats to the UKIP vote being split by the alphabetically cheeky ‘An Independence from Europe’ party being listed first on the ballot paper. In the South West ‘An Independence from Europe’ got 23,169 votes, coming a distant 6th behind the LibDems, and in London they got 26,675 votes.

Indeed, I’ve made a bar chart for the Lewisham result, grouping the ‘other’ votes into anti-EU others, and ‘other’ others – either pro or neutral on Europe. I make the anti-EU others (including the BNP) add up to 1691 votes, and if you add that to UKIP, you get 10411 votes, slightly ahead of the Greens on 10228. This bar chart also shows the LibDems getting fewer votes than the ‘others’, whether you split them on EU lines or not.

Proportional Representation
I’ve never been a big fan of PR*, and last night has done nothing to change my view. For years the Liberal Party, the SDP and the LibDems have blamed lack of PR for their lack of representation in Parliament. Well, the European Parliament is elected by PR, and the LibDems were all but wiped out. Where are the people who say ‘first past the post’ is undemocratic this morning? Oddly quiet. If we had PR in Westminster and local council elections, UKIP would likely be the biggest party in the House of Commons, and Nigel Farage would stand a good chance of becoming Prime Minister. I’d like to hear someone ask Nick Clegg about what he thinks about PR now.
*I mainly dislike PR because it usually reduces geographical accountability. I think that’s why so few people know, or care, who their MEP is. Does a person seem like ‘my’ MEP if they represent an opinion I’m vaguely sympathetic with across a huge geographical area? If each area, South East London for example, had its own MEP, I think people would feel more connected with the European Parliament, and that would be good for democracy.

Two Nations
(Or possibly three, if Scotland becomes independent – see below.) There’s That London. And everywhere else. As Nick Robinson pointed out this morning on Radio 4, this poses a huge problem for Labour. London Labour MPs are saying they should stand up to Farage, challenge his Little Englander views. That’s fine in London, where Labour are now very strong and UKIP relatively weak, but Labour MPs from elsewhere (the North East and North West) are singing a different song. Londoners may say they are pandering to racism, but those MPs have presumably knocked on more doors in their constituencies than I have, and I can only assume what they hear on the doorstep mirrors what happened at the ballot box. For example, in the North East (Labour heartland, surely?) UKIP came a close second, 177,660 votes to Labour’s 221,988.

Labour may also be mindful of what just happened to a politician who had the courage of his convictions: Nick Clegg didn’t duck the issue of Europe, he fought a campaign based on what he passionately believed to be right when many other politicians kept quiet – and his party was annihilated at the polls.
The other problem for Labour is that amazingly few of UKIP’s votes came from the Conservatives. They can’t all have come from the BNP, so where did they come from? I suspect a lot came from people who would have voted Labour in different circumstances.

Alex Salmond will paint the English as boggle-eyed and inward-looking (pot, kettle, anyone?). The likely election of a single UKIP MEP in Scotland is a midge in that ointment – how much of one, remains to be seen. I’m amazed that so little attention has been focused on the real earthquake to come: the effect that Scottish independence would have on English and Welsh politics. I don’t even want to think about it. And I’m pretty sure Ed Miliband doesn’t want to think about it either. Plus, of course, anyone living in England or Wales (Scottish, English or Welsh) doesn’t get a vote, despite the fact that the outcome affects England and Wales every bit as much as it affects Scotland.

Blame the Media
Well, that means: blame the BBC, never mind how much coverage Sky or ITV News have given UKIP – or, as a friend points out, how much coverage UKIP got on Twitter from people complaining about UKIP and/or the BBC.
Last week I predicted an avalanche of criticism for the BBC when UKIP did well. UKIP did well. People are blaming the BBC. But not quite as much as I expected. I’ve been heartened to see, at least among the people I follow, just as many people blaming Russell Brand for encouraging people not to vote. How’s that working out, Russell? Mmm? *Stewie Griffin voice*
Want to blame someone for UKIP’s airtime? How about Ofcom?

I tried to compare the 2014 results with the last European elections in 2009, but I’m confused about the geographical areas for the count. The Lewisham council website’s figures for 2014 are for the London Borough of Lewisham, but 2009′s are for ‘Greenwich and Lewisham’ – so I assume this means the figures can’t be directly compared. I’d be grateful for advice on this. Oddly, if you do compare them, the numbers of votes cast for each party are only radically different for Labour.

So, if the count areas were different, and I can’t split the 2009 Greenwich numbers off from Lewisham, how about I combine the 2014 Lewisham and Greenwich votes to make a more meaningful comparison? Well, I tried that and the picture is no less confusing.

I thought turnout may be an issue: it was apparently 38.9% in Lewisham AND Greenwich in 2014 – though the fact that both boroughs report exactly the same figure makes me suspicious. In 2009 the turnout for both boroughs was 30.79% – lower, but was it low enough to account for the massive spike in Labour votes in 2014?

My conclusion: it’s amazing what I’ll do in order to avoid marking and planning. And I should stick to the day job.

Posted in Uncategorized | Tagged , , , | Leave a comment