Ontario PC leadership contest

The Toronto Star recently tried to compare the Ontario PC leadership race to the American Electoral College (EC) system. While there are some similarities, the comparison is mostly a bad one.

The American EC has members from each state based on their Congressional seats. The number of seats each state has in the House of Representatives depends on its population (i.e. they are assigned proportionally) while the number of Senate seats is always 2.  This gives the smaller states a slightly greater number of EC seats than they should have.

With the exception of Maine and Nebraska, each state’s EC seats are winner-take-all. Maine and Nebraska split theirs 2 – 1 with the the 2 going to the first place finisher and the 1 going to the second place finisher.

The Ontario PCs give each riding up to 100 votes. If more than 100 members vote, their votes are divided proportionally. If fewer than 100 members from a riding vote, their votes are counted directly. For example, in a riding with a small membership, 25 people could vote for A and another 12 vote for B. These votes would be counted directly.

However if a larger riding had 250 people voting for A and 120 voting for B, the votes would be reduced to a fraction of 100. A would get 100*250/370 or 68 votes while B would get 100*120/370 or 32 votes.

While the votes for each candidate are assigned proportionally within a riding, they are not equal between ridings. A vote from a member in a small riding is worth more than a vote from a member in a large riding.

In effect the American EC system is the inverse of the Ontario PC’s system. The EC votes are mostly dependent on the population of each state but are almost always assigned on a winner-take-all basis. The Ontario PCs, on the other hand, treat each riding as equal but allocate the votes proportional to each riding’s actual votes.

The other difference is that the Ontario PCs use a preferential ballot so that the eventual winner requires half of the (weighted) votes. American voters only get to vote for one candidate. If the EC fails to elect a President with an absolute majority of their votes, the decision goes to the House of Representatives.

Neither process is very good. While there is no good way to elect a person to a position of extraordinary power, these are two of the worst. I say that because they violate an inherent principle of representative democracy: that all voters should have equal votes (the power of your vote should not depend on where you live or who you vote for).

In the American EC system, your vote could be counted equally regardless of where you live but because the EC is elected using a winner-take-all system, excess votes for the winning candidate and votes for the losing candidates have no power.

Conversely, the Ontario PC system diminishes your vote if you live in a riding with more than 100 members. The larger the local riding association, the less your vote is worth.

I’m not going to recommend ways to fix these processes because, as I said above, there is no good way to elect someone to a position with extraordinary power. Electing a King doesn’t make you a democracy.

Posted in Electoral Reform, History, Politics | Leave a comment

Wages and Prices

Some people are predicting gloom & doom over Ontario’s upcoming minimum wage increase. On January 1, 2018 the minimum rate for most workers rises from $11.60 to $14.00. Some people claim this will lead to massive job losses and increased costs for everyone.

Simple math should dispel these notions but most people don’t seem to want to do it. So here’s my basic take on the situation:

The minimum wage is currently $11.60 and will increase in 2018 to $14. That is an extra $2.40 per hour. If a store is open 16 hours per day, that’s an increased cost of $38.40 per day or $1,152 per month.

While that sounds like a lot, please note that it only applies to businesses that hire employees. Mom & Pop shops won’t see any increase since they have no employees. While bigger operations will have to pay more, the payroll costs will be lost in the other business expenses.

For example, the local coffee shop is pulling in hundreds of dollars per employee hour while paying out thousands monthly in rent, heating, lighting and supplies. Since those costs aren’t changing, neither should the cost of a coffee. Even if an employee only sells 20 cups of coffee per hour, that would fully covered by a 12 cent increase in the cost of a cup (and no increase in the price of other items).

In the local no-frills, each cashier process thousands of dollars of groceries per hour. Their wages are lost in the other costs so you shouldn’t see any price increase. The same thing holds true for the people responsible for receiving and stocking the shelves. The costs of staff handling the merchandise is far less than a penny an item.

Other staff, such as supervisors and accountants, aren’t earning minimum wage so their costs remain the same.

Those two jobs represent the extremes of retail – a low volume coffee shop versus a high volume grocery. At the one end, labour costs are a significant factor while at the other, they are negligible so far as the consumer is concerned.

