Each participant performed a series of online tasks that assessed their ability to behave randomly.
Five tasks included listing the hypothetical results of a series of 12 coin flips so that they would "look random to somebody else", guessing which card would appear when selected from a randomly shuffled deck, and listing the hypothetical results of 10 rolls of a dice.
"This experiment is a kind of reverse Turing test for random behaviour, a test of strength between algorithms and humans," Hector Zenil, study co-author said.
Dr Gauvrit said "25 is, on average, the golden age when humans best outsmart computers".
The scientists analysed participants' choices according to their algorithmic randomness, based on the idea that patterns that are more random are harder to summarise mathematically.
After controlling for characteristics such as gender, language and education, they found that age was the only factor that affected the ability to behave randomly.
The study also demonstrated that a relatively short list of choices, such as 10 hypothetical coin flips, can be used to reliably gauge randomness of human behaviour.