Math

February 23, 2021

Imagine a big map of North America… now, take 100 pins and stick then on the 100 biggest cities. Now imagine trying to find the shortest path that visits every city exactly once. Imagining the problem isn’t difficult. Solving it is a different story.

To solve it, you’d create a table of all the distances from once city to another. Each city would have a list off 99 entries below it… Vancouver to Seattle, Vancouver to Portland, Vancouver to Miami… etc. The total number of distances to consider would be 100 x 99… and yes, even though Vancouver to Seattle is the same as Seattle to Vancouver, you need the entry twice in the table because, in the solution, you’re not sure from which direction you’d be approaching.

Setting up a computer to solve this is simple: Generate every version of path through all cities, add up the little distances, and keep track of the best one so far. Once you’ve cycled through all the combinations, you’ll have the answer. This is easy, in theory.

It gets a bit more complicated in practice.

How many combinations of paths are there? Starting in any city, there are 99 options for the next one. Once you get there, there are 98 choices for the next one. After that, 97. Therefore, the number of combinations is 100 x 99 x 98 x… all the way down to x 1. That’s 100 factorial (100!) which equals… a really big number. How big? It’s a number with 157 zeroes after it. The number of particles in the universe is a number with 80 zeroes after it. How long would it take to analyze every combination? A few zillion years. Not too practical. That’s how long it’d take to find the perfect solution… but how about a “good enough” solution? Not 100%, but how about 95%?

Back in 1993, when I wrote a program like this, it took about 20 minutes. With today’s horsepower, any home computer could do it in less than a minute.

That’s quite a difference, and for all practical purposes, good enough. The traveling salesman can spend a few extra days on the road and burn a bit more gas… not a big deal. Good enough.

One strategy to solve big problems down to a “not perfect but good enough” level is what’s called a “Genetic Algorithm”… it’s what I used, and it’s pretty cool, so now you get to hear about how it works.

Out of the zillions of possible 100-city-tours, imagine you generate a bunch of random ones… say 10,000 of them. Just create 10,000 unique paths through those 100 cities, totally randomly. Some, like the ones that begin Vancouver-Miami-LA-Toronto… will be awful. Ones that start Vancouver-Seattle-Portland are likely to look better. But… whatever they look like, out of the 10,000… take the best 100.

Now… here comes the cool part… you take those 100 – call them the “first” generation, and figuratively “breed them” to each other. You pretend they’re like parents having offspring… you splice half of one, splice half of another, join them together… and now you have a whole new potential solution. It might be better than one or both parents… it might be worse. Doesn’t matter… breed all the combinations… now you have a whole new generation of 10,000 possible solutions, and they’re almost all certain to be better than their respective “parents”. And now you take the best 100 of those and do it again, and create a third generation. This is like instant evolution… but it doesn’t take 9 months and lots of diapers. It takes a few milliseconds… and that’s the beauty of it… after less than 1,000 generations, which doesn’t take long at all, you have a surprisingly good solution. Already north of 90%.

Modelling 100 cities with nothing but the distances between them is very simple. Modeling the infrastructure within which a virus may live and thrive and propagate is a lot more complicated, but once it’s in place, searching for a solution might look similar. Here’s a random formula for a mRNA vaccine… was it effective? Try 10,000 random formulas, pick the best 100… splice them, mix them, test them… and do it again. And again and again. Pretty quickly, you will have honed-in on realistic possibilities.

This isn’t quite how it came about… but when people wonder how it’s possible to come up with an answer to a supremely complicated and unknown problem, it’s strategies like this… which have the capability of very-quickly zeroing in on viable solutions drawn from an unfathomably huge search-space of potential solutions.

Finding the perfect vaccine might take decades… if not centuries. But a vaccine doesn’t have to be perfect.

How long would it take to find one that’s good enough… say, 95% effective…?

That question has been answered.

14 Likes, 3 Shares

October 9, 2020

If there were any doubts about there being a second wave here in Canada, that question seems to have been answered. We’re no doubt in it, and the question that remains is how bad might it get.

This is a big country… from here in Vancouver, St. John’s is not much closer than Tokyo. That’s a lot of space, in which the 38,000,000 of us are all navigating this journey differently.