People predicting increased costs are simply wrong. Some businesses may need to raise their prices marginally but most won’t need to raise any prices.

So why are business owners so opposed to raising the minimum wage? Generally it’s because they want to keep all costs down, whether they are significant or not. Every dollar they pay out is one less dollar they make, so far as their vision extends.

What they don’t see is that a lack of customers also limits their income. People earning the minimum wage don’t make discretionary purchases, like a cup of coffee, very often. They only buy food that is on sale and get some of their sustenance from the food banks. They aren’t fixing up their homes or apartments. They aren’t buying new clothes.

In Ontario almost 3 out of 10 workers earns close to the minimum wage. Increasing their buying power brings a lot of new consumers to the marketplace. They’re not going to be traveling abroad to spend their money. They’re going to be spending it locally.

They’re not going to be hiding their income in offshore accounts either. It will be taxed, as will their spending, with the revenues going back to our governments. This will help keep taxes down – something that the people arguing against increasing the minimum wage seem to value.

Of course you don’t have to just argue mathematics over this. There is ample evidence that raising the minimum wage doesn’t raise prices or increase unemployment. Indeed, one need only look at European nations where the lowest wages are far higher than what Ontario pays, to see that high minimum wages are beneficial.

What this really is about is that business owners see things in terms of competition. If you win, I lose. Their minds are generally not thinking in terms of societies or long term benefits. Indeed capitalism is envisioned as a purely reactive system with any ideas about planning considered anathema.

Like any ideology however, purity is at odds with reality. America in the 19th century, when capitalism was at its purist, was no utopia. Attempts to emulate it have never led to good results.

Raising the minimum wage also won’t bring about utopia. However it is a step in the right direction that is welcome after decades of regression.

Posted in Economics, History, Labour, Politics, social programs | Leave a comment

Witch Hunting

I’m getting fed up with all the people coming forward to denounce people over alleged sexual wrongdoings. They are demeaning the very real complaints being made against sexual predators. And they are destroying the reputations and careers of people who have done little to deserve it.

The case of George Takei is what pushed me over the edge. The complainant makes allegations about something that happened 36 years when he was drunk to the point of passing out. Presumably Takei was in a similar state. The complainant alleges that Takei sexually assaulted him. It might have happened or he might have misinterpreted or misremembered what happened or he could just be making it up. I don’t know.

However it’s clear that Takei isn’t a Bill Cosby, drugging his victims. Nor is he a Weinstein or Ailes threatening careers if they don’t go along. This also isn’t a male versus female situation where the assaulter has a presumed strength advantage.

At worst Takei once attempted to take advantage of someone who had consumed the same amount of alcohol as him. Or perhaps he didn’t. I don’t care. If it did happen as reported, Takei learned from the experience and didn’t repeat it. Many people have done much worse when they’ve had a few yet not learned anything. This includes Takei’s accuser who drove shortly after the incident despite having apparently consumed too much alcohol.

Woody Allen was lambasted for saying that he hoped that Weinstein affair didn’t lead to a witch hunt. Sadly it appears that his fears were justified.

George Takei has done a lot of good with his life. Even it the allegations are true, he shouldn’t be judged by one decades-old mistake. Let’s save our condemnations for people like Cosby, Ailes and Weinstein and others who abuse their positions to do significant harm to people. Let he who is without sin cast the first stone.

Posted in Arts, History, Religion, social programs | Leave a comment

Damned Lies and Statistics

It’s a poorly-kept secret that computer games cheat. What’s unfortunate is when the developers try to deny that is what they do to increase the apparent strength of an AI opponent.

Obviously this is something that isn’t applicable to all games. Chess or Go have no way to cheat. However there are a lot of games with endless opportunities for the game’s developer to use dirty tricks to make their AI players more formidable.

One game that I play a lot on my smart phone is Backgammon by AI Factory. It’s a free game with a reasonable user interface, but the developers couldn’t even program a reasonable algorithm for “bearing off” (removing pieces after you’ve got them all into your home quarter).

