Ajackpot of $14.3 million is a lot of money, and it seemed strange that the person holding the winning ticket in Iowa’s Hot Lotto waited almost a year before claiming it. The draw took place in December 2010, but it wasn’t until 2011, just a few hours before the deadline, that an anonymous individual made the winning claim. While lottery winners are entitled to “no publicity,” they still need to identify themselves to the lottery company. The claim was turned down, but it raised suspicion with the authorities and sparked a long criminal investigation.

The lottery company knew where the ticket was purchased: a QuikTrip grocery store in Des Moines. In 2014, the company distributed CCTV footage from the store showing a white man in a hooded sweatshirt buying the ticket. In January 2015, a man named Eddie Tipton was arrested.

There were two interesting things about Eddie Tipton. He was an employee of the Multi-State Lottery Association, and therefore prohibited from playing, but more important, he was also the company’s director of information security. The lottery win was an inside job. Tipton was charged with fraud and sentenced to 25 years in prison.

His method for rigging the lottery was ingenious. Eddie Tipton had rendered the numbers generated by the lottery computer entirely predictable. On three particular days of the year, the numbers drawn were anything but random. It was on one of those days that Tipton made his winning play.

The Iowa Hot Lotto draw was an entirely virtual affair. A random number generator produced numbers with a computer housed in a sealed glass room under constant surveillance. But Tipton, as director of security, had access to it, and via a USB stick had injected his own software into the system. The software was smart enough to pass a security audit and deliver preprogrammed numbers on the appointed dates. During the long criminal investigation, it was discovered that this was not the first time Tipton had won the lottery. It was the fourth.

In the UK, the National Lottery uses a different system to choose its random numbers. The machines are mechanical and physically pull actual numbered balls from the selection in play. Unlike the Hot Lotto’s computer system, the National Lottery draw is completely visible and open for inspection. The machines used are made by Smartplay International in the United States, suppliers of machines for lotteries around the world. Validating randomness on a physical draw has its own problems, but as far as I know, no one has ever managed to spot a pattern in the draws to predict a future win.

But the numbers people choose when playing the lottery are not so random. We know this from information provided in the 1990s by Camelot, organizers of the UK’s National Lottery. In the spirit of openness, the company revealed some very interesting biases in the numbers people choose to play on lottery tickets. Many picked numbers associated with birthdays, skewing their choices to just 31 of the possible 59 numbers. Players attempting to mark numbers randomly on their lottery ticket unconsciously gravitated toward the central columns, so the layout of numbers on the ticket also creates a bias.

In a valiant but doomed attempt to play unlikely numbers, many chose 1,2,3,4,5,6. That set of numbers is no more likely to come up in a random draw than any other set of six numbers, but if you placed a bet on it, the jackpot would be shared with an average of 10,000 other people every draw. Your once-in-a-lifetime lottery win might earn you the cost of an Xbox or new TV, rather than the mansion or yacht of your dreams.

Choosing truly random numbers is a challenge for people just as much as it is for machines. It also largely outside the control of the lottery organizers and has some potentially dangerous financial ramifications. For example, in the 1990s, the UK lottery paid a guaranteed £10 for picking three correct numbers. If enough people played the same correct numbers and won, would this bankrupt the lottery?

That idea almost became reality with an experiment on the 1997 UK television series The Paranormal World of Paul McKenna. In an experiment in so-called psychokinesis — the power of mind over matter — McKenna asked the nation to concentrate on a particular set of six numbers in the hope of making them come up in the Saturday draw.

It quickly became apparent that if millions of viewers bet on them, and even if only three of those numbers came up for the minimum £10 prize, the National Lottery would have to make a huge and unprecedented payout. Luckily for the organizers, the numbers didn’t win, but it led to Camelot changing the rules shortly after the McKenna program, so that four, not three, matching numbers were now required to win the minimum prize. Camelot said the timing was pure coincidence, but it no longer releases any information on the numbers that are played, nor does any other lottery organizer, presumably for fear that such information might affect play in an unforeseen and costly manner.