Heading into the weekend… yesterday, B.C. crossed that “10,000 cases” line. Alberta will have crossed their 20,000 line by the time you read this. Comparatively speaking, Quebec has seen 10,000 new cases in only the last 10 days. Ontario will see its 3,000th death tomorrow.

As we head into this rainy weekend, I don’t have much more to add for today, but one thing… we won’t get updated local stats till Monday, and while I used to do some fancy math to extrapolate/guess what might be in store, I think I’ll back off from that. This isn’t a math exercise; each stat is a real person somewhere, just like you and me.

And wishing every one of those people a good start to this Thanksgiving weekend.

View Original Post and All Comments on Facebook

September 29, 2020

Leona Helmsley was a wealthy hotelier, back in the 1980s. In discussing herself and her husband, she once famously said, “We don’t pay taxes; on the little people pay taxes.” Leona was ultimately sentenced to 16 years in prison for federal income tax evasion. And, as you may already know, Al Capone, guilty of every organized crime known to man (bootlegging, prostitution, racketeering, murder, etc.) was ultimately only charged and sentenced for one thing… income tax evasion… which landed him in prison for the rest of his life.

More recently, like a few months ago, I was staring at a math formula that I needed to plug into a spreadsheet. I needed the formula in terms of x, but unfortunately, x was an exponent in an expression that was under a square-root sign, and all of that was the numerator in a bigger expression. After staring at it for a minute, I asked my son, who was sitting nearby, if it he could figure it out… and he promptly did.

In hindsight, perhaps I could’ve paid him a consulting fee. What was that worth? Well, like the old joke… from the old “50 cents to push the button, and $999.50 to know which button to push” school-of-thought, $20 wouldn’t have been out of place. Even $100, since I needed it right away.

Wait… maybe I need a mathematician on payroll… I could hire him as a consultant on a monthly retainer. $1,000 a month? How about $10,000, because now I’m thinking tax benefits. How about $500,000,000 a year, and I get to deduct chunks of it for the rest of my life… and since I’m not paying him all of it, it’s of no tax consequence to him. And for me… some fancy accounting showing the liability due, and then claiming the annual credit of $10,000,000 – wow, I’ll never pay taxes again!!

Welcome to the slippery slope of how tax avoidance (totally legal) slides into tax evasion (totally not).

Setting aside the cushy job she got in her daddy’s organization, Ivanka Trump was paid an extra $750,000 in consulting fees. Giving your kids money is no crime. Claiming it as a business expense, however, is quite a different story. What’s slowly coming to light is how many tens of millions of dollars Donald Trump “consulted“ away… when actually, he was just keeping money in the family, but paying no tax on it.

As per emerging facts imply, as bad a businessman as Donald Trump may be, there’s still income from his numerous properties. The ones he didn’t already bankrupt (how do you bankrupt a casino) do generate some sort of revenue. That they’ve all lost money year after year probably means he doesn’t run them too efficiently… and whatever they do make is outweighed by the generous deductions he claims. Again, they either genuinely lose millions of dollars a year of his father’s hard-earned money that he’s slowly squandering… or, they make a bit, and he “cleanly” hides the profits.

As per above, you don’t mess around with the IRS. Around here, the CRA. Same thing… they want their cut, and they’re not happy when you try to hide it, or dance around it. They understand you’re allowed to pay as little tax as possible, as long as it’s legal… but there’s a line, and sometimes, its crossing is just way too blatant.

If Donald Trump doesn’t get re-elected, among the long list of lawsuits he’ll be slammed with… is likely to be the IRS, seeking what they feel is owed to them. Whether it’s criminal tax evasion, or a simple slashing of a bunch of bullshit deductions ($70,000 a year for hair care?)… remains to be seen. Taxes owed, interest, penalties… on top of the hundreds of millions of dollars of loans he has to repay in the not-too-distant future… to be clear, Donald Trump can’t ride off into the sunset, even if he wants to. He desperately needs the four years of presidential immunity that comes with the job.

View Original Post and All Comments on Facebook

By |2020-10-08T01:08:39-07:00September 29th, 2020|Categories: COVID-19 Daily Report, Politics, Business & Economics|Tags: , , , , , |0 Comments

September 16, 2020

Today’s brief update will simply be about some simple numbers and some simple math.

