In a jam packed grocery store, a woman shopper has a cart piled high in the middle of the "8 items or less" express line.

"Are you in the express line?" she's asked by someone with a single item.

She nods and says the small mountain in her cart belongs to both her and what appears to be her adult son next to her.

"We're just sharing the same cart. Is there a problem?"

Well, yes.

Because if I followed that logic and showed up with my kids, I could theoretically go through the express line with 24 items.

And if my friend with four kids did the same ... well, you get the idea.

But here's the thing.

This person's complete and utter disregard for proper grocery protocol aside, the number of items in her cart isn't what other shoppers should focus on when looking for the fastest line.

Which line will get you through the checkout fastest? The answer may surprise you. (Associated Press) "You see someone with a stacked cart, you want to get out of that line," says Dan Meyer.

A former math teacher, Meyer is chief academic officer at Desmos, a San Francisco-based company that makes software for developing and sharing educational content, including a web-based graphing calculator.

Recently Meyer decided to try to use math to figure out a way to get out of the grocery store faster.

He stood and watched the checkout lines in the store where he used to shop in his former neighbourhood, did some calculations, plotted his findings on a graph, and came to a remarkable conclusion.

Wrong strategy

Avoiding the person with half of Costco in their cart is the wrong strategy.

Here's why:

On average, it takes about three seconds to ring through an item.

But each shopper also exchanges a greeting/goodbye with the cashier, hands over cash or punches in a PIN for a payment card, waits for the receipt, gathers his or her bags, and leaves the area.

That takes 41 seconds.

So the number of items going through a line is not nearly as important as the number of people.

Put another way:

Dan Meyer studied shoppers in his hometown store to come up with the best way to game the grocery line. (Desmos) "If you have 10 items that are going through two different lines and in one all 10 items are in one basket and in the other those 10 items are split up between five different people, even though it's the same number of items in both, that express line will take much, much longer," Meyer says.

"Because every single person incurs this 41-second fixed time cost of pleasantries and payment.

"It's definitely counter intuitive."

Mind. Blown.

Consider how, for years, so many of us have operated under the Apu theory of grocery store egress.

If you're not familiar, his advice on The Simpsons for getting out of the Monstromart ("Where shopping is a baffling ordeal") was as follows:

Apu: "Let's cut to that line."

Marge: "But that's the longest!"

Apu: "Yes but look, all pathetic single men, only cash, no chitchat."

*Sails through longest line*

Don't believe The Simpsons' Apu

New research suggests The Simpsons' Apu Nahasapeemapetilon's strategy for getting out of the grocery store quickly may have been wrong. (20th Century Fox) Well, Apu was wrong.

Don't shy away from the dude who looks like he's stocking his bunker for the coming zombie apocalypse.

"Suspend your intuition for a second and get behind that one person with the large [overflowing] cart that no one else is getting behind. Don't just look at the number of items and think that that is your everything," says Meyer.

It's not a foolproof strategy, of course.

The wrench in the works

Potential pitfalls include the shoppers who:

Seem surprised to find out that payment is actually required and then inexplicably can't find their wallet.

Bought that weird, exotic fruit from that place not even the store computer has heard of.

Feel the need to actually tell the cashier how their day is going.

But Meyer says even with all those other possible variables, following his strategy is the way to go (faster).

"Any shopper will tell you there's other stuff going on. [Mine is] a simple model, which means it will fail sometimes, but as a rule of thumb it works remarkably well."

Want proof?

I'll provide it once the karmic joy wears off from walking out ahead of that grocery store scofflaw stuck in the express line.