20
CS4FN Computer Science for Fun Issue 2 Claytronics: From Goo to You Exclusive Interview with Kevin Warwick. What is it like to be a Cyborg? Enter the Future Human Competition Special Issue on the Magic of Computer Science Special Issue on the Magic of Computer Science Claytronics: From goo to you Exclusive Interview with Kevin Warwick. What is it like to be a Cyborg? Enter the Future Human Competition

Computer Science for Fun Issue 2 CS4 FN CS4FN · be long before the whole back catalogue of music fits ... Feel free to photocopy pages from cs4fn ... it’s great fun to play and

  • Upload
    lamnhu

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

CS4FN

CS4FN

Computer Science for Fun Issue 2

Claytronics: From Goo to You

Exclusive Interview withKevin Warwick. What is it like to be a Cyborg?

Enter the Future HumanCompetition

Special Issue on the

Magic ofComputerScience

Special Issue on the

Magic ofComputerScience

Claytronics:From goo to you

Exclusive Interview withKevin Warwick. What is it like to be a Cyborg?

Enter the Future HumanCompetition

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/

Welcome to cs4fn

In this issue:

Pg 6 Exclusive

interview

with a cyborg

Pg 12 Perfect shuffle

Pg 14 Sonic sleight

of hand:

The magic of MP3 Pg 15 Claytronics:

from goo to you

More in the cs4fnwebzine www.dcs.qmul.ac.uk/cs4fn• Magic of the sands – computer

science transforms sand to sums• Bugs, biology and

computer science• The mind-reading

computer magician

Coming in the next issue:

• Robot wars - fighting withcomputer science

• Potter magic - how computerscience made Hogwarts wizardswork

• Big brother - computer scienceand telecommunications: I’m comming to get you

2

Future Proof

Bill Gates believes CDs and DVDs have had it. It won’t be long before the whole back catalogue of music fits on a device in your pocket:

“It’s going evenfaster than weexpected…Fiveyears from nowpeople will say‘What’s a CD? Whydid you have to go

to the case andopen something upand you couldn’tsequence it yourown playlist way?’That will be a thingof the past. Evenvideos in the futurewill either be on a disk in yourpocket or over

the Internet, and far moreconvenient for you.”Bill Gates, Chairman and Chief SoftwareArchitect, Microsoft.

The magazine about the fun side of computer science

This issue is about magic, but not theHogwart’s kind, the computer science kind.The great thing about technology is that itis better than magic. Magic is about theimpossible. Computer Science is aboutmaking the impossible routine. What about things that today are dismissed asfantasy…Is teleporting possible, or at leastto be in two places at once? See “From gooto you” on Page 15. How about super-human powers? We can’t do it unaided ofcourse, but wire a human brain directly to a computer and some of it becomes a possibility. Find out what’s already beendone in Cyborg super-senses on page 6.We also look at how magician’s tricks haveled to new ways to build computers, andhow your MP3 player is playing tricks onyou. Microsoft kindly sponsored this issue,and since seeing into the future is alwaysfun we start with a seeing-into-the-futurequote from Bill Gates.

There are more predictions

about future technology

on the cs4fn website.

There are more predictions

about future technology

on the cs4fn website.

What do youthink is mostlikely todisappear next?

Future HumanCompetition

Enter our 2006Future HumanCompetition?Using the Internet as aresearch tool and yourimagination write upyour predictions of howthe human of 50 yearsfrom now will look,communicate, work, play and live. You mustbase your predictions on actual computerscience projects currently underway.

There are prizes for boththe winners and theirschool. You might want toread “The Machine Stops”

by EM Forster for one sciencefiction view of the future

written in 1909, long beforecomputers or the Internet.

How accurate was he? Go towww.dcs.qmul.ac.uk/cs4fn/futurehuman/

to enter.

Have your vote on the cs4fn site…

g Fixed phones?

g Cables?

g Written signatures?

g Loose change?

g Wrist-watches?

g Paper?

g Physical shops?

g Calculators?

g Radios?

3

BrainAcademy: The Compute-

Ability Competition is Back

BrainAcademy the Compute-ability competition with the chance to win degree places aswell as other career-enhancing plug-ins is back.

This year we will also be offering prizes for younger entrants who are not eligible to start University in 2007 – the chance to spend an afternoon in our Augmented-HumanInteraction Lab. and find out first-hand some of the research going on in ComputerScience. The theme this year is “Computer Science and the Entertainment Industry”.For more details see the BrainAcademy website www.brainacademy.qmul.ac.uk/

This year there are prizes for youngerentrants

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use

Snakey Bites Back

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/

QGames is a fun new way of getting gamesfor your mobile phone. It uses artificialintelligence (AI) techniques know asgenetic algorithms to breed a virtual zoo full of evolved versions of the Snake gamerated for how difficult a human player willfind them. To rank the difficulty levelsdeveloper Milan Verma, a student at QueenMary, University of London built a gameplaying computer program with ‘humanlike’ abilities. It 'plays' the game to decideits difficulty. It is based on data from realhuman game players to give it realisticproperties.

The genetic algorithm uses a ‘fitnessfunction’, an approximate way of workingout what level of game playing talent theuser has. It’s a case of survival of the fittest- as with Darwin’s natural selection thatdrives evolution in the natural world. Onlythe best fitting solution for each level ofdifficulty is selected.

A real user plays a few games so the AIcan get a measure of their ability. Milan’sprogram then sends them a game tailoredto their game playing ability. It tailors Snakefor each individual's needs by changinggame play factors like speed, snakecamouflage, environment and snakemobility. QGames is the first time this ideahas been used in a mobile phone.

To learn more about how QGames worksand to get two free sample games, visit the Qwacky site linked fromwww.dcs.qmul.ac.uk/cs4fn/ Updates areavailable via WAP and GPRS technology.

Milan has bred

a zoo full

of evolved

versions of

a game

4

“QGames takes the human versus machine competition straight into your

pocket; it’s great fun to play and you never know what trick the AI will try to

use to defeat you next time.”

Harry Potter’sInvisibility Cloak

Harry Potter’s invisibility cloak is surelyHogwarts’ magic that science can’t match.Wrap it round you and people just seethrough you as though you weren’t there.Turns out even that kind of magic can bedone with a combination of materialsscience and computer science. ProfessorSusumu Tachi of the University of Tokyohas developed a cloak made of thousandsof tiny beads. Cameras video what isbehind you and a computer system thenprojects the appropriate image onto thefront of the cloak. The beads are made of a special material called retro-reflectrum. It is vital to give the image a natural feel –normal screens give too flat a look, losingthe impression of seeing through theperson. Now you see me, now you don’t at the flick of a switch.

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use