Let’s say 100 people catch Covid-19… and struggle through it, till they’re either cured or dead… if 93 survived and 7 died, let’s write it down as 93/7. Looking around the world, here’s a brief sample of how that looks in different places:

United States: 95/5
China: 95/5
Canada: 93/7
Mexico: 87/13
Italy: 86/14

It’s annoying that some places have stopped publishing their recovery numbers. I’d be interested in throwing Sweden, U.K. and Spain into that mix to see how they compare.

The best ratios out there seem to come out, at best, 97/3.

If we just add up the entire planet — there have been almost exactly 30,000,000 cases – and the global ratio is 96/4.

The implication of that is that the true potential extent of this virus, should everyone on the planet get it, would mean a little over 300,000,000 deaths; simply 4% of the world’s 7.8 billion people.

Fortunately, there’s every reason to believe… through social practices and herd immunity (one way or the other), that nothing close to that will end up transpiring. But it’s always worthwhile to look at all the scenarios, and as far as the worst-case goes – there you have it.

View Original Post and All Comments on Facebook

September 10, 2020

Well… it’s become very clear what I need to write about if I’m trying to get a reaction. Little anecdotes about my life are fun to write and people seem to enjoy them. Bashing on Trump seems to get the usual reaction from the usual people, but to be honest, it’s died down… either because they’ve come to their senses or have decided they don’t like arguing with me.

But when I try to state some simple facts… like hey, here are some numbers, and here’s what they mean and what they imply… wow. Some people whose minds are already made up sure don’t like hearing alternative points of view. Like it’s all some big conspiracy. To be clear, while there are certain things that are opinions or theories, some things are just blunt facts. At the end of the day, when you take away all the vague hand-waving, certain things are not up for discussion. They’re not “opposing opinions”.

Indeed, when it comes to debunking conspiracy theories, there’s usually a “backstop” fact that really should put things to rest, at least for any reasonable person. All the little nit-picky out-of-context details of “proof” to confirm some outlandish claim are easily put to rest by one “umbrella” fact that’s indisputable.

Obama born in Kenya? There are birth announcements in the Hawaiian newspapers at the time. All of the copies, michrofiched versions, scanned, digitized, etc… over the decades, all indisputably in agreement. Set aside the long list of BS claims, forged birth certificates and bribed doctors and nurses… just explain that.

Moon landings faked? The technology to fake a moon landing simply didn’t exist in 1969. The ability to seamlessly film hours of footage and then play it back in slow motion… how? With what?

The holocaust was a hoax? The numerous census numbers at the time, including Germany’s, all agree… and all imply a European Jewish population of around 9.5 million in 1933. That number was found to be around 3.5 million by 1945. The simple math begs a simple question: Where are all those people?

Similarly, the great Covid-19 pandemic will ultimately fall back to a simple number: Excess deaths. Tests per million, positives per test, deaths per positive… etc etc.. I know all these numbers, ratios and percentages well. Many of you evidently disagree with those numbers, as published and verified as they may be. I find myself answering lots of questions after yesterday’s post.

But let’s take a big step back from all of the nitty-gritty numbers… which, to be clear, are presently being used to figure out what happened, what’s happening today, and what’s likely to happen in the future. It has nothing to do with today’s numbers, as if they’re a frozen statistic. Statements like “the flu kills more people” are foolish because this virus hasn’t finished killing people. It was being heard at the start of the pandemic… and sure, a month into it, the flu annually kills more people. Except people kept dying, and still keep dying. We’re at 5x the annual flu deaths, and counting, yet that particular statement keeps popping up. At what point do even the most die-hard Covid deniers finally, grudgingly admit that maybe this is more serious than they thought? 10x the flu deaths? 100x the flu deaths?

At this moment, in the U.S., close to 196,000 Covid deaths have been reported. Also, at this moment, the U.S. excess-death count is somewhere around 220,000. That discrepancy might be attributable to Covid deaths that weren’t recorded as such. Or someone’s heart attack brought on by the stress of the pandemic. Or illness that didn’t get treated as a result of the pandemic. Or suicide. Whether that latter list counts as a Covid death is a separate discussion. What’s not up for debate is that at this moment, and at a continuing rate of 1,000 per day, people are dying in the U.S. that otherwise wouldn’t be.

