Perhaps the most famous dream prediction comes from the Bible. Pharaoh dreams of standing by the Nile. Seven sleek, fat cows emerge from the river, followed by seven scrawny, ugly cows that eat the plump, succulent ones. But what does it mean? There’s a pattern, isn’t there? Good is followed and overwhelmed by bad. And seven comes into it. Pharaoh summons Joseph, who interprets the dream – seven years of abundance will be followed by seven years of famine. The input is valuable. Now Pharaoh can anticipate and conserve for the bad years. But if Pharaoh can predict, why doesn’t he just dream of seven plentiful years and seven starvation years? What’s with the cannibalistic cows? Do these cows represent an associative pattern in Pharaoh’s experience? And how would identifying a pattern enable prediction, anyway?

It has to do with the way the brain works; it doesn’t passively receive information about the external world but, rather, actively interprets that information and looks for patterns in it. If everything were random, there would be no patterns, and prediction would be impossible. You can predict only by discerning a pattern in your experience (or knowledge, which is a sub-set of your experience). Are there regularities or sequences in events? Do some events generally occur with others? If there are associative patterns in events, they can be used to help predict what will happen next.

Some patterns are deterministic and logical. For example, day follows night. Day and night are, therefore, associated as a sequence in the human mind, and we can predict that day will occur after night. Another example: traffic is worst at commuter times, and heavy traffic is associated with commuting. This isn’t an association determined by natural law but, without human intervention to stagger commuter times or alter traffic flows, you can still predict the bad traffic around 8am.

Some patterns are much less obvious. We call them ‘probabilistic’ because they are based on events that have a tendency only to co-occur, so we cannot be as confident in predicting them. Predicting the behaviour of living beings, human and animal, is a probabilistic task. Based on their past behaviour, you know it is likely that they will do certain things but you don’t know for sure. Their behaviour is not random but neither is it determined. Living beings can always surprise you.

For example, I am a research academic with limited teaching hours. Most of my time is spent writing papers at home. It is not easy to predict when I will go into the university. The most obvious logical predictor is if I have teaching, but I will swap teaching if I have a research engagement. Another predictor is a booked meeting, but if an urgent research deadline looms I will skip the meeting. So although being at the university has a tendency to co-occur (and be associated) with teaching and meetings, it is by no means determined by them.

A less obvious predictor is an invitation to have coffee with an interesting colleague. If I am scheduled to teach and attend a meeting and also have the chance to join a colleague for coffee, it is very likely that I’ll be on campus – but it is still only a probability, albeit a strong one. On the other hand, I could be at the university just to have coffee with a colleague or because I am moving from one office to another, though these are much less likely to co-occur. That said, having coffee with a colleague on the same day I am moving office are probabilistic predictors of me being at the university.

What has all this got to do with dreaming?

While awake, we are good at spotting logical, deterministic patterns. We tend to suppose that we need to be awake to function, but this is not the case. In every 24-hour period, there is another state when our brains are just as active, some researchers think more active. This state is rapid eye movement (REM) sleep, when most dreams occur. During REM, we are better at spotting the less obvious or ‘remote’ associations that predict probabilistic events.

Several experimental studies demonstrate this. In 1999, Robert Stickgold, a psychiatrist at Harvard Medical School, and colleagues demonstrated that after being woken from REM sleep you make more remote associations than you would if you had been awake for some time. For example, when prompted with a word such as ‘hot’, study participants were more likely to respond with ‘sun’, whereas the fully awake brain generally elicited the word ‘cold’ – a more obvious association, like night-and-day.

In 2009, Denise Cai, a psychologist at the University of California, and colleagues administered tests in which words appeared to be unrelated. Consider a word sequence such as ‘falling’, ‘actor’, and ‘dust’. Those with more REM are better able to come up with the word that links all of them: ‘star’.

In a study published in 2015, Murray Barsky, a sleep researcher at Harvard Medical School, and colleagues looked at probabilistic associations in more depth. They had their participants predict one of two probabilities – ‘sun’ or ‘rain’ – based on descriptions of associated events. They then compared the performance of participants who took a nap containing REM sleep with those who stayed awake, finding that REM subjects routinely had better scores.

