Slashdot Mirror


Canada's 'Random' Immigration Lottery Uses Microsoft Excel, Which Isn't Actually Random (gizmodo.com)

An anonymous reader writes: Last year, Canada introduced a new lottery system used to extend permanent-resident status to the parents and grandparents of Canadian citizens. The process was designed to randomly select applicants in order to make the process fairer than the old first-come, first-served system. There's just one problem: the software used to run the lottery isn't actually random. The Globe and Mail reported the Immigration, Refugees and Citizenship Canada (IRCC) uses Microsoft Excel to run the immigration lottery to select 10,000 people for permanent resident status from a field of about 100,000 applications received each year. Experts warned that the random number generating function in Excel isn't actually random and may put some applicants at a disadvantage.

First, it's best to understand just how the lottery system works. An Access to Information request filed by The Globe and Mail shows that IRCC inputs the application number for every person entering the lottery into Excel, then assigns them a random number to each using a variation of the program's RAND command. They then sort the list from smallest to largest based on the random number assigned and take the first 10,000 applications with the lowest numbers. The system puts a lot of faith in Excel's random function, which it might not deserve. According to Universite de Montreal computer science professor Pierre L'Ecuyer, Excel is "very bad" at generating random numbers because it relies on an old generator that is out of date. He also warned that Excel doesn't pass statistical tests and is less random than it appears, which means some people in the lottery may actually have a lower chance of being selected than others.

