“If you pull an all-nighter,” Dr. Benca said, “the next night your slow waves will be much larger.”

Other mammals experience REM sleep and slow-wave sleep, as well, indicating that humanlike sleep patterns existed early in the history of mammals. But beyond mammals, scientists have had a hard time finding humanlike sleep patterns. So far, they have been seen just in birds. The fact that the closest relatives of birds, like alligators and turtles, do not have our kind of REM sleep and slow-wave sleep suggests that birds, or their dinosaur ancestors, evolved humanlike sleep independently.

This parallel evolution has given scientists the opportunity to test the hypothesis that slow-wave sleep is essential. “If slow-wave sleep is a fundamental building block of sleep, then it should be true in birds as well as in mammals,” Dr. Benca said.

Niels Rattenborg of the Max Planck Institute of Ornithology in Germany tested this hypothesis by depriving pigeons of some slow-wave sleep. “We kept pigeons from taking their daytime naps,” he said. “All we did was tap their cage or move the cage floor or give them things to play with for eight hours before we turned the lights off.”

After the lights went dark, the pigeons had slow waves 27 percent stronger than on undisturbed nights. “What we found was that they actually showed response very much like that observed in mammals,” Dr. Rattenborg said. “There’s something in common in being a bird and being a mammal that results in sleeping this way.”

Dr. Rattenborg contends that birds and mammals have similar kinds of sleep because birds and mammals have much larger and more complex brains for their size than other vertebrates. In mammals, much of that expansion occurred in the front of the brain, in the neocortex. The neocortex endows mammals with sophisticated, flexible learning and decision making.

Only in recent years have scientists realized that birds have a brain region similar to the mammal neocortex. Known as the pallium, it arises from the same population of embryonic cells that produces the neocortex in mammals.

The pallium is made up of clumps of neurons, while the neocortex is organized in layers. Despite the differences, the pallium also lets birds carry out many impressive mental tasks. Some birds can remember thousands of locations where they hide food. Others fashion tools like sticks, to obtain food. Others can learn many bird songs. Pigeons can learn how to distinguish between Cubist and Impressionist paintings.