Pilot Error and Space Invaders The TextingMarrakechGame

Another plane crashes with all on boardkilled. The papers blame the pilot. Theofficial report agrees. It was pilot erroragain. But was the pilot really toblame?…and what does this have to dowith cash machines? Would the pilot havestill made the mistake if the cockpit - a verycomplicated computer interface - had beendesigned differently? Or is better trainingthe solution?

This is something that is important forcomputer scientists to know - as if it is thedesign of the human-computer interfacethat is the problem then they can dosomething about it. You can help us findout, just by playing a Space Invaders game.Interested in helping? Find out more onthe cs4fn website.

How to PlayThe aim of the texting Marrakech game isto have texted 3 numbers that add up to 15before the other player. Each player takes itin turn to text the other a number from 1 to9. Text a number already texted and youimmediately lose.

Here’s an example gameYou text: 8Your opponent texts: 5You text: 2Your opponent texts: 4You text: 6Your opponent texts: 7You text: 1and win with 8, 6 and 1 = 15Notice that if you hadn’t texted 6, theopponent could have done and won with5,4 and 6 = 15.

The SecretThe Marrakech Texting game seems toneed you to be amazingly clever at mentalmaths. In fact all you need is to know asimple bit of mathemagic: a magic square.A magic square is just a square of numberswhere each row, column and diagonal addup to the same number.

You can use an ancient magic squareknown as the Loh Shu to help you win theMarrakech Texting Game. Find out how inthe cs4fn webzine:www.dcs.qmul.ac.uk/cs4fn/

Did you know?

The main town square in

Marrakech is called the

Magic Square

Magic Squares were

invented in China.

The earliest one so

far discovered is on a

scroll from 2800 BC.

5

Join the experiment. Play the game.

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/

Exclusive Interview withCyborg Kevin Warwick

6

Our senses are not great compared to otheranimals. Peregrine falcons can see smallprey up to 5 miles away. Polar bears cansmell a seal from similar distances. Manyanimals have senses we do not possess atall, like bats that can sense in ultrasound.

Inventing tools to improve our senses isalmost a defining feature of being human.After all that is all that a pair of glassesdoes. Computer technology can even let us "see" things other than light. Radiotelescopes, for example, let us see distantgalaxies and the combination of theInternet and spy satellite technology allows everyone to look down from space on any street in the world.

All of this technology is disconnectedthough. It doesn't really give ussuperhuman senses any more than sittingin a tank gives us armour-plated skin. Thetechnology turns the signals into somethingour limited abilities can sense. We then justuse our eyes or ears as normal.

Neuroscientists increasingly understandhow our brains and nervous system, thebrain's communication system to the rest of the body, works. Signals from our eyes or fingertips pass down our nerves to the

Could humans ever gainsuper-human powers?Could the blind see withthe help of computers?This is the stuff of sciencefiction comics and films -like Dr Octopus and theX-men or Geordi La Forgefrom Star Trek who couldsee using implants in histemples. Can computerscience make things liketelepathy, dismissed asmagic today, become areality of the future? Wetalked to the world’s firstCyborg, Kevin Warwickabout what it is like tohave super-humansenses.

brain that turns them into understanding of the world around us. Similarly the brainsends messages out down the nerves tocontrol our movements. Our brains are veryadaptable, though. Where the messagescome from originally or ultimately go todoesn't matter too much to the brain...andas they are basically just electrical signalscomputer technology can both detect themand recreate them.

This leads to intriguing questions. Whatwould be possible if we linked computersdirectly to the nervous system or even thehuman brain? Can we “cure” disabilities?Could we have super-human senses? Couldwe sense in ultrasound like a bat and whatwould it actually feel like? If the computerswere linked to the Internet, could it literallytake our senses further: outside our bodiesaltogether? Is any of this even remotelypossible?

“Sitting in atank does not give you armourplated skin”

Conjuring Cyborg Super Senses:

Exclusive Interview withCyborg Kevin Warwick

This all sounds like science fiction or magicbut it has already happened. They are thekinds of question Cybernetics Professor,Kevin Warwick of Reading University(www.kevinwarwick.org/) is interestedin...and he actually turned himself into the world's first cyborg to find out answers.

A team of neuroscientists implanted a chipdirectly into the nerves of his arm. It sensedthe electrochemical signals travelling alonghis arm from his brain and transmittedthem to a computer. The computer couldalso send signals to the implant. They thentravelled along the nerves of his arm to hisbrain just like the normal sense signalswhen he touched something.

By connecting the computer to anultrasound detector, with the signals from itbeing sent via the implant to his brain, hecould literally feel objects moving towardshim even when blindfolded. His brain learntto interpret the signals from the ultrasound.He really had gained a completely newsense.

The implant was also connected to theInternet. For example, a robot arm copiedhis arm movements by sensing the signalsbetween his brain and his hand as heflexed his fingers...even though he was inNew York and the robotic hand in England.

What does it feel like?According to Kevin:"Controlling a robot hand on a differentcontinent with my own brain signals wasreally weird, especially when I could feelhow much force the hand was applying.Even after thinking about this for some timeI cannot fully imagine the extent ofpossibilities. Essentially your bodycan be any physical shape orsize whatever that means."

A student made a light-necklace for Kevin’swife, Irena, to wear. When he was relaxedthe necklace sensed this via the implantover the Internet and was a cool blue.When he was excited however, his wifewould know as her necklace glowed red asa result...even when she was in Londonand he was still in Reading. When she laterhad probes inserted into her arm, shedidn't need to watch the necklace. Shecould directly feel the signals from his armand vice versa, allowing them tocommunicate directly nervous system tonervous system.

Kevin is excited as towhere this could lead:"One of my heroes is Alexander GrahamBell, so when my wife and I succeeded

with the direct nervous system to nervous systemcommunication experiment itwas the most exciting thing

imaginable. With a

blindfold on, my brain received neuralpulses that originated from my wife'snervous system. Who knows where this willlead? Hopefully to thought communication,so maybe we won't need speech in thefuture."

The next step is to place implants not inthe arm but directly in the brain. The use of brain implants is actually already quitewidespread to help some people withParkinson's disease live a normal life again.What hasn't been done is to connect brainimplants to the Internet and so connecthuman's brains directly together. Thatraises even more amazing questions thatwere previously only the realm of sciencefiction and pseudoscience. Can moreadvanced forms of this technology make"telepathy" a reality? Could a humandirectly sense the thoughts of another, and if so what would it be like?

We could soon know.

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use 7