Based on all this, I argue that we are better at making non-obvious word-based associations after REM sleep because our brains are primed during that sleep – by our dreams – to spot non-obvious, probabilistic patterns of experience and events. This means that if someone wanted to predict whether I would be at the university on any particular day, they would have a higher chance of success soon after having a dream.

In some ways, our brains function differently during REM sleep as opposed to when we are awake. One key difference can be found in the lateral prefrontal cortex, located behind the forehead on both sides of the head. These areas are responsible for logical reasoning, planning and maintaining focus on the most obvious solutions to problems. Among other things, the prefrontal cortex prevents ‘mind-wandering’. But, for solutions to difficult problems, based on remote associations, mind wandering or ‘thinking outside the box’ might be just what is required to make non-obvious connections.

This point was made by the psychologist Carlo Reverberi and colleagues from the University of Milano-Bicocca in a paper published in 2005. The team gave patients with lateral prefrontal damage a difficult problem requiring ‘thinking outside the box’, and found that they actually performed better than a control group of normal individuals. But we don’t need a brain injury to tap into the skill. During REM sleep, the lateral prefrontal cortex is deactivated, impeding logical reasoning but strengthening the kind of non-obvious, remote associations required for making connections and intuitive leaps.

Familiar people, places and events appear in our dreams but, with the lateral prefrontal cortex deactivated, we hardly ever experience them as they are in reality. Instead, people, places and experiences are recombined to render the familiar unfamiliar and often bizarre. I argue that the familiar becomes bizarre because in a REM dream we do not experience memories per se. Instead, we form an image that associates with memories of experiences. A dream image is bizarre because it portrays a pattern created by combining associated elements of different people, places or events. Our brains in REM sleep are primed to identify remote associations or non-obvious patterns between people, places and events in much the same way that, following REM sleep, we are better able to associate the word ‘star’ with ‘falling’, ‘actor’ and ‘dust’.

But there is more: the best way to remember that ‘star’ is associated with ‘falling’, ‘actor’ and ‘dust’ would be to combine these in an image: a famous actor, say Tom Cruise, covered in dust and falling from a star. In short, I argue, dream images probably appear bizarre to us when awake because they associate elements from different experiences to identify a pattern. Moreover, such bizarre images help us to remember simply because we recall strange events much more readily than mundane ones.

A powerful image from my personal dream repertoire, the ‘Sand-cloth house’, might look like the image which accompanies this essay.

And here are extracts from my dream report about this bizarre house:

Now I am walking along a quiet suburban road of neat houses with open front gardens … Something is a bit wrong – even though the day is sunny and all seems fine … The last house down by the bridge at the end of the road seems to be under construction. As I approach this last house, I notice how odd it looks – its shape appears rounded but is not clearly delineated. Then I see that something is covering the house. But I can’t work out what this is – maybe it’s a vast piece of cloth …Then I perceive the colour – it’s yellow – and I see that the house is covered in sand. I feel afraid. Suddenly the scene ahead has changed – now I am approaching a beach…

If, based on this dream, I were to ask you what associates ‘house’, ‘cloth’, and ‘sand’, you would get the answer wrong. The answer is ‘death’, but how would you know? It is my dream, not yours – my experiences are being combined, and you don’t know what they are. I’m awake when remembering my dream – so even I find it hard to work out the connections because my awake brain isn’t primed to identify remote, non-obvious associations.

Much of my behaviour when awake might be determined by unconscious associations created and expressed in dreams I cannot recall

But the associations relate to my eldest son, who is thinking of buying a house that someone has died in. As a child, I used to be very afraid of dying in quicksand, and I had a childhood traumatic experience in a house when I anticipated that a loved one would die. Dead people are covered with cloth or a shroud (a cultural association we all share).

