If we could somehow rewind the history of life to the dawn of the animal kingdom, it would be unlikely that we humans would ever evolve, the evolutionary biologist Stephen Jay Gould argued. The history of life was shaped by too many flukes and contingencies to repeat its course.

Scientists can’t turn back the clock 700 million years, so we can’t know for sure whether Dr. Gould was right on that particular point. But in experiments using bacteria and other fast-breeding organisms, scientists can replay evolution many times over in their labs. And the results of a new experiment published Thursday in the journal Cell Reports demonstrate — with movies — that evolution can be astoundingly predictable.

The experiment was carried out by Joao Xavier of Memorial Sloan-Kettering Cancer Center and his colleagues. They studied a common species of bacteria called Pseudomonas aeruginosa. These microbes live pretty much everywhere — in dirt, in water, on our skin. Under certain conditions, they also invade our bodies and cause dangerous infections. People with cystic fibrosis, for example, can get P. aeruginosa infections in their lungs, which are often impossible to eradicate.

To better understand the biology of this pathogen, Dr. Xavier began to study how it searches for food. In a process called swarming, the bacteria spray out gooey molecules that form a slippery carpet; they can then slither over it by whipping their tails, devouring food they encounter along the way.