The famous inventor of the telephoneAlexander Graham Bell was born in 1847in Edinburgh, Scotland. His story is afascinating one, showing that like all greatinventions, a combination of talent, timing,drive and a few fortunate mistakes arewhat’s needed to develop a technology thatcan change the world.

A talented ScotAs a child the young Alexander GrahamBell, Aleck, as he was known to his family,showed remarkable talents. He had theability to look at the world in a different way,and come up with creative solutions toproblems. Aged 14, Bell designed a deviceto remove the husks from wheat bycombining a nailbrush and paddle into arotary-brushing wheel.

Family talkThe Bell family had a talent with voices. Hisgrandfather had made a name for himselfas a notable, but often unemployed, actor.Aleck’s mother was deaf, but rather thanuse her ear trumpet to talk to her likeeveryone else did, the young Alexandercame up with the cunning idea thatspeaking to her in low, booming tones veryclose to her forehead would allow her tohear his voice through the vibrations hisvoice would make. This special bond withhis mother gave him a lifelong interest in the education of deaf people, whichcombined with his inventive genius andsome odd twists of fate were to change the world.

A visit to London,and a talking

dog

While visiting London with his father, Aleckwas fascinated by a demonstration of SirCharles Wheatstone's "speaking machine”,a mechanical contraption that madehuman like noises. On returning toEdinburgh their father challenged Aleckand his older brother to come up with amachine of their own. After some hardwork and scrounging bits from around theplace they built a machine with a mouth,throat, nose, movable tongue, and bellowfor lungs, and it worked. It made human-like sounds. Delighted by his success Aleckwent a step further and massaged themouth of his Skye terrier so that the doggrowls were heard as human words. Prettyruff on the poor dog.

Speaking ofteachingBy the time he was 16, Bell was teachingmusic and elocution at a boy's boardingschool. He was still fascinated by trying tohelp those with speech problems improvetheir quality of life, and was very successfulin this, later publishing two well-respectedbooks called The Practical Elocutionist andStammering and Other Impediments ofSpeech. Alexander and his brother touredthe country giving demonstrations of theirtechniques to improve peoples’ speech. Healso started his study at the University of

London, where a mistake in readingGerman was to change his life and lay thefoundations for the telecommunicationsrevolution.

A ‘silly’ Germanmistake thatchanged theworldAt University, Bell became fascinated bythe ideas of German physicist HermannVon Helmholtz. Von Helmholtz hadproduced a book, On The Sensations ofTone, in which he said that vowel sounds,a, e, i, o and u, could be produced usingelectrical tuning forks and resonators.However Bell couldn’t read German verywell, and mistakenly believed that VonHelmholtz's had written that vowel soundscould be transmitted over a wire. Thismisunderstanding changed history. As Belllater stated, "It gave me confidence. If I hadbeen able to read German, I might neverhave begun my experiments in electricity.”

The time formore than dotsand dashes His dreams of transmitting voices over awire were still spinning round in his creativehead. It just needed some new ideas tospark him off again. Samuel Morse had justdeveloped Morse Code and the electronictelegraph, which allowed single messagesin the form of long and short electronicpulses, dots and dashes, to be transmittedrapidly along a wire over huge distances.Bell saw the similarities between the idea ofbeing able to send multiple messages andthe multiple notes in a musical chord, the“harmonic telegraph” could be a way tosend voices.

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/8

Its good to talk:

Alexander Graham Bell

See thewebzinefor thestory ofhow

computer science student Lila Harrar was also inspiredby a deaf friend... and she has ended up with a commercial product.

ChanceencounterAgain chance played its roll intelecommunications history. At theelectrical machine shop of Charles Williamsin the USA, Bell ran into young ThomasWatson, a skilled electrical machinist ableto build the devices that Bell was devising.The two teamed up and started to worktoward making Bell’s dream a reality. To make this reality work they needed toinvent two things: something to measure a voice at one end, and another device toreproduce the voice at the other, what wewould call today the microphone and thespeaker.

The speakeraccidentJune 2, 1875 was a landmark day for teamBell and Watson. Working in theirlaboratory they were trying to free a reed, asmall flat piece of metal, which they hadwound too tightly to the pole of anelectromagnet. In trying to free it Watsonproduced a ‘twang’. Bell heard the twangand came running. It was a sound similarto the sounds in human speech; this wasthe solution to producing an electronicvoice, a discovery that must have come asa relief for all the dogs in the Boston area.

The mercurymicrophoneBell had also discovered that a wirevibrated by his voice while partially dippedin a conducting liquid, like mercury orbattery acid, could be made to produce a

changing electrical current. They had adevice where the voice could betransformed into an electronic signal. Nowall that was needed was to put the twoinventions together.

The firstemergency call On March 10, 1876, Bell and Watson setout to test their new system. The story goesthat Bell knocked over a container withbattery acid, which they were using as theconducting liquid in the ‘microphone’.Spilled acid tends to be nasty and Bellshouted out "Mr. Watson, come here. Iwant you!" Watson, working in the nextroom, heard Bell's cry for help through thewire. The first phone call had been made,and Watson quickly went through to answerit. The telephone was invented, and Bellwas only 29 years old.

The worldlistensThe telephone was finally introduced to theworld at the Centennial Exhibition inPhiladelphia in 1876. Bell quoted Hamletover the phone line from the main building100 yards away, causing the surprisedBrazilian Emperor Dom Pedro to exclaim,"My God, it talks", and talk it did. Fromthere on, the rest, as they say, is history.The telephone spread throughout the worldchanging the way people lived their lives.Though it was not without its socialproblems. In many upper class homes itwas considered to be vulgar. Many peopleconsidered it intrusive (just like somepeople’s view of mobile phones today!),

but eventually it became indispensable.Bell became rich and famous, and he wasonly in his mid thirties. The Bell telephonecompany was set up, and later went on tobecome AT&T one of Americas foremosttelecommunications giants.

Can’t keep a

good idea down

Inventor Elisha Gray also independentlydesigned his own version of the telephone.In fact both he and Bell rushed theirdesigns to the US patent office within hoursof each other, but Alexander Graham Bellpatented his telephone first. With themassive amounts of money to be madeElisha Gray and Alexander Graham Bellentered into a famous legal battle over whohad invented the telephone first, and Bellhad to fight may legal battles over hislifetime as others claimed they hadinvented the technology first. In all the legalcases Bell won, partly many claimedbecause he was such a goodcommunicator and had such a convincingspeaking voice. As is often the way fewpeople now remember the other inventors,though different countries now claim theinvention of the telephone for differentpeople, so there is plenty to talk aboutthere!

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use 9

