Cats have a wily reputation, but their cunning could just be basic deductive reasoning.

Scientists from Kyoto University in Japan found that cats can grasp the concept of gravity and cause and effect. The sounds they hear help them predict what they can expect to see next, which may play a role in how the animals hunt. Their work was published in the journal Animal Cognition.

“Cats use a causal-logical understanding of noise or sounds to predict the appearance of invisible objects,” Saho Takagi, a graduate student studying psychology at Kyoto University and lead author of the paper, said in a press release.

For their experiment, Takagi and her colleagues gathered 30 domestic cats, some from cat cafes and some household pets. They shook a box in front of individual cats, which either made a rattling sound or didn’t. Then, the researchers flipped the box over, either to reveal something inside or an empty box.

The cats appeared confused when what they saw didn’t match up with what they expected. They stared at the box for longer periods of time when they saw an object emerge from a box that had not rattled, or saw no object from one that did make a noise. The authors suggest that this behavior is a result of the fact that cats can apply rules about physics—particularly, that unattached objects in a box should fall to the ground because of gravity—to common situations.

Using a basic understanding of sound and gravity could help cats hunt. ”They often need to infer the location or the distance of prey from sounds alone because they hunt in places of low visibility,” they wrote.

Of course this was a relatively small study, and the researchers were not cat-mind-readers, so it’s also impossible to know exactly how the cats were processing information. But, as Smithsonian reports, human babies as young as two months can also apply basic rules of gravity to their surroundings, and like cats, babies will stare when what they see doesn’t seem to follow the basic rules of physics.

Although cats probably won’t be doing advanced physics any time soon, Takagi told Scientific American she wants to study just how much information cats can infer about different objects. Next, she plans to test their ability to estimate the size and number of objects in a container based on the sounds they hear.