Friday, 27 May 2016

Forcillo Verdict

I've wrote before about the verdict in the case of Officer James Forcillo killing Sammy Yatim on a streetcar in Toronto in 2013. It was a strange-seeming-but-completely-reasonable verdict where Forcillo was acquitted for the three bullets that killed Yatim, but found guilty of attempted murder for the following six shots.

I've been following the hearing only lightly and the decision won't be made until the end of July. I haven't been very impressed with the defense team's arguments. First of all, they seem to try to skirt around the fact that Forcillo was convicted of attempted murder. That's a very serious crime, and an element of the crime is having an intent to kill. For the defense team to act as though Forcillo didn't have an intent to kill Yatim is to pretend he wasn't found guilty.

If you are going to stand up in court at your sentencing hearing and say, "I understand the crime I was convicted of, I understand that I will be sentenced for that crime and that is the law, but I did not actually commit that crime," then that's one thing, but it feels a lot more like Forcillo's lawyers are trying to pull a fast one on the judge.

The average sentence for attempted murder is around 13 years, the mandatory minimum when committed with a restricted firearm is 5 years. Forcillo's team wants 2 years of house arrest. They argue that the mandatory minimum is unconstitutional. I think mandatory minimums are terrible, but I don't see how they are unconstitutional. Is the maximum sentence unconstitutional as well? I'll be interested to see this argument further fleshed out as it moves through higher courts if it comes to that.

But I think the defense ask for 2 years of house arrest is extreme. Sentences with no custody for attempted murder are rare according to Statistics Canada, and even if a judge agrees with the defense team that the Federal government had no right to set a five year minimum for using a gun, surely we'd have to agree that in a society where such a law was passed we ought to count using a gun as an aggravating factor.

Probably the worst part of the defense argument is that they really seem to want to say that Forcillo's attempted murder of Yatim didn't do any harm. No harm, no foul, right? I mean, sure, he egregiously shot someone six times but the guy was going to be dead anyway. Forcillo's lawyer even had the gall to talk about how in many attempted murder cases the victim is left severely injured and has to live with that. Yatim doesn't have to live any with injuries. You know, because he's not alive. The culpability could only be lower if Forcillo had missed, apparently.

Right around the time she was hearing that Yatim doesn't have the burden of living with quadriplegia Sammy Yatim's mother burst into tears and rush out of the court room. Perhaps she would rather her son was alive and badly injured than dead.

So while technically Forcillo's legal team is correct that shooting someone who will be dead in moments does no lasting harm, the bit where they talk like it doesn't matter that it happened is very overdone. It comes from a team that is really trying to deny responsibility; to get a second shot at the verdict with a sentencing judge. Besides which, even recognizing that less harm could have been done - i.e., he could have missed - is admitting that more than the minimum harm was done, and thus it is arguing against a non-custodial sentence for a crime where a 10 year sentence would be more normal.

In the end, prison just doesn't seem to work and I agree with Forcillo's defense team that putting him in prison won't help him reform, won't bring Yatim back, will hurt his family, and so on. That's true almost every time anyone is sent to prison though. Growing a compassion organ just when a police officer is being sentenced and then rapidly discarding it after is worse than showing no compassion at all.

Tuesday, 24 May 2016

Truth Engineering

I have a lot of confidence in bridges. That's not a gut reaction, but an empirical assessment. As a child I would get very nervous every time I crossed nearly any kind of bridge. Today that nervousness has gone. That's not because I grew up and stopped worrying, it's because at the age of five or six I independently created one of the major techniques of Cognitive Behavioural Therapy and used it to beat my nervousness into submission. Every time I cross a bridge, before the nervousness can even take hold, the rational-brain preempts it with a "And what is the likelihood that this bridge collapses this time we cross it?"

Bridges don't tend to collapse when you cross them because people are pretty good at building bridges. When bridges do collapse it is usually because no one is listening to engineers who say things like, "You really have to do maintenance on bridges or they eventually fall down."

Of course bridges sometimes do collapse in spectacular ways:



In 1940 the Tacoma Narrows bridge shook itself to pieces spectacularly. It waved like a flag in the wind and fell apart. I saw a video of this in grade nine or ten science as an example of the incredible effects of resonance. So if I had been crossing that bridge in 1940 and it began to flap in the wind and fall apart, I might rightly say, "Maybe bridges aren't so safe. Maybe engineers don't know what they are doing."

Well, engineers don't know what they are doing, but they know they don't know what they are doing, and they do their best to know what they are doing to the extent possible. They don't want bridges to collapse in strong winds so they build models of bridges and subject the models to strong winds. That isn't a sure thing for prevent bridge collapses, but it may well have prevented another Tacoma Narrows.

