If you have three cookies and dinner is five hours away, how slowly should you eat the cookies so that you don’t get dangerously hungry?

This is the kind of calculation that plants do during the night when they are waiting for sunlight to come back on. Here’s a recap from primary school biology: plants generate energy using photosynthesis. During the day they synthesise carbohydrates, such as sugars and starch, from carbon dioxide and water. And they store some of those carbs to feed on while it is dark.

Scientists at the John Innes Centre in the UK have found that plants consume their starch reserves in a cleverer manner than you would expect from an organism that doesn’t have brains. They do this by measuring the starch content in their leaves and the expected time until dawn, and then arithmetically dividing these two to find out how slowly the starch should be consumed. This enables the plants to use up their reserves at a constant rate so that they run out almost precisely at dawn.

“The calculations are precise so that plants prevent starvation but also make the most efficient use of their food,” said metabolical biologist Professor Alison Smith. “If the starch store is used too fast, plants will starve and stop growing during the night. If the store is used too slowly, some of it will be wasted.”

The scientists confirmed that plants are able to adjust their starch consumption rate if night time comes unexpectedly early or late, or if their starch reserves are different than normal due to genetic mutations.

“This is the first concrete example in a fundamental biological process of such a sophisticated arithmetic calculation,” said mathematical modeller Professor Martin.

So, how to these plant mathematics occur within the cell? The researchers turned to mathematical modelling to find this out.

“Since plants are able to adjust the rate of starch degradation according to variations in two independent quantities (the expected time to dawn and the amount of starch present), two separate species of molecule are clearly required,” the authors wrote in the paper published online at eLife.

The researchers hypothesised about these two molecules, marking them S for starch, and T for time. If molecule S stimulates starch consumption while molecule T prevents it, the calculation determining consumption rate is S divided by T. Simple and effective.

“The capacity to perform arithmetic calculation is vital for plant growth and productivity,” professor Smith noted. “Understanding how plants continue to grow in the dark could help unlock new ways to boost crop yield.”

Of course, even mathematically endowed plants are still firmly rooted in the ground, and we probably don’t have to worry about the tiny science hero Arabidopsis thaliana taking over the world any time soon.