Schooling Microsoft On Random Browser Selection
Rob Weir got wind that a Slovakian tech site had been discussing the non-randomness of Microsoft's intended-to-be-random browser choice screen, which went into effect on European Windows 7 systems last week. He did some testing and found that indeed the order in which the five browser choices appear on the selection screen is far from random — though probably not intentionally slanted. He then proceeds to give Microsoft a lesson in random-shuffle algorithms. "This computational problem has been known since the earliest days of computing. There are 5 well-known approaches: 3 good solutions, 1 acceptable solution that is slower than necessary and 1 bad approach that doesn’t really work. Microsoft appears to have picked the bad approach. But I do not believe there is some nefarious intent to this bug. It is more in the nature of a 'naive algorithm,' like the bubble sort, that inexperienced programmers inevitably will fall upon when solving a given problem. I bet if we gave this same problem to 100 freshmen computer science majors, at least 1 of them would make the same mistake. But with education and experience, one learns about these things. And one of the things one learns early on is to reach for Knuth. ... The lesson here is that getting randomness on a computer cannot be left to chance. You cannot just throw Math.random() at a problem and stir the pot and expect good results."
People like the higher-ups at Microsoft (or most companies, I believe) do not care or want to hear about these issues.
:-|
If it does not involve a bonus (for the executive) or making them look good (the executive), engineers have to shut up and smile.
-Todd
p.s. Of course, this is my opinion--not what I would do, and it goes against good ethics. But, who in Silicon Valley cares about ethics?
Omne ignotum pro magnifico.
Microsoft was so grateful, because Microsoft cares.
Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
Ok in all fairness, bubblesort is arguably the best sorting algorithm because in today's modern computing power it will do the job sufficiently for 99% of your problems and is easy to implement and verify. Its especially efficient when appending an already sorted array to another already sorted array, which some other popular algorithms can't claim.
And the naive solution to a shuffling an array is similar to bubblesort, traverse through the array and generate a random number up to array size to swap the element with. If current position + number > array size then deduct the array size from the number to get the position to swap with. Maybe I should patent that because it apparently isn't obvious.
I think I have to agree that this looks like a situation where an author, likely a young one, is trying to nerd off when they dont understand how Microsoft operates. My question is why would you go through this kind of effort in the first place...
I developed one of the good implementations in school... god, Microsoft is such a pile of tinkerers! Is there anything they can get right, that a highschool student could not? No, I don't mean marketing, bribing politicians and blocking competition! They exist for 35 years and - heck - they still have problems with leap years!
sometimes I get the impression that they are trying the "a thousand monkeys on a thousand typewriters" approach...
The MAFIAA is a bunch of mindless jerks who will be the first up against the wall when the revolution comes
Actually they made the very intelligent decision to not waste precious resources on a simple problem with a simple solution that any freshman college student could manage in five minutes.
Seriously, the only criteria for this browser choice is that Microsoft does not pick the order ahead of time. It needs to be "random" in that the order needs to be chosen at start up, not that it needs to be 99% random.
The function used is extremely simple, is about 60% random, and consistently puts IE in the last position 50% of the time. Not even a European court is going to come back and say they were giving themselves an unfair advantage, and that's the whole purpose of the function. In court it would be viewed as going "above and beyond" what was necessary to ensure that their browser did not have the advantage.
What dumbass would waste hours of a programmer's time to solve a problem that can be sufficiently solved in five minutes? Not only is this solution "good enough", from an anti-trust standpoint it is probably far better than a truly random function.
Seriously, what the hell kind of world do you live on? Wait, wait, let me guess - you're some low-level wanna-be programmer, with absolutely zero management experience, and you think you could run your company better than those who sign your paychecks, am I right? I'll bet you bitch every day around your lunch table to your co-workers about how poorly your company is run, too.
Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller