A pack of cards and a little calculated hocus-pocus

PETER 2.bmp

This weeks guest blogger, Peter McOwan, is currently a Professor of Computer Science and Dean for Taught Programmes in Science and Engineering at Queen Mary, University of London. His research interests are in visual perception, mathematical models for visual processing, in particular motion, cognitive science and biologically inspired hardware and software. He is also active in science outreach through various projects such as cs4fn and Sodarace. Peter was awarded a National Teaching Fellow in 2008 by the Higher Aducation Academy.

Since I was a kid I’ve been fascinated by magic, the way that you can use science and maths to make it look as if you’re breaking the rules of the natural world. Way back I remember being amazed with diagrams in old magic books from my local library showing how the Victorians created ghosts on stage using sheets of glass, or how you could pour a colourless liquid into a glass and it would turn to ‘wine’ or ‘milk’, (all done not with mirrors, but with physics and chemistry). My favourite tricks were the ones where the ‘secret’ was in the hidden maths. With a pack of cards I could entertain my friends and family, being able to perform seemingly impossible feats of mind reading or memory; as a kid that was cool!

Fast forward to the present day; my interest in science and maths led me through various earlier incarnations to being a professor of computer science, researching into biologically inspired artificial intelligence (I also loved Dr Who and Sci Fi on TV, but that’s another story…). Computer science, the study of information and how we process it is, I believe, at the core of understanding the modern world round us. In the past we needed physics chemistry and biology; now we also need computer science. If you look at it, computer science underpins much of the progress in diverse scientific endeavors, for example bioinformatics or climate change, it is also fundamental to our economic prosperity, banking and businesses. It’s computer science that today lets us work, rest and play. But computer science also has a significant ‘image’ problem. The fundamentals are often hidden in our everyday devices, it’s considered to be filled with socially inept ‘geeks’ , it’s seen as too hard or dull, with a low uptake of students at all levels and an almost invisible profile with the public. Why were people not getting it?! It perhaps needed a bit of magic.

With my colleagues Paul Curzon and Jonathan Black I set about applying my knowledge of magic techniques to create a series of entertaining tricks the hidden secrets for which were some fundamental computer science principles. In the same way as those Music Hall illusions from the past had inspired me to study science, we would create tricks to inspire people to explore computing. It wasn’t that hard, in the back of my mind during my scientific career I’d come across techniques that I realised were used in the mathematical based tricks I loved, I just never thought those links would be useful.

One of the first moments of magical ‘fusion’ was with computer assisted tomography, the Radon transform technique which is used to back project and reconstruct 2D images from an angular sequence of 1D scans clicked, it was exactly the same idea that was used to construct forcing matrixes as used by mentalists. The more I looked the more I realised that a whole load of magic tricks involved computer sciency things like binary searches, Markov sequences and so on. These ideas had been developed by magicians, and by scientist separately but they used the same principles. I was intrigued and started to do more research. To my surprise I discovered that there were a number of famous magical effects that had been developed by computer scientists.

Alex Elmsley, who created the wonderful slight of hand move called the Elmsley Count (perfecting which had taken many days of my youth) was actually a Cambridge computer scientist – his famous 16th card trick was a binary search algorithm!

Then I discovered Dr Brent Morris, who has probably the only doctorate in the world in card shuffling with the snappy title of “Permutations by Cutting and Shuffling: A Generalization to Q Dimensions.” Brent was an amateur magician who had practiced long and hard to perfect the Faro (or so called perfect shuffle), where a pack is split in two and weaved together so that the cards interlock alternatively one by one with each other. It’s inspiring to see (I’m still practicing!). The Faro shuffle was known by magicians of old as being a way to shift a card from one position in the pack to another while looking like you’re shuffling the deck. Brent spotted that if you understood the maths of how to move things around you could equally apply the method to efficiently moving data in a computer memory instead of sneakily shifting cards. It got him his computer science doctorate and also two U.S. patents on computers designed with shuffles. I was impressed!

