Artificial Intelligence! …but where is the intelligence?

Paul Curzon, Peter McOwan and Jonathan Black contents

Introduction Biological intelligence

Artificial intelligence? 04 Copy the machinery 27

Living dolls in history 05 It’s just an illusion 28

How do you recognise Neurons 29 intelligence? Build a brain to play snap 30

What is intelligence? 07 Neural networks 34

Almost human? 08 Robots IQ and all that 10 Intelligent robots 37 The Turing Test 11 Making it happen 38 Engineering intelligence Polite robots 39

An intelligent piece of paper 13 Friends at home 40

The intelligent piece of 14 Pet robots 41 paper’s instructions The future Is rule-following intelligent? 15 Human race? 43 Winning at chess 16 AI for real 44 Experts and patterns 17 More real AIs 46 Are you adaptable? 18 The end? 47 Learning to win 19

A sweet computer 20

Where’s the understanding? 24

Creative computers 25

2 Queen Mary, University of London www.cs4fn.org introduction

www.cs4fn.org Queen Mary, University of London 3 Artificial Intelligence? Artificial intelligence – machines that think. Is it really possible or is intelligence something only humans have? How would you spot an intelligent computer? How would you build one? What is intelligence anyway?

4 Queen Mary, University of London www.cs4fn.org Living dolls in history Through history inventors have strived to make ‘living dolls’ – machines that could act like real creatures and do intelligent things – and back then they had to do without computer electronics.

Greek pigeons French musicians His second attempt third could draw. 350 BC: a Greek 1738: French inventor was an automaton These lifelike dolls mathematician called Jacques de Vaucanson that played a flute entertained royal Archytas of Tarentum built a series of and a drum or families all over built a model mechanical creatures tambourine. Europe. mechanical bird called automata. His called ‘the pigeon’. first was a model of Swiss dolls As if that wasn’t It was pushed along a flute player. It could 1770: Two Swiss enough Pierre also a string by steam. play twelve songs on clock makers, Pierre found time to invent a real flute. Jaquet-Droz and his the wristwatch. Italian knights son Louis, built three in armour mechanical dolls. One 1495: Artist and could write, one could inventor Leonardo da play music and the Vinci designed a mechanical robot that looked like a knight in armour. The cogs and gears inside made Duck! it move as if someone was actually inside it. Jacques de Vaucanson also Lots of inventors made a duck automaton that in medieval times could move, quack, flapped designed mechanical its wings and even ate and creatures to amuse digested food! (It pooed too!) their kings and queens.

www.cs4fn.org Queen Mary, University of London 5 How do you recognise intelligence? what is Intelligence? What can we do that shows we’re intelligent?

There are lots of How many things can Now think of other abilities we have that you think of that show animals like chimps show our intelligence. us that animals are or crows, bats You might be good clever too? or elephants. Have at reading but your Start by thinking you heard of any friends are good at about pets – cats, amazing abilities puzzles. She has an dogs and mice. they have that show amazing memory for Compare them to they are intelligent? facts and he is good a doll – can they do at understanding clever things that help Perhaps there are people. We are all them survive without things they can do intelligent but in needing to be looked that people can’t different ways. after? do at all! What can people do that ‘shows’ they are intelligent in some way or other? It’s supposed to be our intelligence that makes we humans stand out, but animals can be clever too. There are lots of things that people have said no animal can do, but then someone finds an animal that can do it!

www.cs4fn.org Queen Mary, University of London 7 Almost human? Is it possible to put animals in order of intelligence? It isn’t as easy as you might think. Different animals (including humans) are intelligent in different ways, just as different people are.

Think about how intelligent the animals (and other things) on the next page are.

Which would you say are intelligent at all?

Which do you think have the most human-like intelligence?

Which do you think have the least human-like intelligence?

Do any have intelligence in ways humans don’t?

8 Queen Mary, University of London www.cs4fn.org A mouse I can find food and avoid being eaten by others. I can learn the way round mazes to find food at the centre. A pet rock I’m just a stone with eyes and mouth painted on. I can’t do anything much at all, but am easy to get on with. A dog I can find things to eat with my great sense of smell. I love to play and will protect my owner. I can learn tricks and even act as a guide dog A bee A FurReal Squawkers CCTV with computer for a blind person, helping I can find flowers with pollen, McCaw vision system them cross roads. then return to the hive and I can say lots of things and I can tell men and women do a special dance to tell the learn new words by copying apart from their faces and 20Q other bees how to find them what you say. I can dance, the way they walk. I can I can read your mind! Well, too. My dance tells them sing, whistle and laugh. I follow one person as they almost. I can quickly work which direction to go in and react when you pat me or pass from camera to camera. out what you are thinking how far to fly to get to the ruffle my feathers. I can tell whether people of just by asking you yes/no pollen. are happy or sad from their questions. A chess-playing expressions. An electronic sudoku computer A human baby solver I can beat humans at chess, An ant I can’t walk, talk, find food I can solve logical puzzles – working out good moves and I am able to find food then or even see very well, but I even the hard ones – faster bad moves. return straight to the nest. will soon learn to do all these than any human. I leave a trail that other ants things. A cuttlefish can follow straight to the food. We ants are good A turtle I am a master of camouflage. managers, dividing up work A robot vacuum After years growing up I can blend into any so that different ants in the cleaner somewhere else I can easily background, even changing colony do different things. I can move around a room find the beach I left when the pattern of my skin to fit. working round objects. I I was born to lay my own I can also recognise different make sure I clean the whole eggs there. threats and give different A homing pigeon room. When I run out of warning signs depending I can find my way home energy I can get back to my A parrot on what the danger is. even if I’m taken hundreds base to ‘feed’ myself, even I can repeat things humans of miles away in a lorry. I am if my base has been moved. say. I can fly and find food A chimp naturally good at knowing the right way to go but I also to eat. I know all the other I can solve problems using know some extra tricks like birds in my flock and can tools – like fashioning a stick following motorways. recognise a stranger. to use to ‘fish’ for ants out of tree trunks. I also share my A fly-by-wire jet food with others. I can take off in New York How clever and land at Heathrow airport without a human doing is that? anything.

