Life is full of choices. Do we have a cookie or go to the gym? Do we binge watch our favorite show on Netflix or go to bed at a reasonable time? Our choices have consequences, and we make them of our own free will. Or do we? The nature of free will has long inspired philosophical debates, but it also raises a central question about the fundamental nature of the universe. Is the cosmos governed by strict physical laws that determine its fate from the big bang until the end of time? Or do the laws of nature sometimes allow for things to happen at random? A century-old series of physics experiments still hasn’t been able to settle the question, but a new experiment has tilted the odds toward the latter by performing a quantum experiment across billions of light-years.

The laws of classical physics are deterministic. Newton’s mathematical cosmos is a clockwork universe, where each cause has a unique effect and we are governed not by our choices but by the rigid laws of nature. Quantum physics, on the other hand, has a property of fuzzy randomness, which some scientists feel could open the door to free will. Because quantum physics lies at the heart of reality, it would seem that randomness wins the day.

Yet some scientists have argued that quantum randomness isn’t truly random. If I roll a die, the outcome seems random, but it isn’t really. All of its bumps and turns are caused by the forces of gravity and the table in a complex dance, but that dance is deterministic. The moment the die leaves my hand, its fate is sealed, even though I don’t know the outcome until it happens. Perhaps quantum objects behave in the same way. Although they seem to act in random ways, they are really governed by some deterministic hidden variables.

It is a question that has fascinated me since graduate school. My dissertation focused on aspects of quantum gravity, a subject that we still don’t fully understand. One of the reasons for this is that we don’t know how Einstein’s deterministic theory of gravity can fit together with the randomness of quantum mechanics.

The question fascinated Einstein as well, and being much smarter than I, he came up with an experiment that could test the idea. Together with Boris Podolsky and Nathan Rosen, both then at the Institute for Advanced Study in Princeton, N.J., he presented a thought experiment now known as the Einstein-Podolsky-Rosen experiment, or EPR experiment for short.

To understand the experiment, suppose we have a mischievous mutual friend named Jane. Whenever Jane wears out a pair of running shoes, she loves to prank us by sending one shoe to each of us. So, whenever you get a shoe in the mail from Jane, you know I’ve gotten one, too. One of us gets the right shoe, the other the left. But until either of us opens our respective box, neither of us knows which shoe we have. Once the box arrives at your door, you open it up and find you have the left shoe. At that moment, you know I must have the right shoe.

This is the basic idea of the EPR experiment. It’s nothing more than a silly prank in our everyday world, but for quantum objects it gets really strange. You may have heard of Schrödinger’s cat, where a quantum cat is neither alive nor dead until observed in a definite state. Like classical cats, quantum cats like quantum boxes. In the quantum realm, things can be in an indefinite state until you observe them. It would be as if our boxes contained a pair of something (gloves, shoes, salt and pepper shakers, etcetera), but it is impossible to know what specific something until one of us opens their box. Even stranger, how we measure quantum objects determines what the outcome can be. It would be as if opening the box on the side forces it to be a glove, while opening it from the top forces it to be a shoe. How I open my box affects your box miles away. In quantum theory, we say that our two boxes are entangled, so that observing the content of one box also tells us something about the other.

We can’t do this experiment for gloves and shoes, but we can do it with light. Two entangled photons can be sent in opposite directions. I measure the orientation of one photon at random, you measure the other, and then we compare our results. There are lots of different orientations we would measure, so we can each choose the orientation we want. When this experiment is done in the laboratory, it actually works. And if our measurements are random, there is no way for the photons to know ahead of time which orientation will be measured. So, there can’t be any hidden variable to determine the outcome. Whether we get the left or right shoe or the left or right glove, the result is truly random.

This is the heart of why Einstein referred to entanglement as “spooky action at a distance.” It’s spooky because entangled objects have a quantum connection, even if they are light-years apart. So, a measurement on one object is a measurement on both through this spooky entanglement. But it’s only spooky if the measurement we make is random. If it’s not random, then no spooky connection is necessary to explain the EPR results.

This is known as the “freedom of choice” loophole. EPR experiments are done in a lab, and even though the choice of how to measure the photons seems random, if there’s no free will, then the observation we make was determined by earlier conditions. Because it takes time to set up the experiment in a lab, it’s possible that there are small interactions that could let the quantum system know ahead of time what measurement will be done. Maybe the experiment, the scientists and the lab are all entangled in such a way that the outcome isn’t truly random, so the quantum objects can game the outcome.

To get around the loophole, you have to deal with the speed of light. It’s often said that nothing can travel faster than the speed of light, but it’s really information that can’t travel faster than light. We can send each other telegrams or text messages, but never faster than the time it takes for light to travel between us. In a small lab, light has plenty of time to travel back and forth across the room while the experiment is being set up, so perhaps small bits of information bias the “random” aspect of experiment before it’s even done. That doesn’t seem very likely, but a new experiment has overcome this problem. Rather than using a random-number generator in the lab to decide which photon measurement to make, the experimenters used quasars.

Quasars are brilliant beacons of light powered by supermassive black holes in the centers of distant galaxies. The team used random fluctuations in the light from quasars to determine how the photons were measured. Because the light from a quasar has to travel for billions of years to reach us, the fluctuations in brightness happened billions of years before the experiment was done—billions of years before humans even walked the earth. So, there is absolutely no way for it to be entangled with the experiment.

The result was just what quantum theory predicts. Thus, it looks like there really are no deterministic hidden variables, and randomness is still possible throughout the cosmos.

Of course, randomness isn’t the only thing necessary for free will. But it does mean that your fate is not necessarily sealed. So, when you resist that second cookie or turn off the TV in the evening, you can take pride in the fact that maybe, just maybe, the choice was yours after all.