2+2

Aug. 24th, 2016 12:20 pm
plonq: (Challenging Mood)
If you are on Facebook, you have probably seen a variation on this one (the numbers change, but the principle is the same).

"90% of people will get this wrong!!!!

6-2x3=?

Give your answer in the comments, then like this and share it with your friends!!!!"

Usually they show up in my feed when a friend has responded, and by that time they will have more than 200K likes, and almost as many comments. Even though I already know what to expect, I usually glance at the first few pages of comments to see if people have somehow become smarter since the last time, but the results seldom vary much from the last time it sneaked into my feed.

There will generally be a mix of answers, with slightly more people choosing 0 over those that choose 12. There is also the statistically small number of people whose answer seems to have been arrived at through some combination of augury or guessing, but they might just as easily be trolls as not.

What's more perplexing than people getting the answer wrong is the people who try to argue in defence of their wrong answers.

The answer is 0. No amount of arguing nor defending one's position will change that; it is a fundamental rule of maths. When I was in school, we were taught it as BODMAS (though I sometimes see it as BEDMAS -- which I think makes a bit more sense).

BODMAS/BEDMAS -- Brackets, Order/Exponent, Division, Multiplication, Addition and Subtraction.

All good, right? Possible not, because some are taught it as BEMDAS. If you take that literally then

6/2x3 = 1, rather than 9. It is a case of people knowing just enough of the truth to be confused. They know something without actually understanding it.

The answer is 9. In spite of people arguing otherwise on Facebook, it is not an answer that is up to interpretation; it is a rule of maths.

When people can't grasp one of the first simple rules we are taught in school, or know just enough of it to get it wrong, it is small wonder why we have so much confusion and friction on more nuanced issues like immunizations, or global climate change.

In the case of the latter, I hear too many people preface their thoughts with, "I'm no climatologist but..." Usually the argument is that humans are incapable of producing large enough effects to affect the entire global climate, or that global climate change is cyclic anyway (as evidenced by the ice ages), and that any statistical correlation between human actions and climate shift are purely coincidental.

Some even cite the fact that there are accredited scientists who disagree with the current climate change models. This is true, though I cannot think of any who are actually part of the field of study that they are questioning. One of the more prominent accredited critics, for instance, is a mathematician. When people point to these critics, it is a pretty clear case of argumentum ad verecundiam. Just because somebody is educated does not mean that they are experts in every other field.

I have little doubt that the same people who will side with a mathematician who questions the models covering the health of our planet would go to those same experts on matters of their own health.

"Now my doctorate is in Maths rather than Medicine, but looking at this scan I can see that the foreign mass in your brain is less than .1% of your total body mass. Statistically speaking, you are cancer free!"

Are all of these climatologists wrong? It's possible - however remotely at this point - that they might be wrong. Unlike the rules of arithmetic, there is a certain amount of experience-based interpretation that needs to be applied to the models they are using.

Do I accept their interpretation over yours?

Yes, for the same reason why I would go to see a real doctor about headaches and blurred vision than I would a professor of history. The professor might know a thing or two about historical remedies for such things, but I'd sooner see an expert in medicine to get a more accurate diagnosis.

The old lighthouse
plonq: (Plonq @ Work)
One of my co-workers called on Friday afternoon. Partly he was just looking to chat, but he also needed to vent a bit after a trying conversation with our senior director.

She had called him because she had received a complaint from one of our executives over a couple of new line items we recently added to our executive dashboard. The line items in question were part of our cost metrics, giving a breakdown of cost-per-car for yard switching. The formula for this is very straight-forward. All you need to know is the total expenditure in wages that we paid to the crews (their hours times their wages plus any overtime hours and wages), and the number of cars that were handled in by switchers in the yard that day. If you divide the total payroll by the number of cars handled, it will give you an average cost per car.

Obviously this is only approximate, since it does not include the cost of fuel and maintenance, but it is a reasonable metric they can pull out during negotiations with customers to justify charging them a premium when they request custom switches.

"We want the fourth car in from the west end of that track."
"Right. So that would involve handling four cars, including yours, for a total charge of $160."

What this executive was complaining about, and what Fearless Leader was having some trouble wrapping her head around was this:

Cost Per Car (CPC) = Total Wages (TW) / All Cars Handled (ACH). One of our illustrious executives reasoned that if CPC = TW/ACH, then TW*ACH should = CPC. That is actually a reasonable assumption to make, but when he multiplied them together, they came up short. He immediately got on the phone and started flapping his meathole at our senior director about how the numbers were wrong. She, in turn, got on the phone to my co-worker and demanded to know what he could do to fix the numbers.

If our leaders and directors are very good at one thing, it is accepting blame on someone else's behalf. There is some degree of reticence on the part of our middle managers when it comes to talking to people above them in the company. Part of that comes from self-serving spinelessness, but there is also a culture that is oozing down from the top where they are more interested in results than they are in explanations. When one of her masters told her to fix the dashboard, she bent over backward to deliver results, not explanations.

