Making educated guesses is something we all do every day – but until now scientists haven't fully understood how these leaps in logic are processed in the brain.

Now new research on mice and humans suggests neurons can effectively 'join the dots' between two thoughts to figure something out.

If you're looking for a friend called Sam, for example, and Sam is always with Ben, and Ben is in the library, it makes sense that Sam will be in the library too. This seems like a simple idea, but on the level of neurons it can actually be quite complex.

"In everyday life we often infer connections or relationships between different things we see or hear," says neuroscientist Helen Barron from the University of Oxford in the UK. "So even when we don't know the full story, we can make an educated guess by joining the dots."

"Although this process is crucial to everyday life, until now, we didn't know how the cells in our brains are able to form links between separate experiences."

In the human part of the study, 22 volunteers played a virtual reality game where particular sounds were linked with colourful pictures, and then in a subsequent game, finding those pictures would mean a cash reward.

The participants soon started inferring a more direct link between the sounds and the prizes – when they heard the sound, they would start to look for the reward.

A similar test was carried out in mice, where the researchers played a sound to the animals while switching on an LED light, and then later, associated that light with a snack.

As with the human volunteers, the mice were able to connect the sound with the reward, joining the dots between two different experiments.

Neither the human volunteers or the mice were directly told that sound equals reward, but their brains' capacity to make informed estimates helped them to make the required connection anyway.

So what was happening to their neurons?

Human MRI scans showed that the hippocampus brain region – already linked to learning and memory – is responsible for making educated guesses (such as where Sam is likely to be in our earlier example), according to the researchers.

With the mice, the study was able to look even closer: by recording individual cell activity, it was shown that mouse brains were able to 'jump' over the intermediate LED light step, going straight from sound to reward, when they were resting.

The neurons linked to the sound and the neurons linked to the reward became active together.

"By carrying out similar experiments with both mice and people, this work shows that the process of establishing a link between separate events is common to both species," says neuroscientist David Dupret, from the University of Oxford.

"And by working with mice, it's then possible to examine what's going on in the brain of a mammal at the level of individual cells."

It's not certain that this cell activity is happening in our brains too, but the VR experiment suggests that it is – and that when we are sleeping or resting, our brain is using that time to build links between neurons that help us make sense of the world and fill in gaps in knowledge.

"Our results suggest the process is very similar in people and that has important implications," says Barron.

"It suggests that periods of rest and sleep play an important role in creativity, where we draw insight from previous experience to come up with original ideas."

The research has been published in Cell.