Sleep provides a nighttime theater in which your brain tests out and builds connections between vast stores of information. This task is accomplished using a bizarre algorithm that is biased toward seeking out the most distant, nonobvious associations, rather like a backward Google search. In ways your waking brain would never attempt, the sleeping brain fuses together disparate sets of knowledge that foster impressive problem-solving abilities.