From The Guardian:

After a particularly creative night’s sleep, Paul McCartney rushed to the piano at his girlfriend Jane Asher’s house to scribble down a tune he had heard in a dream. That song, Yesterday, would become a Beatles classic.

Few can claim their slumbering hours are as productive or as lucrative, but scientists have found evidence that “sleeping on the problem” does work. By scanning the brains of volunteers, they found that a good night’s shut-eye seems to stimulate new brain connections that promote learning by turning a weak memory into a stronger one.

Dr Sophie Schwartz, from the University of Geneva, gave volunteers the task of remembering unknown faces or using a joystick to follow a moving dot on a computer screen. Some were then allowed to sleep while others were not. They repeated the same tasks the next day while having their brains scanned. The results showed that “a period of sleep following a new experience can consolidate and improve subsequent effects of learning from the experience”, says Schwartz.