Animals often rely on their sense of smell to locate food. It's a law of nature: the first one to reach a food source has a better chance of surviving than those who do not. But how exactly does their brain translate scent and then navigate towards it?

In new research published this week in Nature Communications, Hebrew University of Jerusalem neurogeneticist Dr. Alon Zaslaver and his team reveal the complex mathematical calculations that animals -- even those as simple as worms -- do to find their next meal.

Think of the game "Hot or Cold?," says Zaslaver. "Imagine you're in a huge dark house and a chocolate cake has just been taken out of the oven. To find the cake, you'll probably sniff around to see what direction the cake scent is coming from and begin walking in that direction."

Turns out, worms employ this "Hot or Cold" computation in their search for food -- but with an added twist. First, a neural cell picks up the scent of food and set the worm on a course. As long as the scent intensity keeps getting stronger, this neural cell will remain active and direct the worm to keep moving forward. Otherwise, it will instruct the worm to stop and look for a better path.

But how does it calculate that better path? Enter a second neural cell which acts like Waze's "recalculating route" function. This second cell senses "derivatives," meaning it calculates whether the odor intensity is positive, and getting "hotter," or negative, and getting "colder." If the cell detects a negative derivative, it understands that it's getting further from the chocolate cake and needs to recalculate its route. This cell constantly computes new scent data to detect whether the current odor intensity is getting stronger or weaker and charts a path based on these new differential measurements. With a negative reading, the second cell will tell the worm to chart a new path whereas a positive one will tell it to stay the course.

This combination is a winning one, according to Zaslaver and Hebrew University graduate students Eyal Itskovits and Rotem Ruach. The two-part system of charting a course based on an initial scent measurement and then conducting follow up checks (all the time comparing them to the original measurement) to compute whether scent intensity numbers are going up or down is not only an impressive feat for a worm but a very smart and effective method in the search for food.

"These worms teach us an important lesson," shares Zaslaver. When looking to solve a problem, a quick solution is often attractive. "However, we need a backup system in place that monitors whether we are indeed moving in the 'right' direction, even if that new path differs from the one we originally set out on," concluded Dr. Zaslaver.

"A worm uses only two neural cells to perform this critical calculation. Imagine what we humans should be able to do with our 100 billion neural cells."