Have you ever had that moment when you've been racking your brains on a really gnarly problem with no solution in sight… and then the answer smacks you in the face while you’re organising your collection of 1990’s indie music CDs?
Occurrences of this common phenomenon been recorded throughout history, with some notable examples:
Mathematician René Descartes reportedly devised the Cartesian coordinate system whilst watching a fly crawl on the ceiling above him.
More famously, Isaac Newton was inspired to formulate his theory of gravity while observing the fall of an apple from a tree.
I wanted to understand a little more about why this happens, and harness the power of solving problems without thinking about them.
Inspired by distraction
A paper published in 2013 lead by Benjamin Baird and Jonathan Schooler of the University of California found that when faced with a creativity task, periods of time spent performing an undemanding task maximises mind wandering (when compared to a demanding task, a rest or no break at all).
This time spent mind wandering lead to a substantial improvement in performance when subjects were switched back onto the creativity task.
The brick test
In the study 140 participants were given 2 minutes to list as many uses they could think of for a given item (for example a household brick).
After completing the test the participant was given 12 minutes to spend on one the of four activities:
- Demanding task - When given a series of randomly generated digits from 0-9, was the previous number odd or even?
- Undemanding task - When given a series of randomly generated digits from 0-9, is each number odd or even?
- No rest
After the activity was completed, the subject took the creativity test again, with either a new target item or the same item. The percentage improvement on the test was then calculated, and the subjects then filled in a retrospective questionnaire.
Participants that undertook the undemanding task and were retested with the same item recorded a significantly greater improvement in the creativity task than those who undertook the demanding task.
Undemanding task participants also reported a significantly greater mind wandering those who took part in the demanding task (a daydreaming frequency was calculated for participant using the retrospective questionnaire).
It seems that not all tasks are created equal when it concerns mind-wandering and creativity. Mundane tasks appear to foster increased levels of the mind wandering that lead us increased creativity.
So how can we use this to our advantage as programmers?
Perhaps when knowing we have a tricky problem to wrestle with at the heart of a set of changes, we can tackle more mundane infrastructure and boiler-plate code first?
And next time I'm burning a hole through my monitor at the end of the day thinking about how to approach that tricky algorithm...
I’ll go home and do the ironing.
 Descartes and the fly: http://nrich.maths.org/2570  Newton and the apple: http://en.wikipedia.org/wiki/Isaac_Newton#Apple_incident  Inspired by Distraction: http://pss.sagepub.com/content/early/2012/08/31/0956797612446024.abstract