Read Terry Pratchett’s brilliant bookGoing Postal for a fun fantasy aboutinventing and making money fromcommunication technology on DiscWorld.

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/10

Bad Wolf...or a virus in your head?

Lights,cameras,web page

Back in the summer of 2001, the StevenSpielberg film AI: Artificial Intelligence wasreleased. Along with the standard filmtrailers on the web came rumours aboutsomeone named Jeanine Salla. If yousearched for the name you found a web pagefor a university scientist working onadvanced robotics and artificial intelligence.It all looked very convincing: lists ofscientific papers, a CV, and a full website forBangalore World University. This was just thestart. You could continue the trail and findother sites, drawing you into a world ofrobotic revolution. But the revolution wasn'tabout robots. The sites were fakes. The realrevolution was the emergence of viralmarketing as a tool for marketing movies.

The birth of ViralMarketing

Viral marketing is a different way to raiseawareness of your film or TV show. You don'tshove it forward using the usual posters or TVcampaign. Instead you create a new onlinereality, and wait; someone will find it, andthen they tell their friends, and their friendstell others. They post on bulletin boards andeventually you create an enormous buzz onthe Internet. The low budget horror film TheBlair Witch Project showed for the first timewhat a cost effective and powerful marketingstrategy having a fictional web presence was.It was only a matter of time before thismarketing method became mainstream. Thefictional sites look as real as anything elseon the web; there are layers of secrets anddetails, hidden text, web sites that look as ifthey have been 'hacked', with messageshidden in the source code of the web pages.These virtual worlds have the power to drawyou in.

BBC's BadWolf

A recent example of good viral marketing isin the 2005 BBC TV series Dr Who, whereclues on the mystery surrounding the identityof the 'Bad Wolf' were laid out across severalfictional sites like www.badwolf.org.uk.There were fake sites that were actuallyreferred to in the series(www.whoisdoctorwho.co.uk), a fake site forthe UNIT group (www.unit.org.uk) and for thefictional company Geocomtex that appearedin the show (www.geocomtex.net) Thesesites were not publicised in the early stages.Their presence exploded onto the Internet asfans traded information. The viral marketinghelped make the TV series a resoundingsuccess, and added a whole new dimensionto the series.

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use

11

Watch Out for thenext cs4fn magazine:

a special issue onComputer Science

and Entertainment

A step toofar?

In 2001 Electronic Arts released aninnovative new game called Majestic. Theconspiracy-based game invaded your life andcouldn't be switched off; you give it yourphone number, fax number and e-mailaddress. Strange faxes arrive, odd phonecalls occurred at strange times andmysterious emails arrived. The line betweengame and reality blurred, as the designersmade use of all the electronic forms ofcommunication available to make the gameplay real. Surprisingly however the gamewas not a success. In fact it was shut downhalf way through costing the company manymillions of pounds. In 2001, the gameplayers of the world weren't ready for that level of immersive reality just yet.

Beyond the web

But there are still games around that are played by mixing fantasy with reality. For example Uncle Roy(www.uncleroyallaroundyou.co.uk/) is agame that links online players worldwidewith players on the real streets of the city,who, using mobile computers search for the mysterious Uncle Roy. This type ofentertainment is set to continue and expandas new technologies become available togive us new ways to communicate and play.

Will games of the future move off the screenand into people’s lives, creating uniquedigital performances?

The future

The creative use of computers and the webin marketing films and television seriesthrough the creation of alternative realitieswill continue, and who knows where it will end. Perhaps in the not too distant futurethe immersive reality that Majestic pioneeredmay join up with the alternative realitiescreated for viral marketing; a get togetherwhich could prove quite a show.

The next season of Dr Who will hit the TVscreens as we go to press in Spring 2006.How will it be publicised? The Cybermenreturn: half human, half machine. Are theyour future humans? We don’t know how thepublicity will go but suggest you look out for web links to Torchwood and CybusCorporation. And K9 the Doctor’s earthboundfaithful robot dog, left with Sarah Jane Smithmakes a surprise return: robot pets our futureor our present? Let us know your views byentering our future human competition. Seepage 3.

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/

Magical Memoriesjust shuffling along

12

The 21-card trick.The Magic effect: Have your friend shuffle a pack of cards and then you deal outsingle cards left to right into 3 piles of 7cards, all face up. Your friend has tomentally select one of the cards. Theymustn’t tell you which card it is, but shouldtell you the pile it is in. You collect up thecards, and deal them out a card at a timeleft to right into three piles once more.Again they tell you the pile their card is in,you collect the cards once more, sayingyou’re struggling to “read your friend’smind”. Deal the cards out across the tablein the three piles again in the same way.Your friend indicates the pile their card is in. Collect the cards again and deal theminto the three piles one last time. Youimmediately announce their card andmagically it is in the very middle position of the pack.

How do you perform the trick? Let’s look at the ‘mechanics’ of the trick. It involves several deals, each apparentlyshuffling the order of the cards, but doingso in a rather cunning way.

In fact it’s really rather simple. All you haveto do is make sure you always put the pileyour friend selects carefully between theother two piles and deal the pack as above.Do that and after the fourth deal the middlecard of the middle pile is the chosen card,which you can reveal as you see fit. Try andwork out why it works, but then go to thecs4fn web site for an explanation.

Magic and Computers- developing your own algorithmsOnce you understand the mechanics youcan play with some ideas. The order of thechosen pile must not be changed, but thetwo other piles could for example beshuffled before being put together. As longas the chosen pile goes undisturbedbetween the two other piles of seven cardsthe order of the other cards doesn’t matter.You might want to try and come up withyour own additional twists now you knowhow it’s done. The workings of this trick arewhat’s known as an algorithm to computerscientists. The set of steps that you gothrough to get the trick to work are similar to the way that a computer steps through its instructions in a software program.

Brent Morris:Magician andComputer ScientistThe magicians’ art of shuffling in specialways to make tricks, like the 21 card trick,work can also help us build computers.Magicians want to move cards aroundefficiently; computers want to move dataaround in their memory efficiently.

Perfecting the perfect shuffleIn a perfect shuffle, the magician cuts thecards exactly in half and perfectly interlacesthem, alternating one card from each half. It takes years of practice to do but does look impressive. There are 2 kinds ofperfect shuffles: With an out-shuffle the topcard of the deck stays on top. With an in-shuffle the top card moves to the secondposition of the deck. Magicians know that 8 perfect out-shuffles restore the deck to its original order! It looks like the deck has been really mixed up, but it hasn’t.