Engineering takes the reality that we want a stable bridge, and finds the mathematics, physics, materials and tests that allow us to build that.

Logic is truth engineering. The reality is that we want to be able to tell a well supported conclusion from a poorly supported one - something we ought to believe from something we ought to dismiss. The tools we use to address it are abstract reasoning and... well... that's all, just abstract reasoning. The result is that logic - classical logic at least, that is, the kind of logic that anyone outside a university program in philosophy or mathematics calls "logic" - is dismal, failed truth engineering. If logic built bridges then I would never set foot on a single one of them.

I want to be clear about which was this relationship runs. If you believe that logic is the underlying stuff of the universe then you basically believe the farthest thing from the truth possible - which isn't surprising since you apparently have confidence in logic. The hypothetical syllogism from classical logic isn't the basis for my knowing that "if logic works then there is no such thing as a married bachelor" plus "logic works" leads to "there is no such thing as a married bachelor". No, I know that the last statement followed from the first two because that is the meaning of the words "if" and "then". The hypothetical syllogism is a model of that concept put into a formal system in the same way that the blueprints for a bridge only model the bridge - you can't cross the canyon on them.

So when someone brings up a logical fallacy they are saying that within the model of determining truth and validity of statements the kind of reasoning being used isn't relevant. In fact, they are often saying that the kind of reasoning being used simply isn't modeled. If Joe Smith makes a very compelling and seemingly irrefutable case that we ought to back him in his investment scheme, then me pointing out that Joe Smith is a known con artists who has been repeatedly tried and sentenced for fraud is what is called an Ad Hominem. Smith's argument stands on it's own, regardless of the character of Smith.

This, like the flailing bridge, ought to be a warning signal to us: the symbolic system we are relying on to determine the validity of statements is badly broken. "I can't find a problem with his reasoning, but given that he has swindled lots of people out of a lot of money in the past, I'm not inclined to believe him anyway" is a perfectly good argument. It's a fine formulation.

None of this would come as a surprise to anyone who studies logic beyond a first year critical thinking course or an internet list of logical fallacies. The defects of classical logic are many and well discussed. Alternate systems have been created and debated for a long time. But the basic idea of ORs and ANDs and IFs doing what they do and of the irrelevance of non-abstract entries into logic persists all over the lay-understanding of logic.

Engineering must appeal to the real world. Truth engineering that doesn't appeal to scientific experiment is useless because it ignores our current working method of telling fact from speculation. Truth engineering that doesn't appeal to psychology or at least neurology is useless because it doesn't make any reference to the methodology that physically underlies our determinations of truth.

Cognitive biases have their own problems, but they are a far superior model to logical fallacies if you want to do a better job at getting at the truth. Instead of thinking "Ad Hominem is a fallacy" think, "People, including me, have a tendency to believe that people they like are correct and people they don't like are incorrect but that is at best a very weak measure and I should be careful not to overvalue it." Stopping to wonder why you find something convincing as a check against its validity is a much better defense than trying to determine in some absolute sense whether or not the thing is convincing. The former encourages you to spot your biases, the latter discourages it.

So add logic to the list of things that I think are stupid, along with free speech and presumption of innocence. It's going to be a long list.

Monday, 16 May 2016

Advice for a Young Me

Years ago, when randomly contemplating what advice I would give to a young me if I had the chance, I came to the conclusion that the only advice I could give would be, "Life is pain, sorry about that."

I applaud the It Gets Better project that exists to tell young lesbian, gay, bisexual and transgender people that the life they experience in highschool isn't the only life they'll be stuck with. Maybe I could give a young me that same advice. "You won't always feel the way you feel right now." But the truth is something more like, "These sensations will dull over time." Sort of a reason for hope, sort of a reason for cosmic horror.

But I think about how I'm raising my own daughter who, from appearances, is too much like me for her own good, and I realize that while I don't have any advice, I do have an opportunity to be something to her that simply wasn't there for me. Advice is useless, actual support isn't necessarily useless.

What I've been working on lately is accepting that she feels upset about things. I don't want her to enter a cycle of thinking she has to demonstrate her emotions more forcefully to be taken seriously.. I don't want her to feel like she can't undermine her position as an unhappy person by showing happiness. I don't want her to be forced by adults to justify her unhappiness with ever more extreme and undeniable rationalizations.

So, for example, on nights when she squirms and whines while being moisturized, instead of being frustrated that she won't cooperate, I tell her that I'm sorry that she needs to go through that every day and thank her for doing her best to cooperate even though she didn't like the feeling of the moisturizer today. I also remind her that on some days she does mind it and on other days she doesn't. Not as an argument for her to dismiss her feelings and cooperate more, but just as a plain observation. It does get better, even though it just gets worse again after that.

