If you're a glass half empty kind of person, it might be because your brain is telling you to expect the worst.
Scientists believe the habenula, an evolutionarily ancient part of the brain half the size of a pea, plays an important role in learning from bad experiences.
In some people, an over-active habenula may be linked to depression, pessimism and a negative outlook.
"The habenula tracks our experiences, responding more the worse something is expected to be," said lead researcher Dr Jonathan Roiser, from University College London's Institute of Cognitive Neuroscience.
"In this study we showed that the habenula doesn't just express whether something leads to negative events or not; it signals quite how much bad outcomes are expected."
The UCL team scanned the brains of 23 healthy women who were shown a random set of pictures, some of which signalled a painful electric shock delivered to the left hand.
The functional magnetic resonance imaging (fMRI) scans showed that shock-associated pictures activated the habenula. The response was much stronger when an electric shock was almost certain than when it was unlikely.
Dr Roiser said the findings, published in the latest edition of the journal Proceedings Of The National Academy Of Sciences, may point the way towards new treatments.
He added: "Other work shows that ketamine, which has profound and immediate benefits in patients who failed to respond to standard antidepressant medication, specifically dampens down habenula activity.
Therefore, understanding the habenula could help us to develop better treatments for treatment-resistant depression."