Also, a separate discussion… if this pandemic were to magically end today, were the steps taken worth it? Here’s the thing…. “Was it worth disrupting the economy to save 200,000 lives” is only a valid question, in hindsight, when you have the right number to plug in there. Unfortunately, 200,000 isn’t the number… and we’re still pretty far from knowing what that number will ultimately be.

And if you’re still calling bullshit on all of this, as per my “umbrella backstop” questions of above, here’s a simple one… if Covid-19 didn't kill these 200,000 people, what did?

View Original Post and All Comments on Facebook

September 9, 2020

The next time some yahoo tries to convince you that this virus only has a death rate of zero point zero something, feel free to refer to this… I will pick the U.S. as an example because even the doctored, minimized and understated White House data presently implies this:

U.S. population: 330,000,000
Test-positives: 6,547,000
Closed cases: 4,029,000
Recoveries: 3,833,400
Deaths: 195,200

We know that more people than what’s documented have actually had the virus, most of them without even knowing it. How relevant is that? It’s important, of course, because the more people have actually had it, the less lethal it ultimately is. Some people, like the zero-point-zero something crowd, would like you to think it’s no worse than a common cold or flu, but let’s see how the math shakes out.

At face value, given these numbers, the deaths-per-case number (195k ÷ 6.5M) = 2.98%

Relevant to that is the actual closed-cases percentage… ie, if you actually are known to have gotten this virus, what’s your outlook?

3,833,400 ÷ 4,029,000 = 95.15% recover
195,200 ÷ 4,029,000 = 4.84% die

But ok… if everyone who’s known to have the C19 virus at this moment had it miraculously disappear, that’d imply a 3% death rate. That’s obviously nonsense, but let’s go with it. And if ten times as many people actually had it than what was known, that number drops to 0.3%.

How does that compare to the flu? In 2019, the CDC estimated 35.5 million cases… resulting in 34,200 deaths. That’s a 0.10% death rate.

What about colds? I’m not even going to factor in deaths from the common cold… because it’s ludicrous. Some 18,000 people in the U.S. have died from complications of a common cold… since 1979. That’s less than 500 a year. Nothing more than a rounding error.

Again, this supposes that the virus magically disappears instantly. The “the flu kills more people per year” argument fails to address a rather relevant issue; Covid-19 is very much still here, and is still killing thousands of people a day. In the U.S., where they’ve only had perhaps 6 or 7 months of it, it has already killed five times as many people as an entire annual flu season. And it’s not done yet.

Finally, 195,000 ÷ 330,000,000 = 0.06% — which, if the virus vanished and the deaths stopped instantly, is theoretically the lowest number you could ever get for U.S. deaths. Today’s death count divided into today’s population, and not a single death more. To get to the 0.02% number that the crazies insist upon, the virus would have to vanish instantly, and the U.S. would need to have a population of more than a billion.

So… all you “it’s just a bad cold” or “it’s just a flu” people – kindly, stop. I don’t think you realize how silly you sound relaying “facts” that you insist on believing; it’s complete and utter nonsense, and you should be ashamed of yourself for propagating it, and further ashamed for buying into it… and then accusing others of being the blind sheep following some hidden agenda. You’re the sheep, and you and your herd will suffer greatly if you don’t smarten up… and you’ll unfortunately take a few of the rest of us with you.

View Original Post and All Comments on Facebook

August 30, 2020

No pandemic numbers to update, but let’s talk about something relevant in my last 24 hours… my involvement in the World Series of Poker, which was going really well, until… suddenly… it wasn’t.

Unfortunately, that is the nature of the game, and there’s actually something relatable to the world in general, especially these days.

In tournament poker, unlike cash games, you play until you have all the chips (and win) …or you bust out with nothing. Often, in tournament poker, you’re put in a position where it’s blatantly obvious what you should do, but plain old (good or bad, depending who you are in the story) luck will have something to say about it.

Even in the most extreme and obvious cases… and here’s the math on one of the most extreme examples… things can (and do) go wrong.

Let’s say it’s just you and me battling against each other in a hand. You have a pair of Aces, the best possible starting hand. I have a 2 and a 7 of different suits, which is generally the worst starting hand. For some misguided reason, I think you’re trying to bluff me with whatever you did to kick-off the hand, so I go All-In on you, meaning I bet everything I have… not because my cards are any good, but because I think you don’t have anything that good, and as per what I wrote yesterday, this is a game of money played with cards, not the other way around. As long as you think I have something better than you, you should throw away the hand.