Computer scientist Brent Morris wasfascinated by magic. In particular hebecame interested in the “perfect shuffle”in high school and has pursued itsmathematics for more than 30 years withsome amazing results. He earned hisDoctorate in Maths from Duke University,and a Master's in computer science fromJohns Hopkins University in the UnitedStates. He is believed to have the onlydoctorate in the world in card shuffling. Healso holds two US patents on computersdesigned with shuffles, and has written abook on the subject called Magic Tricks,

“Pick a card, any card!” How often have you heard magicians say that? The normal routine is thatyou pick a card, the magician shuffles the deck, and abracadabra, reveals your chosen card. But behind this magic often lies some interesting maths, and as we will see later, magicians’ shuffles have actually led to the development of new ways for computers to work. Let’s start with a trick to amaze your friends.

A perfect shuffle in action

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use 13

Card Shuffling, and Dynamic ComputerMemories. Why the interest in perfectshuffles?

Binary shifts - as if by magicYou can use perfect shuffles to move thetop card to any position in the pack, using a little bit of the maths behind computers:binary. Suppose you want the top card (let’s call that position 0) to go to position 6. Write 6 in base 2 (binary), giving 110(1x4+1x2+0x1). Now read the 0's and 1’sfrom left to right: 1:1:0. Then, workingthrough the 1’s and 0’s, you perform an out-shuffle for a 0 and an in-shuffle for a 1. In our case that means:

1: an in-shuffle, first

1: another in-shuffle,

0: and finally, an out-shuffle

As if by magic (if you are capable of doingperfect shuffles) the top card will havemoved to position 6. Of course it workswhatever the number, not just 6.

What does this have to do with the design of computers? You can use exactly thesame ideas to move data efficiently aroundcomputer memory, which is what BrentMorris discovered and patented.

Curtain callSo as you impress your friends with your21-card trick, coming up with your ownperformance ideas and are basking in that applause, remember two things.

Number one: a magician never reveals their secrets.

Number two: computers don’t work byHogwart’s magic … only by mathematicalmagic.

Point, clickand Sodarace

Following on from its successful ‘run’ at the Royal Society summer exhibitionSodarace, the online Olympicscompetition between human andmachine creativity, has taken the next step forward.

Loads of people throughout the worldhave used Sodarace for their school andeven university projects; from art anddesign to physics, chemistry, maths andbiology, the options seem limitless and it’sgreat fun.

So to help make this even easier you can now download simple to use ‘point and click’ software free fromwww.sodarace.net that lets you select theracetrack terrain and the racers for yourcompetitions. It’s now straightforward towatch as your selected human andmachine created racers go head to head;use your scientific skills to predict whichwill win on a particular racetrack (or justhave a guess).

You can also download the first of a range of ‘ready to use’ lesson plans forclassroom activities to try out. Why notask your teachers to give them a go andlet us know how you get on. Keep onracing.

Talk of the Toon

Do you think computers can be creative likehumans? They are good at repetitive tasksthat are just too boring for humans to do,searching the web for pages on fashion tips or football scores. They can even playsome games like chess better than humans.That’s just done by searching through morepossible moves than a person can. Doesthat count as creative? It doesn't seem, so. How about drawing? Cartoonists arecreative people. If a computer could drawcaricatures of people as well as humanartists do, would that count as beingcreative? Queen Mary, University of London,computer science undergraduates, LilaHarrar and Akbar Hussain decided to findout. As part of their course, they created anArtificial Intelligence program based on theBAFTA award winning SodaConstructor,which draws cartoons of people. It works bychoosing the most distinctive features of aface and exaggerating them just as humancartoonists do. At the Royal Society SummerExhibition it was so successful they evenhad a Robot trying it out. You can get the AI to do a caricature of you atwww.dcs.qmul.ac.uk/cs4fn/ and find outhow it sees you, then decide for yourselfwhether it is creative or not.

Orlando Bloom as a Soda Cartoon

It could be you!

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/14

Sounds like musicSo how is the trick done? Well first we needto look at sound and music. Sound is achange in air pressure. When Madonnasings, her vocal cords change the airpressure and the sound wave passes to ourears. Our eardrum converts this wave of airpressure into a mechanical movement inthe tiny bones in our ear. That in turn ischanged into a nerve signal that goes to ourbrain. A microphone works in the same way.The pressure wave moves a part of themicrophone called the diaphragm, and it'sthis movement that turns the soundpressure wave into an electronic signal.When we are recording digital music wetake many millions of very rapid samples -measurements - of the electrical signal andturn them into numbers to store.

Frequency askedquestionsOne of the things that characterises thesound wave is the frequency it is made of.Frequency means a regular repeatingpattern. A very dull sound might just be asingle frequency. The sound gets louderthen softer, say every second, and repeatsthis cycle every second until you switch itoff. This tedious sound would have afrequency of 1 Hertz (1 Hertz means one'cycle' per second). Normal music doesn'tsound at all like this dull repeating noise,but as it happens you can take any soundor music and, using some specialmathematics, convert it into a set of

different frequencies. Each of thesefrequencies alone just sound dull but addedtogether it makes the music. The same ideais used in a music synthesiser; you canmake the sound of any instrument byadding together the right frequencies. So wenow know that our music can be describedas frequencies, and we can start to playtricks.

Ear, earTurns out that our ears, though very clever,don't do everything well. Certain frequencieswill stop you hearing other close byfrequencies. These special frequencies'mask' the presence of the others nearby.Once you know this (it was discoveredthrough lots of experiments on hearing),then you know there is no point in using upvaluable computer memory storinginformation on the frequencies your earscan't hear. So you don't store them. Kazam!You remove these frequencies altogether,but because they were masked by the otherfrequencies you can hear, you don't noticethey have vanished.

Bunny in theheadlightsThere is another cunning effect you canuse. When we look at a bright light, for awhile afterwards, we can’t see a dim light.Our eyes change so we aren't dazzled bythe bright flash, but this leaves our ability tosee dimmer lights reduced forsoeome time.The same thing happens with sounds. Aloud sound will stop you hearing a quietersound that follows just after. So we can lookat the digital music signal and work out allthe places where a loud sound is followedby a quiet sound, and then cut the quietsound out. This saves computer memory,and again the trick is that your ears won'tnotice the quieter sound is missing.

Sonic sleight of handIt's using these tricks to vanish those partsof the sounds your ears won't notice aremissing that gives MP3 its great ability tocompress music. We need to store less databut the music sounds just as good. To beable to give the world MP3, ComputerScientists needed to work on ways to do themaths, as well as understand how our earswork. So the next time you listen to yourMP3 player just think of all the maths andcomputing making up the wonderful din.