Thus, even though my co-worker spent the next twenty minutes trying to explain the concept of rounding errors to her, she tuned out everything that did not sound like "I'll fix it." He explained that the unit cost number was being truncated to two decimal places at the request of the same executives who were now questioning its accuracy. They asked for it to be truncated because they (reasonably) did not want their dashboard cluttered up with numbers stretching off to five or six decimal places.

She did not get it. Clearly he was just making excuses, rather than changing the fundamental laws of arithmetic.

He walked her slowly through it. If the total cost was, say, $34,126.54 (these numbers are all made up), and the total number of cars handled on that day day was 913, then the cost per car was $37.3784665 (and a few more digits for good measure). Since the executive asked us to truncate it (not round) to two digits, we showed it as $37.37 on the dashboard. Thus, if somebody then multiplied $37.37 * 913, they would only get $34,118.81 and come up short of the actual wage figure. As long as we were truncating to two decimal places, it would always come up short.

She still did not get it.

Obviously the $37.37 figure must be wrong or else when it was multiplied against the total units, it would yield the total cost. He explained it again, showing her the underlying figures, and explaining how the moment we cut it off at two decimal places - whether through rounding or truncation - we were stripping critical data from the number, and unless we happened to luck into figures that divided out evenly, the maths would never work out evenly if the terms were reversed. Given the size of the numbers involved, we would need to publish about six decimal places in order for the equation to work in reverse.

He was not convinced that she entirely understood - or was even willing to understand - but she eventually stopped pressing him for further explanation. My suspicion is that she explained it to the executive as a software limitation. That's a good enough IT answer, I suppose.
plonq: (Dashing  mood)
I have run into a puzzling issue with a report that I recently migrated to one of our newer systems. While most of the problems in migrations of this kind tend to be with the source data (somebody accidentally drops a table during the move), the problem this time is slightly more rounded.

Rather, the problem is with rounding.

In my mind, the main cause of the problem is that our executives don't like to see decimal places. Too messy. Ain't nobody got time for that. Don't sweat the small stuff. Give us nice, woody, whole numbers to deal with. Of course, in the world of data and applications, the fractions are an important part of the equation.

The result is that our old system reported that 20 - 44 = -24. Our new system reports it as -25. The thing is, the new system is actually correct, but hey - that's what you get for ignoring the decimal places. It's just that when one of our pointy-hairs higher up in the company see something like 20 - 44 = -25, they scratch their pointy-haired heads, scrunch up their little faces in confusion, then start heating up the cauldrons of tar.

I inherited the equations in this job, and I have tried a number of approaches, but no matter how much I play with CEILING(), FLOOR(), TRUNCATE(), ROUND(), FUDGE() or the like, it seems to insist on doing the maths before it does the rounding.

I will give you some more specific numbers from the report itself.

This year's bullshit metric is 19.73%, which the report rounds to 20%
Last year's bullshiit metric is 44.44%, which the report rounds to 44%

In the old system, it seems to do the rounding first, so when we show the difference between this year's bullshit and last year's bullshit, we see that we are 20% - 44% = -24% off from last year's bullshit.

HOWEVER.

In the new system, it does the calculation before it does the rounding, so even though it properly displays 20% and 44% respectively, regardless of my petitions for it to do otherwise, it calculates 19.73% - 44.44% = -24.71%. Guess what it rounds that to.

If I could just apply a blanket CEILING to negative values, and FLOOR to positive values then I could resolves this issue in an afternoon, but there are very specific failings that need to pile up properly for this to arise. Ultimately I need to employ some kind of Jedi mind trick to convince this software that it needs to forget that the decimal places exist after it rounds the numbers in its terms. I wonder if it has a program setting for "make it logical, not right".

1 = 2

May. 13th, 2014 03:09 pm
plonq: (Derpy Mood)
When does -40 = -41? When you copy a formula over from version 3.1 of some software to version 4.0 of the same.

I not write the formulas that created those numbers, and if I had, I'd have written them differently anyway. The fact remains that the software that we are using to produce this report has changed the way it handles its rounding from one version to the next.

The formula is taking a performance metric from one year and subtracting it from the previous year to show the variance year over year. When I expanded the two base numbers, this is what I got:

This year: 14.450
Last year: 54.941

When you subtract last year from this year, you get -40.491

The current version of the software correctly rounds that down to 40 when we strip away the decimal places. But wait, when we round all three numbers we get 14 - 55 = -40. In the old version it yielded -41.

What this tells me is that the old version of the software was probably rounding the numbers before it did the subtraction, rather than doing it at the end. In their own, stupid ways, both versions of the software are correct.

And I am left with a report that yields different results from the same source data, depending on which program I use to produce it.

It will be labour intensive, but the only solution I can see at the moment is to redo the formulae and truncate each term, rather than truncating at the end. That should only take most of tomorrow.

August 2025

S M T W T F S
     12
3456789
10111213141516
171819202122 23
24252627282930
31      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 6th, 2026 12:06 am
Powered by Dreamwidth Studios