But instead, this scenario is a dream for you. Someone pushing All-In, while you have pocket Aces. You call instantly, and are even further delighted to see my awful cards. Here’s the math: After running 5 board (common) cards, you should win 88% of the time. I, through sheer luck, will win 12% of the time… having hit 2 pairs or 3 of a kind or who knows.

And that’s the thing… one out of eight times in that dream scenario, you will lose. And it will feel like someone sledgehammered you in the gut… and if you visit the hotel bar at any poker tournament, you will see an ever-increasing group of gut-sledgehammered people wandering in to drown their sorrows and tell anyone who’ll listen how they just got completely screwed by some idiot who doesn’t know what they’re doing.

I will spare you all the details of exactly what busted me out of “The Big One” this year, but there’s no expert that’d tell you I did anything wrong. I got all my money in with a much better hand, and the other guy got lucky. In a real tournament, “IGHN” – I Go Home Now. Silver lining of course… I already am home. And instead of having a bunch of drunk, depressed poker players to make me feel better, I have my dog licking my face.

What’s relatable? That sometimes, doing the exact right thing… doesn’t yield the results you were hoping for or expecting. You’re wearing a mask, you’re social distancing… and somehow you caught the bug. It’s happened. Bad luck. But in no way does that negate what you (and everyone else) should be doing. Knowing that sometimes things aren’t going to work out is no reason to not do the right thing in the first place.

And, for what it’s worth, there are still some smaller WSOP events I might jump into. If things go well there, I assure you, you’ll hear about it. Kind of like the pandemic… when that starts going well, rest-assured… I’ll be here to tell you all about it.

View Original Post and All Comments on Facebook

August 29, 2020

No AB or BC numbers today (or tomorrow)… so, like waiting for that final “river” card in poker, we wait to see how the hand plays out on Monday.

Indeed, poker is on my mind because I’ve spent the better part of today (and will continue into the night) trying to advance a bit further in the World Series of Poker Main Event. It’s all online this year, which has its advantages and disadvantages.

The biggest advantage of course is being able to sit at home, comfortably, and scream at the computer and throw your mouse at the wall in frustration when appropriate to do so. I haven’t done the latter, but plenty of the former… certainly something you can’t (and wouldn’t want to) do in a real cardroom.

If you’re only familiar with the game of poker from what you’ve seen on TV, you might have a bit of a misguided notion… but here’s the deal: Poker is not a game of cards which you play with money. Rather… it’s a game of money which you play with cards. It’s a subtle distinction, but it makes a huge difference.

Watching on TV, you’d think most hands are people throwing their money into the pot and hoping for the best as the cards get dealt. Certainly, that does happen… perhaps one out of ten times. The other nine times, all the poker playing takes place before any cards are seen… or just a few. It’s 80% luck, 15% mind games and 5% math.

Everyone knows the math, and the 80% luck aspect can be rolled out of the equation… other than it serves to level the playing field to the extent “good” amateurs like me can go toe-to-toe with the pros for a while, but eventually they’ll get caught by that intangible 15% of mind games. There’s a reason that, after 5,000 people have entered a tournament, you always wind-up with a lot of familiar names in the top 500… the guys who can stare at you from across the table; stare into your soul and make you think exactly what they want.

To some extent, not having that be a part of it… helps a bit. Nobody can tell what’s going through my mind while it’s counting down, waiting for me to do something. For example, at this moment, for the last two minutes, I’ve been typing here while some guy in Italy put me All-In and is waiting for me to Call or Fold. I already know I’m going to Fold, but he can wait.

If we have to wait till Monday to know what's going on, he can wait 120 seconds extra.

And with that, the break is over — I will gratefully accept your wishes of good luck and let you know tomorrow where I'm at.

View Original Post and All Comments on Facebook

August 15, 2020

No numbers here in B.C. today or tomorrow… so notwithstanding the famous “lies, damned lies, and statistics” quote… I’m going to intelligently extrapolate some numbers… and will correct them on Monday. Until then, both our local and national numbers are just good guesses.

The average new case count in B.C. over the last 5 days averages to 67, so let’s just go with that. For what it’s worth, one standard deviation would make it plus or minus 21 (so somewhere between 46 and 88 new cases). Actually, the 90% confidence interval (15) defines the potential range as between 52 and 82… so it’ll be interesting to see what things look like by Monday. If we’re within this range, we’re sort of stable. If we’re growing… well, I guess we’ll know that too. Take it all with a grain of salt. And that’s enough math for a Saturday.

It’s also enough writing for a Saturday, because it’s a beautiful day and I’m going to take advantage of it… but it seems like a good opportunity to plug the blog where all of these posts are going, in case you feel like you missed something. If you visit www.kemeny.ca and click on the red seal, everything I’ve written here recently (like, every single day since March 17th) can be found there.

Hope you’re enjoying this beautiful day… in an appropriately-masked socially-distanced and well-sunscreened sort of way.

View Original Post and All Comments on Facebook

By |2020-10-08T01:09:47-07:00August 15th, 2020|Categories: COVID-19 Daily Report|Tags: , , , |6 Comments

July 23, 2020

You walk into some high-school test. You’ve studied, but maybe not enough… you could’ve studied more. You should’ve. Maybe it’ll be one of those miracle days where the teacher is sick or someone pulls the fire alarm or it’s just postponed for some reason.

Oh well, no such luck… but… well, maybe it’s ok. You didn’t answer all of it, but you got to maybe 70% of the questions… should be ok. And of the questions you answered, you got most of them. Maybe. Yeah, it’ll be ok.

So, later in the week, you get the test back…. and indeed, you answered 70% of the questions. And of the questions you answered, you got about 70% correct…. so, all good… right?

Well, 70% of 70% is 49%. So, no… not so good. Indeed… Epic fail.

That’s the way math works, and that’s the way it’s going to work with three independent variables:

A: what percent of the population needs to be C-19 immune for there to be herd immunity?

B: what percent effective will a vaccine ultimately be?

C: what percent of the population will get vaccinated?

The unfortunate reality is that B x C will likely never exceed A, so this thing is going to stick around for a very long time. The lunacy of the sub-group that makes C anything less than 100% is particularly aggravating. It sincerely makes me wonder… if smallpox hadn’t been eradicated by 1980, would it be celebrating some sort of re-awakening these days, thanks to a bunch of “enlightened” individuals who’d never “poison” their kids with the vaccine…?

“Do you know what’s in a vaccine?”, they’ll ask you… and list off a bunch of poisons… “If it’s so healthy, try drinking it… you’ll probably die.”

Yeah, you know what else is healthy? Broccoli. Try injecting some into your bloodstream… you’ll probably die.

I no longer have any interest in arguing with anti-vaxxers. It makes my thoroughly-well-vaccinated blood boil. And I really wouldn’t care as much, were it not for the fact that their insanity has the potential to affect us all. There are those who wish they could take the vaccine, but for other health reasons, cannot. Those are the people who’d benefit most from herd immunity.

There’s no vaccine yet, but it’s coming. Many groups are making great strides. But if we think our problems are solved when it gets here, not quite.

Apart from the logistics involved in creating 7+ billion doses and distributing them… comes the issue of who gets them first. It’s an interesting discussion. The first thought is obvious – doctors, front-line medical practitioners, etc. They should certainly be near the top of the list, but those people have PPE and good habits and access to medical care. From a humanitarian point of view, it should be those at highest risk for numerous reasons, and if you think it through, you wind up with an interesting conclusion.

Here’s a list of risk factors… age, overall health, access to good medical care, and liberty to exercise social distancing. Ethnicity is not irrelevant, though socioeconomic factors play into it too… like in the U.S., twice as many Black people are dying from this than white people. That may or may not map to other places around the world, but either way, we can all agree it’d be better to ride this out in a first-world country as opposed to somewhere in the third-world.

Put it all together and what do you get? Somewhere in Mogadishu, there is an aging diabetic Somalian pirate, rotting away in a crowded cesspool of a prison. That guy needs the vaccine more than I do, but he’s unlikely to be offered it anytime soon. He’ll get his shot long after some enlightened local anti-vaxxer scoffs it away. Epic fail.

View Original Post and All Comments on Facebook

Go to Top