The ‘magic’ of MP3

Believe it or not, your MP3 player is actually playing a sonic magic trick on you. MP3 is a format, a way of storing sounds and music so that they take up as little memory in the computer as possible. That way you can have hundreds of your favourite tracks on your iPod, which is really just a small computer disc that stores the digital music. The trick is to find a way to remove some of the sound information without your ears and brain noticing. The computerscientists who developed MP3 are playing a trick on your ears.

Sonic sleight of hand :

The ‘magic’ of MP3

Yeh but no but...Read about

compressing VickyPollard in the

webzine

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use 15

It would be magical to be able to teleport: Star Trek’s transporter was a clever device thatallowed the characters to teleport from theirspaceship to the planet.Devised by GeneRodenberry, Star Trek'screator as a way to avoidthe costly special effectsof landing spaceships in the TV series, thetransporter became thekey to many an episode. In effect, the transporter scans thepassenger’s atoms, disintegrating them intoenergy, then transmitting the energy torecreate a copy of that "pattern of atoms” on the planet below. It's a nice idea but thephysics is frightening, disintegrating atomsand turning them into energy is exactly whata nuclear bomb does, and a nuclear bombonly converts a tiny fraction of matter toenergy. If we really want to be able to createcopies of ourselves at a distance we need tothink of less explosive methods.

It is just this problem that computerscientists in the USA at the Carnegie-MellonUniversity Synthetic Reality Project arelooking at. Their solution: a new sciencecalled Claytronics. By using tinyprogrammable machines they hope todevelop 'programmable matter', wheremillions of tiny devices called "claytronicatoms" or "catoms" would assemble into theshape of any object you want, connecting

and disconnecting as theymove. Currently they havedeveloped experimentalcatoms that connect andmove via magnets. Theseearly devices are aroundfour centimetres in size,much larger than the sizethe team want to develop,but you have to startsomewhere.

The challenges are both in the technology, how doyou build these tiny catoms,but also in the programming,how do you instruct billions oflittle machines to build a movingcopy of yourself from the goo? Inthe future, if these problems aresolved, we can imagine a worldwhere you can transmit yourself to ameeting where the claytronics willbuild a copy of you, much like thesmart liquid metal of the T-1000Terminator android in the filmTerminator 2 Judgement Day. Onceyour meeting is over, your duplicate willmelt away and the claytronicprogrammable matter will reassemble intowhatever it is next instructed to become.

Claytronics -from goo to you?

The physics is

frightening ...

exactly what

a nuclear bomb

does

Claytronics -from goo to you?

From goo to you

…since the dawn of

timeDoes a robot that can assemble itself out of particles soundfar-fetched? Something similar can already be done in theanimal world…and by the oldest animal of all – the sponge. A sponge’s body is made up of a loose assemblage ofseparate types of cells that cooperate – more like acolony of cells rather than a single animal…and justlike the claytronics idea. How good are sponge cellsat assembling? Put different species of spongesin a liquidizer. Once liquidized, drop them backinto seawater and the cells that havesurvived of the different sponges willreassemble back into sponges again.Often computer scientists use theinspiration of the way animals dothings to create advancedtechnology.

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/16

tlhIngan HolDajatlh'a' (Do youspeak Klingon)Language is something we take for granted. We learn it as a child, maybe study a new language at school, or pick up some choice phrases for a holiday trip. Alanguage consists of words - the bits it is made of - and grammar - the way thesebits are put together. "The cat sat on the mat" makes sense. "Cat mat on sat the"doesn't. We have the same words but the rules of grammar are broken ... theinformation is lost. This confused list of words still follows a rule: the words arearranged alphabetically. But without the right rules, the rules of grammar, the wordscan't do what they need to do, which is let us know where that pesky cat is.

possible for human programmers toprogram. BASIC, Beginners All SymbolicInstruction Code was an early attempt.That's why, for example, there are universitycourses on Computer Science andLinguistics. The two are very closely related.

The Universal Translator?There are now computer programs thattranslate human languages. You may haveseen these on the Google or Babel Fish websites for example. What is happening here is that, to translate say French text intoGerman, the French is first translated to alanguage the computer understands andcan work with. The text in that computerlanguage is then translated back intoGerman ... so it's passed through thatstrange alien binary language of thecomputer somewhere in between. Of courseits very basic, Google just uses a simpleapproach to translation, but there are manyresearchers around the world trying todevelop software that takes into account the complex rules of human languages andgrammar. Some systems even try to learnlanguages from scratch like a child, in effect trying to produce the universaltranslator similar to the idea in Star Trek,which can translate any language toEnglish. (Of course it would be easier to usethe TARDIS telepathic circuits like Dr Who... a small summer project there for anyoneinterested:-)

computer language that WE understandmeans we don't need to talk the nasty aliencomputer lingo. The language instructiontells the computer to find a place in itsmemory, which the programmer wants to call X and to put 2 in there.

So to programming languagesThe programmer’s language is translated to the language the computer uses byfollowing a list of instructions. In the sameway as with a human language, if we getthe grammar wrong and say typed '=LET 2X' the computer wouldn't know what to do,the information is there but the grammar iswonky. So computer languages developedfollowing many of the rules of humanlanguages to try and keep it as easy as

When we have to communicate with acomputer and give it instructions wewant to make life easy for ourselves. Inthe beginning programmers were forcedto use binary – lists of 1's and 0's to tellthe computer what to do. That's becausecomputers are really just a very complexbox of switches, and the 1's and 0's toldthe computer which parts of its circuitsto switch on and off, but it made writingthe programs a nightmare. It was askingyou to speak in an alien tongue.

A better way to communicatewith our computers Something had to change, so those long-suffering programmers looked to whatthey knew best, human languages, tofind a solution. In the same way as aword is made up from letters you couldstart to think of lists of binary instructionsthat you could associate together into asimple command to which you couldattach some meaningful name. So ratherthan tell the computer in 1's and 0's('0101010' say) to put a particular set ofvalues into a particular circuit, you coulduse the phrase 'LET X=2' to mean thesame. The computer understands how toturn a number into binary. It knows that2 is 10 in binary (that means take a twoand add no ones to it, just like a normaldecimal 10 means take a ten and addno ones), so this useful idea of a

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use 17

Synthetic LanguagesWe tend to think of human languages asalways having been around in their currentform, and computer languages as new, buthuman languages need to have developedfrom somewhere, and that's anotherfascinating story where computers havehelped. Some people have even created theirown spoken languages such as Esperanto.The basic rules and words of Esperanto wereproposed by LL Zamenhof at the end of the19th century. The idea was to create a worldlanguage that everyone could speak. It neverreally took off, though there are still manypeople who learn it and use it.