www.cs4fn.org Queen Mary, University of London 9 iq and all that The most common way to test people for intelligence is an IQ test. The trouble with these tests is that they only measure one or two kinds of intelligence.

Worse still, Musical intelligence Spatial intelligence Social intelligence quite often the You are good at If you are intelligent in You understand questions have music, sounds and this way then you are people really well and several answers beat – you find it easy good at doing things are good at helping to learn a musical with pictures like them understand. that could be right instrument or sing jigsaw puzzles and and you have to in tune. do not easily get lost. What’s missing from get the one the this list? Are there person who set Verbal intelligence Motivational other kinds of it thought of! You find reading and intelligence intelligence too: writing really easy. You don’t need others Not such a perhaps kinds you You may be good at to tell you what to do. are really good at? good test. What word searches and You know what you different kinds of anagrams. want to do and go Different artificial intelligence are ahead and make it intelligences can be there? Below are Bodily intelligence happen intelligent in different You are good with ways too. some of the ways your hands or feet people can be – you are good at intelligent. making things and Circle the three doing crafts or are David Beckham can curl a football to perhaps naturally you’re best at. land exactly where a striker is going good at sport. to need it to be to score. He can Sensory intelligence do it even though the striker is Logical intelligence You are good at You can think somewhere else when he kicks seeing things and the ball! logically and are recognising what they good at puzzles are, or are good at What kinds of intelligence does he like Sudoku and recognising smells need to do that? games like chess. or sounds.

10 Queen Mary, University of London www.cs4fn.org The Turing How do you test decide if something deserves to be called intelligent? Does it have to pass exams to prove it?

What kind of How the Turing question would Test works Put a computer and you put in an none have come truth. The man could exam to test a person in one room, while you go into close to passing it. lie and pretend to be to see if a another. Now ask the woman. Could any animal computer was them both questions pass a Turing Test? The Victorians intelligent? by typing them If not, does that didn’t have Xboxes, messages. Their Alan Turing was mean no animal PlayStations or answers come up on is ‘intelligent’? Wii so they had to a mathematician your screen, and you make up their own and early have to work out which Party games amusements! computer scientist is the human. If after Alan Turing got the who came up with lots of questioning you idea for the Turing one way to decide can’t tell which is Test from a Victorian The earliest if a computer which, then according party game. A man chatbot was a was intelligent. to the test you should and a woman went program called admit the computer is It became known into another room and ELIZA developed as intelligent as the everyone had to work in 1966. ELIZA as the Turing Test human! out who was the man. took the role of a and it’s still used All they could do was There is a million therapist having a today, more than write questions on a dollar prize for the conversation with 50 years after he piece of paper that a first computer chatbot you the patient. referee would take to invented it. to pass a Turing Test. them and bring back The competition is Some people their answers. The held every year. So far were fooled! woman had to tell the

www.cs4fn.org Queen Mary, University of London 11 ENGINEERING intelligence An intelligent piece of paper

This piece of paper is incredibly intelligent. Do you believe that? What do you mean you don’t?

What reason This piece of paper but if you follow the might there be is clever in one way paper’s instructions – it is really good at exactly you’ll see how to claim that a playing noughts and well it plays noughts piece of paper crosses. It has played and crosses. is intelligent? humans a lot and in The intelligent piece It can’t be just fact it has never lost a game. It wins a lot of of paper wants to that it has some the time too – and play first. Perhaps intelligent facts that’s despite the fact you could write some on it – just that if both players instructions that would allow it to play storing facts is play well the game should end in a draw. well if it went second not enough for too. Why not have intelligence. Turn over to find the a go? What might this intelligent piece of piece of paper paper’s instructions. be able to do Give it a game, and to prove how see how you do. The intelligent it is? paper needs you to make its moves for it,

www.cs4fn.org Queen Mary, University of London 13 The intelligent piece of paper’s’ instructions

Please draw me Otherwise if there are Hello. It’s nice to a noughts and two 0s and a space crosses grid in a line then put an be playing with I am X and I go first. X in that space. Ha! Please do the following for me. Otherwise put an X in you, especially a free corner for me. since I’m an For my first move: For my fourth move Draw an X in a If there are two Xs incredibly corner for me. and a space in a line For my second move: (in any order) then If you did not go put an X in that space intelligent piece there already then and I win! draw an X in the Otherwise if there are of paper and will opposite corner to two 0s and a space my first move for me. in a line then put an X probably beat you. Otherwise put an X in in that space for me. a free corner for me. Otherwise put an For my third move: X in a free corner. If there are two Xs For my fifth move: and a space in a line Put an X in the (in any order) then free space for me. put an X in that space and I win!

