In the last half decade, magic—normally deemed entertainment fit only for children and tourists in Las Vegas—has become shockingly respectable in the scientific world. Even I—not exactly renowned as a public speaker—have been invited to address conferences on neuroscience and perception. I asked a scientist friend (whose identity I must protect) why the sudden interest. He replied that those who fund science research find magicians “sexier than lab rats.”

I’m all for helping science. But after I share what I know, my neuroscientist friends thank me by showing me eye-tracking and MRI equipment, and promising that someday such machinery will help make me a better magician.

I have my doubts. Neuroscientists are novices at deception. Magicians have done controlled testing in human perception for thousands of years.

I remember an experiment I did at the age of 11. My test subjects were Cub Scouts. My hypothesis (that nobody would see me sneak a fishbowl under a shawl) proved false and the Scouts pelted me with hard candy. If I could have avoided those welts by visiting an MRI lab, I surely would have.

But magic’s not easy to pick apart with machines, because it’s not really about the mechanics of your senses. Magic’s about understanding—and then manipulating—how viewers digest the sensory information.

I think you’ll see what I mean if I teach you a few principles magicians employ when they want to alter your perceptions.

1. Exploit pattern recognition. I magically produce four silver dollars, one at a time, with the back of my hand toward you. Then I allow you to see the palm of my hand empty before a fifth coin appears. As Homo sapiens, you grasp the pattern, and take away the impression that I produced all five coins from a hand whose palm was empty.

2. Make the secret a lot more trouble than the trick seems worth. You will be fooled by a trick if it involves more time, money and practice than you (or any other sane onlooker) would be willing to invest. My partner, Penn, and I once produced 500 live cockroaches from a top hat on the desk of talk-show host David Letterman. To prepare this took weeks. We hired an entomologist who provided slow-moving, camera-friendly cockroaches (the kind from under your stove don’t hang around for close-ups) and taught us to pick the bugs up without screaming like preadolescent girls. Then we built a secret compartment out of foam-core (one of the few materials cockroaches can’t cling to) and worked out a devious routine for sneaking the compartment into the hat. More trouble than the trick was worth? To you, probably. But not to magicians.

3. It’s hard to think critically if you’re laughing. We often follow a secret move immediately with a joke. A viewer has only so much attention to give, and if he’s laughing, his mind is too busy with the joke to backtrack rationally.

4. Keep the trickery outside the frame. I take off my jacket and toss it aside. Then I reach into your pocket and pull out a tarantula. Getting rid of the jacket was just for my comfort, right? Not exactly. As I doffed the jacket, I copped the spider.

5. To fool the mind, combine at least two tricks. Every night in Las Vegas, I make a children’s ball come to life like a trained dog. My method—the thing that fools your eye—is to puppeteer the ball with a thread too fine to be seen from the audience. But during the routine, the ball jumps through a wooden hoop several times, and that seems to rule out the possibility of a thread. The hoop is what magicians call misdirection, a second trick that “proves” the first. The hoop is genuine, but the deceptive choreography I use took 18 months to develop (see No. 2—More trouble than it’s worth).

6. Nothing fools you better than the lie you tell yourself. David P. Abbott was an Omaha magician who invented the basis of my ball trick back in 1907. He used to make a golden ball float around his parlor. After the show, Abbott would absent-mindedly leave the ball on a bookshelf while he went to the kitchen for refreshments. Guests would sneak over, heft the ball and find it was much heavier than a thread could support. So they were mystified. But the ball the audience had seen floating weighed only five ounces. The one on the bookshelf was a heavy duplicate, left out to entice the curious. When a magician lets you notice something on your own, his lie becomes impenetrable.

7. If you are given a choice, you believe you have acted freely. This is one of the darkest of all psychological secrets. I’ll explain it by incorporating it (and the other six secrets you’ve just learned) into a card trick worthy of the most annoying uncle.

THE EFFECT I cut a deck of cards a couple of times, and you glimpse flashes of several different cards. I turn the cards facedown and invite you to choose one, memorize it and return it. Now I ask you to name your card. You say (for example), “The queen of hearts.” I take the deck in my mouth, bite down and groan and wiggle to suggest that your card is going down my throat, through my intestines, into my bloodstream and finally into my right foot. I lift that foot and invite you to pull off my shoe and look inside. You find the queen of hearts. You’re amazed. If you happen to pick up the deck later, you’ll find it’s missing the queen of hearts.

THE SECRET(S) First, the preparation: I slip a queen of hearts in my right shoe, an ace of spades in my left and a three of clubs in my wallet. Then I manufacture an entire deck out of duplicates of those three cards. That takes 18 decks, which is costly and tedious (No. 2—More trouble than it’s worth).

When I cut the cards, I let you glimpse a few different faces. You conclude the deck contains 52 different cards (No. 1—Pattern recognition). You think you’ve made a choice, just as when you choose between two candidates preselected by entrenched political parties (No. 7—Choice is not freedom).

Now I wiggle the card to my shoe (No. 3—If you’re laughing...). When I lift whichever foot has your card, or invite you to take my wallet from my back pocket, I turn away (No. 4—Outside the frame) and swap the deck for a normal one from which I’d removed all three possible selections (No. 5—Combine two tricks). Then I set the deck down to tempt you to examine it later and notice your card missing (No. 6—The lie you tell yourself).

Magic is an art, as capable of beauty as music, painting or poetry. But the core of every trick is a cold, cognitive experiment in perception: Does the trick fool the audience? A magician’s data sample spans centuries, and his experiments have been replicated often enough to constitute near-certainty. Neuroscientists—well intentioned as they are—are gathering soil samples from the foot of a mountain that magicians have mapped and mined for centuries. MRI machines are awesome, but if you want to learn the psychology of magic, you’re better off with Cub Scouts and hard candy.