A readily reversible state of reduced awareness and metabolic activity that occurs periodically in many animals. Usually accompanied by physical relaxation, the onset of sleep in humans and other mammals is marked by a change in the electrical activity of the brain, which is recorded by an electroencephalogram as waves of low frequency and high amplitude (slow-wave sleep). This is interspersed by short bouts of high-frequency low-amplitude waves (similar to wave patterns produced when awake) associated with restlessness, dreaming, and rapid eye movement (REM); this is called REM (or paradoxical) sleep and is often accompanied by an increased pulse rate and dilation of the pupils. Humans typically experience four or five cycles of non-REM and REM sleep per night, with the latter accounting for around 20% of the total. Four stages can be distinguished in each phase of non-REM sleep, with stages 3 and 4 considered to be the deepest, slow-wave sleep. Several regions of the brain are involved in sleep and arousal, especially the reticular formation of the brainstem and certain pontine nuclei (see pons). Sleep is essential for life, but understanding of its function remains elusive. It may be necessary for repair and maintenance of neural connections in the brain or for consolidating memories and learning. The latter is supported by the finding that individuals have impaired memory of tasks learned immediately before a period of sleep deprivation.