Magic tricks created using artificial intelligence for the first time

November 17, 2014

Researchers working on artificial intelligence at Queen Mary University of London have taught a computer to create magic tricks.

The researchers gave a computer program the outline of how a magic and a mind reading card trick work, as well the results of experiments into how humans understand , and the system created completely new variants on those tricks which can be delivered by a magician.

The magic tricks created were of the type that use mathematical techniques rather than sleight of hand or other theatrics, and are a core part of many magicians' repertoires. The tricks, details of which are published today (Monday) in the journal Frontiers in Psychology, proved popular with audiences and the magic puzzle was put on sale in a London magic shop. The card trick is available as an app called Phoney in the Google Play Store.

Co-creator of the project, Howard Williams, explains how a computer can aid trick creation:

"Computer intelligence can process much larger amounts of information and run through all the possible outcomes in a way that is almost impossible for a person to do on their own. So while, a member of the audience might have seen a variation on this trick before, the AI can now use psychological and mathematical principles to create lots of different versions and keep audiences guessing."

The video will load shortly
Magic puzzle

The magic jigsaw involves assembling a jigsaw to show a series shapes, then taking it apart and reassembling it so that certain shapes have disappeared using a clever geometric principle. Creation of tricks of this kind involve several simultaneous factors such as the size of the puzzle, the number of pieces involved, the number of shapes that appear and disappear and the ways that the puzzle can be arranged. Something this complex is ideal for an algorithm to process, and make decisions about which flexible factors are most important.

The mind reading card trick involves arranging a deck of playing cards in a specific way then, based on a few seemingly innocuous pieces of information from the audience, identifying a card that has been seen selected from the deck and using an Android app to reveal the card on a mobile phone screen. The computer was used to arrange the decks in such a way that a specific card could be identified with the least amount of information possible. The program identified arrangements for the deck that on average required one fewer question to be asked before the card was found than with the traditional method. The app simply avoids the magician having to remember the order of the cards.

The video will load shortly
Card trick

Professor Peter McOwan, part of the QMUL team who worked on the project, added:

"Using AI to create magic tricks is a great way to demonstrate the possibilities of and it also forms a part of our research in to the psychology of being a spectator. For example, we suspected that audiences would be suspicious of the involvement of technology in the delivery of a trick but we've found out that isn't the case."

Explore further: Researcher finds method behind magic

More information: The full report will be available at

The 'Phoney' app can be downloaded from

The jigsaw puzzle trick can be found at

Related Stories

Researcher finds method behind magic

May 10, 2012

(Medical Xpress) -- A magician will have the upper hand because he knows how his trick works. But, according to Jay Olson, the magician might not know why.

Using magic to learn about maths

June 3, 2009

( -- An academic from Queen Mary, University of London has launched a series of videos featuring magic tricks that are conjured from a mathematical perspective.

Researcher uses card trick to reveal unconscious knowledge

November 17, 2011

(Medical Xpress) -- Spanish neuroscientist Luis Martínez of the Institute of Neurosciences in Alicante, has shown that an exception exists regarding “change blindness” and it can be demonstrated by using ...

Recommended for you

Making it easier to collaborate on code

October 26, 2016

Git is an open-source system with a polarizing reputation among programmers. It's a powerful tool to help developers track changes to code, but many view it as prohibitively difficult to use.

Dutch unveil giant vacuum to clean outside air

October 25, 2016

Dutch inventors Tuesday unveiled what they called the world's first giant outside air vacuum cleaner—a large purifying system intended to filter out toxic tiny particles from the atmosphere surrounding the machine.


Please sign in to add a comment. Registration is free, and takes less than a minute. Read more

Click here to reset your password.
Sign in to get notified via email when new comments are made.