Sleep as the solution to an optimization problem
  This paper develops a highly simplified model with which to analyze the phenomenon of sleep. Motivated by Crick's suggestion that sleep is the brain's way of ``taking out the trash,'' a suggestion that is supported by emerging evidence, we consider the problem of the filling and emptying of a tank. At any given time, the tank may take in external resource, or fill, if resource is available at that time, or it may empty. The filling phases correspond to information input from the environment, or input of some material in general, while the emptying phases correspond to the processing of the resource. Given a resource-availablility profile over some time interval $ T $, we develop a canonical algorithm for determining the fill-empty profile that produces the maximum quantity of processed resource at the end of the time interval. From this algorithm, it readily follows that for a periodically oscillating resource-availability profile, the optimal fill-empty strategy is given by a fill period when resource is available, followed by an empty period when resource is not. This cycling behavior is analogous to the wake-sleep cycles in organismal life, where the generally nocturnal sleep phase is a period where the information collected from the day's activities may be processed. The sleep cycle is then a mechanism for the organism to process a maximal amount of information over a daily cycle. Our model can exhibit phenomena analogous to ``microsleeps,'' and other behavior associated with breakdown in sleep patterns. 
Emmanuel Tannenbaum