14 Queen Mary, University of London www.cs4fn.org Is rule following intelligent? Our piece of paper’s claim to intelligence is based on what it can do, but all it is doing is blindly following rules. That is all computers do. They follow instructions a bit like the ones for playing noughts and crosses. Everything you have seen any computer do was done like that.

Most people would Often they can even say the paper isn’t do things better than Back in the 1950s computers had intelligent. It is the programmers who existed long enough that people the person, the wrote their rules, like started to suggest that one day programmer, who chess computers for computers would beat humans at wrote the rules who example. chess. “This is of course nonsense,” has the intelligence. wrote chess expert Edward Lasker. That may be true, but even so Perhaps he was sure it took computers can do intelligence to play chess well and lots of clever things surely machines just following rules just by following could not out-think humans. But he rules like that. was wrong…

www.cs4fn.org Queen Mary, University of London 15 Winning at chess

In 1997, computer The computer Go! Go! Go! company IBM's Deep Blue revolution supercomputer beat the The Chinese game Perhaps giving Artificial reigning world chess of Go is actually Intelligences (or AIs) dumb champion, Garry Kasparov jobs to do is not such a much harder in a chess tournament. good idea. It’s that sort of Deep Blue was just a than chess. treatment that has led in the machine following a set of So far humans past to workers overthrowing rules like our noughts and their rulers – so maybe that’s are much better crosses instructions. It just how the real computer than computers takes more instructions to revolution will start! play chess well. at playing Go. Who is the smartest Beating your maker Kasparov was the best chess- of them all? playing human at the time. Presumably because He could easily beat any of Garry had seen too many the programmers who wrote Terminator films (and Deep Blue’s instructions. because he thought he was The computer could play far the most intelligent creature better than its programmers! on the planet until he lost), he said afterwards: "I'm not afraid to admit that I'm afraid." The mighty fall Kasparov went on to become a Russian politician. Some say Deep Blue is doing airline reservations in an American airport. So the next time the computer double books you on a flight or loses your bags, remember it just could have been the best chess player on the planet who did it!

…and maybe if the computers get too smart for their own good, we could just punish them by giving them dull jobs to do. Ha!

16 Queen Mary, University of London www.cs4fn.org Experts and patterns

A chess Good chess players Experts in other they go with it. Their computer plays like Kasparov will look areas, like firefighters, expertise comes a few moves ahead, doctors or musicians, from having seen the game in a but nowhere near do the same thing. so many situations different way to as far as a chess Experts don’t think in the past that their a human player. computer. It is too through all the first solution, based It plays lots of hard to do and would hundreds of possible on their experience, pretend games take too long. Human choices they could is usually very good. players instead look make in any situation before making for patterns in the before deciding which Some scientists think each move, game and know from is best. Instead they that’s what ‘intuition’ trying out as past experience the recognise the situation is – instantly matching best kind of move and come up with a the current situation many moves to something similar as possible and to make given the solution. When they pattern. think through how it the expert has seen following the will work, if it seems before. game through, good enough, then trying different moves for the other player too. The computer then picks the move that gives it the best chance of winning.

www.cs4fn.org Queen Mary, University of London 17 Are you adaptable? Our noughts and crosses-playing computer was really good at playing the game, but only when it got to go first. What happens when it goes second? Play against it for a few games and see. It probably looked what they do and as though it was nothing more. Artificial pretty stupid. Intelligence researchers call this the ‘Frame The computer’s Problem’ – the suddenly very solution only works easy to beat! Its for the problem it was rules were written made for. It’s easy to think of a list of things for one situation a computer must and work great be able to do to be in that situation intelligent. People can only. Change then write programs things just a little to do each thing – play chess, recognise bit and suddenly faces and so on. The things are not trouble is, as soon as so good. the computer has to deal with a problem Humans show their the programmers intelligence by being didn’t think of, the adaptable. Once computer gets lost. you’ve learnt to play well going first you To show really would probably play intelligent behaviour, OK second too. the rules written must somehow be Fixed rules like our able to cope with new noughts and crosses situations. They must instructions aren’t also be able to learn adaptable. They do from their experiences.

18 Queen Mary, University of London www.cs4fn.org Learning to win Intelligent creatures are adaptable. They can learn from their mistakes. Could a computer do that? Could it learn just by following rules? Well actually, yes.

Let’s play a game called Hexapawn to show you how. Here are the rules.

The game is played on a 3x3 board. 3 ‘x’ pieces and 3 ‘o’ pieces are placed on the first and last rows of the board as shown. To make a move you can either:

1. Move one place forward if nothing is there, or

2. Take an opponent’s piece that’s in the next place diagonally

It’s a little like playing a mini- game of chess with pawns only.

How do you win? There are 3 ways:

1. Getting a piece onto the last row,

2. Fixing things so the other player can’t go, or

3. Taking all the other player’s pieces

That’s all there is to it. You might want to play a game to get the idea.

www.cs4fn.org Queen Mary, University of London 19 A sweet computer

It turns out you can make a learning ‘computer’ out of boxes and sweets. It starts off stupid but after playing Hexapawn for a while, gradually learns to play better and better…until it never loses. Here’s how:

