The truth about cats AND/OR dogs

Here’s an activity I think you could do with almost any year group in KS2 or KS3. You could use it to teach about the origins of modern databases in Hollerith’s punch cards used to collect US census and immigration data in the 1890s. You could link it to the Jacquard loom punch cards that Ada Lovelace and Charles Babbage envisioned being used to program the Analytical Engine in the 1830s. You could also use it to teach logic gate concepts like AND and OR.

I got this idea from a school’s TV programme I must have seen over 40 years ago, which I only just remembered when reading about Hollerith’s tabulating machines in Code by Charles Petzold.  I think it was a programme about data processing and computers, and they made a really cool selection tool using a cornflake box, punched cards and pencils. I can’t remember the precise configuration, and it was way cleverer than this project, but it works on a similar principle.

You have a stack of cards about cars, people, or in my case pets. You encode their properties using either a punched hole or a slot. For example my pet is a dog, black and female, so I snip out all the other labels and leave holes for dog, black and female.

I do the same for all the other animal cards and stack them up. The neat thing is that all the property fields are visible no matter what card is on top.

Now if I put a pencil in the black hole and lift it up, it picks up all the black animals in the pack. This is like running a query in a database:

Of course I may want to select more than one property at a time, and I can do that with these cards. Say I want to sort out all the animals that are black AND female. Aha, I know, I’ll put a pencil in the black hole AND the female one. (It doesn’t matter what order the cards are stacked in).

The results, however, may not be quite what you may expect. We seem to get all the animals that are black OR female, shown on the left. (Rejected cards left behind are on the right – note that these are NOT black and NOT female.)

So we need to sort them again. I stack up the 3 cards I picked up on the left and re-select black. (I could also reselect female but they are all already female). Note that we can see that we now have no white, male pets left in this stack.

Finally I’m left with just the pets that are black AND female, Lilith the cat and Ellie the dog on the left:

There’s lots of scope for expanding this. Can you redesign the cards so you can select black AND female in 1 pass rather than black OR female as I do here? You could build a frame with levers or pins in a DT project. And using the blank cards you can make as many cards as you like, or make your own cards with more than 7 properties. Could you encode numbers, either as binary or using the system Hollerith used with number ranges? The possibilities are endless.

You can download PDF files of the cards here.

Please let me know your ideas or if you have used something similar in class!


Thank you so much to Barbara Kershaw (see comments below) who not only saw the same schools’ programme, she also remembers how the box was made – and she just built one! Here are her amazing photos:

This entry was posted in computers, education, ICT and tagged , , , , . Bookmark the permalink.

6 Responses to The truth about cats AND/OR dogs

  1. Barbara says:

    Thanks for bringing a smile to my face this morning! As a child in the 70s I would fake illness to stay home and watch schools TV; I remember that particular programme very well. Sadly no amount of googling has produced a clip.

    As well as the cards, they constructed a dispenser from an old cereal box. The cards were stacked at the top on a pull out platform which lined them up with holes through which knitting needles could be threaded. The bottom of the box was cut to form a hatch with a slope. When the platform was pulled out, the rejected cards fell down the slope and out of the hatch. I constructed one as soon as the programme finished along with a whole load of animal related index cards. I loved it and I am certain it was one of the reasons that led me to a career in software engineering.

    Great resources and ideas on your blog. Such an inspirational teacher.

    • blogmywiki says:

      Dear Barbara – amazing that other people remember this programme and found it as inspirational as I did! And thank you for your very kind words. I can’t wait to have a go at making one of the boxes, but I’m having trouble picturing it! Can you do a sketch of it?

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>