22 of 224 comments (clear)

  1. Irrelevant by XXongo · · Score: 5, Insightful
    The story is about an issue that is completely irrelevant.

    It doesn't matter whether the "RND" function is ideally random in a mathematical sense. It only matters whether the "random" number generated is independent of the identities of the people applying to be admitted.

    1. Re:Irrelevant by geschbacher79 · · Score: 5, Insightful

      Exactly. And if the order in which the data is inserted into Excel is essentially random, that's good enough. There is no fair or unfair if the number of applicants exceeds the quota and there is no opportunity to game the system (such as naming yourself Aaron A Aaronson to appear first, or something)

    2. Re:Irrelevant by JourneymanMereel · · Score: 4, Insightful

      That's kind of my thoughts on it, too. And who is at a disadvantage in this scheme? Is it the person entered in row 13,428? Or anybody who was entered on July 16th? The chances of ending up at an advantage or a disadvantage are themselves probably pretty random.

      --
      Life has many choices. Eternity has two. What's yours?
    3. Re:Irrelevant by Anonymous Coward · · Score: 5, Funny

      such as naming yourself Aaron A Aaronson to appear first, or something

      [Tears up application]

    4. Re:Irrelevant by Solandri · · Score: 3, Insightful

      While that's true, if Excel's RNG results in a pattern (e.g. cell A2534 is always assigned a low number and thus selected), it could result in immigration employees who know of this gaming the system, to do an immigrant friend a favor or even auctioning the spot to the highest bidder.

      The bigger question to me is why are they using Excel for this? Spreadsheets are for calculating things. They are absolutely the wrong tool if you need the data you're working on to remain consistent or auditable. An immigration employee could take the spreadsheet after the random numbers were assigned, and copy-paste names or random numbers around to move people to/from the selected and denied categories, and there'd be no way to detect they'd done this.

    5. Re:Irrelevant by Obfuscant · · Score: 5, Insightful

      While that's true, if Excel's RNG results in a pattern (e.g. cell A2534 is always assigned a low number and thus selected),

      If you had bothered to read the finr article, you'd have learned that the tempest in the teapot is that Excel uses a pseudorandom generator. That's just like what a lot of systems use. It costs time and money to do real random generation, and it requires some hardware. PGP, IIRC, requires someone to type at the keyboard and it times the characters to generate a random number. There are radiative decay RNGs. There's even a lava lamp based RNG.

      But MOST of the "random" for most software is pseudo. And the algorithms are published.

      The fine article talks about how bad some RNG is because you could "reverse engineer" the algorithm. In 1980 I tested the RNG in DEC RSX-11, and I simply looked up the algorithm in the manual to see if the results from testing matched theory. In a manual. "This is how the RAND function works..." As I recall, it was based on doing a simple calculation on a double precision number and pulling the middle 32 bits out of the number as the random output. You could actually write the code to do this yourself.

      it could result in immigration employees who know of this gaming the system, to do an immigrant friend a favor or even auctioning the spot to the highest bidder.

      Oh for pete's sake. If an immigration employee has this much access to determining who wins and who loses, then even if the RNG is a true, completely unpredictable, physical random process based number, all he'd have to do is run the random generation process over again until his chosen winner "won".

      The bigger question to me is why are they using Excel for this? Spreadsheets are for calculating things.

      Yeah, calculating things. Like random numbers. They're using Excel because it works for this and didn't cost them $1 million to pay a consultant to write something in python to do the same thing.

      An immigration employee could take the spreadsheet after the random numbers were assigned, and copy-paste names or random numbers around to move people to/from the selected and denied categories,

      They could do this even if the RNG is truly random, so the RNG has nothing to do with the problem.

    6. Re:Irrelevant by Anonymous Coward · · Score: 3, Insightful

      They're using Excel because it works for this and didn't cost them $1 million to pay a consultant to write something in python to do the same thing.

      A million dollars?

      $ od -d /dev/urandom | less

      I'm in the wrong job.

  2. even weaker by goombah99 · · Score: 5, Insightful

    The story is about an issue that is completely irrelevant.

    It doesn't matter whether the "RND" function is ideally random in a mathematical sense. It only matters whether the "random" number generated is independent of the identities of the people applying to be admitted.

    It isn't even that. Just because the distribution of random numbers isn't random it doesn't mean the sort order based on that isn't random. For example, suppose my random number generator only put out numbers divisible by 1/(2^16) which is what a finite precision binary based system is going to do. This distribution isn't random because it's zero density at many possible floating point values. Yet the sort order might be perfectly random.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  3. Random enough by duke_cheetah2003 · · Score: 4, Interesting

    Regardless of Excel's poor random function, the way this is being described as being done, it sounds pretty legit and random enough. There's no bias on assigning the random number to each name, and the name itself isn't being used to generate the random number. So this should be fine.

    Just because it doesn't meet some math/computer geek's standards of proper random number generation, doesn't mean it's not useless for this application. I say thumbs up. The RNG being perfect isn't really necessary.

  4. Re:So... by Archangel+Michael · · Score: 3, Interesting

    There is explicit, and there is implicit. There is a whole slew of people who think that if you can sneak across the border, that you are entitled to live in America unmolested for any reason because "oppression". I would consider this implicit "accept all immigrants who show up" stance. It is largely why Donald Trump wants a wall built, and none of these other people want a wall. Again, building the case for implicit "accept all". And then there is the Sanctuary Cities. And and and ...

    On the Explicit category, there is me. I explicitly state that ANYONE that shows up at the border, and checks in (documented) should be allowed in*. Yes, I am a libertarian. I also want to remove the stupid policies and fake fighting over the (D) party who loves illegal aliens, and the (R) party who loves cheap labor and remove those policies from existence.

    I realize that I am in the minority for stated opinions, but the reality is, there are enough people who already "want" it in some way or fashion, I'm just honest about it.

    *Other conditions apply, but for simplicity sake, this is the basis for my policy.

    --
    Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
  5. Re:Trump is a traitor by duke_cheetah2003 · · Score: 3, Funny

    "When you are dead, you do not know you are dead. It's only painful & difficult for others. The same applies when you are stupid." --someone

  6. Re:So... by Geoffrey.landis · · Score: 3, Informative

    Who is the "they" you speak of? I can think offhand of anybody who says "accept all the immigrants who show up."

    That's effectively the position of Democrats.

    Is it? Can you quote a single Democrat saying this? Ever?

    No, I didn't think so.

    This is technically the libertarian position

    Libertarianism also favors small government, freedom of association and private property rights, all of which are severely limited; those are necessary prerequisites for libertarian style open borders.

    Yep. Libertarians are pretty good at avoiding mentioning their position on the hot-button issue of immigration. Guns and drugs, that's what they want to talk about.

    --
    http://www.geoffreylandis.com
  7. Re:So... by alvinrod · · Score: 5, Informative

    I think you're confusing libertarians with anarchists. Libertarians believe in strong property rights, which naturally implies borders and a need for some entity to enforce them. Some would argue that doesn't necessarily need to be a government, but historically that has been a major role of governments.

    Most libertarians probably wouldn't care about immigration if the U.S. had no welfare state as was historically the case throughout most of the country's history. Once you got off the boat you were on your own, but plenty of people were perfectly happy with that arrangement. This generally worked quite well with the homestead system since anyone who wanted to move west could do so and a large number of immigrants did. You had the freedom to make something of yourself and if you couldn't that was your own problem.

    However, the reality in modern America is that the government is expected to care for anyone who shows up and pay for their children's education and healthcare. That necessarily means taxation, which libertarians are generally loath to agree to outside of the limited government functions that they're in favor of, so they'll tend to be less in favor of immigration with those kinds of strings attached to it. If everyone immigrating from Mexico were a doctor, engineer, or otherwise highly skilled such that they'd pay more into the system than they get out of it, I suspect there'd be no disagreement with letting in as many people who fall into that category either.

  8. Re:So... by Midnight+Thunder · · Score: 3, Insightful

    These days the main libertarian issue is to get rid of Obamacare and let people simply die when they get sick.

    "Think of it as evolution in action," that's their catch-phrase.

    --say, we may need those immigrants after all!

    It worse than that "I am okay, so nobody needs it", until things are not so rosey and then it is "what happened to the free market that was meant down health care prices?"

    --
    Jumpstart the tartan drive.
  9. List is already random by hawguy · · Score: 4, Insightful

    Unless they let entrants pick where they are in the list, it doesn't matter if the random number generator is not completely fair.

    Maybe it's biased such that entrants 50,000 - 51,000 are much more likely to end up sorted to the top, but unless the entrants can choose where they are in the list, I don't see why that really matters. Sure, someone that controls the list could move their friends to that range to make them more likely to end up at the top, but they could also move their friends to whatever random numbers and up at the top.

  10. Dems vs Repubs [Re:So...] by XXongo · · Score: 4, Insightful

    Actually, I've seen exactly the opposite analysis.

    Democratic politicians want more legal immigration but less illegal immigration. Legal immigrants vote and pay taxes, illegals don't.

    Republican politicians want less legal immigration, but more illegal immigration. Illegal immigration depresses wages, meaning more profits for corporations. (Even if the corporations don't hire illegals, the illegals have a downward pressure on all unskilled-labor wages).

  11. Translation: by gman003 · · Score: 5, Funny

    Gizmodo just discovered what a PRNG is

  12. Re:So... by Oswald+McWeany · · Score: 3, Interesting

    Who is the "they" you speak of? I can think offhand of anybody who says "accept all the immigrants who show up."

    This is technically the libertarian position, true (libertarians consider borders to be government red tape restricting people's natural freedom to go wherever they want), but most libertarians are smart enough to mostly work on less hot-button issues, like freedom of guns and drugs, instead of freedom of borders.)

    I've also noticed that most libertarians aren't really libertarians. Most people I've met who self-describe as Libertarian tend to be Republicans who are pissed off at the Republican party and call themselves libertarian as a protest. When I ask them do you believe "x, y, and z" (insert libertarian positions) the answer is always, "well no... but I think we need less government". Libertarian is not republicanism minus racism and Libertarians are not just republicans that smoke pot. That's not what libertarian means.

    --
    "That's the way to do it" - Punch
  13. Re: So... by LordWabbit2 · · Score: 4, Funny

    Fuck off, we have enough assholes here, we don't need more Americans.

    --
    There are three kinds of falsehood: the first is a 'fib,' the second is a downright lie, and the third is statistics.
  14. LIbertarian's believe in whatever's convenient by rsilvergun · · Score: 3, Interesting

    I don't see a lot of consistent application of principles from them. I've yet to meet one that turned down free medical care when they needed it. I've known a lot of libertarians who go to the VA long after they've left the military. I know a lot that work in psuedo private sector jobs like the defense industry. My personal favorite is a libertarian friend of mine who gets it from his dad, but has severe health problems. He's come up with some of the craziest justifications to square his LIbertarian ideas with the fact that he needs medicine to live but can't afford to buy it himself (and wouldn't be able to even in a perfect libertarian world since his illness is bad enough he can't work).

    Even Ayn Rand took social security in her old age. Though to her credit she had to be convinced to take it rather than die in the street. Her writings weren't profitable until the Republicans decided they needed an intellectual

    My experience with Libertarians is they're folks who never grew out of that phase in your teenage life where you really, really hated being told what to do. You know the one. It's when you're just starting to realize how capable you are, when you're at your peak of learning capacity and you're figuring things out faster than the adults. And you really are (teenage brains work that way).

    What I find especially maddening is the libertarians who rail against coastal elites and SJW and are perfectly OK with billionaires having unlimited wealth because, hey, they earned it by virtue of having it. Never mind the fact that money is power and you can't be free in a world with that much wealth inequality. After all, you're not free if somebody controls your access to food, shelter, healthcare, education and transportation (the latter needed to access the former). You're one week's food, one winter's cold or one pill away from slavery. True freedom only arrives when everybody has their needs cared for not because they can threaten or cajole people into getting it but because they're humans, and humans have a right to those things.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  15. Fake News by Jodka · · Score: 3, Insightful

    The story is about an issue that is completely irrelevant.

    It doesn't matter whether the "RND" function is ideally random in a mathematical sense. It only matters whether the "random" number generated is independent of the identities of the people applying to be admitted.

    With no intention of diminishing the importance of your statement; that is blindingly obvious. There are two other excellent points raised by others in the comments here: that imperfect randomness does not make the process manipulable by immigration candidates and that sort order of assigned imperfect random numbers can itself be perfectly random.

    The story is mis-reported as a scandal; there is in fact no scandal whatsoever. So who made up the fake news? Tom Cordoso is the author of the original story at the Globe and Mail which the Gizmodo article linked in the Slashdot summary cites. Cordoso quotes Université de Montréal computer-science professor Pierre L’Ecuyer as saying “Anything would be better” [Than the Excel random number generator] but, crucially, Cordoso omits the context of that comment. Was L’Ecuyer referring to its suitability for this particular method and application, or was he commenting on its suitability for general use, including, for example cryptography? In neither the Gizmodo nor Globe and Mail articles can I find any mention of an expert unambiguously expressing judgment on the immigration randomization method specifically. A close reading suggests that the criticism originates with the journalist, and that he deceptively implies it to be the opinion of experts.

    Some enterprising citizen journalist should contact the cited experts and ask them 1) Did their comments refer to general usage of the Excel random number generator or specifically to the immigration randomization methodology. 2) What is their opinion of the immigration randomization methodology 3) Do they agree with the points made here about it being a nothingburger 4) Have they read the Globe and Mail article, if so do they believe that their comments were wrongly contextualized.

    If anyone does that, it would be nice to see a followup article here on Slashdot.

    --
    Ceci n'est pas une signature.
  16. Re: So... by liquid_schwartz · · Score: 3, Insightful

    Must be nice to be ignorant of history. Mexico had alot of problems that were never replicated in the US. Spanish and English colonization was very different. Your remarks remind me of the times my Mother used to tell me that Israel turned desert into farmland. Remarkably ignorant of history.

    Everyone has their cross to bear but at some point they have to move on. I'm aware of history but I neither use it as an excuse nor an accusation. All countries have behaved badly in some ways at some times, are we all victims or do we move on and try and make things better?