Ingredients Building your sweet and orange on You need: computer the box put a red • 24 boxes 1. Copy out the 24 sweet, a green • large numbers of pictures of the sweet and an coloured sweets of board shown and orange sweet at least 4 colours stick one on each in the box. box. • a copy of the 24 4. Fill all the boxes board positions 2. Colour in the in this way to shown on pg 22 arrows so that each match the arrows • A blank 3x3 board is a different colour on the box’s to play on (the colours you board position. use should match • 3 ‘x’ pieces and 3 the colours of Now your computer ‘o’ pieces to play sweets you have). is ready to play. the game with • Coloured pens or 3. Take a box and put pencils one sweet in that box to match each arrow on its board picture: if there are three arrows coloured red, green

20 Queen Mary, University of London www.cs4fn.org Play the game If you ever get into One box matches a position with no each board position box then the sweet If it lo that our sweet computer resigns – se computer could you win, but if you s, punis end up in. The can’t go or the sweet it - eat its h sweets are used to computer gets a piece sw decide which move it to the end then you eet! will make. Here’s lose! ‘ how: At the end of a game How the sweet With a little help from computer plays you after each game the sweet computer You go first, and are learns from its ’ the noughts so… mistakes. Here is 1. Play a move. how. Remember at the end of a game 2. Find the box that there should be a shows the position sweet on top of the board is in. several boxes. 3. Close your eyes. 1. If the computer lost Shake the box and then eat the sweet take out a sweet at that is on the last random. box that made it play the last losing 4. Put the sweet on move. It will never top of the box. play that losing Note its colour. move again! 5. The sweet 2. If that box is computer makes now empty then the move shown put it aside. The by the arrow with computer will the same colour resign if it gets to as the sweet. that position again. 6. Go back to step 1. 3. If the computer It’s your turn again. won then you don’t eat a sweet. 4. Put all the remaining sweets back in the box they came out of. 5. Now play over and over again. www.cs4fn.org Queen Mary, University of London 21 copy, cut out and play! copy,

22 Queen Mary, University of London www.cs4fn.org What’s going on? could reward all the The sweet computer moves that led to it will play really badly by not only putting the to start off. It’s just sweet back in the box making moves at but by adding another random. The more it of the same colour plays and the more too. Now the sweet it loses so the more computer will be more sweets you eat, the likely to make those better it will get. moves again. Eventually it will play perfectly. No one told What other variations it how – it learnt from of rewards and its mistakes – and punishments could because you ate its you try? sweets! It’s possible to write a computer program that learns in the same way – but without sweets. Instead, the sweets are just 1s in the computer’s memory that are flipped to 0s. Not so yummy! You can do some experiments. Try slightly different rules. At the moment we just punish bad moves (by eating the sweets). What about when the sweet computer wins? You

www.cs4fn.org Queen Mary, University of London 23 Where’s’ the understanding? One of the problems with accepting that a computer can be ‘intelligent’ is that it’s just following rules written by a programmer. Isn’t all the intelligence in the person who wrote the rules?

Rules! Rules! Rules! sequence of symbols It’s all in your head The worry boils down you are given, it No one knows to the idea that if has another series of where understanding you’re just following symbols – the correct happens in our brains rules blindly you don’t Chinese answer to either. Is your head have to understand what came in. You like a Chinese room anything, and if you copy it onto a card with your brain just don’t understand and push it out following complicated then that isn’t another slot. rules? If so eventually intelligence! we will be able to Now you have no idea make computers that Inside the what any of it meant. do the same thing. Chinese room However to the They will then be able John Searle, a Chinese person to understand in the philosopher, came asking you questions same way we do. up with a thought by putting cards in experiment that and reading your Losing consciousness captures this worry. answers, you seem to What it boils down to Imagine you are understand Chinese is that we don’t know locked in a room. perfectly. The Chinese what consciousness different animals we Cards with Chinese person doesn’t know really is. Finding out thought of back at writing on appear you are just looking is one of the great the beginning of this through a slot. You things up in a book. challenges for book? What about a can’t read Chinese. scientists to solve. newborn baby, or a Instead you find the You understand baby about to be born symbols on the card nothing but seem Consciousness isn’t in a few days? What in a BIG book of to understand all or nothing though. about you when you replies. For every everything! What about those are asleep?

24 Queen Mary, University of London www.cs4fn.org Creative computers There is more to being a human genius than being good at IQ tests. Being creative is just as important as being straight clever. A robot could never do great art, could it?

Aaron can the same picture each other day Aaron is a successful twice. Once it starts after day generating American painter. it works by itself, wonderful interactive Aaron’s paintings with no human help. art. sell for thousands Aaron just draws and of dollars in the US. paints following the They have been rules for art that it displayed in art has been taught. galleries worldwide including in London's Ed versus Zach Tate Modern In London, 2005, two Gallery and the San computers took part Francisco Museum in the ultimate cyber of Modern Art. Oh head-to-head. One and by the way, computer ran an artist Aaron is a robot! program called “Ed” by Ed Burton and Yes, Aaron is a robot, the other a program controlled by artificial called “Zach” written intelligence, and built by Zach Leiberman. by Professor Harold Cohen to be a They took it in turns creative machine. to draw what they Aaron never paints saw on each other’s screen. They drew