Since I've started doing this she has been far more still and cooperative than she was before. Many days I feel like such a bad parent that I wonder if I should really be able to have kids. Other days I feel like I might have done something right. That's considerably better than I thought I would be.

Friday, 13 May 2016

Hail Sarah Pass

Yesterday I did some averages of Yogg-Saron effects. But Yogg-Saron isn't about the average. In fact, if you have Yogg cast 10 spells for you then while the average damage is just 2.95, the standard deviation is 3.39.

But we can't just use the standard deviation percentages for a normal curve. Yogg-Saron damage definitely is not normally distributed. The only way to get good numbers out of this is through simulation.

So I ran some numbers using a very simple simulation that ignored killing minions. If you play Yogg with 15 spells into an empty board, your chance of winning versus your opponent's health looks like this:


Unbuffed C'Thun, of course, killed 100% at health 6 or less and 0% at 7 or more. Yogg-Saron at 15 spells has about a 50% chance of beating out C'Thun. If you'd like to generate some output of your own, you can enter the number of spells, number of minions your opponent has out, and the number of trials you want to do and get a cut-and-paste .csv showing the distribution of the results below. I'll work on a better simulator that accurately deals with minion death and so on, but, you know, that's actually work.

Thursday, 12 May 2016

Yogg-Saron Averages

People actually play with Yogg-Saron. I assume Yogg is over-represented on streams where there is a viewing public itching to see crazy things happen in games, but I can look up a Yogg-Saron rogue deck online and find miracle lists that appear to have eschewed better win conditions for whimsy of Yogg.

There's a lot more to Yogg-Saron than the average result. There's that feeling that Anything Could Happen. But the kind of anything that makes it talk about Anything is very unlikely to happen, and averages certainly tell us something about what to expect.

By restricting my card pool to spells, I came up with some handy numbers that might guide you in your evaluation of Yogg.

Net damage per spell to your opponent if you play Yogg on an empty board: 0.22
Net damage per spell to your opponent after Yogg has killed himself and the board is empty: 0.26
Net damage per spell to yourself: 0.038 with Yogg or 0.082 without
Chance that Yogg kills himself or otherwise removed himself per spell if he hasn't summoned any friends yet: 11.9%
Damage per spell after Yogg is dead and Embrace the Shadow has fired: 0.41 to your opponent, 0.35 to you
Damage per spell if your opponent is at 10 and we count Tree of Life: Just 0.13

Number of cards gained to your hand per spell: 0.2
Number of cards gained to your opponent's hand per spell: 0.015
Chances you'll discard your entire hand at some point along the way to your 15th spell: 5.8%

Armor gained per spell: 0.071146
Attack gained per spell, counting weapons: 0.071146
Fraction of spells that add the same amount of attack and armor: 0.0079

Average number of minions summoned per spell: 0.15 to 0.175 depending on how many murlocs have died this game
Fraction of those minions have have 3 or more health: 0.086
Chance for a minion with 2 health on your side to be killed per spell: 20.1%
Chance for all minions with 2 health or less on your side to by killed per spell: 3.2%

Number of spells that will put a minion into play on your opponent's side: Fewer than one
Number of spells that will remove a minion from your opponent's side, excluding by dealing damage: 12
Odds that your opponent ends up with a minion in play if they didn't start with one: Quite small

Over the very long run you should expect to have no minions in play more often than you have minions in play. Over the very long run, ignoring Embrace the Shadow, you should expect your opponent to lose about a third of a health per spell cast and for you to break even unless Tree of Life happens. You should also expect to draw a card for every five spells except when you have to discard your hand instead.

So if I tailor my entire deck around Yogg, cast 10 spells and then drop him onto an empty board then I should expect that Yogg won't make it though the process, that my opponent will take three damage and that I'll draw two cards. With 20 spells cast it's six damage and four cards, but with 20 spells cast there is a good chance those cards I drew are just hastening my death to fatigue.

When I first saw Yogg-Saron I thought he was probably worse than an unpumped C'Thun. I think that might be spot on. But if you do want to play Yogg, promise me one thing, don't play him and mash the End of Turn button. There is a reasonable chance you'll end up with attack, and even a chance you'll end up being able to cast something.

Tuesday, 10 May 2016

Hearthstone Cards .csv File

I wanted to do some stuff with Hearthstone cards, but first I needed to get them into a usable format.  Searching web-based databases for cards using the filters they offer is just so tedious. I googled "hearthstone cards .csv" and found something that wasn't exactly what I wanted: Hearthstone Cards in JSON.

