How’d They Calculate That?

News Brief by Kip Hansen

 

featured_image_how_countfeatured_image_how_countThere are two recent stories in the NY Times that bring up a curious seemingly inconsequential oddity of mathematical computing.  They are both written by Steven Strogatz in time order they were: “The Math Equation That Tried to Stump the Internet” and then, two days later, “That Vexing Math Equation? Here’s an Addition”.  Steven Strogatz is a professor of mathematics at Cornell and the author of “Infinite Powers: How Calculus Reveals the Secrets of the Universe.

So what’s this all about?  A Tweet — that’s right — a Tweet on what Strogatz calls “Mathematical Twitter”. The tweet was this:

oomfies solve this

problemproblem

— em ♥︎ (@pjmdolI) July 28, 2019

 

That’s easy!  The correct answer is:

16or116or1

Yes, that’s right, the correct answer is either 16 or 1, depending on an interesting point of mathematics. The featured image gives us some insight into what’s going on here.   Strogatz explains it this way:

“The question above has a clear and definite answer, provided we all agree to play by the same rules governing “the order of operations.” When, as in this case, we are faced with several mathematical operations to perform — to evaluate expressions in parentheses, carry out multiplications or divisions, or do additions or subtractions — the order in which we do them can make a huge difference.”

 When we resort to our handy electronic scientific calculators, we find that my answer is absolutely right!

dueling_calculatorsdueling_calculators

(This image was supplied by a twitter participant…see the twitter thread).

The Texas Instruments TI-84Plus C returns an answer of “16” while our Casio fx-115MS returns “1”.

A quick survey of online scientific calculators returns mixed results as well:

also_equals_16also_equals_16

equals_oneequals_one

And maybe a bit more accurate:

equals_errorequals_error

Math guys and gals know that the problem is order of operations and there are conventions for which operations come first, second, third and so on.  In high school we learn the convention as one of the following (depending on where you went to school):

BODMAS is an acronym and it stands for Bracket, Of, Division, Multiplication, Addition and Subtraction. In certain regions, PEDMAS (Parentheses, Exponents, Division, Multiplication, Addition and Subtraction) is the synonym of BODMAS.

PEMDAS is an acronym for the words parenthesis, exponents, multiplication, division, addition, subtraction. Given two or more operations in a single expression, the order of the letters in PEMDAS tells you what to calculate first, second, third and so on, until the calculation is complete. If there are grouping symbols in the expression, PEMDAS tells you to calculate within the grouping symbols  first.

Strogatz  says:  “Strict adherence to this elementary PEMDAS convention, I argued, leads to only one answer: 16.”   Ah, but his editor ( and a slew of readers ) “…strenuously insisted the right answer was 1.”

To get Strogatz’s “16” one has to do this:  8/2 = 4  then do 4 x (2+2) or 4 x 4 = 16.

How to get “1” is explained in this quote from Strogatz:

“What was going on? After reading through the many comments on the article, I realized most of these respondents were using a different (and more sophisticated) convention than the elementary PEMDAS convention I had described in the article.

In this more sophisticated convention, which is often used in algebra, implicit multiplication is given higher priority than explicit multiplication or explicit division, in which those operations are written explicitly with symbols like × * / or ÷. Under this more sophisticated convention, the implicit multiplication in 2(2 + 2) is given higher priority than the explicit division in 8÷2(2 + 2). In other words, 2(2+2) should be evaluated first. Doing so yields 8÷2(2 + 2) = 8÷8 = 1. By the same rule, many commenters argued that the expression 8÷2(4) was not synonymous with 8÷2×4, because the parentheses demanded immediate resolution, thus giving 8÷8 = 1 again.”

So, if everyone followed exactly the same conventions, both when writing equations and in solving them, all would be well and we’d all get the answer we expected.

But…..

This [more sophisticated] convention is very reasonable, and I agree that the answer is 1 if we adhere to it. But it is not universally adopted. The calculators built into Google and WolframAlpha use the more elementary convention; they make no distinction between implicit and explicit multiplication when instructed to evaluate simple arithmetic expressions.

Moreover, after Google and WolframAlpha evaluate whatever is inside a set of parentheses, they effectively delete the parentheses and no longer prioritize the contents. In particular, they interpret 8÷2(2 + 2) as 8÷2×(2 + 2) = 8÷2×(4), and treat this synonymously with 8÷2×4. Then, according to elementary PEMDAS, the division and multiplication have equal priority, so we work from left to right and obtain 8÷2×4 = 4×4 and arrive at an answer of 16. For my article, I chose to focus on this simpler convention.

Our dear mathematician concludes:

 “Likewise, it’s essential that everyone writing software for computers, spreadsheets and calculators knows the rules for the order of operations and follows them.” 

But I have already shown that writers software do not all follow the same conventions….Strogatz points out that even sophisticated software like WolframAlpha and Google’s built-in calculator in GoogleSearch don’t follow the  sophisticated rules and get “16”.

wolfram_alpha_16wolfram_alpha_16

google_search_16google_search_16

The final statement by Strogatz is:  “Some spreadsheets and software systems flatly refuse to answer the question — they balk at its garbled structure. That’s my instinct, too, and that of most mathematicians I’ve spoken with. If you want a clearer answer, ask a clearer question.”

Update Before Publication:  The NY Times’ Kenneth Change waded into the fray in today’s (Aug 7) Science section with “Essay:  Why Mathematicians Hate That Viral Equation“.

# # # # #

I hope that you have found this essay either instructive or amusing.  The real basic on this issue is that original problem written as “8 ÷ 2(2+2)” is intentionally badly formed so as to be ambiguous.

It does bring up a very serious question:  If simple mathematical equations can be interpreted and solved to different answers, depending on the order of operations and given that even serious mathematical software differs in conventions followed,  what of very sophisticated mathematical models, in which variables are all inter-dependent and must be solved iteratively?

In CliSci, do we get different projected future climates if one changes the order of calculation?  I mean this not in the simple sense of the viral twitty equation, but in a much more serious sense:  Should a climate model, a General Circulation Model, first solve for temperature?  Or air pressure? Or first consider incoming radiation?   Here’s the IPCC diagram:

GCMs_IPCCGCMs_IPCC

I attempted to count up the number of variables acknowledged on this simplified diagram, getting to a couple of dozen before realizing that it was too simplified to give a real count.  Each variable affects at least some of the other variables in real time.  Where does the model start each iteration?  Does it matter which variable it starts with?  Does the order of solving the simplified versions of the non-linear equations make a difference in the outcomes?

It really must — I would think.

Do all of the western world’s GCMs use the same order?  What about the mostly independent Russian models (INM-CM4 and 5)?   Do the Russian models produce more realistic results because they use a different order of operations? Do they calculate in a different order?

I  certainly don’t know — but it is a terrific question!

# # # # #

Author’s Comment Policy:

 There is always yet another really great question to be asked.  Don’t ask me the one above, I don’t know the answer but I’d love to read your ideas.  If you are involved in a deep way with GCMs, please try to give us all a better understanding of the order of operations/order of calculation issue.

Start you comment with “Kip…” if you’re speaking to me.  I do read every comment that you post under any essay I write.  I try to reply when appropriate and try to answer questions when I can.

# # # # #

via Watts Up With That?

https://ift.tt/2YT7xXT

August 8, 2019 at 12:46AM

One thought on “How’d They Calculate That?”

Leave a comment