www.cs4fn.org Queen Mary, University of London 25 biological intelligence Copy the machinery

We’ve seen that one way to give machines intelligence is to work out what we can do, and then try and write computer programs that can do the same things. Another way is to work out how our brains actually work and copy the machinery. A computer that works in a similar way should then be able to do similar things to a human brain.

www.cs4fn.org Queen Mary, University of London 27 It’s’ just an illusion So how do our brains work? It turns out that your brain is following rules too! Not ones like “Keep off the grass”, but rules even we don’t know we’re following.

One way scientists Stare at this eye. something is separate moving. But what’s have shown our Perhaps wiggle from its background, really on the screen brains are following the page a bit. so you are fooled by it! is just a series of still rules is using optical pictures being shown illusions. They Does it seem like the Tricking your brain’s one after the other. happen in situations middle is floating and rules can be really They’re shown so where our brains’ jiggling about? It’s not useful. Your TV is quickly that your brain rules don’t fit – a of course! It’s just a fooling you into can’t keep up, so it bit like the piece of picture on a flat piece thinking that the merges them together paper trying to play of paper. The pattern people, cars and and gives the illusion second at noughts breaks rules that your animals on your of movement. and crosses. brain uses to tell if screen are actually

28 Queen Mary, University of London www.cs4fn.org Neurons

How does your brain work deep down? It’s made up of billions of nerve cells called neurons. The way they work is by passing chemical messages to each other. Every neuron is connected to lots of other neurons, and they can send messages to one another. When a neuron sends a message we say that it is ‘firing’. The messages say “I want you to fire too”.

How does a neuron messages before they know when to send fire. Scientists believe neurons firing a message? It follows there are six different chemical and a simple rule. layers of neurons electrical messages in our brain, all to each other. When it has received connected together enough messages in very special ways. But what does a from other neurons Later in the book neuron understand? it will send a message we’ll play a game Nothing. Somehow out itself. Each that shows you how from all that activity neuron has a slightly the layers of neurons of your neurons you different ‘threshold’. connect up. end up being able That means one to understand! neuron might send The whole of your Scientists are still a message on brain works like this. trying to work out receiving a single Everything you sense how that happens. message. Others and feel and think might need lots of comes about from

www.cs4fn.org Queen Mary, University of London 29 Build a brain §to play snap

You can build a working brain of your own out of rope and toilet rolls. You will need seven friends to make it work. Alternatively you can make a small version out of strings and beads and operate it yourself, though that won’t be so much fun.

First you need to the middle of a long positions shown in There are 100 build the hardware – piece and lay them the diagram: one billion neurons in actually in a brain it’s on the floor in two Y person holding each a human brain. more like squishyware. shapes. knot and the others holding the ends. Our chemicals are Get some rope or Each friend will A single person going to be toilet rolls. string and cut two control a neuron should be holding Thread a toilet roll lengths about a metre in your brain. They the bottom of both on the end of the long and two lengths provide the energy to ‘Y’s. Pull the whole arms of each Y. Next that are 2 metres long. allow it to work. Get contraption tight. thread one on the end Tie each short piece to them to stand in the of each base. Move OK, so you have those last ones up How many neurons in their brains? artificial neurons to the knot. octopus 300 million connected together, but neurons can only rat 21 million Turn the page to see do things if they have how to make your snail 11,000 chemicals to deliver brain work. ant 10,000 messages. slug 7,000

A fruit fly gets by with only about 100,000 neurons. So why is it so hard to swat? It makes clever use of the few neurons it does have.

30 Queen Mary, University of London www.cs4fn.org Tell me when to fire! neurons. Our artificial Now you need to EYE neurons each bring your brain to have a different rule. life. The neurons Each is focusing on need rules! one thing that can be seen. Cards will be The rules in a neuron placed on the table in tell it when to fire. one of two positions: For our artificial brain position 1 or position 2. that means a rule to tell your friends about - The first EYE neuron when they should do fires if there is a Red an action – usually card in position 1. sending a toilet roll down the rope to the - The second EYE next person. neuron fires if there is a Red card in We’re going to play position 2. a simpler version of Deep in the brain Shout! snap – only the - The third EYE neuron fires if there The two people The final person who colours have to holding the knots should be holding match, not the is a Black card in position 1. are INTERNEURONs. two ropes is a SNAP numbers. Interneurons are neuron. A SNAP Senses - The fourth EYE further down in the neuron is different. The four people at neuron fires if there brain. Unlike the eye When it fires it the ends of the Ys is a Black card in neurons they aren’t controls the voice are EYE neurons. position 2. connected to the connected to our Brains get information brain’s senses, only brain. When the To fire, all the neurons to other neurons. SNAP neuron fires, from the outside have to do is shoot world through the Their rule in our the person just shouts the toilet roll along brain is for them to “SNAP” as loud as body’s senses. Our the rope. brain has eyes to fire their toilet roll only they can. When sense the world if they get two toilet does it fire? It fires and the eye sends rolls fired at them. if a single toilet roll messages to the rest arrives. of the brain through