Another UK television show illustrated the challenges with generating truly random numbers. Deal or No Deal was a popular Channel 4 game show hosted by Noel Edmonds. The format of the game involved amounts of money, from 1p to £250,000, distributed among 22 identical boxes. At the start, the player chose a box for themselves; during the game, they had opportunities to open the other boxes and see what was inside or to swap the box they had for another unopened box in the hope of increasing their prize.

Avid viewers became convinced that the randomizing function used to determine the money distribution among the boxes was actually the random number generator from Microsoft Excel. Mathematically astute viewers analyzed the prizes revealed in the five opening-round boxes, and then deduced the positions of the prizes in the remaining boxes. Or so they claimed. Whatever the truth of the matter, it’s easy to see the value of having something more complex than Excel generate a random number when the stakes are high.

‘A Million Random Digits with 100,000 Normal Deviates,” by the RAND Corporation

Random number generators (RNGs) are used in many industries, including cryptography, gambling, statistical sampling, drug trials, and computer simulations. An early attempt with computers by the RAND Corporation resulted in a book titled A Million Random Digits with 100,000 Normal Deviates. RAND found a way for a computer to convert the radioactive decay of an atom into random numbers, which were then converted to tables and printed in the book. The book was never proofread, so nobody knows if the numbers truly are random.

Even in the case of computer-driven RNGs, they can really only be described as pseudo random number generators. RNGs begin with a seed number, and then apply an algorithm to generate a supposedly random number. If the number can withstand extensive pattern analysis to prevent prediction, then it is usually good enough to use, but many computer-driven RNGs can have detectable patterns.

An alternative to beginning with a seed number is to take input from an unpredictable or chaotic event. You could photograph clouds or a motorway and turn this activity into a seed number. Google Patent Search reveals all kinds of surprising methods for generating random numbers, but perhaps the method put forward by Silicon Graphics in 1996 counts as one of the most unusual. That method, called  — seeded a pseudo random number generator using a real-time image from a lava lamp.

Using chaotic events, you can create a true random number generator (TRNG), the holy grail of many industries. It’s especially useful for cryptography and other security issues. An example of a TRNG is Random.org, set up by Mads Haahr of the School of Computer Science and Statistics at Trinity College Dublin. It will generate random numbers for almost anything you have in mind. Haahr describes it as a “true random number service” generating numbers from atmospheric noise.

Magicians have long known that people find it difficult to think of random numbers. A popular mind-reading trick goes like this: “Think of a number between one and 10,” says the magician. He clicks his fingers. “Name it now.” You do. It’s seven. The magician turns around a card he’s been holding, and there, written on it, is your number seven.

This is a simple statistical and psychological trick. You might think you have a free choice of number, but seven is chosen more times than any other number. Magicians have been using this ruse ever since Robert-Houdin, the father of modern magic, described it in his 1868 book, The Secrets of Stage Conjuring.

No one knows why we are drawn to seven more than any other number, whether it’s because of cultural references or simply because it trips easiest off the tongue. But magicians, who are effectively field-testing psychological principles every time they do a trick, have long accepted that this is a very reliable outcome. This bias toward the number seven was proved in 2014, with an online survey conducted by author Alex Bellos, asking people to name their favorite number. A total of 30,250 people nominated 1,123 numbers, of which seven was the overwhelming favorite, being submitted 2,912 times.

With all that in mind, here is a video of a weird trick you might like to try on your friends. The first trick in this Zach King compilation begins with a seed number, which is then manipulated to arrive at an entirely predictable result:

It’s a very simple trick, really, but the secret lies in two psychological insights: The free choice of the seed number gives us the illusion of control, but the math in the next stages make the seed number irrelevant. Second, you are given a further set of “free choices” that are, in fact, based on common biases — most people will name Denmark when asked to think of a country beginning with D, then an elephant, etc. If you follow these common biases, the trick can seem amazing and you will show your friends. If the trick doesn’t work on you, you’ll shrug and quickly forget about it.

Two key insights underpin a huge amount of magic theory: Giving people a sense of control or free choice is, in fact, illusory; and people will share and discuss a trick that works for them, while they’re less likely to discuss a trick that didn’t work.

The universe might well be random, but magic tricks, like many choices we make, are not. When we decide what to buy in a shop, what investments to make, when we gamble, or even when we vote, are we actually being given a free choice, or are we really being all too predictable?