How to Design a Marijuana-License Lottery


In early 2014, Sharif Ibrahim was offered an unusual project. Ibrahim, then a Ph.D. student in mathematics at Washington State University, in Pullman, spent most of his time working on esoteric geometric-analysis problems. Now, his adviser told him, the state of Washington needed help. About a year and a half earlier, voters had approved the legalization of recreational marijuana, and the state was preparing to issue licenses to marijuana retailers. It had capped the number of licenses at three hundred and thirty-four—but the state received more than two thousand applications to open stores. The officials wanted a fair, and random, way of handing out the golden tickets. “The idea is: use a lottery,” Ibrahim, now an engineer at Intel, said in January, in Seattle, during a presentation at the 2016 Joint Mathematics Meetings, the combined annual conference of two major math associations. “How hard could that be?”

Ibrahim agreed to take on the task of designing the lottery, which would be run in collaboration with Washington State’s Social and Economic Sciences Research Center. But lotteries, he knew, aren’t easy to get right. In 1969, a Vietnam War draft lottery, which involved hand-drawing birth dates, in capsules, from a bowl, turned out to be biased toward men born later in the year, because the capsules weren’t thoroughly mixed. In 2003, a geostatistician in Toronto discovered that he could improve his odds of identifying winning scratch-off lottery tickets by studying the patterns of visible numbers on the cards. Last year, a former employee with the Multi-State Lottery Association, in Iowa, was convicted of tampering with a computer to fix the lottery results.

“It’s possible to screw it up,” Aaron Abrams, a mathematician at Washington and Lee University, who has studied lotteries, told me. “There have been plenty of lotteries that are supposed to be random that turned out not to be random.”

Ibrahim explained all of this to the audience in January, at the Seattle conference. While mathematicians in other conference rooms discussed “Lyapunov Exponents in Non-Archimedean Dynamics” and “Nodal Sets of Random Eigenfunctions of the Harmonic Oscillator,” Ibrahim gave his presentation, “Joint Mathematics: Lessons from a Marijuana License Lottery.” Thirty-one, with shoulder-length brown hair and small spectacles, Ibrahim would not appear completely out of place at a cannabis outlet. He carried a cloth shopping bag containing, for demonstration purposes, a deck of cards, five Powerball tickets, and a baggie of weed.

After laying out the basic problem, Ibrahim waded into the detailed mathematical steps involved in randomly ordering a set of lottery applicants. He discussed using a six-sided die to generate a random integer from 1 to 5, employing a modulo operation, and using a 16-bit source to randomly permute any list of up to 65,536 items. At one point, he made a joke about a 65,536-sided die being “basically a sphere,” which elicited chuckles from the audience.

To scramble the applicants in random order, Ibrahim developed software that could carry out an algorithm called the Fisher-Yates shuffle, which simulates shuffling a deck of cards. His computer program selected a card and swapped it with another card in the stack, then repeated the process until all the cards had been reordered. But the algorithm needed help picking cards at random. For each card drawing, Ibrahim had to supply an input: a random number, which the program would then run through a calculation to come up with the position of the card to be plucked next from the deck.

As it happens, there are several freely available services that generate random numbers from data on unpredictable physical processes. (Alas, Lavarand, which produced random numbers by processing digital images of lava lamps, was shut down in 2001.) Ibrahim obtained his numbers from two sources. One was, a service that creates random numbers from the atmospheric noise picked up by radio receivers tuned between stations. The other was a software program that gathers miscellaneous scraps of data on a computer (such as the precise time that a key is pressed), mixes them together, and extracts random numbers from the pool. Ibrahim likened this pool to a boiling pot of soup, to which bits of spice are continually being added: “You take a spoonful out when you want some random numbers.” One number from each source was then fed into a computation to produce a third random number, which became the input to the card-shuffling algorithm.

Using two independent sources of random numbers insured that neither could be a single point of failure. Even if there was a “vast conspiracy,” Ibrahim told me, “the people controlling can’t decide who gets the marijuana licenses.” He set up other safeguards as well: a different person would obtain the random numbers from each source; the program would be run on two computers to make sure that they gave the same results; and a colleague examined his software code line by line, to confirm that it did what he claimed. “The last thing I need is to be accused of fixing a lottery,” he said. Abrams, who read a copy of Ibrahim’s conference presentation, said that the approach seemed thorough: “It looks like it should produce results as random as you could hope for.”

On April 23, 2014, the Washington State team ran the lottery, with little fanfare. “It really turns out to be somewhat anticlimactic, because it’s really just, you press a button on a computer and it says, Okay, here are the results,” Ibrahim said. “It doesn’t have a drumroll or bouncing balls.”

But a new problem soon emerged. The state had mistakenly disqualified some applicants from entering the lottery, and now they had to be added back, without affecting the ranking of the existing applicants. Ibrahim also needed to somehow remain blind to the new candidates’ identities, even though their names were public.

To solve the problem, Ibrahim devised a “supplemental lottery,” in which every applicant except one—the new applicant—was a dummy placeholder. The process was similar to shuffling a deck of cards, face down, in which all but one card is blank. The new candidate received a ranking, which was shared with one of the original candidates; for example, both might be ranked No. 1 out of 10. If that new applicant got a winning number and successfully completed the rest of the licensing process, the state would, in some cases, need to add an extra license to the jurisdiction’s allotment. The advantage of this approach was that all candidates had the same odds of attaining each rank, regardless of whether they had been in the original or supplemental lottery. Paul Dreyer, the organizer of the Joint Mathematics Meetings session and a mathematician at the RAND Corporation, in Santa Monica, California, said, “Not only was his method fair, it was actually provably so, which is always very satisfying.”

So far, the state has awarded two hundred and ninety retail licenses. (Earlier this year, officials raised the cap on the number of licenses to five hundred and fifty-six.) One of the lottery winners, James Lathrop, opened Cannabis City, in Seattle’s Industrial District, a few blocks from the Starbucks headquarters. On a Friday afternoon in late January, a black bus with “CANNABUS” in bright green letters on its side was parked in front. In the small, wood-panelled store, customers perused marijuana-infused lip balm, gel pens, peppermint breath strips, and chocolates; a glass case displayed packaged bud and joints of varieties such as Arjan’s Haze, Blue Dream, and Durban Poison.

Lathrop is satisfied that the ranking of applicants was random. “The lottery itself was fine,” he said. But he and other local marijuana-shop owners still have plenty of complaints about the licensing process. Applicants were required to provide, at a minimum, a letter of intent to lease a store; it was difficult to figure out which locations were legal; and more than one person was allowed to apply using the same location. Bob Ramstad, owner of the marijuana shop OZ., in Seattle, said that some candidates “were effectively ballot-box stuffing” by having relatives and friends submit additional applications for a site, to improve the odds of winning. Although such matters were beyond Ibrahim’s control, he is sympathetic. “I can certainly understand how people might not like it, in retrospect,” he said.

Ibrahim, who finished his Ph.D. program in 2014, said in an e-mail that he did not smoke any pot as part of the research for his project: “The only hash used in the lottery was cryptographic.”



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s