So with all of these fascinating stories of amazing people and equally amazing secrets, we set about writing our first Magic of Computer Science book, hoping that it would catch the imagination, and it did. We traveled the UK doing magic shows, entertaining and educating. The books was translated into Welsh, Italian and German, so we wrote another.

This time we used it to make the point that good software needs both a good mathematical algorithm but also an understanding of how human brains work. This is the all important software usability agenda and it linked with some lovely magic. Magicians for centuries have known how to confuse their audience – its called misdirection – they point left and do something sneaky on the right. Magicians deliberately get you to make mistakes. Understanding how that happens means that you can reverse the procedure and build better software for use in safety critical situations like hospitals, so that the users are directed to pay attention to what’s important.

You would expect that strange out-of-this-world type things happen in magic, and they do! We ended up helping private space explorer and computer games designer Richard Garriott design science based magic tricks to perform on his 2008 visit to the International Space Station (yet another scientist who loves magic). The magic is working.

Finally a blog on magic wouldn’t be complete without a trick…

Shuffling cards.bmpShuffle a deck of cards. Spread the cards on the table face down. Now think of the colour RED and select any 8 cards, then think of the colour BLACK and select another 7 cards at random. Now think of RED again, select another 6 random cards, then finally BLACK again and select 5 cards. Shuffle the cards you chose, and then turn the pile face-up. Take the remaining cards, shuffle them and spread them face-down. Now the magic starts. Concentrate. You are going to separate the cards you selected (and that are now in your face-up pile) into two piles, a RED pile and a BLACK pile.

Go through your face-up cards one at a time. If the card is RED put it in the RED pile. For each RED card you put in your RED pile think RED and select a random card from the face-down cards on the table. Put this card face-down in front of your RED pile. Similarly if the next card is a BLACK card put it face up on your BLACK pile, think BLACK and select a random face down cardand put this face-down card in front of your BLACK pile. Go at it until you run out of face-up cards.

You now have a RED pile and in front of that a pile containing the face-down cards you selected while thinking RED. You also have a BLACK pile in front of which is a pile of cards you selected while thinking BLACK.

Interestingly your thoughts have influenced you choice of random cards! Don’t believe me? Look at the pile of cards you chose and put in front of your RED pile. Count the number of RED cards in this pile. Now look at the cards in front of your BLACK pile, and count the number of BLACK cards you selected. They are the same! You selected the same number of RED and BLACK cards totally at random! Amazing.

And for our next trick, wait and see…

The magic books mentioned can de downloaded for free here, we also wish to thank EPSRC, Google and Microsoft for their support of our work, they are all magic!

Common sense?

John Farndon

This week’s guest blogger – John Farndon studied earth sciences at Cambridge University and has written more than 300 books on science and nature including How the Earth Works, The Wildlife Atlas, The Practical Encyclopedia of Rocks and Minerals, and the forthcoming The Atlas of Oceans. He also writes extensively on the history of ideas and contemporary and environmental issues, penning such books as China Rises, India Booms, Bird Flu and 101 Facts You Should Know about Food. He was the author of the best-sellers Do Not Open, Do You Think You’re Clever? and The World’s Greatest Idea and his books have been translated into most major languages. He has been shortlisted four times for the Royal Society Prize for Science Books, and for the Society of Authors Education Award. He lives in London.

In a fortnight’s time, I’m giving a talk at the Brighton Science Festival about a recent book of mine entitled ‘The World’s Greatest Idea”, which is an exploration of 50 of the great ideas that have shaped the world.

One of the ideas that features is the welfare state, and in researching the topic I was reminded how groundless assumptions can assume the mantle of ‘common sense’ if repeated enough times.

cutting costs.bmpCurrently, many governments around the world are wondering how to cut welfare budgets. Generous spending on welfare is not only unaffordable in these hard economic times, it is argued; it is a drag on economies, discouraging people from seeking work. And most people assume this is so.

And yet this ‘common sense’ argument has no actual foundation in reality. Welfare systems have rarely acted as a brake on a country’s economy. In nearly all cases, countries that have introduced a welfare system have experienced dramatic economic growth.

After Germany introduced its welfare system in the 1880s, its economy grew rapidly – so rapidly that Britain was shocked to find it had an economic rival for the first time, and right on its doorstep. And in the post-war years, Western Europe has experienced a time of unparalleled prosperity. Moreover, the most prosperous countries, such as Sweden and Germany, are those with some of the most generous welfare provision.

Similar myths have been perpetuated in the field of science. Do you, for instance, assume that it is scientifically proven that intelligence declines slowly with age? If so, you’re not alone. For a long while, IQ tests did appear to show that younger people did better than old people, and were taken as gospel proof that intelligence declines with age. Yet a re-examination of the evidence shows that this isn’t so for two reasons.

iq tests.bmp

The first was that the IQ tests which showed young people did better were simply a matter of training. Younger people had had more practice of doing the kind of mental tasks tried in IQ tests than older people. As soon as older people were trained in this kind of thinking, their performance levels shot up.

The second reason is that IQ tests were done against the clock. If the time pressure is removed, older people do just as well as their young counterparts – and it is quite reasonably argued that older people are slower simply because their experience means they have to sift through more possibilities to reach the answer.

In fact, these assumptions about IQ and age went further. Psychologists have been telling us for decades that the one thing that your IQ is fixed and unchangeable through life. If you’re intelligent, we were told, you remain intelligent until age begins to sap it. If you were not, you were not, and that was that. Yet there is little scientific evidence that any of this is so. It is just another ‘common sense’ assumption. And recent scientific research has begun to throw doubt on this.

brain power.bmpIt is now becoming clear, for instance, that IQ is closely connected to your working memory, the amount of current data you can store in your head at any one time. Recent research by Torkel Klingberg in Sweden showed that the neural systems used in working memory may actually grow in response to training. What’s more children who completed a training course not only did better in the tests given to them by Klingberg but actually found their scores in IQ tests leap by 8 per cent.

Of course, Thomas Kuhn argued that scientists can never divorce their own personal take on their subject, and that science is inevitably bound within the prevailing outlook. So there is always likely to be a time when any assumption is finally shown to be false. But in the meanwhile it definitely pays to be wary of those who would dismiss your questions on the basis of common sense.

As Einstein observed, “Common sense is the collection of prejudices acquired by the age of 18.”

Does genius follow the ten-year rule?

andrew final.JPG

Our guest blogger this week is Andrew Robinson, the author of over twenty books on both the arts and sciences. They include biographies of Albert Einstein, A Hundred Years of Relativity, and of the polymath Thomas Young, The Last Man Who Knew Everything. He recently published a biographical study, Sudden Genius? The Gradual Path to Creative Breakthroughs.

Gradual preparation with sudden illumination, dogged work with a “eureka” experience, perspiration with inspiration—whichever pair of contrasts one prefers—are defining features of creative breakthroughs in any domain of science or art. In Thomas Edison’s much-quoted remark, from around 1903, “Genius is one per cent inspiration, ninety-nine per cent perspiration.”

I first became interested in genius while writing a biography of the great Indian film director Satyajit Ray in the 1980s. I followed this book with four more biographies in the arts and sciences, including studies of Albert Einstein and the polymath Thomas Young. Eventually, in 2007, I decided to look generally at the relationship between genius and creative breakthroughs, to see if it follows any rule.

albert.bmpThere can be no doubt that geniuses have worked habitually and continually. Long years of relevant labour have often preceded a scientific breakthrough. In medicine, Alexander Fleming had been working in the bacteriology department of a hospital for some two decades when he discovered penicillin by accident in 1928. Alec Jeffreys’s discovery of genetic fingerprinting in 1984 was similar. Having left an experiment running over the weekend, he returned to his laboratory to find a peculiar array of blobs and lines on his developed film. His first reaction was: “God, what a mess.” But when he stared at the data a bit longer, “The penny dropped.” Yet, the penny would not have dropped without his more than a decade of prior research in genetics.