Which brings us to Klingon, a made uplanguage from Star Trek developed by MarcOkrand, (see the Klingon Language Instituteat www.kli.org/). It has words, a fixedgrammar and there are lots of 'nativespeakers' out there, so you guessed it ...there are programs that translate English toKlingon. It's interesting to think that asoftware program to translate a made upalien language does it by using its ownmade up alien language in the computer. AsMr Spock would say 'Quite Fascinating!'

Qapla’ (“Success!”)

Let’s look at an exampletranslation:Above is some original arabic with itstranslation below:

Machine Translation: Baghdad 1-1 (AFP) – The official Iraqi newsagency reported that the Chinesevice-president of the RevolutionaryCommand Council in Iraq, IzzatIbrahim, met today in Baghdad,chairman of the Saudi ExportDevelopment Center, AbdelRahman al-Zamil.

Human Translation: Baghdad 1-1(AFP) – Iraq's official news agencyreported that the Deputy Chairmanof the Iraqi Revolutionary CommandCouncil, Izzet Ibrahim, today metwith Abdul Rahman al-Zamil,Managing Director of the SaudiCenter for Export Development.

This example shows a sentence from anArabic newspaper then its translation by theQueen Mary, University of London’sstatistical machine translator, and finally a

translation by a professional humantranslator. The statistical translation doesallow a reader to get a rough understandingof the original Arabic sentence. There areseveral mistakes, though. Mistranslating the"Managing Director" of the exportdevelopment center as its "chairman" isperhaps not too much of a problem.Mistranslating "Deputy Chairman" as the"Chinese vice-president" is very bad. Thatkind of mistranslation could easily lead toproblems. That reminds me of the point inThe Hitch-Hiker’s Guide to the Galaxywhere Arthur Dent’s words "I seem to behaving tremendous difficulty with mylifestyle," slip down a wormhole in space-time to be overheard by the Vl’hurgcommander across a conference table.Unfortunately this was understood in theVl'hurg tongue as the most dreadful insultimaginable, resulting in them waging terriblewar for centuries.…

For now the human’s are still the besttranslators but the machines are learningfrom them fast!

Traditionally machine translation has involvedprofessional human linguists manually writing lots oftranslation rules for the machines to follow. Recentlythere have been great advances in what is known asstatistical machine translation where the machinelearns the translations rules automatically.

It does this using a ‘parallel corpus’: just lots of pairs ofsentences; one a sentence in the original language, theother its translation. Parallel corpora are extracted frommulti-lingual news sources like the BBC web site whereprofessional human translators have done thetranslations.

FootnoteIn the interests of Galactic Peace it shouldalso be pointed out that there are alsoprograms that translate English into Vulcan,Romulan, Ewok, Wookie, Ferengi ...

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/18

What makes a judgeFirst let’s describe a basic judge. We willcreate a plan, a bit like an architect’s plan of a building. It can then be used to buildindividual judges. What’s the X-factor thatmakes a judge a judge? First we need todecide on some characteristics of judges.We can make a list of them. The only thingcommon to all judges is they have differentpersonalities and they make judgements on people. Let’s simply say a judge’spersonality can be either supportive or rude,and their judgements are just marks out of10 for whoever they are watching.

Character : SUPPORTIVE OR RUDE.Judgement : 1 TO 10.

So let’s start to specify (describe) Judges aspeople with a personality and capable ofthinking of a mark.

DESCRIPTION OF a Judge:Character personality.Judgement mark.

All we are saying here is whenever wecreate a Judge it will have a personalcharacter (it will be either RUDE orSUPPORTIVE). For any given judge we willrefer to their character as “personality”. Itwill also have a current judgement, whichwe will refer to as mark: a number between1 and 10.

Best BehaviourWe are now able to say whether a judge isrude or supportive, but we haven’t actuallysaid what that means. We need to set outthe behaviours associated with being rudeand supportive. To keep it simple, let us saythat the personality shows in the things theysay. A rude judge will say “You’re adisgrace” unless they are awarding a markabove 8/10. For high marks they willgrudgingly say “You were ok I suppose”.

TO Speak:IF (personality IS Rude) AND

(mark <= 8)THEN SAY “You’re a discrace”.

IF (personality IS Rude) AND (mark > 8)

THEN SAY “You were ok I suppose”.

It would be easy for us to give them lots more things to choose to say in a similar way.We can do the same for a supportive judge.They will say “You were stunning” if theyaward more than 5 out of 10 and otherwisesay “You tried hard”.

Ten out of TenThe other thing that judges do is actuallycome up with their judgement. We willassume, to keep it simple here, that theyjust think of a random number – essentiallythrow a 10 sided dice under the desk withnumbers 1-10 on. Judges’ decisions cansometimes look like that on TV!

TO MakeJudgement:mark = RANDOM (1 TO 10).

Putting that all together to make our fulljudge description we get:

Our final plan formaking judges

DESCRIPTION OF A Judge:Character personality.Judgement mark.

TO Speak:IF (personality IS Rude) AND

(mark <= 8)THEN SAY “You’re a discrace”.

IF (personality IS Rude) AND (mark > 8)

THEN SAY “You were ok I suppose”.

IF (personality IS Supportive) AND (mark > 5)

THEN SAY “You were stunning”.

IF (personality IS Supportive) AND (mark <= 5)

THEN SAY “You tried hard”.

TO MakeJudgement:mark = RANDOM (1 TO 10).

Strictly X-FactorTV talent shows like X-Factor,or Soapstar Superstars havealways been popular. Its notjust the talent on show thatmake them must see TV – it’s having the right mix ofpersonalities in the judgestoo. Simon Cowell has made a career of being rude – evenreaching the dizzy heights ofa guest appearance on TheSimpsons. In contrast judgeSharon Osborne’s on screenpersona is far moresupportive. It’s often thetension between the judgesthat makes good TV.

However, if you believe DrWho, the future of gameshows will be robot judges like AnneDroid in the spaceage version of The WeakestLink…let’s look at the robotfuture. How might you goabout designing computerjudges? We need to write a program. We don’t want to have to describe new judges fromscratch each time. We want to do as littleas possible to describe each new one.

19

Kind words for ourcontestants?Suppose now we want to create a rude judge, called SimonCoward. We can use the plan. We need to say what itspersonality is (Judges just think of a markwhen they actually see an act so we don’t have to give a mark now.)

SimonCoward IS A NEW Judge WITHpersonality Rude.

This creates a new judge calledSimonCoward and makes it Rude. We could similarly create a rude AnneDroid:

