Babies as young as six months old can spot mathematical errors, researchers have claimed.
A team of Israeli and US scientists scanned the brains of 24 babies aged six to nine months as they were shown puppet displays.
The infants looked longer at unexpected outcomes - if there were too many puppets - and their brain activity was like that seen in adults after errors.
The study is published in Proceedings of the National Academy of Sciences.
Previous research has found babies look longer at the unexpected.
But researchers were not certain that meant they were actually surprised by what they saw.
In this study, 24 infants were shown two puppets which were then obscured by a screen.
The babies then saw a hand remove one of the puppets, and the screen was then removed, revealing either one puppet, as would be expected, or two, which would not.
In those situations, the researchers used an electroencephalogram (EEG) to measure brainwave patterns through electrical signals from the brain.
It was found that infants looked for over a second longer when the "incorrect" number of puppets were revealed.
Adults given a similar "correct or incorrect" mathematical presentation showed a faster version of the same response.
Writing in PNAS, the team led by Dr Andrea Berger of Ben Gurion University of Negev, said: "This study demonstrates that this error detection system may be present in the brains of infants and is activated when they are surprised by an incorrect arithmetic solution."
The researchers said that their work showed babies could detect errors before the end of their first year of life, an ability linked to having the capacity to regulate their behaviour and emotion later on.
Dr Stella Acquarone, a London-based psychologist and member of the British Psychological Society, who specialises in early development, said: "The babies are recognising where things are and where they should be.
"This could be used as a test to ensure this ability is present in babies of this age."