The federal government has said it time and time again: marijuana legalization is meant to snuff out the black market and keep profits out of the hands of criminals.

To achieve that goal, the government has to grapple with a tough question: how much should legal weed cost?

We now know that the provinces will be responsible for setting the price of legal marijuana. In its November 2016 report, the federal Task Force on Cannabis Legalization and Regulation explained why pricing will be a tricky balancing act.

"Taxes should be high enough to limit the growth of consumption, but low enough to compete effectively with the illicit market," wrote the task force. "Mechanisms such as a minimum price should be used to prevent predatory pricing, if necessary."

What black market marijuana costs

It's hard to establish a definitive price for a black market item, but illicit dispensaries in Toronto regularly sell a single gram of marijuana for $10.

One gram of dried marijuana bud, with a $2 coin for comparison. The size of a gram varies depending on the density of the bud. (Evan Mitsui/CBC) November 2016 report from the Parliamentary Budget Office, however, offers a more in-depth analysis of black market marijuana prices across Canada. The report used data from PriceOfWeed.com , which collects user reports about marijuana purchases and makes them available in a searchable database.

After running the data through its own statistical analysis and regional weighting, the PBO reported that one gram of marijuana cost an average of $8.32 between February 2015 and August 2016. After adjusting for the bulk discounts common to black market marijuana transactions, the PBO's figure rose to $9.36 per gram.

Average prices were lower in British Columbia, New Brunswick, and Quebec, and higher in Alberta, Manitoba, Newfoundland and Labrador, Nova Scotia, Ontario, Saskatchewan, and the territories.

What legal marijuana costs

As of March 17, the average price of marijuana from Health Canada-licensed producers was $9.12 per gram, according to Brad Martin of CannStandard in Calgary.

Martin is a medical marijuana user who started tracking prices to identify the best value.

"I'm not seeing too much fluctuation since I've started," he said, referring to prices from legal, licensed producers.

Unlike the black market, Martin said, most licensed producers don't offer bulk discounts, although it's common to see shipping discounts on bulk orders.

Marijuana prices actually rose soon after legalization in the U.S. states of Washington and Oregon, said Martin, due to supply shortages. After the shortages were addressed, prices plunged.

"I don't anticipate seeing something in the magnitude that we saw in the states, specifically because the market size is smaller and because we've taken some mitigation measures on it," said Martin.

According to data from marijuana market intelligence firm BDS Analytics, a gram of marijuana bud cost $6.46 US in Colorado in January. The average price per gram in Oregon was $8.56. Both prices reflect bulk discounts, however — a single gram purchased at a dispensary would cost more.

What happens after legalization?

A November analysis from Canaccord Genuity estimates average prices for the total legal market (medical and recreational) will stay steady around $8 per gram until 2019 or 2020, with illicit prices remaining slightly higher, between $8 and $9 per gram.

Post-legalization demand could exceed supply and keep prices stable for a time, wrote Canacord Genuity analysts Matt Bottomley and Neil Maruoka. That's because Health Canada is relatively slow to approve licences for new producers, they said, and it takes a long time to set up a fully operational growing facility.

After legal production catches up to demand, they wrote, "the average price per gram of bud will begin to slowly decline."

What about taxes?

We don't yet know how much the government will tax retail marijuana sales. Those taxes, which could be applied at the federal, provincial, and municipal levels, might be lower for medical users (a common practice in U.S. states where marijuana is fully legal).

But if the government wants to bust up the black market, those taxes can't raise the price of legal marijuana beyond the price of illicit marijuana. Ottawa knows it, too.

"[Seeking] to displace the illicit cannabis market requires the establishment of a legal market that is competitive with the existing illicit market, including safe and reasonable access, price, variety of product choice and adequate consumer education," advised the task force on legalization.

"Therefore, excessive restrictions could lead to the re-entrenchment of the illicit market."