In light of my personal, lived experience, ‘death’ emerges as the hidden meaning in the sand-cloth-house image, which I have remembered because the dream woke me up. But the vast majority of dreams are not remembered, and we never become conscious of them.

However, dreams may be retained at an unconscious level. There is a big difference between unconscious retention and conscious remembering. As much as 98 per cent of brain activity is unconscious, and retained dreams could be an aspect of this. Much of my behaviour when awake might be determined by unconscious associations created and expressed in dreams I cannot recall.

When my son told me he was thinking of buying a house someone had died in, I wanted to say ‘Don’t buy that house.’ I love walking on the beach but I never do this alone, perhaps because of a (usually unconscious) fear of quicksand. Based on my experiences in early childhood, I find it difficult to be in a house alone at night. It required the conscious memory of my dream to take all this apart.

The ability to identify patterns is a hallmark of the human mind. Our visual system has an almost infinite capacity for pattern recognition. But why would our awake brains specialise in identifying logical, deterministic patterns while our brains in REM sleep are better at detecting probabilistic ones? And why do the REM dream images – which portray these probabilistic patterns – remain unconscious?

The answers to these questions might lie in evolutionary imperatives: we dreamed to survive. As the evolutionary biologist Theodosius Dobzhansky declared in the title of his essay: ‘Nothing in Biology Makes Sense Except in the Light of Evolution’ (1973).

REM sleep emerges from evolutionarily ancient brain networks. All mammals (including humans) have REM sleep with its characteristic rapid eye movements. Animals lack the language skills to support complex thoughts but it is likely that they think through images. Most probably, early humans would have thought through images, too. This image-based thought might be highly conserved in the evolutionarily ancient mechanisms of REM sleep. The reason why REM sleep identifies non-obvious probabilistic patterns and retains them in unconscious images might reflect what life was like for early humans.

Just staying alive would have been a struggle for early humans. In The Art of Thought (1926), the British social psychologist Graham Wallas speaks of the evolutionary imperative to recognise non-obvious associations or patterns among, for example, different kinds of scraps that are all ‘food’, or animals from different species that are all predators. He referred to this ancient form of pattern-recognition as the ability to see ‘resemblance in difference’.

Sand, cloth and house are all different but, based on my experience, they all mean ‘death’ to me. My ability to see this might have evolutionary roots in my early ancestors’ capacity to recognise that, although lions, snakes and hyenas are all different, they are all predators and all meant ‘death’. My bizarre sand-cloth-house might follow the same principles as an associative REM dream image that combines a lion, a hyena and a snake to form a ‘lienake’. If a first step for early humans was to associate creatures that were predators, and a second step was to identify any obvious predictors of their behaviour, a third step was to try to discern any non-obvious, probabilistic pattern in their behaviour so that danger could be avoided.

What was life like for early humans? The conventional wisdom is that, until agriculture emerged about 10,000 years ago, humans were nomadic hunter-gatherers. But were early humans more gatherers than hunters? Were they really nomadic?

Few animals are nomadic. Most occupy stable habitats for a season, a few years or even a lifetime. The space used by animals on a regular basis is the ‘home range’, a concept known to Charles Darwin. A home range would be chosen because it offers opportunities to gather food (hunting is dangerous) and consume water. For early humans, places near rivers or lakes where fish were plentiful would have been attractive to settle. Natural resources such as water, fish, fruit and nuts are ‘clumped’ rather than distributed in an even or random manner. Consequently, early humans would have frequently visited resource-rich places, often undertaking tours of a series of such locations.

Clearly, locations with an abundance of natural resources attract many animals. Animals must visit waterholes but these are perilous places as both prey and predators congregate there: lions lie in ambush in the vegetation that surrounds waterholes, and snakes ensnare prey near water. On the other hand, mates can be found at waterholes, so they offer sexual and social opportunities, too. Equally, competitors will visit waterholes. Predicting when predators and competitors will be absent but mates present enhances survival and reproduction.

Unconscious, predictive mental images ensure rapid responses to danger

But prediction is difficult because the behaviour of animals and humans is based on probabilities, not certainties. Predictions depend on being able to discern probabilistic patterns in past experience. Anticipating when predators, competitors and mates will be at the waterhole is not that dissimilar to predicting when I will be at the university.

The approach to a resource-rich place such as a waterhole is the most dangerous time because predators conceal themselves in its immediate vicinity. If an early human saw a flash of yellow (a lion, perhaps) while approaching, unconscious image-based predictions, formed through prior predator sightings and associations between these sightings and other events, would rapidly inform whether to continue or to retreat. In such potentially life-threatening situations any action must be fast. Unconscious, predictive mental images ensure rapid responses to danger.

The schematic diagram below represents such a situation. The early human usually undertakes a tour of places 1 to 5 in that order but, on this occasion, on approaching the waterhole (position 4) some possible indication of danger triggers an unconscious mental image. On the basis of this predictive image, a retreat back to a refuge (position 3) is made:

This gathering tour involves journeys between a series of landmarks that would have involved predicting sequences. For example, if the early human had just left the food resource at position 2, it could predict that a refuge (position 3) came next on the tour, and the waterhole after that. Such logical predictions could be made with confidence. On the other hand, what might occur at these landmarks could not be predicted with confidence because it involved the behaviour of other living beings.

Such fundamental and enduring early human experiences might have given rise to dual brain states – the awake state and the REM dreaming state. While awake, our conscious thought is more logical and sequential. We can spot deterministic patterns and use them to predict what will happen next with some confidence.

During REM dreaming, our brains are better at identifying the probabilistic patterns that underlie the behaviour of living creatures. These patterns are portrayed in unconscious images, which are retained for the awake state. Whenever fast, instinctive action is required, archetypically in dangerous situations, unconscious images associate past experience to predict the probable significance of, for example, an ambiguous flash of yellow. This gives rise to a somewhat surprising conclusion. In our evolutionary past, we dreamed to survive.

While we can’t say that dreams come true, we can say that they predict. I don’t believe that I will ever walk along a suburban street, see a house smothered in sand, and feel afraid. But I do think that my dreams identify probabilistic patterns in my experiences that, in the past, were used to predict experiences at ‘landmark’ places. And if you think about it, dreams can also predict how I will act in certain situations because I unconsciously anticipate their consequences. For example, you now know that if someone I love is thinking of buying a house a person has died in, I will want to say: ‘Don’t buy that house.’ If you knew what the associations I make in dreams mean, you would be able predict things about me. But if you don’t share my experiences, I don’t think you can interpret my dreams.

Pharaoh summoned Joseph from a dungeon to interpret his cannibalistic cow dream. We will never know what experiences Pharaoh associated to engender the image of seven cannibalistic cows. Only you can interpret your own dreams. Yet Joseph needed to come up with something convincing pretty quickly. An interpretation that made Pharaoh feel important would have been a good idea. I don’t believe Joseph could know what the dream ‘really meant’ because he wasn’t Pharaoh. But he knew Pharaoh and weather cycles in Egypt, so he was able to offer a likely predictive narrative.

In evolutionary terms, the visual code that REM dreams provide remained unconscious or ‘hidden’ so that early humans could make quick decisions in situations of potential danger or reward, for example, on approach to a waterhole. In modern life, we still make daily tours of familiar places to gain resources: we leave home to drive to work so that we get paid; we visit the supermarket, have a coffee with a friend, and go to the gym to keep fit. But although we might be avoiding enemies and competitors while looking for mates on these tours of ‘landmark’ places, we don’t face anything like the dangers our ancestors did when they encountered other living creatures. We no longer have to dream to survive.

But our ability to identify probabilistic patterns in past experiences during REM dreaming is still quite useful, because we still face uncertainties. The ‘hidden’ code helps us act intuitively and rapidly to navigate them. Does it help to try to decipher a hidden dream code? Yes, particularly if a hidden code is making you fearful in situations that are not actually dangerous. Like me being afraid when alone in a house. You might think you know yourself, but you will have more insight still if you understand yourself through your dreams.