What I don't like about JSON is that I can't open it in a spreadsheet. What I do like about JSON is that with a few lines of code I can transmute it into something I can open in a spreadsheet.

Hearthstone Cards, Comma Separated

Click that link and you'll get a lot of selected text, ready to be copied and pasted into a text editor and saved as a .csv which will be recognized by your spreadsheet.

Thanks to stackoverflow for having great resources on javascript. In particular in this case how to select text and how to open a file from the web.

Now that I have this I should be able to figure some useful things out.

Thursday, 5 May 2016

"Set Bonus"

I am continuing my trend of playing Diablo 3 for a few weeks when a new season starts. Just like with other similar games I like making a new character, leveling up, getting new stuff and playing to the point that I've accomplished the challenges the game has to offer, but I am not interested in grinding up the best possible gear and then hunting for better rolls on that gear. I'm looking for a six piece set bonus with accompanying legendaries, not a maximum intelligence roll on my ancient shoulders.

I've been critical of some of the design decisions in Diablo 3 in the past, and I've never been thrilled with the set-bonus-or-bust style they have decided to go with for the end game. It seems like they wanted to accomplish what could have been accomplished through some sort of character customization system but through other means. Instead of putting points into Arcane Orb you get a want that triples its damage.

Since the end game is focused entirely around six piece sets and they know it, for this season and the last they have given you one for free. That is, they give you one for completing three different tasks on the "Season's Journey". You get two pieces each from reaching level 70, killing Izual at level 70 on Torment II or higher, and reaching Greater Rift tier 20. Since tier 20 is between Torment III and IV, those have a clear order of difficulty. You get your two piece bonus as soon as you hit 70, have to play on Torment II to get your four piece, and have to be quite competent on Torment III to get that six piece.

This season the Witch Doctor set is Zunimassa's Haunt. So when you hit level 70 you have a fetish army that lasts forever. Given that Fetish Army is supposed to be a 20 out of every 120 second cooldown that probably helps a fair bit with your damage to make it fairly easy to get your four piece. The four piece is a survivability boost with no damage bonus so that's unfortunate, but Torment III isn't a huge hurdle, so the Fetish Army probably does the trick and you get can get your six piece.

The Demon Hunter set is the Embodiment of the Marauder. The two piece bonus allows you to have all five Demon Hunter pets out at once. That's a nice damage and survival boost that should make Torment II easy enough. The four piece bonus makes your sentries deal five times as much damage and use some of your hatred spending abilities. I imagine that two pets firing 1000%+ damage piercing bolts and tripling your spender abilities makes very short work of Torment III.

Wizards get Delsere's Magnum Opus. The two piece bonus lets you cast Slow Time more often. Hmm... well, Torment II isn't very hard anyway. The four piece bonus makes you take half damage while in your Slow Time bubble. So still no damage boost.

I had claw my way up to a tier 20 Greater Rift. I was hunting for legendaries that would give me a viable strategy. To be fair there are a large number of them. There's a belt, a couple of orbs and a few wands which each on their own is probably enough to get over that hump, but I ended up using my first 100 Death's Breaths converting rare wands to uniques just trying to find something that would let me do enough damage to win the rift. Sure, if I was frozen on a plague field in the middle of a horde of arcane enchanted minions I could live, but the rate at which I was killing things was abominably slow.

Well, I found one of the wands and cleared the rift with seven minutes to spare. What is the six piece set bonus for Delsere's? It's doing twenty times as much damage. So I went from farming on Torment II to farming on Torment VII just like that. My trickle of legendaries became a mighty river.

I can just imagine someone at Blizzard saying, "I guess there might be some way to split some of the damage bonus from this set up over the various tiers instead of putting it all as a giant multiplier at the end, but I can't see how."

Wizard isn't the only class with a problem. The difference between the interim bonuses of Witch Doctor and Demon Hunter looks staggering and the Monk set looks like an extremely mediocre damage increase at four pieces. It all fits with a philosophy entirely focused around the endiest of end games. It's not just that they don't care about levels one through 69, they don't even care about set bonuses in the two to four piece range.

Nearly all of the six piece sets provide some credible boost to damage in the two or four piece bonus. Wizards stand out as having two sets that don't. Delsere's used to make your Slow Time deal damage at the four piece, but they got rid of that in favour of absolute end-loading.

It frustrating to me because there is a reason why I only play the game when a new season comes out. It's because that's what I like to play. New characters doing new things. That's the part of the game that they don't seem to think is worth supporting at all, despite the fact that it is also part of the game that they want us to play over every few months, and, I'd wager heavily, the part of the game that most players play for most of their time with the game.