www.cs4fn.org Queen Mary, University of London 31 Play the game Your artificial brain is now ready to play snap! The EYE neurons should watch their own spot on the table. Someone else should lay down cards in pairs. If both are red or both are black our artificial brain should end up shouting “SNAP!” snap! If they are different colours it should stay quiet – just like when you play snap without an artificial brain. After each round of two cards, the brain needs to reset. In a real brain all the chemical messengers have to wash back to where they came from. In our artificial brain it’s the toilet rolls that have to go back. Make up two artificial brains and you could have a real game of snap between them. Alternatively you can make small brains with straws and beads. Then it’s your job to push the right beads about, and you can only shout snap if a bead gets to the SNAP neuron! May the fastest brain win!

32 Queen Mary, University of London www.cs4fn.org Spot the tiger! into the zebra-spotting Why not try and make part of the brain. a brain to do other things, like identifying When you need a animals? Let’s try to bit of brain that fires make a brain that when two things are recognises whether true – it has stripes it’s looking at a tiger, AND it has sharp which has stripes, teeth – you just paws and sharp need a Y-shape like teeth, rather than in our snap brain. a zebra, which has The middle stripes too but hooves INTERNEURON of instead of paws and the Y has a rule to fire no sharp teeth. if beads arrive on both the lines coming in. This can get a bit complex, so you When you need a bit might want to of brain that can tell experiment with if one thing is true beads for toilet rolls or another thing is and straws instead of true, you just have a rope before building a neuron that fires as full-size brain. soon as it gets any bead on its lines You need two coming in. That’s MOUTH neurons – how the snap MOUTH one to shout neuron worked as it “ZEBRA”, the other had to fire if there to shout “TIGER”. were 2 red or 2 black You will need one cards. EYE neuron that fires if it sees STRIPES. Think up some other A second EYE neuron similar animals and will fire if it sees see if you can create “SHARP TEETH”. brains that tell them A third eye neuron apart. How about will fire if it sees one that can identify “HOOVES”. whether it is a bird, fish, mammal, insect Now you just need to or reptile? But don’t connect them in the forget about the right way. awkward ones like bats – a mammal The EYE neurons may that flies, or the duck- have two lines coming billed platypus – a out of them, each with mammal that lays a bead to fire. One eggs. might go into the tiger- spotting part of the brain and the other

www.cs4fn.org Queen Mary, University of London 33 Neural networks

It turns out you can write a computer program to act like a neuron. It just has a way of following simple rules of firing. By putting together lots of neuron programs into a single big program and giving them a way to send messages to each other (like the toilet rolls), you can create a program that works just like our artificial brain did but inside a computer. The computer then has a brain that works much like our real brains do.

The picture on the neural network, rather next page shows a than making the robot Your brain contains about the robot with a brain shout a word like in same number of nerve cells just like that. Called snap, changed its Blade, it was made expression. Blade as there are raindrops in an out of Lego by Zabair could look happy, Olympic size swimming pool. Qureshi, a student sad or surprised, at Queen Mary, depending on ‘Moore’s Law’ says that every University of London. what it heard. year and a half the cost of Rather than detecting animals, Blade was A difference to the electronic chips drops by half, able to hear the tone artificial brain we made and their power doubles. Some of someone’s voice. out of rope is that the researchers believe that by 2019 It can tell the neurons in Blade’s difference between brain learned their even a home computer will be a loud, angry voice rules by experience. able to do the same number of and a soft, calm Zabair and his friends calculations as the human brain. voice. The rules in its shouted and talked softly to Blade a lot, When Zabair finally training it how to react had to take Blade – a little like you might apart, he said it was train a dog. Over time difficult to do. He’d it learned to look sad got so used to Blade’s when Zabair was human-like reactions angry and to look it felt like it was much happy when he more than just a pile sounded calm. of Lego bricks.

34 Queen Mary, University of London www.cs4fn.org www.cs4fn.org Queen Mary, University of London 35 robots Intelligent robots Put an intelligent computer into a mechanical body and you get a robot. Science fiction films are full of them, but will robots like R2-D2 and C-3PO ever really exist?

Czech robots Climbing stairs Ring that bell! ’Robot’ comes from The car company In 2002 Honda’s new the Czech word Honda don’t just ASIMO robot rang ‘robota’. It means make cars. They’re the opening bell at ‘compulsory worker’. also trying to build the New York Stock humanoid robots like Exchange. ASIMO The word ‘robot’ was C3PO in Star Wars can do even more