The basic idea is to optimize the removal of pieces for each dice roll. If you’ve got all 6 spaces covered in your home quarter, you remove a piece from each number rolled on the two dice. That’s simple enough.

Where it gets trickier is when you don’t have all the spaces covered. The basic tactic is to remove one piece if possible. However you also want to make the best use of the numbers rolled on the two dice by moving other pieces closer to the end.

This is where the AI falls down. Say you rolled a 6 and a 1 and your highest remaining piece was 5 away from the end. A rational person would use the 6 to remove the 5 piece and use the 1 to move another piece closer to the end. The AI will use the 1 first to move the 5 piece to 4 then use the 6 to bear it off. This wasted 2 out of the 7 rolled when an optimum tactic would only have wasted 1.

It does this because there are situations where using the smaller number first makes sense. However their algorithm is basically wrong. In a close game, letting the AI handle the tedious task of bearing off could result in you losing. Conversely, because it controls your AI opponent, it also means that the AI loses more games that it should have based on the dice roles.

Faced with an AI that plays an inferior game, the developers resorted to the old standby tactic of cheating. However they don’t want to admit that’s what they do, so to back up their case, they collect statistics on the games you’ve played.

According to them, I’ve won 4,411 matches versus the AI’s 2,419. While I’ve rolled 24,907 doubles, the AI has rolled 25,176 – a negligible difference. Similarly we’ve won almost exactly the same number of First Dice rolls.

Those are the easy statistics to gather and the easiest to verify. However any backgammon player will tell you that they are also pretty crude indicators. Slightly better are the post-game statistics on the totals of all your dice rolls.

Again though, timing is everything. If you have a piece on the bar, rolling double-sixes is unlikely to help you.

And that’s where the game doesn’t collect statistics. One consistent thing I’ve noticed is that it’s almost impossible to keep the AI’s pieces on the bar while my own pieces have extreme difficulty getting off the bar. Statistics on that could be collected but aren’t.

And double-sixes are exactly what I usually roll when I have a piece on the bar. Conversely double sixes are a common roll for the AI after I’ve decided to run for home. And they are also a common roll for my last before the AI bears its last piece off, defeating me. When it gives me double-sixes that don’t help, it allows it to produce statistics showing the dice rolls were closer than they were. When it gives itself double-sixes, I might get some other double that isn’t helpful but which allows the program to report similar numbers of doubles.

I could collect the statistics to demonstrate this but what’s the point? The game’s developers don’t appear to interested in developing a better AI, which is what I really want – an opponent that can challenge me without cheating.

I just wish they wouldn’t try to cover up their cheating behind meaningless statistics.

Posted in Science and Mathematics | Leave a comment

9/11 conspiracy theories are all delusional

I’m still seeing people posting 9/11 conspiracy theories on Facebook. When I point out that they are giving even conspiracy theorists a bad name, someone pointed me to a 9/11 conspiracy theory site, as if that somehow proved something.

I hate to break it to people but there is simply no way any of 9/11 conspiracy theories (except that it was planned and executed by Al Qaeda) could possibly be true. You can tell that because:
1) they all require too many people to keep a secret about something horrific being plotted against their own people, and
2) they all involve sufficient complexity to give Rube Goldberg nightmares.

The simplest theory that fits all the known facts is that as many as 19 Al Qaeda operatives hijacked 4 airplanes and attempted to fly them into buildings. 3 attempts succeeded while the fourth failed.

A conspiracy of this size is difficult to pull off. It only succeeded (partially) because none of the attackers were Americans. They saw the U.S. as the enemy and thus had few qualms about attacking even mainly civilian targets.

A false flag operation on the other hand would require at least similar number of people who would be willing to sacrifice their own lives to attack their fellow countrymen for nebulous political reasons.

Or perhaps the false flag involved real attackers but the planning was directed by people pretending to represent Al Qaeda. That would require fewer people to be directly involved but would require those people to be able to convince others that they were actually legitimate Al Qaeda operatives for an extended period.

Setting up a fake Al Qaeda network would be tricky but is possibly doable. However in the post-Snowden, Post-Manning and Wikileaks era, you’d expect to see some sign of it in the released documents. There isn’t any.

However the conspiracy theorists don’t stop there. They insist that planes that were seen flying into the twin towers didn’t do sufficient damage to destroy them. Bizarrely they also claim that the plane seen flying into the pentagon didn’t and that it was actually a missile.

This is where the 9/11 conspiracies venture into the delusional. What political goal could be achieved by destroying the twin towers that wasn’t already achieved by damaging them while killing hundreds of people? Absent a critical motive, why risk the entire conspiracy by adding another one to ensure that the towers came down?

And why fire a missile at the pentagon when you’ve got a flight full of passengers to account for? While it’s conceivable that a few people could be duped into hijacking a plane, arranging for 64 people to vanish is a much larger undertaking.

There’s no doubt that there was a 9/11 conspiracy. However the only one that fits the evidence without requiring a huge suspension of disbelief is that it was plotted and carried out under the direction of Al Qaeda.

Posted in Economics, History, Politics, Religion | Leave a comment

Computers can be very frustrating

A year or two back, I had a problem with a computer that I use as a file & print server. It had 6 SATA ports on the motherboard, which I used as follows:
0) boot drive (SSD)
1) BluRay writer
2 – 5) RAID 6 array for data and backups
(for those not familiar with the term, RAID 6 is a method of grouping drives so that they work together as a single large drive, with built in redundancy so that any 2 drives can fail and the data is still intact).

For some reason port 4 & 5 stopped detecting the disk drives attached to them. I solved this by purchasing a PCIe SATA card with 2 internal ports and connected the drives to it instead. This worked until a month ago. After upgrading the operating system (from Debian/Jessie (8) to Debian/Stretch (9)) the add-in card stopped being able to detect the 2 drives attached to it.

After much fiddling about, I discovered that there was nothing apparently wrong with the card or the drives. For some reason, only the first 4 ports (0- 3) could now recognize the hard disk drives, while the last 2 (4 & 5) and the add-in card could recognize the boot drive and the BluRay writer but not a hard drive. Switching the cables around and removing the add-in SATA card and I was back in business.

This lasted for almost 2 weeks. Then the computer began emitting intermittent (but frequent) beeps. It also stopped recognizing two of the drives. I eventually traced the beeping to a flaky power supply (replacing it with a new one cured the beeping) but I had to reinstall the add-in card to get all 4 hard drives recognized.

More bizarrely, I couldn’t boot into the latest version of the Linux kernel. I had to boot into the older (Debian/Jessie) kernel, which fortunately was still an option. While not ideal, I was willing to live with it. My server was still doing what it was supposed to do.

That didn’t last long. About a week ago, you guessed it, the two drives attached to the add-in card stopped being recognized.

At this point I concluded that maybe it was time to replace the motherboard. I found a cheap board that could to the job for about $100 (including processor) although I’d have to buy new RAM (the old system used DDR2 while the new board used DDR3) and a 4-port SATA card. Still it seemed like the cheapest solution so I placed the order on canadacomputers.com and asked for the free delivery to my closest store.

This was just before the long weekend. On Tuesday I got a call saying that the board I’d ordered was actually now out of stock.

Time to go for my first instinct – replace the server’s CPU, motherboard and memory with the one in my workstation. It’s been very reliable but is showing its age as a desktop system. However it’s half the age of the server components and there’s the AMD Ryzen processors now on the market. I normally buy AMD because I don’t want Intel to have a real monopoly on the desktop market.

As an aside, it’s interesting to note that with the AM4 socket, AMD has actually reunited its two socket types. Previously they’d used the AM sockets for processors without an onchip graphics processor while they’d used the FM sockets for processors with onchip graphics. Newer A-series and Athlon processors now use the same AM4 socket as the Ryzen processors.

This leads to an interesting confusion. Socket AM4 motherboards all have back-panel video ports but you won’t get a video signal from them unless you are using a processor with an onchip graphics processor. I haven’t read much discussion of this anywhere and it’s barely mentioned in the advertising.

Wednesday I bought a new CPU, motherboard and memory (since the Ryzen processors require DDR4) for my workstation. Returning home, I removed the motherboard from my server and put it aside. Then I transferred the motherboard from my workstation to the server, removing the video card though and replacing it with an more mundane one that uses passive cooling since the server doesn’t run a GUI.

I reconnected everything and started it up. This being Linux, everything started up perfectly – almost. One of the disk drives wasn’t being seen and the network wasn’t starting. This latter point is not good for a server!

Since I didn’t need the network until I got my workstation running, I first added the working disk drive back into the RAID 6 array so that there would still be some redundancy in case a drive failed. While the drive was resynchronizing with array, I started rebuilding the workstation.

I normally put the motherboard in the case before adding the CPU because it makes it easier to access all the screw locations. After getting everything connected, I went to install the CPU.

All the CPU coolers I’ve dealt with recently use a clip to hold them to the motherboard/CPU. The Ryzen’s cooler uses spring-loaded screws instead. This meant removing the motherboard’s clips so that the cooler could screw directly into the plate under the motherboard. However this plate isn’t attached to the board – it relies on the screws to hold it in place. When I removed the clips, the plate promptly fell off.

Not a big deal – I just had to remove the back of the case and hold the plate in place with one hand while trying to screw the CPU cooler in place with the other. And yes, that is as awkward as it sounds.

Finally, I inserted the memory, reconnected the peripherals, and powered it up.

Nothing. The lights came on, the fans started spinning but no sound, no video, nothing.

Back to basics. I removed everything except the video card and memory. No disk drives connected, no front USB or audio connections. Just the motherboard, memory and speaker. Still nothing. Next I removed the memory, since this should be a sure way to get the motherboard to start beeping. Another failure.

Next I shut down my server and yanked the video card from it to install in my workstation instead of the heavy-duty card. I still got nothing from the video.

After replacing the card back into the server and starting it up, I removed the motherboard from the workstation and connected it to a different power supply. I still couldn’t get the system to give a beep.

Admitting defeat, I returned to Canada Computers to give their tech support a try. I left everything with them and returned home to work on debugging the server’s missing drive issue.

By swapping cables around, I eventually found that the drive that wasn’t being recognized was apparently dead. I could attach it to the power and data cables from one of the working drives but it still wasn’t being seen.

Just then Canada Computers called. They couldn’t get the motherboard to beep either. Returning, I got a refund on the CPU and motherboard but decided to keep the memory. I then bought another CPU (same model) and a different, more expensive, motherboard, along with a replacement drive for my server.

I replaced the dead drive with the new one and restarted the server. The drive was being recognized correctly so I added it back into the RAID 6 array so I’d have the full 2-drive redundancy again. While it was rebuilding, I started rebuilding my workstation.

Learning from my mistake, this time I installed the CPU before putting the motherboard in the case. Also, I went with a minimal install, just connecting the power and switches before trying to power up the system.

Still no beeps. Perhaps the speaker was faulty? I put the video card back in and connected it to my monitor and tried again. Still nothing. I again removed the memory, since that should surely trigger some angry beeping. Utter silence.

At this point I’m wondering “WTF am I doing wrong?” One bad board could be a manufacturing defect, but two in a row is almost unheard of.

Back to Canada Computers again. When their tech guy came back, he rechecked everything then suggested perhaps it’s the memory. Apparently the Rizen processors are somewhat finicky. Moreover, unlike most processors, they don’t seem to trigger “no memory” POST warning beeps.

He grabbed a box of DDR4 RAM from another manufacturer and an open-box video card, plugged things in and powered it up. Success! Despite the new memory having identical specs to the old, the new memory worked while the original memory didn’t.

I returned home and commenced rebuilding the workstation. First I redid the minimal install, with just enough connected to get the system to boot. It worked, so I shut things down and reconnected everything. When I started it up, everything worked flawlessly – almost.

Remember, my server wasn’t starting the network properly so I didn’t have my network shares or printers available. Time to get that fixed.

I had vague recollections of network problems with the motherboard when I first installed it. I couldn’t recall how I fixed it however, so I powered up my laptop and looked for solutions online.

