Jogging, doing the dishes and riding the bus to work are other examples.
The results of neuroimaging studies indicate that these types of situations allow the outermost regions of the prefrontal cortex—those areas of the brain that help exert cognitive control—to loosen the reins and allow thought processes and neural activity not strictly related to the primary task.
In this state of defocused attention, one idea can trigger the next across a relatively unconstrained range of concepts and associations that might otherwise be viewed as completely unrelated. The resulting novel connections may explain how a broad focus can significantly facilitate creative thought and inventive problem-solving.
It may also explain how wandering thoughts about a thistle burr, a hymn-book marker and a falling apple could have inspired developments as useful as Velcro, Post-it notes and a theory of gravity.
Incubation is one of the 4 proposed stages of creativity: preparation, incubation, illumination, and verification.[1] Incubation is defined as a process of unconscious recombination of thought elements that were stimulated through conscious work at one point in time, resulting in novel ideas at some later point in time.[2]
The experience of leaving a problem for a period of time, then finding the difficulty evaporates on returning to the problem, or even more striking, that the solution “comes out of the blue”, when thinking about something else, is widespread. Many guides to effective thinking and problem solving advise the reader to set problems aside for a time.
...Recent advances in neuroscience provide intriguing evidence of the mechanisms underlying incubation effects, particularly those that occur during sleep.
There’s been a significant amount of work on this problem, if you are wanting what I think you are wanting. Quick googling got me:
A Generic Article
And a wikipedia article on “incubation” ( http://en.wikipedia.org/wiki/Incubation_(psychology) )