first used in 1921 too. In 1996 they than P3; it can by^ Czech writer Karel revealed the P3. It dance, run, play Capek in a play called could walk by itself, musical instruments RUR (Rossuum's and even climb up and even conduct ~ Universal Robots). stairs, which is more an orchestra. than a Dalek can do! Gastrobot In 1996 two America scientists created Gastrobot, a robot that digests real food. Its stomach turns the food into carbon dioxide, which is then used to power the robot. Burp!

www.cs4fn.org Queen Mary, University of London 37 Making it happen

We’ve made brains out of rope and toilet rolls, but how can a brain actually turn the things it senses into useful action? The earliest creatures with eyes could probably only sense the difference between darkness and bright light. How useful would a really simple ‘eye’ like that be to a creature?

Let’s do a thought of it. The first fires if there experiment. Let’s imagine is bright light ahead. The creating a ‘wheelybot’. It is second fires if there is only a robot that needs strong darkness ahead. Otherwise light to survive. Perhaps it’s nothing fires. All we have solar-powered. That means it to do is connect its bright needs to stay in the light – it EYE neuron straight to the wants to move towards light FORWARDS terminal and and away from the dark. the other to the BACKWARDS terminal. Our imaginary How complicated a brain wheelybot will be drawn would our wheelybot need to towards bright light, just have to always move towards like a moth, but will scuttle the light? away if it’s dark.

Suppose the wheelybot has Now think again. What a wheel connected to a would happen if we motor with two terminals to connected the eye neurons connect wires to. If a signal to the motor terminals the comes in to the first terminal other way round? With a (the FORWARDS terminal), simple change to the wiring the wheel turns forwards the wheelybot’s behaviour so the wheelybot moves has changed. Now it slinks forwards. If a signal arrives away from the light and into at the second terminal dark places – just what it (the BACKWARDS terminal) might need if there was a it makes the wheel turn predator out to gobble it up backwards, and the if it came out in the daylight. wheelybot moves backwards. The right-hand The way neurons in brains side of your brain Now suppose our eye is are connected together connected to a neural makes a real difference controls the left- network like the one we to how creatures behave. hand side of your made out of rope and toilet As we’ve just seen, even a body, and vice rolls. This neural network has simple swap can lead to big versa. two EYE neurons coming out changes.

38 Queen Mary, University of London Polite robots Robots already work for us. They build cars in factories and help repair satellites in space. If robots are going to be useful at home too they will need to learn good manners. After all, intelligence is about being able to get on with others too.

Did you say thanks? That’s where computer Kerstin realised that studying Saying please and thank you, scientist Kerstin Dautenhahn biology was a great way to not standing too close to comes in. Her robots have find ideas to help build someone you don’t know a special kind of intelligence: robots, and that the social very well, and asking social intelligence. They know intelligence animals use to “Excuse me, can I get how to behave properly live with each other can help past? are all examples of around people. us to create polite, sociable something called ‘social robots. etiquette’ (a posh word for Kerstin started She is trying to answer good manners). It’s a set out as a biologist of rules that lets people in questions like "What's the a group get on with each looking at how best way for a robot to other. To fit in, any robots stick insects’ interrupt if you are reading in the group will have to a comic? Should it gesture understand the rules too! legs move. with its arms, blink its lights or make a sound?"

What do you think it should do? (We’ll tell you what Kerstin’s group came up with on the next page.)

www.cs4fn.org Queen Mary, University of London 39 Friends at home Kerstin’s group created a special flat to look at how people and robots got on together at home.

People lived in the feel uncomfortable. house with the Quite a lot of people robots for weeks were happy for the at a time. robots to be close to them. In fact they In your face were happy for robots One experiment was to come closer to about discovering the them than people best way for a robot they didn’t know well. to approach a person. This is because At first Kerstin’s group people see the robots thought that it would as machines. As be best if the robot Kirsten says: “You are came straight towards happy to move close the person from to your fridge, and it's the front. People the same for robots”. found that was too aggressive. Instead Friendly future the robots are now By building robots trained to come up with manners and gently from the side. good social skills Kerstin and a team Comfort zone of people across The people in the Europe hope to create house were also robots that will be given special 'comfort our friends, helping buttons' to press if to make our future the robots made them friendly.

An ‘android’ is a robot that looks like a human. Researchers in Japan have found that people find existing androids creepy because they look like a human but don’t behave like a proper human. People seem to prefer being around robots that look like robots.

40 Queen Mary, University of London www.cs4fn.org Pet robots

Make your own Furbys ! Rabbit! Rabbit! In 1989 Dr Seymour Papert Furbys came out in 1998, A Nabaztag is a clever become the first Lego and were one of the first electronic rabbit. It collects Professor of Learning electronic pets you could buy information from the Internet Research at a top American in the shops. They react with for you. It can read you university. sounds and facial expressions weather forecasts, tell you when you play with them. the news, let you know the His wages were paid by They know over 800 phrases time, wake you up, download Lego, the toy company. to use to talk to their owner. and play MP3s and read He helped them create new They also have their own you email messages from electronic bricks to be part language called ‘Furbish’. friends…for starters. of a kit for making toy robots. Nabaztags can even talk Sit! to fellow bunnies over the The resulting toy was called Electronics company Sony net and get married! Lego Mindstorm after a have created a range of research paper that Dr robotic dogs called the AIBO. Papert wrote. You can build These cute robotic pets can your own Mindstorm robots sit and walk like a real dog. using the bricks, then They can even ‘see’ using a program them to behave tiny camera built into their the way you want them to. head. Using this camera AIBOs can play games with Blade the emotional a brightly coloured ball. They robot (see page 34) are also able to learn and was made of Lego remember tricks their owner teaches them. Mindstorm

www.cs4fn.org Queen Mary, University of London 41 the future Human race? Who can create the fastest creatures to race over digital racetracks? Have a play with some artificial intelligence and find out at Sodarace (www.sodarace.net)

Sodarace is a free online and fast to steep and scary. Is this really intelligent? Sodarace: round Olympics where humans can All you need to do is point Well, humans learn from one to humanity try to win against artificial your mouse and click away. their mistakes all the time. The first sodarace to pit intelligence. Using your How will your creature do in If something doesn’t work humans against artificial mouse to draw a springy the races? Will it make it to you tend not to do it again, intelligence was won by creature, you can then add the finishing flag? and that seems quite a clever a human, but only at the muscles to make it move. thing to do. So is our artificial very last minute. An AI Muscles move back and You can play with some intelligence smart because it had designed what was the forth in time to an energy artificial intelligence yourself learns from its mistakes too? fastest creature on sodarace wave that passes through too. On the website you’ll at the time, and its creators them. You can create cars find software that lets you Why not try and answer were all set to take the news or caterpillars, birds or create amoebas, which in the the question for yourself on of their program’s intelligence bouncing boxes. It’s up to game are rolling wheel-like Sodarace and join forces to the public. But just before you and your imagination. creatures. You can then ask with the artificial intelligence they did, a schoolkid in You can also see what other the artificial intelligence for to see if your team can be a Canada did a bit of work players have created and help to make them go faster. winner. on the AI-created creature. use their ideas to help create He found another change your own. You can then Learning by trial Moovl, which is a overnight to make it even create racetracks, from flat and error cartoon version of faster, and became the The artificial intelligence Sodaconstructor, uses surprise winner of the works in much the same first race! way as you might. It makes some of the same tweaks to the creature, and software as Sodarace. sees if that change makes it Computer scientists go faster. If it does then the often do this: reusing artificial intelligence keeps the change. If the creature parts means you is slower then the artificial don’t need to waste intelligence throws the time getting them to change away. It’s a bit like work from scratch. a human designer using trial and error to make things better. The artificial intelligence can try hundreds and hundreds of changes though. Each time it just keeps the best.

www.cs4fn.org Queen Mary, University of London 43 AI for real There are lots of ways the approaches to creating artificial intelligences that we’ve explored in this booklet are being used for real. Here are a few. The programs may not really be intelligent but they can definitely do clever things.

Expert AIs Copying the brain Neural nets have Programs using rules Neural networks have even been used like our noughts been trained to help to help DJs mix and crosses player give robots the senses records in clubs. have helped doctors of touch and sight. The networks learn decide which They’re also used to the best way to antibiotics to give help recognise what combine the music. a patient. There’s people say so that also an expert system humans can talk that helps engineers directly to computers. design airplanes, and another that can Neural nets are also help farmers decide used by banks where what crops to plant, they learn how to and where and when predict the money to plant them. A market, and can even different one helps automatically sell in oil exploration and shares when it looks yet another helps like their value is people work out about to go down. how ecological their building projects are.

44 Queen Mary, University of London www.cs4fn.org Trial and Error Trial and error methods have been used to evolve games for mobile phones. This helps tune them to just the right level of difficulty.

TV Stars Robots have even starred in their own hot tv show, Robot Wars, where robots built by teams up and down the country battled for supremecy in the arena under the watchful eye of judges including computer scientist Noel Sharkey.

www.cs4fn.org Queen Mary, University of London 45 More real AIs

See like a fly Helping the disabled Researchers have used some Researchers are looking at ideas from examining how ways to connect electronics houseflies see to build silicon to the nerve cells that chips that can detect how send messages all through fast things move. The chips your body. In the future are used to help make cars this could help people safer by avoiding crashes. with disabilities link with technology to have a better Driving home alone quality of life. In 2005 the American government sponsored a For example, the silicon car race through the rugged cochlea is an electronic Mojave desert with a 2 device that works in the million dollar first prize. same way as part of your The cars in the race ear. It connects straight into were all driven by artificial the brain, and has been used intelligence software – to help deaf people hear. no humans allowed. The winning robot car, from The PS3 Stanford University, was supercomputer called ‘Stanley’. It drove The Sony PS3 game console itself over the 130-mile allows users to donate some desert racetrack in about of its spare computing power seven hours. when it’s not being used. In 2007 more than 600,000 AIs making movies PS3 users donated some Artificial intelligence software power this way. Using the is used in movies, computer Internet to join up all these games and TV too. When machines, they created a directors want gigantic battle record breaking worldwide scenes or to show lots of supercomputer to help people in a crowd, AI scientists examine how software is used to animate proteins get their shape. all the computer-generated Even with all those PS3s characters. Each of the linked together, it’s been characters can be doing estimated that the resulting something different, and supercomputer was still because they have simple slightly less powerful, in artificial intelligence built terms of raw calculating in, they can react to the power, than one human characters around them too. brain.

46 Queen Mary, University of London www.cs4fn.org The end?

It used to be that when we saw artificial intelligences in movies they wanted to take over the world – they were the enemy of humanity. In more recent movies like Wall*E and AI, they are the good guys. Maybe the kinds of AIs we see in movies tells us something about what people at the time think about computers. Being intelligent does not mean wanting to destroy things, and if computers do become more intelligent than us then hopefully they will realise it! In the meantime they are helping us more and more, making it easier for us to do things, and looking after us. Someday soon they’re even likely to become our friends…

www.cs4fn.org Queen Mary, University of London 47 This booklet was created for a 2008 Artificial Intelligence workshop series at Chingford Church of England Junior School with support from the Royal Society on a Partnership grant together with funding from Queen Mary, University of London.

It is part of the cs4fn project (www.cs4fn.org) supported by EPSRC, the BCS, HEA and industry. cs4fn is a free website and magazine that aims to inspire students of all ages about computer science. Have fun!