The onboard NIC is a Realtek R8168. This is actually a family of devices that aren’t always supported on Linux out of the box. Realtek make their own Linux driver so I went to their web site, downloaded it onto a USB stick and installed it on the server.

When this didn’t work, I decided to do what I should have done in the first place – check out what the exact failure is.

The problem seems to be that with SystemD replacing the venerable SysVinit, network interface names have changed. The old eth0, eth1, etc. only stick around if they were used before the upgrade. Since the network interface is on the replacement motherboard, it was given a new name. The old eth0 interface was tied to the old motherboard’s NIC so it is now obsolete. I had a udev persistent rule to name that old NIC eth0, so I removed it.

The new network interface is named enp5s0. However simply creating an /etc/network/interfaces file asking for enp5s0 to get its address via dhcp didn’t work. This wasn’t a good solution anyway, but I thought it would be worth a shot just to see if the network would actually work.

Since the Realtek r8168 driver didn’t seem to be working, I tried replacing it with Debian’s r8168-dkms driver. That didn’t work either. However I knew that the NIC was working when it was part of my workstation, so perhaps I had the right driver originally after all.

I removed the r8168-dkms driver and tried the r8169. This seemed to work, but I was getting an error message about firmware. Ignoring this for the moment, I returned to the /etc/network/interfaces file.

Because I run virtual machines on the server, I require network bridging. The actual NIC (enp5s0) is tied to a bridge service (br0) so I had to replace eth0 in the interfaces file with enp5s0 in both iface line and also in the bridge definition.

Another problem was, because of my earlier fiddling with the drivers, the r8169 driver was no longer loading automatically. Adding r8169 to the /etc/modules file fixed this. I also found a blacklist file set up by the r8168-dkms driver installation that I removed.

Now there was just the pesky firmware message to deal with. While it doesn’t seem to be necessary, installing the firmware-realtek package did remove the message since the package contains the correct firmware for the variant on my board.

I now have a speedy workstation and what seems to be a reliable server. Keeping my fingers crossed that no new problems will crop up!

Posted in Home repair, Internet, Science and Mathematics | Leave a comment

Good enough?

I had a bizarre discussion recently on Facebook with some people who didn’t seem to understand the difference between “good enough” and “not good enough”. They also didn’t seem to understand even the basics of any kind of system design.

Their position was that “good enough” isn’t “good enough” (a logical contradiction) and that we should always want something better. They however didn’t seem to apply this to their own decisions. They just wanted everyone else to do it.

For example, I drive a Toyota Corolla. There are better cars on the market but this one is “good enough” for what I use it for. It’s not that I settled for an inferior car. A Rolls Royce or Lamborghini simply wouldn’t be appropriate and there was no need even for me to spend more money for a Camry. I’d rather save my money for other things I want.

That’s a normal trade-off in any system. You have limited resources and have to allocate them to things that matter in order to maximize your overall satisfaction.

They replied with the argument that a bridge that was built to be “good enough” would fall down, killing them. Clearly such a bridge wasn’t “good enough” since it fell down. Things that are “good enough” don’t fail with catastrophic results. What they described was something that clearly wasn’t built or maintained “good enough”.

Similarly we don’t normally spend money for durability on items where the technology is rapidly evolving, delivering more for less over short time spans. Few people have cell phones that can last a decade even though they could be built. Indeed, when a component fails, they generally replace the phone for one with upgraded features rather than fixing it. The old phone was “good enough” to serve until dramatically better ones came along.

For some people “good enough” in a cell phone is the latest technology. For others, it’s the “free” phone that’s a generation back but still “good enough” for their purposes which probably don’t revolve around the phone.

“Good enough” shouldn’t be a pejorative. Yes, we can often do things better but usually only by allocating more resources to it without getting any real return on that investment. Indeed, if something else does the same job for less, we normally go for it. We should never stop looking for ways to do more with less – improving efficiency or productivity – but at any given point, we should always make sure that we do is “good enough” for what it is intended to do.

People who say “good enough is never good enough” are just trying to be clever. It’s not how they or anyone living with limited resources actually do things.

Posted in Economics, Environment, Home repair, Internet, Politics, Science and Mathematics | Leave a comment