AnneDroid IS A NEW Judge WITHpersonality Rude.

For a supportive judge that we decide to callSharONN we would just say:

SharONN IS A NEW Judge WITHpersonality Supportive.

Whereas in the specification we aredescribing a plan to use to create a Judge,here we are actually using that plan andmaking different Judges. So this way wecan quickly and easily make new judgeclones without copying out all thedescription again.

A classless society?Computer Scientists are lazy beings – if theycan find a way to do something that involves

less work, they do it, allowing them to stayin bed longer. The idea we have been usingto save work here is just that of describingclasses of things and their properties andbehaviour. Scientists do that a lot:

Birds have feathers (a property) and layeggs (a behaviour). Spiders have eight legs (a property) andmake silk (a behaviour)

We can say something is a particularinstance of a class of thing and that tells usa lot about it without having to spell it all outeach time (even for fictional ones): eg

Hedwig is a bird. (so feathers and eggs)Charlotte is a spider. (so legs and silk)

So we can now create judges to our heartscontent, fixing their personalities and putting the words in their mouths based on our single description of what a Judge is.

All ChangeWe have specified what it means to be arobotic judge and we’ve only had to specifythe basics of Judgeness once to do it. Thatmeans that if we decide to change anythingin the basic judge (like giving them a betterway to come up with a mark than randomlyor having them choose things to say from a big database of supportive or rudecomments) changing it in the plan will apply to all the judges of whatever kind.

What we have created is our first object-based program – it would be relatively easy to convert this into a program in aprogramming language like Java or C#.

We could create robot performers in asimilar way (after all don’t all the winnersseem to merge into one in the end?). We would then also have to write someinstructions about how to work out who won– does the audience have a vote? When dojudges make judgements? When can theyspeak their mind? How many get knockedout each week? That’s no harder. Why notgive it a try and judge for yourself?

So how does a SharONNJudge have daughterKeLEE judges without any help from Ozzie? Seewww.dcs.qmul.ac.uk/cs4fn/

Email us at [email protected]

Feel free to photocopy pages from cs4fn for personal or class use

Passionate about computer science?

www.dcs.qmul.ac.uk/cs4fn/

Sodarace and the Human Error Modelling Project are funded by EPSRC

cs4fn Paul Curzon, Peter McOwan, Gabriella Kazai and Christof Monz of the Department of Computer Science,Queen Mary, University of London. Keypad photos by Ferenc Kazai. Proof reading by Sue White.

Back (page) to the drawing board.

You may have heard the termsoftware engineering. Buildinga complex computer program is like building any complexmachine or structure. It takesskill, professionalism, team-work and the ability to learnfrom your mistakes. Every type of engineering throughouthistory has had its share ofdisasters. Early steam enginesexploded, the Titanic famouslysank, the Hindenburg airshipcaught fire, and the Tay Bridgein Scotland fell down.

Software engineering is nodifferent. Here are a few of itsdisasters to learn from (morein the cs4fn webzine):

The Ariane 5 Rocket

(problems with big numbers

in small spaces, 1996)

In 1996 an Ariane 5 rocket exploded fortyseconds after lift-off. The project had taken10 years, and cost $500 million. Thisspectacular software failure was due tosqueezing a big number into the computermemory reserved for a small one. Therewasn’t enough space to hold the rocket’sspeed when it was passed to another smallermemory store. This caused the rocket to veer off course, break up and explode.

The moral: Make sure numbers fit theirdestinations.

Mars Climate Orbiter

(a weighty problem

in space, 1999)

Programmers work in teams to build softwarefor a space mission. Unfortunately for NASA’s$125 million Mars Climate Orbiter, two teamsdidn’t know what the other was up to. Oneteam was using Imperial weight measures(pounds). The other was using metric(kilograms). The mistake wasn’t found until,when finally in space, the two programs spoketo each other, got very confused and causedthe spacecraft to become lost in space.

The moral: software engineering is alsoabout team communication

AT&T Crash (The day

the phones stopped

working…all of them, 1990)

In late 1989, AT&T engineers upgraded thesoftware of their 114 US switching centres:the computers that make the connections soyour phone links to the one you are calling.Each computer was duplicated so if one went wrong the other would takeover. On January 15th 1990, they stoppedworking: 70 million calls failed. The problem was in a single line of code out of millions…and it was in both computers’copies. AT&T lost $1 billion as customersfled to their competitors.

The moral: with software, duplication doesn’t always help

USS Yorktown Stops

(a big something caused

by nothing, 1998)

Dividing by zero is a bad idea. The answerdoesn’t exist. However a crewmember of thecomputer controlled guided-missile cruiserUSS Yorktown mistakenly entered a zero ontheir console. It resulted in the computerprogram trying to do an impossible divide by zero. The program crashed and caused afailure in other linked computer systems onthe ship, eventually shutting down the ship'sengines, leaving it drifting for hours.

The moral: always check numbers are as expected.

The Pentium Chip Error

(not enough numbers in

the table, 1994)

The Pentium Chip used a look up table (LUT) to do division; basically it uses a pre-calculated set of numbers to speed things up. The LUT should have contained 1066elements, but when the numbers weredownloaded a bug in the software only put in 1061 of them. No one checked, andthe chip went to manufacture with thosenumbers missing. When the mistake wasfound the chips all had to be replaced. The cost was more than $4 billion.

The moral: keep testing all the way.

The missing American

Patriot Missile (a problem

with bad timekeeping,

1991)

In 1991, during the first Gulf War, anAmerican Patriot Missile battery in Dharan,Saudi Arabia, failed to shoot down anincoming Iraqi Scud missile. The Scudmissile hit an army barracks with manycasualties. State-of-the-art computerscontrolled the Patriot missile, but there was a problem. To work Patriot needed toaccurately know the time. This was donewith an internal clock that started to tickwhen the computer was first switched on.However the computer program, whenconverting the internal clock time into thetime used by the guidance system introduceda tiny mistake. It rounded the number downslightly. With each passing second the errorbecame larger until finally it was enough tomake the missile miss.

The moral: small mistakes in calculationsoften build into big mistakes

And Finally expectthe unexpected

In the early days of electronic computersthey used relays, electromechanical switchesthat rocked up and down to switch theelectrical circuits. Grace Murray Hopper, who was in charge of the team working with the Mark II computer, (an early electro-mechanical device), found that a moth hadflown through the window and blocked one ofthe relays, so shutting the system down. Thisis arguably where the term computer ‘bug’comes from.

The moral: The things some moths get into can be shocking!

Microsoft provide support for printing.

Bignumberscan hurt

Bugs cankill