Both discoveries are fine examples of Louis Pasteur’s 1854 dictum: “Where observation is concerned, chance favours only the prepared mind.” Can we today be more specific than Pasteur? Perhaps. Although genius does not follow laws, it seems to follow the so-called 10-year rule. First identified by the psychologist John Hayes in 1989 and soon endorsed by other psychologists, the rule states that a person must persevere with learning and practising a craft or discipline for about 10 years before he or she can make a breakthrough. Remarkably few breakthroughs have been achieved in less than this time.

Frkekulé-thumb-198x345-1941In the sciences, Einstein is a good example. His first insight into special relativity occurred around 1895, 10 years before the creation and publication of the theory in 1905. August Kekulé’s theory of the benzene ring was published in 1865, 10 years after his first day-dream

of his structural theory on a London omnibus. Tim Berners-Lee invented the World Wide Web in 1990, 10 years after his first web- like computer program, known as Enquire. It is not difficult to multiply examples.

The arts frequently show the rule in operation, too—if “breakthrough” is defined as the production of an artist’s first generally accepted masterwork. In literature, Percy Bysshe Shelley’s creative explosion of 1819-20 occurred 10 years after he wrote and published his first poetry and fiction in 1809-10. In painting, Pablo Picasso’s Les Demoiselles d’Avignon was created in 1907, a decade after he began training as an artist in Barcelona in 1896. In music, Igor Stravinsky’s The Rite of Spring was composed in 1912, a decade after he began his apprenticeship to Nikolai Rimsky-Korsakov in 1902. In cinema, Satyajit Ray created his first film, Pather Panchali in 1955, a decade after drawing illustrations for the novel on which the film was based.

In my view, the 10-year rule is best considered in three versions: weak, medium, and strong. The weak version is that a breakthrough requires a minimum of 10 years’ hard work and practice in a relevant domain—and it may take much longer. The medium version is more restrictive: a breakthrough requires a minimum of 10 years’ hard work and practice focused on the particular problem solved by the breakthrough. The strong version is more restrictive still: a breakthrough requires about 10 years—no less and no more—of hard work and practice focused on the particular problem solved by the breakthrough. Of course, there are many exceptions to the strong version, such as Fleming and penicillin. However, exceptions to the weak version of the rule are rare. Not even Wolfgang Amadeus Mozart fits this last bill, since his first masterwork, his piano concerto No. 9 (K271), was written in 1777, which is 12 years after his first published composition.

issac newton.bmpHayes discovered only three exceptions among classical composers: Erik Satie composed a masterwork in year 8 of his career, while Niccolò Paganini and Dmitry Shostakovich composed one masterwork each in year 9 of their careers. In the sciences, exceptions are extremely rare. Werner Heisenberg created matrix mechanics in 1925, aged 24 years, only about 5 years after beginning his university study of physics. On the other hand, Heisenberg had two leading physicists, Max Born and Niels Bohr, as close mentors during this period. Paul Dirac may provide a further exception: in 1928, he formulated the relativistic theory of the electron from which he predicted the existence of the positron, aged 25 years, about 6 years after beginning his university training in applied mathematics. However, Dirac had previously taken a 3-year degree in electrical engineering. Perhaps only Isaac Newton fairly and squarely beats the 10-year rule in science: his annus mirabilis, 1665-66, occurred after less than 5 years of solitary study at Cambridge, at the age of only 22 years.

The predominance of theoretical physics among the handful of exceptions may be a small clue to the explanation of the 10-year rule in exceptional creativity. In theoretical physics, years of laboratory grind are not required, nor is any of the corpus of facts about nature that has to be memorised and assimilated in other sciences, such as medicine and biology. So perhaps the theoretical physicist needs to expend less time in perspiration than other scientists before he or she can reach the frontier of the subject and make a breakthrough. Indeed, the 10-year rule seems to me to be an empirical truth about perspiration and inspiration equivalent to that of Edison’s personal guess—not only in its underlying rationale but also approximately in its ratio. Instead of Edison’s 99% versus 1% estimate, for every 10 years (120 months) of hard work, an individual may be granted, so to speak, a month or two’s worth (1%) of “sudden inspiration”. Discouraging as this may be in one sense, it also means that hardly any genius in history—not even Leonardo da Vinci —seems to have short-cut the long and gradual path to creative breakthroughs.