If you need help doing a few simple sums, you might want to ask your pet dog.

According to top boffins, the average pooch is better at maths than a two-year-old child.

It could explain why your beloved mutt casts an angry glance your way when you pop fewer treats in its bowl.

For decades, scientists have been trying to discover if dogs can count and do simple maths.

Like their human owners, dogs are great at numerosity – estimating the number of things in a group, for example how many dogs are in a park.

In tests carried out by Emory University in Atlanta, Georgia, it was observed that dogs’ understanding of numerical quantity lights up the same brain activity as in a human, in the parietal cortex.

Dogs are opportunistic and will snatch food closest to them, reports the Mirror.

But researchers noticed that if two bowls of treats were placed an equal distance apart from the pooch, he would choose the bowl that contained the most food.

Working dogs, especially Border Collies, Spaniels and Labradors, are among the breeds that demonstrate a particular understanding of counting.

In trials, dogs were sent to retrieve a number of ducks. Those who brought back two ducks knew they had to go back and find the missing one.

This seemed to be an inherited skill rather than learned, as researchers ran the experiment with pet dogs as well as trained hounds – although the trained dogs did better at the challenge.

Rebecca West of De Montfort University and Robert Young of the Catholic University of Minas Gerais in Brazil proved that dogs understand simple arithmetic. They used a technique known as preferential viewing, which was previously used to test if babies and infants can count.

The scientists showed 11 dogs a treat, then put it behind a low screen. They then showed the dogs a second treat and placed it with the first. When the screen was removed to reveal two treats, the dogs showed no interest.

But when the researchers removed a treat, or added an extra, so the dogs saw one or three treats, they showed signs of surprise. The dogs, just like infants in the human tests, had done the maths and knew instinctively that the answer in front of them was wrong.

He claims that according to several behavioural measures such as obedience, adaptation, and motivation, dogs have an intelligence equivalent to a child of two-and-a-half – and maths is only part of it.

But why would dogs need to count? It’s not just so they can keep track of the treats you’re giving them. In the wild, a mother dog needed to know how many pups she had, so she would know when to go in search of any stragglers.

According to canine psychologist Dr Stanley Coren of the University of British Columbia, dogs “may not be Einsteins but are sure closer to humans than we thought.”

That instinct has stayed with domestic canines even today – you might notice that your dog seems to count your family when you go out or come back home.

As for the age-old question as to who’s smarter, cats or dogs – science doesn’t yet have an answer.

Studies testing the ability of felines to do simple maths are hampered by the cats getting bored and walking away.