Collectively, Americans shelled out about $72.7 billion on lottery tickets during that year, but most players got nothing for their gamble.

"The probability of winning a significant lottery prize is so small that we can state with confidence that the lottery win will not arrive," says Stephan Unger, assistant professor of economics at Saint Anselm College in New Hampshire.

Investing — real investing — brings much better results. You might be surprised just quickly and impressively lottery dollars could grow if invested instead.

Losing out on billions a year

Men's feet and dollar banknotes on the floor
Maryna Pleshkun / Shutterstock

MoneyWise.com finds that if Americans had decided to put all of their lottery money into stocks in 2016, that $72.7 billion would have grown to $98.9 billion just by the end of 2017. That's a serious gain.

The average U.S. adult spent $312.86 playing lotteries in 2016. Investing that money in stocks would have turned it into more than $425 by the end of 2017.

By "stocks," we mean the most basic kind of stock investment: an S&P 500 index fund that owns a piece of each of America's 500 largest companies. Our math is based on S&P 500 returns for 2016 and 2017, assuming dividends were reinvested.

One way to invest in index funds is by using an automated investment service, like Wealthsimple.

"When you invest, you're benefiting from compound interest — you're giving your money a chance to grow, and then for those gains to grow, and so on," says Mike Allen, portfolio manager at Wealthsimple.

"Markets rise and fall in the short term, but over the long term, investing is a much, much surer bet," Allen says.

And no, lottery tickets are no investment

MONTREAL, CANADA - DECEMBER 23, 2016 : Powerball New York lottery tickets.
dennizn / Shutterstock

In your state, people might spend much more than the average on lottery tickets — and be missing out on fairly sizable returns from stocks. Hang on, because we'll show you the overall lottery spending numbers by state.

But first, let's make sure you understand that playing the lottery is not a good investment.

Many people do see it that way. A survey by the Consumer Federation of America found that more than 1 in 5 Americans thought winning a big jackpot was their best shot at accumulating several hundred thousand dollars.

And, 3 in 10 who never graduated high school said buying lottery tickets was a "very important" wealth-building strategy.

But most people don't come out ahead in the lottery. In fact, Bloomberg found that U.S. lottery players lose 40 cents, on average, for every $1 they spend on tickets. Needless to say, those are horrible returns.

Like an NFL team aiming for the World Series

The Virginia Lottery, November 2002
Taber Andrew Bain / Flickr

Playing the lottery is no financial strategy, says Professor Unger.

"Categorizing it as such would be like having the Miami Dolphins switch over to baseball to try to win the World Series, just so the team could finally win its first championship since 1974," he says. "That's not a strategy, it is a near-impossibility."

A few states have resisted lotteries, but most have them, and they can be big moneymakers.

On the table below, find out how much money the people in your state are pouring into lottery tickets in a typical year, and see how that money could grow in a relatively short time if invested instead.

Then, do yourself a favor and think twice the next time you find yourself standing in the lottery line at the supermarket.

Lottery spending vs. investing that money, by state
State Lottery spending, 2016 Value in 2017, if invested
Arizona $811.8M $1.104B
Arkansas $429.9M $584.7M
California $6.276B $8.535B
Colorado $550.5M $748.7M
Connecticut $1.162B $1.580B
Delaware $400.6M $544.9M
Florida $5.731B $7.795B
Georgia $4.028B $5.479B
Idaho $192.0M $261.1M
Illinois $2.856B $3.884B
Indiana $1.126B $1.531B
Iowa $366.9M $499.0M
Kansas $256.0M $348.2M
Kentucky $921.3M $1.253B
Louisiana $478.8M $651.2M
Maine $236.2M $321.2M
Maryland $1.908B $2.595B
Massachusetts $5.234B $7.118B
Michigan $2.819B $3.833B
Minnesota $514.0M $699.1M
Missouri $1.292B $1.758B
Montana $55.5M $75.4M
Nebraska $168.1M $228.6M
New Hampshire $290.5M $395.0M
New Jersey $3.104B $4.221B
New Mexico $154.3M $209.9M
New York $8.344B $11.35B
North Carolina $2.217B $3.015B
North Dakota $33.9M $46.1M
Ohio $2.871B $3.905B
Oklahoma $189.6M $257.9M
Oregon $955.2M $1.299B
Pennsylvania $3.865B $5.257B
Rhode Island $542.2M $737.4M
South Carolina $1.487B $2.023B
South Dakota $156.1M $212.2M
Tennessee $1.521B $2.068B
Texas $4.794B $6.520B
Vermont $116.5M $158.5M
Virginia $1.894B $2.576B
Washington $658.9M $896.0M
West Virginia $1.087B $1.478B
Wisconsin $627.2M $852.9M
Wyoming $27.1M $36.8M

Alabama, Alaska, Hawaii, Mississippi, Nevada and Utah are not included in the table because those states don't have lotteries.

Again, the state lottery spending data is from the U.S. Census. We calculated the investment results using S&P 500 returns, with dividends reinvested, for 2016 and 2017.