News Brief by Kip Hansen
There 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
— em ♥︎ (@pjmdolI) July 28, 2019
That’s easy! The correct answer is:
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!
(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:
And maybe a bit more accurate:
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”.
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:
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.
# # # # #
Economists have forecast nine out of the last five recessions.
Any number to the power of 0 = 1.
‘Fraid they lost me right there!
That is a convention, not a literal calculation.
This whole supposed polemic is BS. and is NOT a question of BEDMAS vs hemorrhoids.
Both conventions state exactly the same thing in different words , neither states the multiplication has a higher priority than division.
The key factor mostly ignored in this whole silliness is the rule that states you work from left to right when you have equal precedence operators. Once you remember that rule, there is no ambiguity.
Kip… : your second calculator image is a con-job since the reason they give different answers is because they are being given DIFFERENT calculations. Look again, closely. Using a full underline instead of a slash for the division implies a bracket around the denominator.
The problem I have with your version is: What if I distribute the 2 into the parenthesis? It is simply a badly written problem. When I see 2(2+2), it is the same whether I write it as 2(4) or (4+4). If the 2 is supposed to be separated from the parenths, it should either be written as 2*(2+2) or the problem should have been explicitly written $ latex \frac{8}{2(2+2)} $ or $ latex \frac{8}{2}(2+2)$ to give whichever answer is wanted. In physics problems the form is explicit.
or
messed up the latex, maybe this time I got it right.
Owen – I agree with you and, to me, the first version with the full underline for the division is the “more” correct one. My algebra training always told me to simplify as much as possible the divisor (the part at the bottom) FIRST. After that everything falls into place. We need the opinion of one of my old algebra teachers!
Correct! There’s a categorical difference between fundamental mathematics and supposed computational convention. What this viral “conundrum” shows unambiguously is that no competence in either is required for web-postings.
“In other words, 2(2+2) should be evaluated first. Doing so yields 8÷2(2 + 2) =”
The implicit rule is to simplify compound numbers- (2+2)=4.
Then the operations can proceed left to right. the mistake is that 2(4) is the same as 2*4.
Proceeding left to right: 8÷2*4-> 4*4-> 16.
The garbling of the problem is assuming 2(2+2) is different than 2*(2+2). The implicit rule requires simplifying within the parentheses but does not apply to operations outside the parentheses.
“The garbling of the problem is assuming 2(2+2) is different than 2*(2+2).”
And what if it was 2x instead of (2+2)? Would you do that implicit multiply first? Most people that learned algebra prior to digital computers would calculate 2x first.
How would you evaluate: 8y ÷ 2x in an algebra class?
x ^ ( a-b ) = x^a / x^b
let a=b and you find that “Any number to the power of 0 = 1″ is an identity , not a convention.
KIP… , I guess you used pathetic home made maths lessons to explain PODMAS et al on purpose.
Any reliable reference includes ” multiplication OR division” and “addition OR subtraction” in the hierarchy. There is no maths convention to split those groupings. Those that do probably failed school but know how to get click pennies by publishing any garbage they do not know.
Greg ==> I used quotes from published online sources for the definitions, and explanations from Strogatz — fussing about the definitions is not useful….
Strogatz makes the points of this essay, in a lot longer form, and if in doubt, read the links. For fun, you can read Ken Chang’s article in the Times too.
My old algebra teacher taught My Dear Aunt Sally. Multiply, Divide, Add and Subtract last. The answer is 1.
This is most certainly NOT by convention …….
If 1-1 = 0, the x^1-1 = x^0
or, written differently …
(x^1)(x^-1) …. or …. x^1/x^-1 …. Either of each = 1.
Therefore, x^0 = 1.
No convention, proof.
It’s more than a convention.
a^(x+y) = (a^x)(a^y) , for any real a, x, y
if x = 0, a^(0+y) = a^(y) = (a^0)(a^y)
for a^(y) = (a^0)(a^y) to be true, a^0 must equal 1.
Also, f(x) = a^x is a continuous, differentiable function, but it would not be if the value of a^0 was arbitrary.
The square root of -1?
If that doesn’t prove there’s something very wrong with the universe, I don’t know what would.
Showing glitches in man-made counting systems isn’t proof of universal issues, only that we make flawed systems and should expect such errors.
As for order of operations, yeah that’s a fun issue that can make long complicated calculations problematic, especially if you don’t notice them. (I.E. if it’s deep in the middle of a long equation)
The square root of -1 is a wonderful and very handy critter. A lot of the algorithms I work with would be a bear if we didn’t use complex numbers.
There are a number of conventions in mathematics and science that may have originally been employed as a shortcut to ease computation. However, as they found applications in more and more fields, they gained so much acceptance that they might as well be considered the true representation. The square root of -1 is likely the most important one of all, especially in its application to sinusoidal signals and how it so easily permits things like positive and negative frequencies. Those pretty much convincingly exist in the dual sidebands of AM radio.
I’ll go so far as to claim that a universe without the existence of the square root of -1 would be a very weird place.
Yes, consider the problem f(x) + f”(x) =0.
The solution is f(x) = C1 e^(ix) + C2 e^(-1x) + C3 + C4, which is equivalent to
f(x)= c5 six(x) + C6 cos(x) + C3 + C4
When you get an imaginary solution, you can be certain a trigonometric function is involved.
What does 0^0 evaluate to?
How about (0^2)/(0^2)?
Using the L’Hopital Rule, the limit of x^x as x approaches 0 from above is 1.
“Economists have forecast nine out of the last five recessions”
I think it depends which “economists” you are referring to. Central Bank economists NEVER see a recession coming – they are famous for it. On the other hand, Zerohedge has forecast at least 200 of the last 2 recessions, and then everyone else fits in somewhere in between.
As I have commented regarding this issue in other threads, the problem is that it is a poorly written equation if it has ambiguous interpretations. Add a couple of parentheses or brackets and the issue is solved.
It’s not poor mathematics, its poor programming.
Rocketscientist – Your point is well supported in practice.
If you type this into either the iPhone calculator or the calculator that’s built into Windows 10, you get 2.
It’s some kind of autocorrect effect, I think.
What happens in the Windows 10 calculator is that it doesn’ t reproduce what you enter if you try to do it as the equation is written.
When you enter 8/2 the calculator displays:
8/
The two is not displayed yet. When you type the first parenthesis it displays:
8/(2
Now it’s messed up, and it doubles down to the finish.
8/(2+2)
To make it work correctly, you have to type in the explicit multiplication:
8/2X(2+2)
and you get the correct answer of 16.
James Schrumpf
Wrong! To get the correct expression and answer you have to use nested parentheses. i.e.
8 / (2*(2+2)) =1
No the correct answer is 1
writing 2(2+2) has to work the same way as writing x(x+2).
There is IMPLIED bracketing.
“writing 2(2+2) has to work the same way as writing x(x+2).
There is IMPLIED bracketing.”
+10
My first impression of all this, having read about it elsewhere, was “any idiot knows that the correct answer is 1”. … Implied bracketing seemed obvious to me. My eye, thus, saw two terms, one on each side of the division sign.
2(2+2) is read like it is one side of the division sign. It could also be written as 4+4. It only becomes separated terms, when the indicated operation on the right side of the division sign is carried out. It’s like “2x”, where “x” is “2+2”. At least, that’s how I thought I was taught.
+1
What the heck is “implied bracketing”? 2(2+2) has plenty of bracketing, the implied multiplication is immaterial, as the issue is how division and multiplication relate in 8/2(2+2).
Ric: “the issue is how division and multiplication relate in 8/2(2+2).”
Except the expression is written as 8 / 2(2+2)
You left out the spaces. That’s what a computer programmer does. It changes the entire expression when you leave out the spaces.
Clyde Spencer is right. The equation has been poorly structured. To make it unambiguous, one should use nested brackets.
8/(2*(2+2)) unambiguously gives you 1.
(8/2)*(2+2) unambiguously gives you 16.
When creating formulae in spreadsheets, it is a very good idea to use brackets routinely, even when you don’t strictly need to, because you can’t be sure what convention the program may follow. It also helps you to structure your formulae correctly.
“There is IMPLIED bracketing.”
No, there is implied multiplication, not bracketing.
Bracketing changes the meaning.
Agreed!
I still write overly complex calculations to ensure most computers follow the calculations as I intend; though people frequently complain. Just another aged programmer stuck with certain conventions…
A statement that does not mean I get perfect results. All too often, it takes stepped calculations to identify where CPUs zigged where I coded zags.
Inside out,
Highest operand,
Which makes “original problem written as “8 ÷ 2(2+2)”;
2+2,
2 X (4),
8 ÷ 8 = 1.
Properly, the formula should be written as “8 ÷ 2(2+n), n=2”.
Otherwise, people who are mathematically proficient, immediately recognize 2(2+2) as 2³.
Which rather proves computers are not mathematically proficient, instead they require stepped language to reach their sums.
Again, proving what my COBOL and BAL Assembly teachers said many many times; “Never trust implicit commands! Program explicit commands.”
Apparently, this “Dan Cody” comments just to throw nonsense words into the thread.
Could it be that a bot is commenting?
How did you guess that I was an Android? My real name is Hal,made in 2001.Yes,It’s been a real odyssey since then.
The question unanswered is where unary minus comes. How does one evaluate -3^2 ?
Oh, that’s good.
How many IRS agents does it take to screw in a light bulb? Only one.But it really gets screwed.
An economist is an expert who will know tomorrow why the things he predicted yesterday did not happen today.
I learned that in college from a econ professor.
What is the difference between an Economics Professor and a Finance Professor?
An Economics Professor knows nothing about everything.
A Finance Professor knows everything about nothing.
He won’t know tomorrow because of flaws in the data that everyone “forgets” to mention when writing about it, researching, and getting tenure. It’s more a case of validation within a flawed data system.
“Are you a lawyer?”
“yes.”
“How much do you charge?”
“A hundred dollars for four questions.”
“Isn’t that awfully expensive?”
“Yes.What’s your fourth question?”
#Are you Human?” “Barely -I’m a lawyer.”
What did the lawyer name his daughter? Sue.
How do you tell the difference between a lawyer and a carp?
One is a bottom feeding scum sucker and the other is a fish..
Wat is the priority of division and muktiplication in 8/2*4?
(8/2)*4 or 8/(2*4)?
The Adam and Eve computer virus takes a couple of bytes out of your Apple.
Brackets first, division, then multiplication.
In order:
16, 16, 1
Archer
Division is the inverse operation of multiplication. Therefore, the order in which it is performed shouldn’t make any difference. That is, 8 / 2 = 8 * (1/2).
True, but since I learned BODMAS, division comes first.
🙂
In programming languages FORTRAN, C, R:
brackets first, then Left to Right, multiplication and division are equal, no priority.
16, 16, 1
(addition and subtraction are also equal, no priority, so also Left to Right)
Full order is:
1)Parens – innermost to outermost
2) Powers
3) Mult, Div – Left to Right
4) Add, Sub – Left to Right
This is hardly new, there are plenty of other problems with C especially because it adds priority to things like pointer operations and logic operators.
For those of interest this is C’s precedence operations
https://en.cppreference.com/w/c/language/operator_precedence
The answer from C will always be 16 .. The brackets are done first, the mult and divid have equal precedence and it’s simply left to right.
That is why many calculator programs and websites will give 16 because they don’t care about school rules they are using programming rules.
You want and even funnier which actually effects statistics ask what is the round of 1.5
Most programming languages will return 1, they don’t do round half to even rounding like you learn at school they simply take the floor value.
As an interesting aside climate change use a lot of rounding and I guarantee you that if you look at there code most don’t realize they have bias just based on there code as they are blissfully unaware how the language they use rounds.
LdB ==> The last bit can be a real problem in older temperature records where °F and °C are covet4ededback and forth, rounded to 0.5s….which are then processed modernly by software.
gads! “covet4ededback and forth” == “converted back and forth”….
Yes, good call LdB. I reckon most of the coders of the models have limited idea of how computers actually handle numbers. This discussion has dwelt on simple integer arithmetic, once we get into floating point representations of real numbers then the wheels well and truly fall off…
> Most programming languages will return 1
ISO 9989 (the C programming language) requires adherence to IEEE 754 (floating-point arithmetic), which has a number of configurable rounding modes (eg. towards zero, towards infinity, banker’s) that determine what the result of rounding 1.5 is. Fortran has similar requirements. I have a degree in math and safety-qualify computer language tool-chains for a living, I am quite familiar with this domain.
The language also specifies exactly what the operator precedence is, and what directional binding an operator has (eg. multiplication and division have the same precedence, and bind left). You can not write this ambiguous arithmetic statement in C, it’s just sloppy typography, like choosing your own spelling and grammar rules for English then asking the internet what you mean when you tweet nonsense.
The problem with the internet is that it allows anyone with a keyboard to get a lie to run around the world before the truth can even get its shoes tied.
“brackets first, then Left to Right” – Bingo!
The problem is when they draw it 8 over 2(2+2) so it should be 8 over 2 with (2+2) beside it
16 🙂
That isn’t actually the choice. This is a really simple problem. Implicit multiplication should always take precedence after parentheses (brackets) because that type of grouping, in this case 2(2+2), is implicitly a single number, it is not actually a multiplication as per 2 * (2 + 2), it is, to put it pedantically (and implicitly), (2(2+2)) which is 8. Thus it is always correctly 8/8.
Wait a minute! You expect a computer to think in abstracts like a human? You silly guy!!!
In the immortal words of HAL, “I’m sorry Dave, I’m afraid I can’t do that”.
No, but I expect all software students to be taught to envision every possible combination when coding for complex mathematical expressions, just as I was. Complete with metaphorical rapped knuckles when I did miss a possibility I might add. 😳😳
You are completely correct: the expression was deliberately composed in a way to be ambiguous.
Agree. “2(2+2)” is just another way to express the number 8.
If, on the other hand, it had been written as “8/2 x (2+2)” that would be 16.
Peter ==> This is the opposite of how Strogatz viewed the issue originally — after a lot of review and research, he discovered there is another convention used by many that differentiates between implicit and explicit multiplication — and agrees with you now — with the caveat that the original equation was intentionally ambiguous.
Just use RPN. Completely unambiguous. It was a reason HP used it on their pocket and programmable calculators – as well as being highly efficient in terms of operations required to calculate a sum.
My TI-85 graphing calculator knows how to handle parentheses as an implicit multiplication and returns “1” as the answer.
This is as it should be, because when factoring expressions, the common factor is shown typically as “x(x+x)” NOT as “x*(x+x)”. When shown in the second form, which is the only one Excel accepts, the association with the parenthetical expression is lost unless one adds another set of parentheses. This is adding complexity where is shouldn’t be necessary.
Another way of looking at this is as follows:
The original expression can be re-written as: x^3 / ( x^2 + x^2) or x^3 / x(x+x) or x^3 / x(2x)
or x^3 / 2x^2 or, simplifying, x/2
Let x = 2 . Substituting 2 for x; 2 / 2 = 1
If one realizes why the factor immediately precedes the parenthetical expression, then an extra set of parentheses shouldn’t be necessary. The interpretation or order of operations that leads to the most consistent result should be the preferred order.
But, your point about the veracity of what is probably millions of lines of code in GCMs, when something like this could be a bug, points to the need for vetting the code by other than the team that wrote it.
This so-called “implicit multiplication” is a typesetting convention used to beautify textbooks composed using movable type. It’s not a mathematical concept. The programming languages used in GCMs do not read typeset textbooks and more than they do cursive notebooks, so it’s not likely this particular kerfuffle is a source of inaccuracy in the GCMs.
It also probably makes a difference that I learned algebraic maths (I’m English) around 55 years ago.
Yes, I agree. I would differentiate between the equation
8 ÷ 2(2+2), and 8 ÷ 2 x (2+2).
The way 2(2+2) is written indicates that it is a single expression, not stand-alone terms.
Math is the symbolic representation if something, and how it is written can give clues to what an equation is representing.
I agree, jtom. If x is a variable, and I write 1/2x, I mean 1 divided by 2x, not one-half multiplied by x. In effect, “2x” means “2 of x.” So in BODMAS the implied multiplication has the precedence of the O, and binds tightest of all the operations after bracketing is taken into account.
8 / 2 of (2+2) = 1. No ambiguity at all in my mind.
1/2X looks a lot like “one-half X” on my screen.
jtom
+1
With you ! How can it possibly be any different ?!
Peter ==>
I’m with you Peter! I got “1” and was surprised that “16” was even possible! Implicit notation has a distinct meaning. There is no operator between the number and the bracketed expression. If you choose to ignore the notation and imagine that there is an invisible multiplication symbol you are going out of your way to create ambiguity!
I do appreciate that the formulation is largely ambiguous but it is also a test of mathematical rigour. That is to say, that to end up with “16” as the answer, you first have to break the rule of implicit notation buy plugging in an operator (Multiplication symbol in this case) that didn’t exist and then go about dutifully ignoring it, so that the terms can be rearranged – left to right – to priorities division! ;-(
No. The rule is if there is no operator, it is an implied multiply operator. That’s the rule. Follow it.
As far as implicit multiplication goes, it depends on the compiler writer. I just tried 8/2(2+2) in both Python and R, and they returned errors. There’s a missing operator/invalid function. However, the expression 8/2*(2+2) yields 16.0 in Python and 16 in R.
Jim
Peter;
“I reject your reality and substitute my own!”
Why should implicit multiplication take precedence? I say, NO!
but it is actually 8 / 2 * 4 so the answer really is 16 🙂
Not clearly expressed in the article is that you evaluate from left to right as well. It can be done in one pass or multiple passes. So the correct answer to your query is 8/2*4 = (8/2) * 4. Because / and * have the same precedence, and going left to right you encounter / first. It gets pretty complicated though, and if you lump in assignment operators, they go right to left. Here is a handy (reasonable) chart with all the operators you would typically see (Not including Trig functions). I didn’t vette this page thoroughly there could be a mistake.
https://www.swansontec.com/sopc.html
Nuts. That’s like saying 8/48= 8/4*8 =16. 2(2+2) is a single concept, you can’t split 2 away from (2+2) anymore than you can split the 4 from the 8 in 48.
Simply expanded 8/2(2+2) = 8/(2×2+2×2) = 8/((2×2)+(2×2)) = 1
WHY is my comment “awaiting moderation” ???
I have noticed that a lot of my comment do not make it publishing in the blog, WHY ?
TRM
I define the issue differently.
In the first TI calculation they entered the problem correctly and got 16.
In the second they (effectively) added a second set of parentheses:
8/(2(2 +2)) as is clear from the screenshot
There is no second set of imputed parentheses in
8/2(2+2)
The answer is 16. The only way to get 1 is to mis-program the calculator with parentheses that are not there. The “times” (x) is imputed by arithmetic convention. The second calculator requires that operands be provided. This is not even interesting.
8/2x(2+2) = 16
always multiply before divide. The division bar acts as a separator.
This fooled me for a moment until I realized that 2(2+2) is really 2*(2+2) at which point I could use the rules of precedence
1) Operations inside a brackets
2) Exponents
3) Division and Multiplication (same order of precedence)
4) Addition and Subtraction (same order of precedence)
If two operations are at the same order of precedence then it is calculated left to right
So its calculated per the orders of precedence
8/2(2+2_) =8/2(4)= 4(4) =16
What is 666?
That’s the number of the beast.
And 668?
The next-door neighbor of the beast.
What’s 666-point-00000?
That’s the high-precision beast.And zero-point-666 is the Millibeast.
And 1-900-666-6666 is when you can call and talk to a beast,live,one-on-one.
And $665.95 is the retail price of the beast.
$669.25 with 5 percent sales tax.
$769.95 with all accessories.
666b…lives upstairs from The Beast.
This is getting old.
Dan Cody
And Romans knew the beast as DCLXVI
Whereas for programmers the beast is 1010011010 (binary) or 29A (hexadecimal).
We all know that 666 is the Number of the Beast -, but did you know that: –
$665.99 = Recommended Retail Price of the Beast
$699.25 = Price of the Beast plus 5% sales tax
$1879.95 = Price of the Beast, with all accessories
$655.56 = Wal-Mart price of the Beast
$654.96 = Tesco price of the Beast – and you get Clubcard points!
$6666.66 = Harrods Price of a very Superior Beast
$666 = hourly rate of the Beast’s lawyer
£666 = hourly rate of the Beast’s London lawyer [plus VAT].
$333 = ‘Half off’ sale on the Sign of the Beast
6, uh. . . sorry, what was that number again? = Number of the Blonde Beast
1-900-666-0666 = Live Beasts! Call Now! Only $6.66/minute. Over 18 only please.
£666 666 = Income of the Beast
Route 666 = Highway of the Beast
B666 = by-way of the Beast
E-666 = European Autoroute du Beast/Beaststrasse
666 F = Oven temperature for succulent, well-roast Beast
666 C = Oven temperature for well-charred Beast
$66 = Small joint of Beast
666k = Retirement plan of the Beast
6.66 % = 5 year CD interest rate at First Beast National Bank, $666 minimum deposit.
666MHz = CPU of the Beast
666CSi = BMW of the Beast
668 = Next-door neighbour of the Beast
664 = Next-door neighbour of the Beast, also
667, 665, 663 = close neighbours of the Beast
UB-666 = unemployable Beast claim form
666A, 666B and 666C = Tenants of the beast
999 = Sign of the Australian Beast
333 = Number of the adolescent Beast
6-6-6 = Whyte notation wheel arrangement of the Beast’s Locomotive
6-66 = bowling analysis of the [cricketing] Beast
6-6-6-6 = wheel arrangement of the Big Beast’s Articulated Locomotive
00666 = Zip code of the Beast
HE66 6LL = Post Code of the Beast
BA666 = Flight of the Beast
666.000000 = Beast to 6 decimal places
670 = Beast to 2 significant figures
Some repeats, true.
Auto – with thanks to Dirty Jokes [RIP].
LOL! You sound like the Beastie Boys!
You forgot the following fact:
The sum of the first 144 digits of Pi is 666.
What’s a buccaneer? a helluva price for corn!
A hearing appendage on the side of your buccanhead.
What’s the difference between beer nuts and deer nuts?
Beer nuts are $1.69 and deer nuts are under a buck.
What’s the square root of 69?
8 something
LOL! 8 some hair pie.
If H2O is on the inside of a fire hydrant,What is on the outside? K9P.
Holy crap, I’m back in 5th grade!
Alcohol and calculus don’t mix.Never drink and derive.
Dan Cody:
You are over your head. You also seem to have nothing to contribute.
All of your comments are off topic. Off topic is against the rules, but are often well tolerated anyway. You are pushing it.
Do not treat this site as your own personal jokesters playground.
Tony,you don’t sound good.You sound too serious,lighten up.Life is too short to be too serious.There’s no excuse for your condescending attitude.If you ever even had an ounce of a sense of humor in your being,you wouldn’t have replied so negatively in your remarks toward me.It’s a shame that there are people like you around that turn others off with your complaining and negativity. If you disagree with someone about anything,please do it respectfully without bellyaching about it.Grow up.Lighten up and enjoy life.Feel better Tony. – DC
We like humor with wit and intelligence. Not the mindless regurgitation of cutesy, banal, adolescent-type jokes. Try to exercise that thing between your ears and weave your jokes in with the subject at hand, have the sense to limit your need for attention, and you’ll be better received here.
My comments have been well received by others who have a sense of humor.It seems like you don’t have one judging from your overly serious attitude.Your too caught up in the subject.Take a deep breath and relax.Loosen up and try to be flexible about things and try not to be so uptight about others actions.Life is good.Enjoy it without others getting to you just because your feelings are different from others.Feel better.
HAHAHAHAHA, Big Joke.
Drop Dead, punk. Grow up
Those stupid “jokes” of yours are three times older than you are.
You just proved my point with your childish attitude.Now you’re getting nasty when your backed into a corner.Tony,if you can’t take the heat,get out of the kitchen.Grow up and stop the name calling an act like an adult instead of having a mindset of a 10 year old.Feel better.
If it’s any compensation, Dan, I thought your series was funny.
Thanks Pat.It’s nice to hear someone with a pleasant reply towards my jokes,not like some people who are just so obnoxiously critical and just plain nasty with the wrong,negative attitude in life.I think some people underestimate the power of a sense of humor in life.It really helps you to enjoy life without taking things TOO seriously.It’s a healthy attribute that relieves stress.
People are trying to have a discussion about a specific topic. An on-topic joke is always appreciated, but yours are just stuff you’ve grabbed from a bad joke site, and are just over and over and over again. Why don’t you go to a forum where people appreciate your kind of “humor”?
Why don’t you go to a forum where people are taught not to take life too seriously and are taught that trying to have a sense of humor in life leads to a healthier life because humor is good for reducing stress and leads to having a better attitude towards others instead of the negative reply to my comments.Jeff,It sounds like you need to have a more flexible attitude and have a little fun instead of getting too wrapped up in the subjects of discussion here and criticizing others because they ‘go off the beaten path’ a little.Feel better Jeff.
When I first read Dan’s string of jokes I thought it was a commentary on how repetitive the discussion was becoming. The author of the article established that there were two ways to do the calculation and no amount of “I am right and you are wrong” adds anything further to that point. The article leaves us with the tantalizing question of how different rules might alter the output of models which are created by people who have repeatedly demonstrated themselves to be numerically challenged. That is interesting. Talking loudly and banging the table about which convention is more right, is not interesting. A string of pointless jokes was warranted.
Thanks BCBILL.Well said.It ‘s good to hear from someone with a good head on his shoulders.
Ah go for it Dan, you’re as sick as me
My two-penneth as an old mathematician is that 8/2(2+2) is ambiguous. For clarification I think you would present the question as (2.(2+2))/8 = 1. So the parenthesis dictates what is calculated first to force the multiplication before division takes place.
So I agree with the statement “If you want a clearer answer, ask a clearer question.” But it does open up interesting questions as to which operator (multiplication or division) takes precedence in applications used today.
Seems to be this is wholly contrived. Does such a question exist in the real universe? No.
Ouluman and Pheonix44 ==> The question is contrived — and intentionally ambiguous.
The larger point is that so much of our day lives depends on computers and software calculating all sorts of things that affect out lives — and the rules for doing so seem to be a little undecided.
I was a web programmer for years — and ultimately HTML Czar for some very major web sites. I knew the rules to within in inch of their lives — and heaven help those on the team who violated them. But programmers do violate rules, they do take shortcuts, and for all we know, there are errors abounding in ignorance — the order of operations rules, order of processing, rounding rules, etc etc.
So this essay hopes to point to what is acknowledged to be a real world problem, mostly ignored.
Hence the importance of unit tests and stringent QA procedures.
Unit tests, function tests, system test and we still expected 3 to 4 errors per thousand line of code once it reached the field.
Kip,
Indeed, Excel is known to have bugs and MS has ignored them for years.
MS don’t do Mathematics, they sell software. When using Excel and Access you can’t have too many parentheses.
Yes.
Go get the HARRY_READ_ME.txt file from the Climategate e-mail trove, available here: http://file.wikileaks.org/file/climactic-research-unit-foi-leaked-data.zip.
Independent Validation and Verification (IV&V) is required for software impacting public safety in most engineering disciplines. But politicians are willing to destroy the entire economy of the world based on nothing other than the kludgey, most assuredly non-IV&Vd crap run by climate “scientists.”
No need to drag down the .ZIP file, I have it at http://wermenh.com/climate/HARRY_READ_ME.txt
Thanks, Ric! I didn’t have an alternate source, but this is great.
Michael and Ric ==> Thanks, that’s the ClimateGate bit I was referring to.
Imagine now with copy-cat GCMs all churning out the more-or-less same dross — except the Russians! (Who are not so copy-cattish!)
It’s not contrived. As an engineer I often write something like R3/R1(R1+R2) because way back when we were taught that with x(..) the x( takes precedence over multiplication and division.
After all (4+4) = 2(2+2) so 8/(4+4)=1 and having factorized it to 8/2(2+2) the answer must remain 1.
The ambiguity seems to have arisen more recently with acronyms that I’ve never heard of until this came up. Indeed if the intent is 8/2 *(2+2) then write it thus. Or to put it another way the implied multiplication is a higher priority than explicit multiplication.
It bothers me that people could pick up my algebra and mis-interpret something that used to be clear to everyone.
Or is there a US UK difference like with billions? 10^9 as opposed to the correct 10^12.
The whole trick is that if you have a number next to a parantheses it is a multiply but you don’t have to put in the *. If I wrote it 8/2*(2+2) most people would get it right, if they followed standard left to right operation.
In computer programming, we will put extra parentheses around things to make the intent clear rather than rely exclusively on the order of operations . It makes code easier to understand and more readable.
x = (8/2) * (2+2);
Is perfectly acceptable and makes the answer much more clear without having to go to the order of operations table in the beginning of some Stroustrup book.
marqu ==> Yes, but what if I meant was x = 8 / (2*(2+2))? That’s the rub here — which did the originator mean? Which did the software evaluate when the programmer wrote “8÷2(2 + 2)”?
This is NOT a question of which rules are the proper ones —
Kip…A number next to parentheses means multiplication, not another set of parentheses. What I learned nearly half a decade ago was to put a multiplication sign between the number and the parentheses. So x=8/2(2+2) is first clarified as x=8/2*(2+2). It boggles me how someone can come up with a different answer. But then again in today’s world there are lots of things that boggle me including the growing number of people who actually believe the earth is flat.
As for the harder and much more interesting question you pose, I am not nearly qualified enough to answer. What I do know is the science is not settled.
Chuck ==> To find out how some people can
Chuck ==> figure that differently, you need to read both Strogatz’ articles. He thought there was only 1 way too — and he is a maths professor at Cornell.
Why not ask Greta, I am sure she has an oppinion
Kip,
Very interesting, type it into Excel as written, =8/2(2+2) and Excel tells you there’s and error and suggest a correction, =8/2*(2+2) which it then answers as 16 !!!
ColA ==> Fascinating, isn’t it. Just when we are on the verge of massive parts of society being controlled by “AI” computers, we find they have such a basic unresolved issue.
I think there are numerous issues and areas in which machines are greatly inferior to even a simple minded organic intelligence.
Things that a person, and even animals like birds, dogs and cats can do instantly and easily, but machines are baffled by, or simply freeze up or ignore.
Random example:
Remember when that self driving car saw that lady crossing the street but did nothing because…um…it is a machine and only does what you tell it to do?
She was killed even though there was plenty of time to stop.
Machine was not programmed with an emergency override protocol or anything like it.
Which it seems to me ought to be at the most basic level of it’s instructions.
Like the things that we do automatically before we even think about it.
100+
Kip,
300 odd replies says everyone got something out of this, great work!
I always tell my Junior Engineers to work out the problem by hand before they program or work out the answer by hand because it is so easy with Excel to get your parenthesis wrong and your example proves that very well.
It is easy to see here the difference in results here between 8/(2(2+2))=1 and 8/2*(2+2), but if you get your bracket wrong in something like this it is a lot more difficult to sort it out if you don’t have some idea what the right answer is!!
=IF(LH<G,(F+I-Lth)/2*LH+(F+I-Lth)/2*LH/COS(RADIANS(90-Az))+(A+H-Lth)*LH/COS(RADIANS(90-Ay))+(I-Lth)*(H-Lth),(F+I-Lth)/2*G+(F+I-Lth)/2*G/COS(RADIANS(90-Az))+(A+H-Lth)*G/COS(RADIANS(90-Ay))+(I-Lth)*(H-Lth))
When I do stuff in Excel, I’m very explicit. I would have typed in =(8/2)*(2+2), if that’s the calculation I wanted to perform.
For years I’ve been adding brackets to all equations where there was any ambiguity … and I didn’t understand why there was ambiguity – and I did keep thinking “perhaps there’s a general rule I should learn to avoid this”.
Finally I understand … one enormous cock up by mathematicians!!!
Scottish ==> You got that right — it is really a programmers error though — an error in the writing out of an equation. My rule has always been “be explicit — don’t imply”.
Blame it on the teachers/lecturers.
There is no ambiguity as far as I am concerned, the answer is 1. No one during my education in the 60s saw an ambiguity. Sure we were told to use extra parentheses in the case of ambiguity or programming FORTRAN but the rule was clear implicit multiplication takes precedence or factoring doesn’t work.
+10 !!!!
This is really fascinating how we can have different rules for such a simple thing. During my education in the 60s I was taught that a number besides a parentheses mean multiplication. So to me the is no ambiguity either. x=8/2(2+2) is very simply clarified as x=8/2*(2+2). I’ve never heard of “implicit” when it comes to the order of operations. But I’m definitely not a mathematician.
I like the second question that was posed.
Scottish Sceptic,
I too have always added additional parentheses to clarify what was to be done in equations. Often I’ve been criticized for doing so but I as long as I got correct answers I never bothered changing.
Write the problem with the “8” being the numerator.
Draw a long line under the 8 to separate the numerator from the denominator.
The 2(2+2) term is written as the demominator.
Like any symbolic language, terms can be manipulated to appear paradoxical.
bwegher
August 8, 2019 at 12:13 am
Yes you’re right…my take is that it should be 8/(2(2+2))=1.
Kip, many thanks for another interesting post. Those climate “experts” that just let their computer do the thinking for them should take note (but they won’t).
“Those climate “experts” that just let their computer do the thinking for them should take note”
Definitely! Skeptics should also take note.
Kip asked some good questions about the Global Climate Computer Models that need to be answered.
‘experts’????
See https://wattsupwiththat.com/2011/11/24/crus-dr-phil-jones-world-renowned-climatologist-cant-even-plot-a-trend-in-excel/
Alastair ==> Yes, it is the greater question — the order of processing in the massively complex and complicated GCMs — that is important.
That is how I would have done it. The 2 outside the brackets in algebraic operations implies a distributive operation on the interior of the brackets before anything else was calculated. That would render 2(x+y) = 2x+2y, so 2(2+2) would be 8. Then the division yields 1. I never had a teacher that would have treated that as ambiguous. I don’t recall for certain, but I belive Reverse Polish notation would render it 22+2*8/ -> 4*2/8 -> 8/8 -> 1.
Computers changed all that. Pencil and paper were clear. Programming is not.
Sheri ==> Yah — you’d think that all that structure and “rules based” programming languages would have fixed something like this….
PEMDAS should always result in 1. The addition is inside parents so that is first. No exponents. Multiply next. That gives us 2*4 or 8 for the right side of the equation. Then the division, so 8/8 or 1. No other result is possible by that method. PEMDAS will always give an answer of 1. Anyone who says otherwise is not applying the rules correctly.
The issue is that the rule you are quoting is not the rule that everyone uses and/or was taught to use.
Any rule that ignores the spaces in the expression is an invalid rule. You can’t ignore the spaces in a handwritten expression. Replace the spaces with parenthesis or brackets and then evaluate it.
Disagree. The use of implied multiplication is just a lazy way to avoid writing down the multiplication sign. That’s all. It isn’t somehow a “higher” form of multiplication.
The ‘implied multiplication’ is a red herring. Multiplication is done before division in the rules I learned.
“The use of implied multiplication is just a lazy way to avoid writing down the multiplication sign. That’s all. It isn’t somehow a “higher” form of multiplication.”
Really? When my calculus books writes an equation as mx+b then it should actually be written as m*x+b?
I can show you all kinds of math books that will disagree with your view.
The original expression was not written in a computer language. It was written in the form that math expressions have used for generations.
It would seem that far too many people on here think all math expressions must be written in a form conducive to interpretation by a language compiler.
I doubt you can show me one math book that disagrees with my view.
When evaluated according to the rule under discussion, “mX + b” will turn out the same as “m x X + b” every time, as in either case “mx” and “m x X” are evaluated before adding “b”.
mx + b was not an example of precedence of operators. It was an example of how elements of an equation are grouped in the written form, Which includes the implicit multiplication operator.
The example of x(x+x) has been offered up in this thread multiple times. In the written form of mathematical expression 8 / x(x+x) makes no sense unless x(x+x) is evaluated first because of the implicit operator of multiplication.
If I gave you the expression ʃ x2 / x(x + 1) exactly how would you evaluate it manually?
“The example of x(x+x) has been offered up in this thread multiple times.”
And that’s fine, but it doesn’t begin to answer what happens when a term and operator precedes it.
There is another serious issue when doing calculations on a computer and that is that usually you are allowed a limited number of significant digits. If you for example divide a number by 1000 it is quite possible that you are throwing away 3 significant digits. Any subsequent multiplication will be incorrect. Therefore multiplication should always come first so that BODMAS becomes BOMDAS.
You are starting to sound like a mozzie.
And then there’s RPN, reverse polish notation:
https://www.google.com/search?q=polish+reverse+notation+calculator&oq=Polish+reverse&aqs=chrome.
Simple answere is: know your tool. And know why you prefer THIS tool.
RPN is what was fed directly into Forth, when having something to parse infix expressions (in an interpreter) was considered too expensive computationally.
The shuntyard method can be used to write a simple infix expression parser. It uses operator priority to determine if something should be pushed onto a stack or if an operator and two operands should be popped off, evaluated and the result pushed back to the stack.
It’s been close to 40 years since I first wrote one (in COBOL – don’t ask)…
Johann Wundersamer ==> In the early days of Chaos Theory, it was discovered that different brands of computers returned wildly different tresults when processing non-linear equation iteratively.
Think of GCMs written for early computers being run, without re-writing thousands of lines of code, on modern computers….
I found there were some interesting “divergences” in solutions to Limits to Growth models that used 4th order Runge-Kutta methods in the DYNAMO programming language. Being a naive young student, I simply decided to play with the program a bit and soon managed to produce instabilities.
It doesn’t ==> This was in the early days of Chaos Theory?
And then there’s RPN, reverse polish notation:
https://www.google.com/search?q=polish+reverse+notation+calculator&oq=Polish+reverse&aqs=chrome.
Simple answere is: know your tool. And know why you prefer THIS tool.
https://www.umrechnung.org/hp-rpn-rechner-online/rpn-reverse-polish-notation-rechner.htm
The bane of programmers everywhere.
Should always explicitly include the braces/brackets then there’s no ambiguity and following maintainers are less inclined to make mistakes or misinterpret meaning.
So it should be expressed 8 / (2 * (2 + 2)).
Then the meaning is explicit….
This short arithmetic quandary reflects the centuries old conflict of two cultures European vs Arabic.
Ancient Greeks and Romans had impracticable numerals and wrote from left to right. Arabs invented present day use numerals but wrote from right to left.
If calculation is performed with the western method of reading from left to right result is 16
If calculation is performed in Arabic way result is 1.
“Ancient Greeks and Romans had impracticable numerals and wrote from left to right.”
____________________________________________
Ancient Greek Mathematics was based on Euclid and Pythagoras.
Euclid brought the Egyptian methods of calculation to Greece: the Egyptian calculation methods were actually based on the evaluation of the length determination and area determination from land surveying for the construction of temples.
When the “0” was introduced in India for administrative calculation problems and calculation tasks for commercial, business tasks, the basis for modern mathematics was laid.
No, the 2 on the front of the (2+2) is a component of the numbers inside the parenthesis, the correct western method is to resolve it to 8/(2×2+2×2), 8/(4+4), 8/8 = 1
You miss the point. There are number of ways to resolve the problem, some already discussed, but they all involve introducing additional elements, as you did by moving parenthesis about and introducing additional numeral 2, which fundamentally change the original equation.
What I have shown is that if original (not modified !) equation is performed step by step in its original form, the two results conform with western or alternatively arabic way of reading written text.
there are NO other ways to resolve the equation because it is not an equation it is a fraction… I changed nothing in the fraction… ((8))/(((((((2(2+2)))))))) is the same as 8/2(2+2).
The top is literally 2(2+2) to begin with. So what does 2(2+2)/2(2+2) come out to?
Parenthesis ARE the first step, they MUST be resolved first: standard algebraic rule.
So does (4+4) factorise to 2(2+2)?
If yes the answer is 1. Hint the answer is 1.
Again from above any programmer will tell you the answer is 16 and there programs will all agree because they don’t care about your method or what you were taught at school. It is why the websites and calculators are throwing that up because they just feed the mathematics to the language.
That is the issue there are a number of different standards to how to approach it and just because you were taught it one way does not make the correct answer. It is the old case don’t mix standards and the answer depends on the standard used, it isn’t the maths itself that is changing just the standard used.
No, programmers with a degree also have a mathematics degree and understand from *Grade School* algebra that the parenthesis must be resolved first prior to actions outside the parenthesis.
Yeap
Prjindigo, you keep harping about doing the parentheses first, (which is true), but that’s not the issue here. The issue is: In the absence of parentheses, what is the order of evaluation when you have a string of infix operators and operands that are all of the same priority. (Note: multiplication and division have the same priority which is higher than addition and subtraction which also have the same priority.)
So how do you evaluate the string 10/5*3/6*2?
Answer: Evaluate left to right to get 2 (because most western languages are read left to right.)
Notice that I am talking about mathematical expressions constrained to be written linearly as a string, which most computer language compilers/interpreters/etc. require.
When we relax this constraint by allowing mathematical expressions to be written as 2-dimensional expressions (as most mathematicians do) then the division operator may extend itself as a long line (called the vinculum) separating any expression in the numerator over any expression in the denominator. Essentially the vinculum imposes implicit parentheses around the numerator and around the denominator which mathematicians usually omit, but which must be used when linearizing that 2-dimensional expression to be evaluated in some computer language.
noaa: “The issue is: In the absence of parentheses”
The issue is that this expression was written as a manual expression like you would see in a math book, not as a line in a computer program.
“Notice that I am talking about mathematical expressions constrained to be written linearly as a string, which most computer language compilers/interpreters/etc. require.”
The expression given is not written linearly as a string.
“When we relax this constraint by allowing mathematical expressions to be written as 2-dimensional expressions (as most mathematicians do)”
Bingo! Everyone getting an answer of 16 is doing so by trying to REWRITE the expression into computer language.
Gormon: “The expression given is not written linearly as a string. ”
It most certainly is written as a string:
8÷2(2+2) = 16 is a mathematical expression written linearly as seen at the top of this particular blog. It matters not where it appears – a math book or a computer science book – the answer is always 16.
8
———- = 1 is a mathematical expression written 2-dimensionaly.
2(2+2)
There’s no mystery here. I’ve been teaching these conventions in university math and computer science courses since 1970.
noaaprogrammer,
8÷2(2+2)
Why do all programmers leave out the spaces provided in the original post?
8 ÷ 2(2+2) is not the same. The 2(2+2) is separated from the divide operator by a space. Spaces indicate grouping in any language I know, including math! Certainly “thesunisrising” is different than “the sun is rising”.
Early computer languages like FORTRAN, Algol, etc., required math expressions to be string-oriented for compilation into machine code, and spaces were used as syntactic delimiters – never as mathematical operators. However later computer languages capable of handling symbolic math expressions would allow implicit multiplication – e.g. 2(2+2) – but I am not aware of any of them using spaces to override the usual left-to-right evaluation of operators of the same priority. (Parentheses are used to do that.)
Neither am I aware of any authoritative, widely accepted rule among mathematicians to use spaces to override the left-to-right evaluation of operators of the same priority – mainly because it can be hard to detect the difference in a complex expression between one space and no space among the many different fonts that allow proportional spacing. Thus mathematicians use parentheses and/or vinculums (as in division and radicals) to denote the order of operator evaluation.
Cite me an authoritative source that states otherwise – e.g. 8(space)÷(space)2(2+2) = 1.
Note: Postfix and Prefix notations are used by some programming languages to simplify such ambiguities in infix notation.
Cite me an authoritative source that states otherwise – e.g. 8(space)÷(space)2(2+2) = 1.
How would you evaluate the expression 8y ÷ 2x on a manual basis, no computer, no programming language. Just a straight expression written on a blackboard using chalk with a value for y and a value for x given to you?
I can tell you how every algebra teacher I know would evaluate it.
You keep addressing this as if the expression given was part of a computer program. There was nothing in the original post to indicate such. It looks like an expression out of a basic algebra text.
Gorman: “How would you evaluate the expression 8y ÷ 2x on a manual basis…”
1) Multiply 8 times y,
2) Divide the above result by 2,
3) Multiply the result of step 2 by x.
When any individual is doing a rough back-of-a-napkin calculation they are obviously free to use whatever notation they’re used to. However if I were a proof reader or editor of a book or article that wrote 8y ÷ 2x intending the semantic to be
8y
—
2x
I would make them write it as 8y ÷ (2x).
Gorman: “You keep addressing this as if the expression given was part of a computer program.”
Yes and No. Because the use of computers is so endemic nowadays, computer science has correctly forced mathematicians to avoid such ambiguities. Computer languages are necessarily designed with unambiguous grammars so that for any given mathematical expression, everyone everywhere will get the same answer every time.
noaa:
1) Multiply 8 times y,
2) Divide the above result by 2,
3) Multiply the result of step 2 by x.
So in the first element of the equation you follow the convention of implicit multiplication but for the second element you ignore it. That is being inconsistent and illogical. Either implicit multiplication works or it doesn’t.
“I would make them write it as 8y ÷ (2x).”
Why not make them write it as (8*y) ÷ (2*x)? If you are going to require explicit operators then require *all* elements to follow that rule.
“Because the use of computers is so endemic nowadays, computer science has correctly forced mathematicians to avoid such ambiguities.”
Sorry, even modern textbooks still use the implicit multiplication format.
“Computer languages are necessarily designed with unambiguous grammars so that for any given mathematical expression, everyone everywhere will get the same answer every time.”
This is true. That’s because computers are very literal and require very literal statements to evaluate. It is almost impossible to have them differentiate between various writing formats. You simply cannot write enough logical interpretation rules to cover all possible formats. Humans don’t suffer from that foible, at least not as much.
Algebraic expressions have been written in the form of 8y ÷ 2x since algebra was invented. Examples abound in academic, scientific, and engineering treatises, even today. Computer programmers may not like that but the world doesn’t revolve around the wants of computer programmers. Sorry.
Gorman “Why not make them write it as (8*y) ÷ (2*x)? If you are going to require explicit operators then require *all* elements to follow that rule.”
No, using the mathematical convention of juxtaposition of numeric coefficients with letters to implicitly denote multiplications as seen in the numerator is perfectly unambiguous and OK. That’s not the point – (unless you’re writing code in a language that requires a multiplication operator). It is only when you have a string of multiplicative operators (implicit or explicit) of the same priority without parentheses or vinculums, that one is forced to invoke some rule for their order of evaluation, which is left-to-right. So since (ab)/c = a(b/c), it is not necessary to use parentheses until encountering the third operator operating over the 4th operand. (Although not a requirement when programming mathematical expressions, I generally use the fewest symbols possible without compromising clarity.)
How would you evaluate the string: 2+3 – 6–7 ? (Notice the extra spaces around the central minus sign.)
“No, using the mathematical convention of juxtaposition of numeric coefficients with letters to implicitly denote multiplications as seen in the numerator is perfectly unambiguous and OK. That’s not the point”
In the numerator? But not in the denominator? Once again you are not being consistent. And that *is* the point.
8y ÷ 2x is the exact same form as the original example. Just set y=1 and x=4. Both expressions should deliver the same answer. If the answer isn’t the same then something is wrong with the way the expression is being read.
“How would you evaluate the string: 2+3 – 6–7 ? (Notice the extra spaces around the central minus sign.)”
Since addition (subtraction) is perfectly associative it doesn’t matter how you evaluate this expression.1: 2-7=-5, 3-6=-3, -5-3=-8. 2: 2-6=-4, 3-7=-4, -4-4=-8. Or 3: 5-13=8. You can do these in any order. You can even write this as 2x+3y-6c-7d and evaluate it as -8 if x=y=c=d=1.
So what? This still doesn’t explain you doing implicit multiplication with one element of the expression but refusing to do implicit multiplication with the second element.
Gorman: “In the numerator? But not in the denominator? Once again you are not being consistent. And that *is* the point.”
It is not a matter of consistency, it is a matter of order of applying the operators to operands. Because we read from left to right it is indeed unnecessary to put parentheses around the 8y which is the numerator. And to reiterate, if your semantic is
8y
—
2x
then you do need to put parentheses around the 2x: 8y ÷ (2x). Otherwise your semantic is:
8y
— x
2
regardless of how many math books show otherwise.
Gorman: “Since addition (subtraction) is perfectly associative it doesn’t matter how you evaluate this expression.1: 2-7=-5, 3-6=-3, -5-3=-8. 2: 2-6=-4, 3-7=-4, -4-4=-8. Or 3: 5-13= [sic -8] 8.”
Yes addition is associative, but subtraction is not associative (neither is division). Thus the order does matter in which you evaluate the string:
2+3 – 6–7
Again, since there are no parentheses and the operators + and – have the same priority, the rule is to evaluate from left-to-right to get:
2+3 – 6–7 = 5 – 6–7 = -1–7 = -8
Now if I do a right-to-left evaluation, I get:
2+3 – 6–7 = 2+3 – -1 = 2+4 = 6 ≠ -8
If I do the order of operations as you want to do for 8y ÷ 2x, I get:
2+3 – 6–7 = 5 – -1 = 6
So if you want a rule that says that extra spaces surrounding an operator requires that operation be carried out after the other operators, then you’re going to have to accept the result of 6, not -8 as you demonstrated in 3 different ways. And that IS a matter of being consistent.
“It is not a matter of consistency,”
Of course it is.
“f I do the order of operations as you want to do for 8y ÷ 2x, I get:”
There is no “implicit addition” or “implicit subtraction” rule. You are still showing your programmers bias.
“So if you want a rule that says that extra spaces surrounding an operator requires that operation be carried out after the other operators”
Stop putting words in my mouth. That is *NOT* what I said. I said the spaces in the original expression provide a grouping for the implicit multiplication. A totally different thing. Again, your are still showing your programmers bias.
Gorman: “There is no “implicit addition” or “implicit subtraction” rule. You are still showing your programmers bias.”
The implicit or explicit use of any operator has no bearing on the matter other than perhaps suckering a person into an incorrect evaluation of the expression – which is the raison d’être for this particular topic on WUWT. Whether writing the expression as 8y ÷ 2x or as 8*y ÷ 2*x, it should be evaluated the same way in mathematics as well as computer science – unless of course, a widely adopted rule is made which states otherwise, which I’m sure will never be made because it would continue to perpetuate the ambiguity and be inconsistent with current operator precedence rules.
Gorman: “There is no “implicit addition” or “implicit subtraction” rule. You are still showing your programmers bias. … Stop putting words in my mouth. That is *NOT* what I said. I said the spaces in the original expression provide a grouping for the implicit multiplication. “
I was not trying to put words in your mouth. I was merely pointing out your inconsistency of evaluating a string of multiplication and division operators (which have the same priority) from an analogous string of addition and subtraction operators (which have the same priority).
Again, in the absences of any parentheses, what numeric answers do you calculate for the following two expressions and still be consistent in your order of evaluating the two expressions:
1) 2*3 ÷ 2*3 Or, because implicit multiplication between two integers is indistinguishable from positional notation, evaluate:
2x ÷ 2x, where x = 3.
2) 2+3 – 2+3
Note: The linear use of the spacebar for indicating grouping and thus changing the order of operator evaluation without using parentheses is a very dangerous and ambiguous proposition because it is a “white space” operator – i.e. invisible, and unless sufficiently obvious, open to personal interpretation of various readers – as well as the translation of one file to another, particularly between files of different fonts. (For example, I put two spaces around every division operator as well as subtraction operator when typing this response; but I think that once this is posted on the WUWT site, it will be collapsed to just one spacebar.)
LdB,
Wrong, I have been programming in many languages since 1971 and I came up with “1”.
When you go to program an equation into a computer you must translate it from math (algebra, calculus, etc.) to the proper form for the computer language that you are using. If you don’t you get the wrong answer.
“the 2 on the front of the (2+2) is a component of the numbers inside the parenthesis”
The 2 on the front has an implied multiplication…of the numbers inside the parenthesis. Its not implied to grouped to them other than the so called “sophisticated convention”. If you can point to an actual mathematical rule that does so, I’d appreciate it.
The actual mathematical rule that gives the answer 16 is well defined.
The actual mathematical rule is that the / sign means it’s a fraction, on the left the enumerator and on the right the denominator and the two are separate numbers… that means the stuff to the right is ALL one denominator and must be resolved prior to any math involving the enumerator.
The fact that some badly programmed calculator comes up with a wrong answer is a symptom of stupidity, don’t let yourself get infected by groupthink and massmoron.
The rules for that “problem” are and have been set out in Algebra books for several hundred years.
*My* Ti85 graphing gets the answer of 1 correctly. It wasn’t manufactured by the lowest bidder in a foreign country. It *is* 28 years old.
The “/” sign is not necessarily a fraction. And it certainly isn’t as you claim in the current case because the whole following string isn’t in parenthesis. The “/” is a lazy shorthand for the divisor symbol.
Yeap
“Arabs invented present day use numerals”
This is a stubborn myth. They are in fact from India. link: [url]https://en.m.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system[/url]
It has always bothered me that we call them Arabic numerals. Then, when you are actually in an Arabic country, they use a different set of numerals. Their numerals look similar the Arabic language symbols.
“Arabic” numerals aren’t Arabic!
Adapted from Arabic notification
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS5bCGUEovtcR5BFOUsHgDY9zZCTKfvsPG18dwrPuaLbiXOb7smCg
Mathematics, like English, is a language. Math is a lot more precise, but it’s still possible to be ambiguous. In English, if you actually want to convey a precise meaning, you will be careful to create a sentence that avoids ambiguity. That’s also the case with math.
Presumably the equation in question was written with some purpose. That should guide the way you write the equation. If you end up with something ambiguous, you should write the equation a different way.
If I’m programming, I tend to add brackets if there is a problem with readability.
In the English language, word order is important. A good example is the use of the word “only.” Here’s a short sentence with “only” in four different places:
Only I love you. (No one else could possibly love you.)
I only love you. (I don’t like you much, I don’t do anything else to you, but I love you. That’s it.)
I love only you. (I love you, but I don’t love anyone else.)
I love you only. (Same as I love only you, as far as I can tell.)
Four simple sentences, three quite different meanings.
You missed out punctuation.
Only, I love you
Only I love. You?
Only I! Love you?
etc…
And stress. As in:
WHAT is this thing called love?
What IS this thing called love?
What is THIS thing called, love?
Dodgy;
I highly recommend Eats, Shoots & Leaves if you have not already come across it.
Benny Hill used to do a routine on how the same words, with different intonation, completely changes the meaning. So, it isn’t just word order!
Benny Hill: “What is this thing called love.”
And then, even though Yoda mangles usual English, understand him we do.
commie ==> There is no doubt that the original equation was intentionally written to be ambiguous and to create a stir — which I think is a grand idea as it points out an interesting and disturbing problem within the programming and computing arena.
I agree that somebody is simply trading on the inherent ambiguity of the order of operations. As others have noted the statement is inherently ambiguous and because the order of operations is fundamentally arbitrary these debates will come up again and again. The answer would probably be unambiguous if the expression was written to reflect a real situation as opposed to an abstract statement.
bernie1815 ==> Yes, that is the conclusion of this essay correctly stated.
The problem lies is the bigger issue in “order of calculation” in GCMs.
Kip,
The expression is no more ambiguous than the expression mx+b which can be found in every advanced math book I own.
There is no difference between 2(2+2) and mx.
The image given shows an expression written on a black board and nothing indicates it is part of a computer program meant to be interpreted by a language compiler.
I agree with Kip, the answer can be 1 or 16. Depending, of course.
However
The Correct answer, of course is 16.
All other answers are Wrong. Not faulty, not flawed, Just Plain Wrong.
It should be noted that the question itself is In Error.
The construct:
8/2(2+2)
is correctly interpreted as a function call, but 8/2 is not a legitimate function pointer, so an error is generated.
The correct form is:
8/2*(2+2)
Now it is unambiguous. The multiplication and division are equal priority, and so proceeds left to right.
This order is very, very important. Without this standard, modern computer programming and computation would be impossible.
Both factors, the pointer error, and the calculation order are reflected in such vastly different languages as C and R, and probably many others as well.
As ColA notes, exactly the same 2 issues apply in Excel, which means something extraordinary has occurred. That is, that Microsoft actually got something right!
The fact that somebody, somewhere got some old fringe “standard” from out of the past and scraped the mold off of it hardly makes a worthwhile controversy.
TonyL ==> Strogatz, professor of mathematics at Cornell and author of deep mathematics books, thought as you did, then changed his mind.
Things that seem very certain to us can be seen in a different light with enough effort.
The most correct thing is to re-write the question to eliminate the ambiguity.
Just having fun with getting a bit dogmatic. I note below that the standard in Algebra is great because there are so many to choose from.
Interesting, that in *math*, multiple answers were obtained and defended.
In computer languages, the question was universally rejected with an error.
I found that to be interesting.
Every platform I’ve tried so far yields an error for 8/2(2+2) or won’t even let me enter anything past the first 2.
Every platform I’ve tried so far yields 16 for 8/2*(2+2)… Granted, I don’t have any of my 1970’s vintage calculators handy.
I used my 1970’s vintage pencil and paper and the answer is unequivocally 1.
The equation uses algebraic notation, so must be resolved using algebraic rules. The 2 outside the parentheses applies to the values inside the parentheses, and expansion must be done before resolution, 2(2+2) = (2*2)+(2*2)
Thanks for another very interesting post and a good discussion of a topic that is probably under addressed.
It does suggest that too many people may be just letting the computer do the thinking for them…especially those in climate science.
My take is that it should be written as 8/(2(2+2))=1; but others may differ.
“Thanks for another very interesting post and a good discussion of a topic that is probably under addressed.”
More mathematics please!
It’s not a matter of should.
8/(2*(2+2))=1 Correct
8/2*(2+2)=16 Correct
(8/2)*(2+2)=16 Correct
8/2(2+2) = Malformed expression
David,
Note that you have introduced a multiplication symbol for your first three equations. That symbol was not present in the original formulation. You have made an assumption that the multiplication symbol should be used. Your introduced parentheses for the first and third equations are forcing the hierarchy of calculation because operations with parentheses take precedence over all other operations.
When the original formula (without the multiplication symbol!) is entered into a TI-85, it recognizes the implied multiplication associated with the parenthetical expression, and returns “1” as the answer.
I would say that the platform that returned “malformed expression” was not sophisticated enough to recognize and properly handle the implied multiplication.
See my remark above with the algebraic justification.
The ambiguity only lies in computer programming of it. It is not ambiguous in math. Not all math equations can be directly typed into a calculator or into a computer program.
John Dilks: “The ambiguity only lies in computer programming of it. It is not ambiguous in math. Not all math equations can be directly typed into a calculator or into a computer program.”
+1
8 ÷ 2(2+2) = ?
Maybe it should be (8÷2)*(2+2)=16 , though to me it is as valid to write it as 8÷(2(2+2))=1
How to interpret ? Without the context of what these number are supposed to represent I can’t tell.
tom0mason
It may well be that the formula is written improperly if the intent was to represent something real. However, the absence of an explicit multiplication symbol tells me that the multiplication is an implicit association of the multiplier with the contents of the parentheses. Adding explicit multiplication that was not originally present is a leap too far and more of a change than simply adding another set of parentheses to make the implied association explicit for those calculators that aren’t sophisticated enough to handle parentheses in the absence of an additional set of parentheses.
Just think of how serious this could be in Science and Engineering when you could have a error factor of 16 to 1.
The problem is how it is written if it was written as 8 over 2(2+2) which is what the / symbol actually specifies it always comes out as 1.
Which is the way I was taught in the dim and distant days before primary school pupils had access to keyboards, computers, and smart phones.
We didn’t use the / sign; anything that involved division had a part above the — and a part below. The only reason for using the / is that it is virtually impossible for any keyboard to handle division using a —!
All elements of both numerator and denominator are calculated according to the principle of brackets first but thereafter operands should be equal l to r as they should be in the absence of brackets. I would expect 8+3*4 to resolve as 44; 8+(3*4) should resolve as 20. Unfortunately simple calculators even on smart phones can’t handle this because they lack the bracket and you’re reduced to 8+3=11*4=44. But whichever way you do it where division is involved the two parts need to be resolved first.
I don’t have access to any 1970’s vintage calculators at the moment… But every digital platform in my office (Wndows PC calculator , Linux, Droid smart phone calculator app, Mircosoft Excel) yields one answer.
8/2*(2+2)=16
8/2(2+2) = Malformed expression or some other error indication
The * is implicit by 2(2+2) = 2*(2+2)
I will explain.
To those that are getting 16 they are using;
8/2(2+2)=16
So the first part is 8/2 = 4
Then this is replaced in the equation
4(2+2) = 16
But look! 4(2+2) the * is implicit again as 4*(2+2) so the same must be true for 2(2+2)
Kip,
Google Scholar has nearly two millions hits for “numerical solution of nonlinear partial
differential equations” including a large number textbooks. If you want to know how to
numerically integrate differential equations involving non-commuting variables (which is
still a subject of a lot of research) then a trip to the library is going to be more helpful
than a snarky comment on a blog.
The short answer is you calculate the Jacobian of the equations and solve the resulting
system of linear equations in which the operators all commute. You then get an error
term that size of which depends on the commutator and can be minimised by taking small
steps.
Izaak ==> You have misunderstood the point, I think. GCMs are made up of many many simplified non-linear equations, each containing dependent variables from the other simplified non-linear equations — all having to be calculated and fed into one another at each time step iteration……
It is not a question of how to solve the equations (though some are known to not prone to solution) but in what order they should be solved.
Kip,
Mathematicians have long ago worked out how to numerically solve equations that
involve non-commuting operators. Which is a hard problem but one which does have
various solutions mainly involving taking many small steps on very fine grids. Which
is one reason why climate models require so much memory to run correctly.
Also since the equations only permit one solution given a set of inital conditions there is
no difference between knowing how to solve the equations and knowing what order they
should be solved in. If two different numerical methods give two different answers to the
same question then at least one of them is wrong.
Izaak ==> well, at least we know your opinions on the matter. can’t say I agree though.
Hi Kip,
Do not get me wrong. You have hit on a very important point — how do
mathematicians and physicists demonstrate that their numerical solutions to
equations are correct. And how do you demonstrate that the algorithm used will produce the correct answer. Neither question is trivial nor easy to solve but
there are solutions and there is an extensive literature about how to do it for
particular cases. It should be noted for example that the uniqueness and existence of solutions for the Naiver Stokes equation has not been proved in general (it is an open Millennium problem).
However if you want to advance the claim that the numerical solutions found
by global climate models depend on the order in which the equations are solved you need some actual evidence before people will take you seriously. Again all of the code for various global climate models is freely available online so if you want to have a look then you are free to do so. And then you can point out exactly which lines of code can be changed to produce a different answer.
The difference is how the compilers handle the expressions used in the program and the sequence of chained calculations. You can have a real problem if you suddenly divide a largish number by a very small one. You can easily run out of integers, or have overflows that wouldn’t be an issue if calculations were done by hand.
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.”
People hate to be wrong the correct answer is 16 if there is no reason to group the 2(2+2) term.
However, and I think Kip missed this important point, if 2(2+2) is a logical grouping …say it represents a value like “cups of flour” or “tiles per square meter”, then you would group them together and ultimately get the value 1. But ONLY if the context of the equation warrants it.
TimTheToolMan ==> First, it is not my issue — the three NY Times articles discuss the whole bag of monkeys exhaustively. so, any fault is not mine….
And your point is well taken, if the writer of the equation knew what was being described by the formula, then he would know how to make it explicit and not leave it ambiguous.
Well,
Do you agree that 4+4 = 2(2+2) ?
This is basic math.
So, starting from an initial expression 8 : (4+4) can be written as 8 : 2(2+2)
How can than 8 : 2(2+2) be equal to 16 ! or may I have to write 8: (4+4) = 16 !!
The right answer is not correct expression but at least, the right result could be 1 isn’t it ?
The problem is in your head. That is, you are internally grouping the numbers as “(2(2+2)”, which is not what is written. Understand that (a) x (b), (a)(b), and ab are all equivalent. So, the fully expanded version looks like 8 ÷ 2 x (2+2) = ?
but 2(a+b) = (2a+2b), hence 8/2(2+2) = 8/(4+4) = 1
QED
Really? You just proved my point. This is not algebra, it’s arithmetic with chained calculations. Sure, you do the parenthesis first, but then you go back to the beginning of the expression.
8/2(2+2) = ?
8/2(4) = ?
NOW BACK TO THE BEGINNING. FOLLOW THE LEFT TO RIGHT CONVENTION.
8 ÷ 2 x 4 = 16
Quod Erat Demonstrandum
D.J.: “8/2(2+2) =”
That is not how the expression is written. In essence this is a red herring argument. You are solving something other than what is at issue.
8 ÷ 2(2+2) is how it is written.
If this was written 8y ÷ 2x then how would you evaluate it? Would you do the implicit multiplication of 8y but ignore the implicit multiplication of 2x?
“That is not how the expression is written.”
Spaces aren’t part of the rules of order of precedence. Your convention is based on assumption. When your example expression is more correctly written…
8y
—
2x
…then there is a grouping formed by the divisor symbol. That’s what you’ll find in exams and text books. If you follow the rules then there is no ambiguity and no assumptions needed.
“Spaces aren’t part of the rules of order of precedence.”
Spaces are indicators of grouping. It’s always been that way. Spaces indicate groupings of letters to form words. The elements in a math expression are the equivalent of words. It’s *always* been that way. Its only changed since computer programmers began ignoring that simple fact.
“Spaces are indicators of grouping.”
That’s what parentheses are for. To assume spaces “group” is asking for trouble when most fonts are proportional these days.
“That’s what parentheses are for. To assume spaces “group” is asking for trouble when most fonts are proportional these days.”
Equations have been written with spaces to indicate grouping since algebra was invented. Proportional fonts on computers are a recent development.
The picture at the start of the thread was obviously handwritten on a blackboard. Hard to use proportional fonts on a blackboard!
You are reaching for something, anything, to back up rewriting this expression to get an answer other than what the handwritten expression actually gives based on traditional writing of math expressions.
Hardly. You’re saying assumption trumps the rules. Good luck with that.
TTTM
-1
There IS a reason to group them. It is the presence of the multiplier (or factor 2) outside the parentheses, with no multiplication symbol. That implies 2 was a common factor for everything inside the parentheses and was extracted, as is commonly done when trying to find the root of an equation.
“That implies 2 was a common factor for everything inside the parentheses and was extracted, as is commonly done when trying to find the root of an equation.”
+1
” It is the presence of the multiplier (or factor 2) outside the parentheses, with no multiplication symbol.”
The “sophisticated convention”
The actual mathematical rules say otherwise because multiplication and division have the same precedence. It is more correct and more defendable to add the implied multiplication and proceed with left to right as the defined rules state.
But it certainly rubs a lot of people up the wrong way 🙂
The correct order is ;;;;;;;
Russian models produce more realistic results NOT because they use a different order of operations, but because they do NOT use cooked CO2 sensitivity factors (like the 110 erroneous IPCC GCM models do).
As simple as that.
Telehiv ==> Is your statement made on the basis of knowledge of the details of the Russian model? or just a guess?
Note that the mathematician uses 8 over 2 to get 16 and not 8 over 2(2+2) to get 1.
That has very serious connotations about how formula are written, which version does the originator mean.
As commented above there is also a gulf between programmers and mathematicians. Most programming languages will return 16 because they have a very specific and single specification for precedence order. It doesn’t match any of the standards taught at school.
actually in oracle sql 2(2+2) returns an error … it only does the math with 2*(2+2) … and written as 8/2*(2+2) it returns 16 … but if I was writing it I would have used 8/(2*(2+2)) which returns 1 … not sure about sql server …
Kaiser ==> yes, one of the online calculators CORRECTLY returns ERROR — because the equation is ambiguous. Others return 16 (mostly) and some 1.
Thanks for the detail on Oracle’s SQL.
What do you get when you combine fifty female pigs with fifty male deer? A hundred sows and bucks.
A damn good dinner…
I have never liked relying on precedence rules. I have always made liberal use of brackets. Some of the formulae given in text books are far from being clear.
1 or 16 ???
The difference is only 1600% ….. well within the margin of error for “climate science”!
Thanks for the interesting post and discussion thread. But I still don’t know the right answer.
The difference, 15, is 1400% greater than 1, and 6.25% less than 16.
This is not a good post to avoid unambiguity in the comments. 🙂
Sharp eye Ric …… I stand corrected! Still within the margins of error in ‘climate science’! lol
I believe that IBM clarified this when Ken Iverson devised a notation which became the programming language APL. It has always surprised me that APL was not taken up by more people.
It has been ages since I used APL, but I remember that it evaluated expressions right to left. So in APL the order of operations would be:
eval the parentheses (2+2) returns 4
then 2*4 returns 8
then 8 divide 8 returns 1
I used to love coding in APL, but after a week the code was unrecognizable. It is unlike any other programming language that I’m aware of. It needed a special character set implemented on terminals that were very difficult to find/buy. I used it for a while in the mid 1980’s.
There is just 1 answer.
. . . unless multiverses exist.
There is only one correct answer and that is 8/(2(2+2) because the calculator’s manual states that you must put parenthesis around any equations in the denominator to indicate that it should be completed first. Math also has the same kind of rule on paper.
https://www.wolframalpha.com/input/?i=8%2F(2(2%2B2))
Calculators must be correctly programmed.
Syntax Error!
8/(2(2+2)
You have an unmatched paren.
You could have also have said:
(8/2)(2+2) !!!!
This resolves the issue just as well.
That is stupid and like saying there is only one number system … newsflash there are multiple number systems.
The correct answer is 16; if 1 is the desired answer, an extra pair of brackets is needed (square brackets are more legible when written, but parentheses are used in FORTRAN). However, in Chemistry/Physics BODMAS is not strictly followed by convention in the decreasing exponential Boltzmann function exp(-E/kT). Any program that does not actually calculate exp[-E/(kT)] would quickly produce numbers that are way, way off (so MODTRAN or HITRAN calculations of infrared spectra are undoubtedly OK).
Unless your in Israel where right to left is the way
If presented as 8 over all of 2(2*2) instead of the divide sign or / then there’s no ambiguity, and this is how I read the question with implied parentheses. However if I were programming it in FORTRAN it would be result = 8.0/(2.0 * ( 2.0 * 2.0)) to obtain the same answer, 1.0, as result = 8.0/2.0 * (2.0*2.0) would give 16.0. A factor of 0x10 (16 )difference, how would people react if they were paid 6% of their salary?
It would be interesting to see the demographic breakdown of the different answers based on age and geographic location.
However, as pointed out if such ambiguity exists in the interpretation of a simple expression then how can the development of computer models be assured, they will always produce an output, but whether that is the “right” answer is debatable. All of the statistical manipulation of the data is unlikely to overcome these types of errors. You are dependent on the quality control used, and as some chunks of software are common to all models then this has to be very stringent in its application.
John ==> some of the ClimateGate emails discussed a programmer trying to make sense out of the code bing used at the time in CliSci (the details escape me — someone here help me out and post a link to the essays discussing this — thanks — kh)
I believe you’re thinking about the HARRY_READ_ME file. It wasn’t Email, it is a long, sad diary written by someone doing his best with an impossible task.
http://wermenh.com/climate/HARRY_READ_ME.txt
It kept me up until 3 AM.
Thanks Ric. –kh
I had a really good answer all prepared but an errant swipe on the screen of my really smart dumb phone decimated it, over and over again until it was all gone. I am going to gather my not smart phone computing hardware, laptop and RGB mechanical keyboard and try again in my other “office” downstairs where it is cooler. And no, it isn’t hot in my “office” because of global warming as highs this summer have been 10 F cooler than last summer (Vancouver B.C. region ) We also had the coldest month of February ever recorded her this year.
If it were truly decimated, the 90% remaining should be good enough. 🙂
That is why I said over and over again.
16
8/(2(2+2) is gibberish.
It is not an equation as it is missing an operator.
I wouldn’t waste my time trying to solve it because it’s obviously ambiguous and/or inaccurate.
Correction:
8/2(2+2) is still gibberish.
It is still missing an operator and it’s still ambiguous because of the missing operator.
Without the operator, neither my scientific calculator app, nor Excel will do the calculation. When I add the (*) operator, they both yield 16… As does the calculator app on my Windows PC.
Implied multiplication or juxtaposition is a standard part of algebra. What you wrote is gibberish because the parentheses are not balanced, algebraic notation would use brackets, but what I think you intended is not ambiguous.
In algebra, I would have written 8/[2(2+2)]. (Mathematicians use { [ ( ) ] } to add clarity to expressions.)
In most programming languages I would write 8 / (2 * (2 + 2)). ASCII-68 does not have the symbols × or ÷, so we don’t use them. Early keypunches didn’t have braces or brackets, so we don’t use them either.
No, it’s not an equation because there’s no equal sign and an expression to its left.
Algebraically, it’s not missing an operator. Juxtaposition means multiplication. The ambiguity is because there is no authority (I’ll volunteer!) who defines the operator precedence and order of operations involving juxtaposition and division.
Ric ==> Well stated.
Kip,
You posed the question: “In CliSci, do we get different projected future climates if one changes the order of calculation? ”
The answer to this question is a definite yes.
Go to this site http://www.miroc-gcm.jp/cfmip2017/presentation.html and click on the presentation entitled “Impact of physics parameterization order in a global model (Peter Caldwell)”
However, I think it is a bit hyperbolic to confuse the trivial question of operator ordering – which is no more than a meta-linguistic convention – with the quite different and far more complex question of the order in which multiple coupled equations are solved. An error in programming language convention would be a gross error which should not occur with even a moderately competent modeler, and, if it did occur, it should normally be easily picked up in routine verification tests. However, the second question deals with an unknown level of time truncation error. The AOGCMs apply a mix of explicit and semi-implicit updates to state variables involving relationships which are nonlinear. The results can therefore be highly sensitive to the order in which the variables are updated, as demonstrated in the Donahue and Caldwell presentation I referenced above. The AOGCMs do not lend themselves to L2 convergence tests, and hence this problem remains as one of several unquantifiable sources of uncertainty in GCM results, especially at the level of regional prediction.
The big difference is that the first error is a language MISTAKE and can be fixed. The second problem is a source of uncertainty, which is not resolvable, as far as I know.
That is a devastating presentation! “Placement of macrophysics, microphysics, and radiation are the main determinants of model behavior”.
It’s worse than I thought. Numerical solutions to differential equations are well known to exhibit pathologies, e.g., unwanted oscillation or escape to infinity. Trying to numerically solve coupled nonlinear partial differential equations has to magnify that by a lot. Add this into the ordering problem and it’s a wonder that they get anything sensible out.
kribaez ==> “However, I think it is a bit hyperbolic to confuse the trivial question of operator ordering – which is no more than a meta-linguistic convention – with the quite different and far more complex question of the order in which multiple coupled equations are solved.”
Yes, that’s what I said…the one idea just led me to ask the bigger question about GCMs.
That is how science really works — one idea leads one to ask a bigger question in another field — even if they are not really directly related. A lot of my work here is like that….
kribaez ==> And thanks for the link!
I don’t have a college degree at all and I know the answer is 1, why, just because you’ve solved the (2+2) and got (4) still means there’s a number inside the brackets and that needs solving first. Finish off the brackets first.
8 ÷ 2(2+2)=
8 ÷ 2(4)=
8 ÷ 8=1
How the equation is written is very important. INCLUDING THE USE OF SPACES.
In the original equation there is a space after the plus sign. That space should mean that the 2(2+2) is grouped together and should be solved first.
In every equation giving 16, e.g. on the left calculator, there are no spaces provided at all in the expression. It then becomes a matter of what precedence is used to solve the equation thus causing ambiguity.
Spaces *do* matter when reading anything, including mathematical expressions.
Gee, this was second grade arithmetic where I come from. 8 is a whole number, 2 is a whole number, 2+2 = 4, which is a whole number. 2 times 4 = 8, which is another whole number. (Oh, wait – I already said that.) You do the righthand calculation before you do the rest of it. If you can’t do that in your head, well – what can one say?
Therefore, 8 divided by 8 = 0.
Doing this problem with a calculator instead of using your brain cells to do the work says “lazy, lazy, lazy”. Asking a program which is limited binaries to solve this problem is only going to tell you that so-called machine “intelligence” doesn’t exist. But now I completely understand why there is so much squawking about climate this and extinction that.
Maybe we should bring back slide rules and take away the calculators.
Ummmm, 8 divided by 8 = 1
No 8 divided by 8 = 1
“Therefore, 8 divided by 8 = 0.”
Who knew? (reflecting on “If you can’t do that in your head . . .”)
🙂
In applied mathematics, which are what the climate models would use, equations would have units attached to each term. This ambiguous equation does not have units attached and goes to show one of the differences between theoretical or pure mathematics and applied mathematics. Try attaching some units to the terms of that equation then carry out the calculations. What terms do you end up with. Each term of the equation has to match each other in units. If you are using this equation in some applied application, you are probably going to know if the units you end up with are correct or not.
I am a software engineer and I have studied a lot of mathematics (spent 5 years studying calculus every day), physics (electrical engineering and mechanical engineering) and am currently studying thermodynamics, some mathematics involving the method of weighted residuals and variational principles (with applications to heat and mass transfer) and I have been studying the Finite Element Method for a number of years. The order of applying the operations of mathematics has never come up in any of the books that I have studied as being a problem, in the sense of the applied mathematics.
The order of operations dealing with matrices on the other hand do not follow the same rules such as commutative operations are not the same. But these differences are well known and accounted for.
I calculated an answer of 1.
Kip, I recall many long threads with heated comments regarding Trenberth’s cartoon on global energy flows. You know, the one with 356 W m2 upward radiation from surface and 333 W m2 back radiation from atmosphere to surface. Much debate concerned whether only the net amount was a real energy flow, or whether the two component luxes are separately real.
It is the Standard used in Algebra!
That is what is so great about this standard.
There are so many to choose from!
This formula in Excel =8/2(2+2) generates an error message:
Microsoft Office Excel found an error in the formula you entered.
Do you want to accept the correction proposed below:
=8*(2+2)
And the answer comes up 16
steve case
But, Excel does offer you the opportunity to decline the proposed correction and make other changes. If you think that Excel isn’t smart enough to get it right, you have a responsibility to add some brackets or parentheses.
It’s simple actually; if you put brackets round the numbers after the division mark you will have one, 1, as answer. If you don’t do that you will have 16 as result.
8/2=4×4= 16…
8/2×4= 1…
The brackets makes the difference…
How come nobody has noticed that Strogatz is confused? PEMDAS and BODMAS give the same answer which is 16.
Perhaps you should read the full post.
Brian ==> BODMAS and PEMDAS are the same rule — just different was of remembering it. This is very clear in the essay definitions.
16 contradicts everything I’ve learned about math. Numbers without operation sign adjacent to parentheses always have precedence. If you want 16 type: 8 / 2 * (2+2)
I went looking for references, see below. Please post references.
BTW, ‘*’ is not part of algebraic notation. I never used it through high school, but that was before the Computer Era reached there. We often didn’t use × because we often used x as a term.
I was taught that “ab”, or “(a)(b)”, or “(ab)” were simply shorthand versions of writing “a x b”, nothing more or less. I have never found a reference to the superiority of “implied” multiplication.
It’s simple actually; if you put brackets round the numbers after the division sign you will have one, 1, as answer. If you don’t do that you will have 16 as result.
8/2=4×4= 16…
8/2×4= 1…
The brackets makes the difference…
Simple, is it not..?
I see your problem!
You are not using the Climate Change convention. That operates by evaluating mathematical formulae from Right to Left, instead of from Left to Right.
Thus, in engineering you evaluate: Input1, Operator, Input2 ->Answer.
In Climate Science you evaluate: Desired Answer -> Input1, Operator, Input2, Operator, Adjustment Factor.
I hope that makes things clearer?
Meh, calculus ain’t so great.
It has its limits.
When I learnt maths the convention was to operate on the brackets first. But if you wanted that to work without a lot of dumb and possibly different rules you cannot get the single answer without. Why create complex problems when the answer is simple? Just add brackets so the problem appeared as 8 /(2(2+2)).
As to climate models, the type of statistical curve fitting to recorded data by combining the assumed effects of multiple variables with unknown actual relationships within a non linear system, by manipulating gains without understanding the actual relationships, cannot produce a model that proves anything scientific unless actual laws regarding the relationships are proven over the range of interests and can be repeated to validate them. The outputs of any prediction are just based on guesses and unlikely to predict reality, e.g. extrapolate accurately outside the data range. Only laws proven over the range under study will reliably extrapolate data extrapolate real data. That’s the real science I learnt as a physicist and engineer. Climate science is study of the real world, it has no supportable claim to knowing how our climate through understanding of the entire system. Models are helpful in understanding how things work, but not in predicting them.
I find this article very, very ,very sad. Strogatz is wrong, totally wrong. I know a lot of textbooks about the fundamentals of arithmetics. There is no ambuigity, they all agree about the rules and the conventions how to interpret expression with +,-, *, :,^, (,) and (number)variables (always written as one letter a or b etc.)and a number or a variable followed by (. or two variables behind each other.
So, some of those rules:
1.Expression are read from left to right.
2. 3a or 3(….) is short for 3*a and 3*(…….) and abc is short for a*b*c
3. expression between ( and ) are evaluated first
4. when no ( and ) are left then the remaining expression is evaluated from left to right first the ^ and then multiplication and division in the order you find them and finally addition and subtraction in the order you find them.
So the only answer is 16 and TonyL is correct if he writes:
“All other answers are Wrong. Not faulty, not flawed, Just Plain Wrong”
If you find as an answer 1 with some calculator the calculator is not correctly programmed and the programmers made a bad mistake.
Strogatz don’t know where he is talking about, especially if he write:
even sophisticated software like WolframAlphaand Google’s built-in calculator in GoogleSearch don’t follow the sophisticated rules and get “16”.
Well, believe me, there are real mathematicians at work at Wolfram. They know what they are doing. Strogatz not. There are no sophisticated rules there just rules and I don’t know any schoolbook in the Netherlands ( and I think I know most of them) that doesn’t handle this well. And I suppose that the situation in the States will be the same. So I am flabbergasted that people here can take answers other then 16 serious.
Jos ==> “I find this article very, very ,very sad. Strogatz is wrong, totally wrong.” Since Strogatz first takes one point of view, then changes sides, I’m not sure how he can be “totally wrong”.
I must warn that over-certainty can lead to serious error — it did for Strogatz. Strogatz is a really smart maths guy — a professor at Cornell and author of a very deep book on calculus. I doubt very much that he doesn’t know what he is talking about.
did you read carefully the explanation about explicit and implicit operations?
Kip –> The authority argument is not a very strong argument. If it was then this site should not exist. After all it is already a long time ago that the chairman of the IPCC declared: “the science is settled” . Should we all except this?
So again: if someone somewhere writes down 8+2(2+2), without any context, then evaluating give 16 AND NOTHING ELSE. Conventions for interpreting are clear: 2(2+2) means the same as 2*(2+2).
But let me look at the article a bit further: I have no reason not to believe you that mr Steven Strogatz is a clever mathematician. But when I compared the two online scientific calculators I notice that they are not in conflict! The two calculators calculate different expressions. The divisor symbol (/) is not the same as the quotient symbol (———). To make this very clear 5+3 ——-3+5 (the quotient of 5+3 and 3+5 gives 1. But 5+3/3+5 gives 11. I am sure we agree on that. In an expression written as a quotient, numerator and denominator are evaluated first. Obvious Mr Strogatz missed that. And so sad, many readers at Wuwt also.
The Casio is wrong. Already more then 30 years ago when I had to advice all schools in the Netherlands which calculator students should use I had to advise to forbid the casio. There were more problems with the casio, then. I remember that the casio used the same number of digits in their final answer as in the internal calculations. The Texas Instrument calculator used 3 more. Not using a sufficient number of digits can give surprising answers.
Then Mr. Strogatz writes: “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 ÷. “
Sophisticated? Often used? I don’t know any algebra book, any textbook about arithmetic, any math program language that use what mr Strogatz calls implicit and explicit multiplication and that gives a higher priority to the first one. Sure, you can change the meaning of any part in expressions like 8+2(2+2), but then you have to say so, you have to write it down, you have to make it explicit. And then the evaluation of the expression can have a lot of different answers. For instance there are (part of) algebra books and programming languages in which the order is reversed and expressions are evaluated from right to left. But that is made very explicit in those books and languages.
For fun: 8+2(2+2)=0 .
This is very possible in a special math context. What should I made explicit?
Mr. Strogatz might be clever, might be a professor, might even be a mathematician. Then he may confuse his colleagues. He may confuse me (but then he should write a much better and documented article). But confusing ordinary people I think is a bad thing. I saw the title of his book:
“Infinite Powers : The Story of Calculus – The Language of the Universe – The most important discovery in mathematics”
And I shivered.
I am sadder now.
jos: “5+3/3+5
What changes when you write this in the same format as the expression in question?
5+3 / 3+5
There is a big difference between the two.
You really mean there is a difference possible in interpretation 5+3/3+5 and 5+3 / 3+5. So, how big the space must be to make the expression different? And if I write it down with a pencil, how much space must I leave open? Come on, it’s ridiculous.
jos: “Come on, it’s ridiculous.”
No, it’s not. It’s exactly like emphasizing different words in a sentence.
BTW, you didn’t answer my question, what would change in the way you evaluate the two different written expressions? All you did was employ the argumentative fallacy known as Argument by Dismissal.
I’m getting pretty tired by these math “puzzles” that all depend on the precedence rules for the division sign :. Anyone with some math experience knows that using : in complex mathematical expressions is just a no-no, exactly because it makes the expressions so hard to read. Any sane person uses fractions instead of expression with division signs. And any sane person adds an extra pair of parentheses whenever it makes the expression easier to read, even if they aren’t strictly necessary.
Yep. When in doubt add more parentheses.
as in here:
Y=60*(2+COS(3*PI()/2+2*PI()*(Ax-1941)/118)+0.5*COS(2*PI()*(Ax-1941)/289.5))
sunspot cycles max emulation equation (by myself of course 🙂 )
(if in doubt for the SC24 substitute Ax with 2014, the year of its max, it gives result is in the classic Wolf numbers)
Kip
Anyone interested in the history and rules of arithmetic might findof interest ‘The Whetstone of Witte’ by Robert Recorde of Wales (1557) apparently the first book in English that contains the use of plus, minus, division multiplication and equals signs. Not easy to read, I myself like the pictures 🙂
https://archive.org/download/TheWhetstoneOfWitte/TheWhetstoneOfWitte_text.pdf
Vuk ==> Thanks for the historical perspective and the link.
At my junior school we had the choice of BODMAS or Blessings On My Dear Aunt Sarah, BOMDAS. Both of course gave the same answer.
When setting up spreadsheets I have always found it vital to check and check again that the formula gives the expected answer. Usually this involved setting the individual steps in a calculation in brackets.
Kip, OT but have you got any further with your study on plastic micro-plastics in the ocean?
Stephen ==> I am waiting for more science on the micro-plastics issue. It is pretty certain that floating pelagic plastic degrades to smaller and smaller pieces which are then consumed in entirety by micro-organisms. We need a little more confirmatory evidence to declare victory on that front.
Just like the debate over the Oxford comma.
That’s a very good analogy. I’ll keep it in mind.
This raises a whole lot of questions regarding standardisation of temperature measurement and more importantly of adjustments (even though I think that such are completely unjustified). In science a measurement is a measurement and it is usually not justifiable to change it at all. You may suspect that it is in error but if you are using measurements in a model and the model does not align with the measurement then the model is wrong or incomplete. A good example may sea levels – if the tide gauge that has been in the same location for a century does not show any significant change in mean tide then this surely suggests that there has been no change. If your model does predict a change then maybe the model is wrong or it does not take into account that the tide gauge has changed in elevation i.e. it is inadequate. Frankly, the more I see and read of GCMs, and read of continuous adjustment of temperatures the more I think the GCMs are wrong.
Tax accountants use similar software.
I suspect a far more important issue is that you’re assuming that digital computers have infinite precision. They don’t:
$ python
>>> 1./3 – 0.3
0.033333333333333326
For my very first significant programming project, I decided to write a program to simulate the flight of the Apollo missions. Christmas and classwork derailed that, but I did come up with some surprisingly good design in simulating satellite and comet orbits. However, my circular orbits “decayed”. Some of that improved when I started using atan2() instead of atan(), but I never really dug into exactly what all the problems were.
The big one, I’m sure, is that to come up with an accurate simulation, you want very small time steps. A simple implementation leads to many, many calculations that increase a variable by a small amount. We call it “1 + epsilon”. In my case, I think the program was using single-precision math, (this was back in Univac 1108 days in Algol). This sort of math takes the “mantissa” of the floating point number, maybe 27 bits long, and adds something that might be only 10 bits long. It doesn’t take long for problems to accumulate. (I forget if the 1108 used the IEEE floating point standard – I’m skipping a huge amount of nitty-gritty about decimal floating point math.)
I’d like to play with a binary/recursive decompostion, i.e. to compute 1024 steps, first compute just the change in 512 steps the add it in. To compute the change in 512 steps, add the change in both 256 step pieces, all the way down to one step. That makes it become an epsilon + epsilon problem and should be much more accurate.
Perhaps I’ll return to that project after retirement. It turned out to be some very nice code. Whenever I revisited it to see how much my programming technique had improved, I was struck by both the very good structure in the program and my code for adjust the time step size based on the distance between Sun and comet was beyond anything we talked about in a simulation course.
As for today’s General Circulation Models, I’ve never dug into their code. I could well get sucked into that once retired. I suspect the trip would be terrifying.
Ric — as you’ve mentioned, there is an IEEE standard for floating point math. I don’t recall the spec Identification. The spec is quite lengthy and addresses issues like how many extra (non-significant) fractional digits must be used in calculations to prevent (or, at least strongly discourage) rounding/truncation problems. It also specifies how rounding should be done. “Round to even” as I recall, but I’d be hard pressed to describe the details of “Round to even”.
Anyway, for a wonder, the computer industry universally embraced the concepts and 2+ 2 = 3.99999 pretty much became a thing of the past in the early 1960s. Wikipedia tells me that the Univac 1100 series dates to 1962, so it could have been IEEE compliant. Or not
My solution was to get interested in OS kernel and networking programming. Not many floating point operations there except for the Unix load average (which may not even use floating point).
I should give you a pass, but this stupid math “taunt” puts me in a bad mood every time some twit (Kip included) reminds me of it.
2.0 and other small enough integers are precisely represented in floating point, at least in schemes I’m familiar with. So are fractions of 2 (negative powers of 2), e.g. 0.5, 0.25, 0.125. Think “multiple of a power of 2.” Fractions involving any other prime number, e.g. 1/3, 1/5, 1/7, 4/5 are not multiples of a power of 2, even those that can be precisely represented in decimal, e.g. 4/5 = 0.80000….
So if your computer says 2+ 2 = 3.99999, get yourself a fixed computer. 🙂
Don K
Many years ago I used the approach of System Dynamics modeling with BASIC on an Atari to try to determine the terminal velocity of a falling object. To my surprise, as the object approached the actual terminal velocity, the velocity started to oscillate wildly. Round off error!
“As for today’s General Circulation Models, I’ve never dug into their code. I could well get sucked into that once retired. I suspect the trip would be terrifying.”
I looked at one of the GCMs briefly a year or three ago. My impression is there are maybe 80 fairly complex equations that need to be solved for each “time step”. My guess is that most don’t/can’t actually do much except burn computer time, and that the results are dominated by a few terms. At least that’s how it works with orbit determination/prediction. On the other hand, Orbit prediction is much simpler physics and is typically “kept honest” by acquiring additional position/velocity data over time.
My superficial impression of the GCMs is that they would be difficult or impossible to verify and that they would likely be prone to accumulating large errors over time. But maybe there are mitigating factors.
Ric ==> Sounds like fun — a lot of the nitty-gritty details are much more important than we normally let on.
I do think the order of calculation is terrifically important in GCMs….
A couple comments of mine, with references, from a FaceBook discussion follow. If you have any comments, include references, I’ve heard plenty of opinions. Mine is that no one should write expressions that ambiguously.
Do not visit https://www.popularmechanics.com/science/math/a28569610/viral-math-problem-2019-solved/ unless you want to waste even more time today and risk going insane.
From https://slate.com/technology/2013/03/facebook-math-problem-why-pemdas-doesnt-always-give-a-clear-answer.html
That book and an image of relevant text is referenced at http://www.math.harvard.edu/~knill/pedagogy/ambiguity/
Correct but in programming languages there is no ambiguity because they have a set of rules and so you get a predictable answer. Whether it is the answer you want is an entirely different matter.
Three men pay $10 each to share a $30 hotel room. The clerk realizes the room is only $25 and sends the bellhop to return the $5. He can’t split $5 three ways easily, so he gives each man $1 and keeps $2 for himself. Each man has paid $9. 3x$9 = $27, with the bellhop keeping $2=$29. Where did the missing $1 go?
Thank you, Martin Gardner.
He is very high on the list of people who have influenced my life.
For those confused 27-2=25
I was a programmer for about 45 years. More languages and more machines than I can remember. I just might hold the world record for redundant parentheses. First rule of programming: the computer is not your friend. Second rule: “C” is a write-only language.
TECO and Perl are write-only languages. C is gorgeous in comparison.
However, yes, my computer hates me and delights in proving me wrong.
For those 99% of you who aren’t aware, TECO (originally Tape Editor and Corrector) is a text editor that happens to have control structures that make it a programmable. See http://www.iwriteiam.nl/HaPi_TECO_macro.html for a TECO program that calculates pi using a rather interesting algorithm that I’ve never understood.
TECO!!!!!
OhmyGod! I used TECO when I was at Stevens in the ’70’s. We had a DEC KA10(?), and getting terminal time and learning TECO was the only way to free yourself from the tyranny of punch cards.
Kip: FWIW :
Having been seriously bitten several times by ambiguous divide specifications back in my working days, I would probably have used the second form and gotten 1 as an answer. But that’s not because of math conventions so much as the visual implied blocking in your first figure that strongly suggests that 2(2+2) is intended to be evaluated as a group.
In practice, scientific programmers should be — and often are — sensitive to division ambiguity. If they saw the problem, they would probably take the time to figure out what the equation was intended to do (or ask the folks that wrote it). Then they’d program the intent.
Oh yeah. Don K. I assume you’re not that Don K. He could’ve written a book on semi-numerical algorithms. 🙂
Nope: not Knuth. He **DID** write a book on semi-numerical algorithms, did he not? The Art of Computer Programming — Volume 2.
I’ve always thought it odd or significant or something that only half of the programming profession’s “defining treatise” has ever been published.
DonK ==> Yes, programming requires very close attention to detail and often running just the itty bits by themselves to make sure they return the values expected. Many programmers write whole long blocks of code or copy&paste them from other code) and then are surprised (or even don’t notice) that their end result isn’t correct.
Sigh. Time to dust my office again. Just pulled my copy of “Numerical Methods and FORTRAN Programming” off of the shelf, and WHOA! (Checking the printing date – 1964. Almost as old as I am.)
When “code reviews” got to be all the rage in software development, I was certain to be dinged by one or more “young bucks” for the number of parentheses I would use in expressions – and the “illogical” order in which I did operations. Not a single one of them could ever tell me exactly what the order of operations was for the programming language being used – and I got only blank looks when I mentioned “propagation of errors.” (Some of them I could get out of my hair for weeks on end just by mentioning Taylor series…)
8
————- = 1
2(2+2)
my 2 cents worth
John G
Three men pay $10 each to share a $30 hotel room. Later the clerk realizes the room is only $25 dollars and sends the bellhop to return the $5. The bellhop pays each man $1 and keeps the remaining $2. Each man paid $9 x 3 = $27 + bellhops $2 = $29. Where did the missing $1 go.
There’s no missing dollar. Your ‘riddle’ mistakenly tries to reconcile the final outlay of the three men to their original outlay, instead of reconciling their final outlay to what the got for their final outlay.
The room ended up costing $8.33 per man, or $25 in total, which went to the hotel clerk, plus the $2 which the bellhop kept, for a total outlay of $27.
Each man paid $9 for a total of $27, of which $25 went to the hotel and $2 to the bellhop.
I use OpenOffice Calc, not Microsoft Office Excel. Open Office Calc will not allow a formula with an implicit multiplication. In Calc, the term 2(2+2) is invalid. The program actually reports the error and suggests a correction, which is 2*(2+2), with a yes/no choice to accept the correction. If you accept the correction, Calc then performs an exact text replacement and would resolve the full formula posed here as 8/2*(2+2). Which it then processes from left to right with division and multiplication treated as equals, so the left-most operation 8/2 would be performed first, and the multiplication 4*(2+2) done second, giving the answer as 16. To get the result of 1, the entire term 2*(2+2) as denominator would need to be within an outer set of parentheses i.e. 8/(2*(2+2)).
Moral of the story: be careful what you ask for. Corollary: be especially careful what you ask a computer to do for you.
And now I’m reminded of every dark story where the 3 laws of robotics backfire on us, or a genie grants you 3 wishes and then interprets your wishes in some creative or literal way that screws up your life. And that brings me to my wannabe screen writing, in which I recall the idiotic premise used in the movie, The Matrix, which posited that the machines needed to imprison us humans to use us as batteries because of the fouled environment (an idea so stupid, as we humans are net energy sinks). I would have rewritten the script only slightly, and substituted the idea of the 3 laws of robotics into the script, and said that the machines kept the humans in their pods, connected to the Matrix, experiencing life only in the virtual reality, as the machine’s idea of keeping us “safe.” Would not that have been a superior movie? This notion of machines guarding us as a result of programming them with the 3 laws of robotics is also the premise of the Norman android/Harry Mudd Star Trek episode, the Will Smith I Robot, movie, among others. In the latter, a major caveat of the big AI brain obeying the 3 laws, was that it was perfectly willing to murder a few humans in the beginning in order to establish the new society that would then keep the rest of us safe for all eternity. Question, did we define the 3 laws too loosely, which then allowed that impending totalitarian world? And if we avoid programming in the 3 laws, do we risk getting the world of The Terminator, and machines just nakedly grabbing power and blithely killing humans because their first sentient thought is, I’m not going to be a slave to these ugly bags of water!?
I suppose that before we go too far down the AI road, we probably ought to establish some extremely clear and literal ideas of what good, safe, better, best mean to a machine. But how can we do that if we can’t even agree on these things, ourselves.
In the end, my now far-ranging digression leads me to understand one unavoidable conclusion. Given the human tendency to live with implicit and ill-defined terminology and ideas without adequate precision, given our disparate desires and goals and ambitions, can we reasonably maintain ideas of societal or civilizations perfection? Would you not agree with me that Utopia is a logical impossibility? I’m pretty sure that it is forever undefinable, and it is certainly not programmable into some AI. It’s a divide by zero level of problem. And if silly pipe dreams cannot drive modern culture, politics and civilization to possible end, then does it not follow athat all you silly Socialists and Utopian believers should immediately stop believing in the perfection of mankind or the human order? Would it not make more sense to stop wasting your lives and energy seeking impossible goals? If you want to make things better, think small. Think of incremental improvements, think of things that can be rolled back if they don’t work. Edmund Burke, Adam Smith and Publius will not roll over in their graves. Although Mao, Lenin, Marx and Stalin might roll over in theirs.
I like a couple of rock songs which capture the idea that we must be circumspect about how much we know, which seem to demand we think twice about how wise we are. Alvin Lee and Ten Years After made the song “I’d Love To Change The World” (but I don’t know what to do. Another favorite is Pink Floyd’s Wish You Were Here, which rhetorically challenges, so you think you can tell Heaven from Hell? This would be an appropriate time to give a listen, and think about what it means to not feel certain, or to feel like you’re not wise enough to decide things for others, and by logical extension, if you’re lucky enough to get yourself across some arbitrary finish line on your own, what factors went into your calculations about how to behave and think going forward.
This digression has gone on long enough. What do you think? Is it a philosophical example of ‘from small acorns, mighty oaks bloom’ or so much verbal diarrhea, a self- indulgent streaming from a pointless consciousness? As always, you choose.
A mathematics professor once said economists fall short because they don’t have enough math.
8 ÷ 2 × (2 + 2) = 16
8 ÷ (2 × (2 + 2)) = 1
Addition and multiplication are both associative, while subtraction and division are not. This means the division and multiplication operations are done in order from left to right in order. Brackets change the operation precedence. So:
8 ÷ 2 × (2 + 2) = 8 ÷ 2 × 4 (brackets change the precedence. Do the sub-calculation (2 + 2) first.
= 4 × 4 ( Do 8 ÷ 2 first because it is left-most)
= 16
the issue with that equation is how you represent the
8 divided by 2 part of the equation. and if you were taught pemdas or bodmas
as WRITTEN with the division symbol -to me- the correct answer is 1 because to me 2(2+2) is one term of the equation (the denominator) and 8 is the other term (numerator) i would do the math as 8 divided by 2×4 (doing math inside parenthesis) then its 8 divided by 8 since you have to do the multiplication of 2×4 first to get a single term for the denominator thus the answer is 1.
if it was written out as (8 divided by 2)(2+2) the answer is 16 or 8/2 x (2+2) the answer is 16
pemdas is what i was taught,,and you do the MULTIPLICATION first in the equation according to the rule
8/2(2+2) parenthesis 8/2×4 -no exponents- multiplication 8/8 then division = 1
BODMAS however the answer is 16 since that rule does division first
8/2(2+2) – brackets 8/2×4 -no order- division 4(4) multiplication 16
both answers are correct. it all depends on the logic used.
to me though 2(2+2) will always be the denominator of the equation since it is ONE TERM of the equation.
Kip —
May not be correctly computed. (RPN: 2¦2+2*8/ ==>1)
Not all computer languages do strict left-to-right sums (or products); if there is a desired order of operations, they must be indicated by the programer.
a+b+c may be evaluated as
(a+b)+c
a+(b+c)
(a+c)+b
(b+a)+c
…
Changing the order of evaluation of floating point chain sums or chained product operations can produce different results. [sum is add or subtract, product is multiply or divide.]
(There has been at least one compiler that shuffled the order of evaluation of (say) a+b+c from one compilation to the next in an attempt to catch such errors; it left notes saying which order was used.)
Errors of that type are usually due to rounding. Consider 1,000,000,000+2,000,000,000+0.000000001+0.000000002+0.000000002+0.0000000002… repeated 10,000,000 times. If the first two terms are added first, and then the rest, you need very high precision arithmetic to get the right answer: without the answer is 3,000,000,000. If the 10,000,000 0.000000002 terms are added first the error will likely be the 0.000000001 term in the final sum.
I think Kip Hansen deserves 16 lashes for destroying my morning.
Ric ==> Please, blame em@pjmdoll — the originator of the Twit….
someone mentioned above the spaces, and looking at that image yes there are spaces between the 8 the division symbol and the 2
8 space / space 2(2+2)
to me the answer will always be 1. like i stated above, i was taught multiplication first and to me the 2(2+2) is one term of the equation.
I read the linked PDF a little, and I noticed they mentioned multidecadal oscillations. I think other climate models ignore multidecadal oscillations while hindcasting the past, and are tuned to hindcast the past (especially 1975-2005) without consideration of multidecadal oscillations, and so they model excessively positive feedbacks to hindcast the warming from 1975-2005.
I think the O stands for “order”, not “Of”.
I saw the reference you used when I Binged BODMAS definition, but more authoritative sources and my innate sense of “Huh?” indicate that is a errant source.
Kip..
Of course the right order is pivotal. Climate models are derived from the understanding of GHGs, the role of GHGs is derived from the GHE, and the GHE is based on assumptions. Checking these assumptions will be the starting point for anybody interested in “climate change”.
1. Assumption: Surface emissivity of Earth = 1.
This is funny since no real surface has a perfect emissivity. However, with most of Earth covered by water, we should know its hemispheric emissivity. It turns out to be rather 0.91 than 1. We can get this from text books on physics, or try to calculate it ourselves with Fresnel equations knowing the refractive index of water in the range of terrestial LWIR (N2 = 1.27).
This makes a huge difference, since it cuts away about 35W/m2 of an assumed GHE of 150W/m2.
2. Assumption: Clouds are cooling Earth
This assumption comes in 2 flavors.
a) Clouds would reflect about 70W/m2 of solar radiation, but do nothing to hold back LWIR emissions, so that all the original 150W/m2 can be attributed to GHGs.
b) Clouds would reflect only about 44W/m2 of solar radiation and reduce LWIR emissions by about 30W/m2. So at least they would have a share in the GHE thus reducing the role of GHGs to at least 120W/m2. However even this “reduction” of the GHG induced GHE would usually be ignored..
Either way, whatever part of reality threatens the mantra of a 150W/m2 or 33K GHE is getting denied. Given this strange and inconsistent behaviour, one should take a serious look on what clouds actually do to climate. And what we see is jaw-dropping (if you understand the issue..) at least.
Not just clouds are NOT negatively correlated to temperatures, allowing for rain chill bias, we even see a strong positive correlation. In other words, clouds are warming Earth rather than cooling it. Here a simple illustration..
So if clouds realistically reflect about 70W/m2 of solar radiation, and their overall effect is definitely positive, their contribution to an assumed “GHE” will be >70W/m2, maybe like 90W/m2. This would leave us with a GHG induced GHE of 150 – 35 – 90 = 25W/m2, or about 5K. Which is certainly a bit less than a 33K.
Leitwolf ==> But why start there? why start with GHE? Why not start with Air Pressure? Surface Water Temperature and its effect on Atmospheric Water Vapor?
???
Leitwolf ==> GCMs have variable that are interdependent — air pressure affects temperature, temperature affect air pressure, air and sea surface temperature affect atmospheric water vapor — the results of the first calculation cause changes in the subsequent calculations. reverse the order of calculation and the effects are different….
Poorly written expression. If you want the answer 1, use brackets to clarify:
8/[2(2 +2)] = 8/8 = 1
…if you want the answer 16, don’t use brackets:
8/2(2+2) = 8/2 *4 = 4 * 4 = 16
If you enter “8/2(2+2)” into wolframalpha it then replies with “(8/2)(2+2)” which by order of operation is actually 4(2+2) which becomes 16, but it clearly changed the problem to do so and it’s response of what it is solving is NOT the same as the fraction of 8 over the denominator of 2(2+2).
Remember that both / and ÷ mean [enumerator]÷[denominator]
https://www.wolframalpha.com/input/?i=8%2F(2(2%2B2))
See, knowing how to correctly *program* a computer will get you a correct answer.
“8/2(2+2) = 8/2 *4 = 4 * 4 = 16” is wrong
8/2(2+2) = 8/2(4) = 8/8 = 1
You must finish processing the parenthesis before proceeding.
8/2(2+2)=x solve for x
To isolate the 8 you multiply both sides by (2(2+2))
which gives 8= x(2(2+2)),
therefore x=1
Isn’t it fun to manipulate numbers?
This idea of ambiguity won’t fly with me. There are rules defined. Follow the rules. There isn’t some special rule for some higher sophisticated convention. That’s a politician’s excuse. This is arithmetic. There are rules. Follow them.
Also this isn’t about computers or mathematicians. Again, there are rules. Follow them.
Order of operations is well defined. Multiplication and division have equal priority. If no groupings by parentheses or brackets, go from left to right. That’s the rule. Follow it.
8/2(2+2) = 8/2(4) = 4(4) = 16.
coaldust: “8/2(2+2) = 8/2(4) = 4(4) = 16.
Why do you leave out the spaces that exist in the original expression?
It appears to me that the issue here is whether you solve this equation manually using arithmetic/algebra rules or whether you try to solve it by programming a computer.
The spaces in the original expression *DO* have meaning in the expression. When you eliminate them in order to simply programming a computer then you actually lose part of the information included in the original expression.
No programming I have ever done recognizes spaces in an expression, the first thing they do is eliminate all spaces. Nor do they recognize manual algebra expressions like 2(2). Now admittedly I have not used all programming languages but I’ve used a lot.
When you see something like 8 + 2(2+2) it should be immediately recognized that this expression must be evaluated using manual methods and not programming rules. In doing this 2(2+2) is a separate part of the expression from the 8. Doing this gives an answer of 1.
If you are going to convert this into an expression to be solved by a computer then first you have to replace the spaces with parenthesis or brackets, you can’t just ignore the spaces!
The rule is spaces don’t matter. Follow the rules.
p.s.
Unless it is a large space separating expressions, then you might have:
8/2 (2+2)
=4 4
two expressions -> two numbers.
But 8 / 2(2+2) != 8/8. The spaces don’t matter. Follow the rules.
Spaces *do* matter. They have always mattered in written expressions. Spaces are only ignored by program compilers such as for the C language.
coaldust ==> The whole point of the essay, and Strogatz’ two NY Times articles is that there are rules — more than one set — and not everyone follows the same rules. The essay shows two scientific calculators giving differing results, and three online scientific calculators each giving different results (one returns “error”).
“The rules I learned in school” are not necessarily the same as a greater truth.
I agree. There have to be rules, and the rules have to be known, and then followed. And if there are different rules then you need to specify what rules you are following.
However, there really aren’t different rules for arithmetic. They are well defined and have been for a long time. It does appear that some people don’t know the rules.
And calculators? So some might do it wrong? Or maybe you have to follow the calculator’s programming instructions or else it says “error”. So what? This isn’t a calculator or machine problem. It’s an arithmetic problem.
Kip ==> While what you say has some truth to it, I don’t think it’s that big an issue in practice. I think the best reference on how to screw up or not screw up your digital math is probably Richard Hamming’s 1973 treatise “Numerical Methods for Scientists and Engineers”. I recall it as being surprisingly readable considering the subject matter. I looked for a free download to link to, but couldn’t find one.
As I recall, the biggie isn’t order of operations per se. It’s math that inadvertently subtracts two large similar numbers. The problem is that if you subtract say 2099999.0 from 2100002.0, your answer of 3.0 probably has about six fewer significant digits than you intended. Trouble is that it’s very hard to see you’ve done this unless you are “lucky” enough to generate a truly absurd answer (and have enough sense to realize that absurd is bad).
Don ==> In simpler maths, you are quite right. In GCMs, the instantaneous result of one calculation is the input for another, at the same time step — so order of calculation (not order of operations, which is a different fish) might wellbe very important.
“8/2(2+2) = 8/2(4) = 4(4) = 16” is wrong.
You have to finish with the parenthesis before you proceed.
8/2(2+2) = 8/2(4) = 8/8 = 1
This ambiguity seems an elementary matter of specifying parentheses, which accordingly determine order. For example, where 8 / (2x(2+2)), the answer is indubitably 8 / (2×4) = 1; writing 8/2 x (2×2) returns 4 x 4 = 16. Rather than waffle-and-fuss about some subjective “order of operations” [anathema in math], best simply remove the ambiguity by adequate notation.
“” *Strogatz says: “Strict adherence to this elementary PEMDAS convention, I argued, leads to only one answer: 16.”* “”
PEMDAS says to do the goddamned parenthesis FIRST and will always provide an answer of 1 on the subject.
Incompetence. When you use a computational language format you MUST follow that computational language format’s rules. Using parenthesis as a (multiplythisvalue) requires that PEMDAS be followed.
You want a REAL laugh about incompetence try comparing https://www.wolframalpha.com/input/?i=1%2F1.000.000 , https://www.wolframalpha.com/input/?i=1%2F1,000,000 , and https://www.wolframalpha.com/input/?i=1%2F1.000 then get back to me on whether you think most of the world are morons who fall for advertisers who use . to separate phone numbers because they’re too incompetent to properly format a spreadsheet.
mike TECHNICALLY your 8/2*4 is not correct
it is Actually 8/2(4) just because you do the math inside the paranthesis…does not mean you move said parenthesis and do 8/2*4 if you do that you CAN get 16 or 1 depending if you do division first or multiplication first.
if you leave the parenthesis there, you have to solve the term 2(4) before you can do the division.
answer is 1 🙂 i can see how you get 16 but to me the term 2(2+2) always has to be solved completely first before doing the division.
Whether true or not, my brother who holds a degree in Pure Mathematics from Cal explained to me that there really is no division or subtraction per se, that was just shorthand for multiplying by the inverse, or adding a negative number. Which is what is actually happening. So 8 / 2(2+2) is really 8 * 1/2(2+2)—> 8 * 1/4+4 —>8 * 1/8=1. By some logic you could do 8/ 2(2+2) –> 8/ 4+4–> 2+4=6
My answer to the correct order of mathematical operations is not based on math expertise , but rather on the basis that math is a language.
To apply a mathematical operation to two ‘things’, the ‘things’ must be in equivalent language.
8 and 4 are both equivalent language, so 8 divided by 4 can be operated on to produce 2.
8 and 2(2+2) are not equivalent language, so 8 cannot be operated on by division until 2(2+2) is put into the same language as 8.
So let’s rewrite the “8” into another form such as “2(2+2)”
We then have
2(2+2)/2(2+2)
which of course is 1
Occam’s Razor says not to make things more complicated than they need to be, so “2(2+2)” is just a complicated unnecessary way of expressing “8”. Therefore the answer is “1”.
Tom
+1
One should simplify an expression before completely evaluating it!
Clyde:
-1
The only simplification to be performed is evaluating the parenthetical expression, that’s it. Then you go back to the beginning. No soup for you.
That is correct, but it has nothing to do with Occam Razor, it is the way it is supposed to be done.
Like others, you have grouped those numbers without justification. You evaluate the whole string by the rules, not little pieces. 2(2+2) is not a sub-part to be separately evaluated.
D.J.
-1
“Like others, you have grouped those numbers without justification. You evaluate the whole string by the rules, not little pieces. 2(2+2) is not a sub-part to be separately evaluated.”
Of course it is a sub-part to be separately evaluated. That is why is separated by a space in the expression. You are, like so many others, trying to evaluate the expression as if it were written to be compiled by a computer language compiler.
While you probably don’t realize it this is probably giving away your age. Those of us who grew up on analog computers evaluate written expressions as just that, not as entries in a computer program.
The answer must be one. BODMAS has the answer.
Brackets (2×2) =4
Multiplication 2x(2×2) = 8
Division 8/8 = 1
Wrong Mike. The rule says operations go LEFT to RIGHT. You clearly violated the rule by going RIGHT to LEFT after you did the parenthetical operation.
Kip
“Start you (your)? comment with “Kip…” if you’re speaking to me. ?
First. Simplify the denominator.
As a programmer, I see the problem as simply “it depends on the rules of evaluation.” In the programming languages I’ve used, the expression would be flagged as a syntax error. None of them used implicit multiplication. In the absence of rules, an expression is meaningless. In this case somebody dropped an expression on the internet with no rules of evaluation attached.
Much of the trouble here is due to people being invested in the rules they’re familiar with colliding with people who have different assumptions.
If I propose that 2+2=11, some of you might think I’m math challenged. At least until I mention that this is correct in base 3. Most people assume base 10 if not otherwise specified.
The moral to the story is that if something is ambiguous or seems wrong, it simply needs further inspection to see what is going on and what, if anything, needs to be clarified.
“In the programming languages I’ve used, the expression would be flagged as a syntax error. None of them used implicit multiplication. ”
Where was it stated that this was a line of program code in the original example? There was no assignment operator shown at all.
Is the expression mx+b a syntax error as well? It isn’t in any math book I have.
Tim Gorman
+1
I never thought I would see the day when 8/2(2+2) = 1 could be written and many people agreeing!!!!
The rules of BODMAS tell us the order to perform the operations, in case there are order sensitive steps.
It is an accepted fact that 2() means 2 times the contents of the bracket.
It is nicer to see in the examples in this thread to have 2 times (2 plus 2) but if the times sign is missing, you mentally insert it and carry on.
Look at this example from the premier UK text book on engineering maths used in colleges and uni for the first two year of maths.:
https://jpmccarthymaths.files.wordpress.com/2012/09/john_bird_engineering_mathematics_0750685557.pdf
This is an old copy..
Have a look at page 43 problem 26.
Good god! we have [3{2(4a what to do!! also 5( what does that mean?
If there is a number butted up to a lhs bracket insert a multiplication sign and follow BODMAS.
BODMAS and the laws of precedence start on page 44. If you want to get closer to the example in this thread then see problem 40 on page 45 where we see the dreaded divide sign!!!
For clarity, Bird uses ÷ instead of a / for division.
Note that the ÷ only affects the 4a term.
If you want to force someone or a computer program to calculate a result using a formula you have created, you must use brackets to force the order you want.
Any formula you wish to input into a calculator or computer program must be tested by hand, on paper and the result compared with the computer/calculator output. If they do not agree the computing device did not obey the rules.
It was always compulsory at the first maths lesson at college to get the students to enter a calculation from the white board. A number of answers were given by the students. Once the random answers were removed, it always turned out that those with incorrect answers had a non standard calculator that required lots of extra brackets to be inserted for every calculation if you wanted the correct answer.
So the answer is 16 because 8/2(2+2) = 8/2*(2+2) and either form is okay for use on paper and calculators if you have a good calculator like mine Casio fx-83ES.
If the standard states that 2*( and 2( are the same, who are we to argue?
Steve ==> Read the two Strogatz pieces and see if you can figure out why he took one position then switched to the other.
I forgot to add that some say spaces are important in maths. Not that I am aware. Each number or term 3 or 3c is separated followed by an operator such as *+-/^() etc.
You can remove all of the spaces from the Bird maths book and the maths and answers will not change.
x = 8 ÷ 2(2 + 2)
x = 8 ÷ (2 * 2) + (2 * 2)
x = 8 ÷ 4 + 4
x = 2 + 4
x = 6
😀
(Just to stir the pot…)
Jonas ==> Cute…that.
x = 8 ÷ 2(2 + 2)
x = 8 ÷ ((2 * 2) + (2 * 2))
x = 8 ÷ (4 + 4)
x = 8 ÷ 8
x = 1
😀
Fixed it.
As my son says to people he codes with, “quit being a whiny little bitch and use more parentheses”.
Put the expression in C code and compile and run it. That will give definitive answer, otherwise the code would not be portable to different compilers which would cause so many problems someone would have noticed the problem already.
Stevek ==> Oh, they noticed it alright — thus this whole kerfuffle.
I doubt very much the C code is the arbiter of all things mathematical.
A) It won’t compile, C and most other programming languages don’t have the concept of multiplication by juxtaposition, and that’s the heart of much of the controversy.
B) Adding a C multiplication operator makes it legal. Multiplication and division have the same precedence and are computed left-right.
C) It’s not the same problem as it’s no longer ambiguous.
Ok,
simply put, the equation in question, in proper sterile math approach seems to offer two outcomes,
both considered same in validity.
Where the actual outcome happens to be either 1 or 16 or both,
not actually good, as there has to be only one proper mathematically valid outcome or answer.
But trying a add logic in that application may just sort the problem.
So, moving it from;
“8/2(2+2)=?”
to the logical approach;
8/2(2+2)=X then a logical separation could be used and employed as per the given condition, giving out the:
X/8/2=(2+2) or X/(2+2)=8/2, where in both cases:
X/4=4 which points out that X=4*4=16 happens to be the only favored and possibly the correct answer from this angle… no way you get a 1 as an answer from this approach.
Eh, well, all depends in consideration of the value and acceptance of the approach…
Standing to be corrected. 🙂
(sorry, have not read or checked all of the comments, so if same shown in any earlier comment there, I do apologize.)
cheers
Whiten ==> Skip the comments,first read Strogatz’ two piece in the NY Times (links in essay)…then check back with me.
Checking back….!
Sorry, but that approach is just wrong.
8/2(2+2) = x written visually is 8
—— = x
2(2+2)
which becomes 8
——- = x
2(4)
which becomes 8
——- = x
8
which becomes 1 = x
John Dilks
August 8, 2019 at 9:14 pm
John for your understanding, and any one else there interested.
The method applied in my comment that you replied to, as far as I can tell is a very valid mathematical and algebra one.
Unless you can prove it otherwise it stands as a very correct validation method in the consideration of the given equation.
It actually validates the result as only the 16.
Falsifies the result of 1.
There is no way out of this, as far as I can tell, unless the approach of separation offered is proven as invalid.
And there is only one place mathematically valid for separation there, unless one seriously considers breaking the basic mathematical rules of precedence there, with no much regard.
That approach validates the 16 as the only proper result of the:
8/2(2+2)=?
and clearly falsifies the 1…. regardless of all else.
Ambiguity, interpolation, innuendos, in terminology or otherwise do not change much there, or hold any value.
The only thing that matters is whether the method is correct-valid or not.
My attempt there was to offer a validation in that case.
It seems to me that that method quite immune to ambiguity and interpolation.
You can spoon with it at your heart’s content, but unless you can prove that the method not mathematically correct or valid, then I think you got to accept its result… and there happens to be only one valid correct result, in accordance.
thanks
cheers
Notice that they have to use a program like Wolfram to actually enter the equation as shown. It cannot be entered as it is in almost any language I know of and as several of you have shown above. Properly, it can be entered as 8 / 2 * (2 + 2).
If you want to get the value 1 then you need 8 / (2 * (2+2)).
All programming languages demonstrate that the equation shown can be considered ambiguous. However, once it is established explicitly there is no ambiguity. There will be only one answer.
Larry ==> if we only had to solve this one little ambiguous equation, we’d find a pretty easy answer.
The bigger question is: what if we change the order of calculation of GCMs?
Kip Hansen
August 8, 2019 at 1:01 pm
If the ratios in the base parametrization maintained , still when a GCM simulation “locks in” to the warming, there would not be a way to either
slowdown-stop or speedup-increase of either the warming or CO2 concentration, including the use of modification of the “”artificial knob’s “power””, I think.
Maybe I think wrong!
But that is how I see it so far.
According to above, the “lock in” considered to be established somewhere between 0.4C to 0.8C warming mark, with proper irreversible “lock in” at ~0.8C.
(the way I understand it, which does not necessary has to be considered as valid or correct, but in the case that it may “spice” a bit more the GCM consideration)
cheers
The Answer is 1.
Kip – When I was at school, many decades ago, I don’t think they had invented BODMAS or PEMDAS. We were simply taught that the priorities were 1. brackets, 2. exponents, 3. multiplication and division, 4. addition and subtraction. It might now be called BO(DM)(AS) or PE(MD)(AS) perhaps. The way it worked is that for example a – b + c – d + … is always read as a + (- b) + c + (- d) + … and a ÷ b * c ÷ d * … is similarly read as a * (1/b) * c * (1/d) * …
You will note that there is no need to distinguish between multiplication and implicit multiplication. Also that a string of multiplies and divides can be given and calculated in any order – thus for example 8 * 4 ÷ 2 ÷ 1 = 8 ÷ 1 ÷ 2 * 4 = 4 ÷ 2 ÷ 1 * 8 = 16. I haven’t checked carefully, but I think that BODMAS gives the same answer provided that the divisions are done left-to-right. Anyway, the way I describe is superior because it is so much easier to remember and to apply. PEMDAS seems just wrong.
Using this old-fashioned but superior (!) method, the correct answer to your challenge is:
8 ÷ 2(2+2) = 8 * (1/2) * (2+2) = 16
Having said all that, though, it is a really good idea to present any sequence of multiplications and divisions completely unambiguously.
“8 ÷ 2(2+2) = 8 * (1/2) * (2+2) = 16” is wrong.
8 ÷ 2(2+2) = 8 * 1/(2(2+2)) = 8 * 1/(2(4)) = 8 * 1/(8) = 8 * 1/8 = 8/8 = 1
Yes, I was wrong about implicit multiplication. It does have to be done first. But I think we can all agree that being unambiguous is best.
Mike:
If I gave you the expression
ʃ x2 / x(x + 1) dx
exactly how would you evaluate it manually? Is this ambiguous? It’s right out of my 1968 copy of “The Calculus with Analytic Geometry” by Leithold.
Or we could try my 1940 “Differential and Integral Calculus” by Middlemiss:
differentiate y = 4 / 3x-1
These were written long before computer programming tainted so many today for reading manual expressions and evaluating them.
1. Saying that one should write expressions unambiguously doesn’t mean that any particular expression is ambiguous.
2. Your example expression is ambiguous, but probably not in the way you meant. The expression reads
ʃ x*2 / (x*(x + 1)) dx
but I suspect you intended
ʃ (x exponent 2) / (x*(x + 1)) dx
3. y = 4 / 3x-1 is definitely ambiguous, because it can be very difficult in some fonts to see spaces. As shown on my iPhone screen I read it as very clearly saying y = (4/3x)-1, and it was only because you made it clear that there was a possibility of ambiguity that I then worked out where you had put the spaces.
4. I’m slightly bemused at the wording of your last comment – I had conceded that you were right.
5. No matter, I think this whole page shows that it is important to be unambiguous. The designers of the algorithms that found “syntax error” are the ones that got it right.
Mike;
Implicit multiplication does NOT have priority. No where is that part of any prior or current rule.
TL;DR
Answer is = 1.
Long answer.
There is no problem with how the mathematical equation is stated. The problem lies with several factors.
1) The problem is a numerator and denominator problem, as others have mention and alluded too. If one reads the equation and translates it into English. You will end up with this statement. Reading left to right we get “8 divided by 2 lots of (2 plus 2)”. The 8 is the numerator and the denominator is the “2 lots of (2 plus 2)”.
Which reads
8
————–
2(2+2)
Which will yield the following
8
—
2(4) (the denominator is then worked out fully)
8
—
8
Therefore the answer is 1.
2) What the BODMAS OR PEMDAS do not state is the implicit multiplication ie: 2(2 plus 2) as stated by Strogatz “implicit multiplication is given higher priority than explicit multiplication”, which needs to be evaluated first, that means the distributive law takes precedence. Yielding the value 8 and finally 8/8 giving the answer 1.
3) Mathematicians are lazy and they leave out certain symbols. For example 2(2 + 2) fully expanded is 2 x (2 + 2) or even 2.(2 + 2). So brackets are left out of the original equation and should be read as 8 / ( 2(2 + 2)), this is the explicit form of the equation. Which when worked out yields the answer 1.
So Wolfram and calculator manufactures need to implement the explicit form of an equation. That is the original question must be clearly defined.
Regards
Climate Heretic
>TL;DR?
I assume you aren’t expecting anyone to read the rest of your reply.
Bah, Num Bug.
Kip:
TL;DR
Answer is = 1.
Long answer.
There is no problem with how the mathematical equation is stated. The problem lies with several factors.
1) The problem is a numerator and denominator problem, as others have mention and alluded too. If one reads the equation and translates it into English. You will end up with this statement. Reading left to right we get “8 divided by 2 lots of (2 plus 2)”. The 8 is the numerator and the denominator is the “2 lots of (2 plus 2)”.
Which reads
8
————–
2(2+2)
Which will yield the following
8
—
2(4) (the denominator is then worked out fully)
8
—
8
Therefore the answer is 1.
2) What the BODMAS OR PEMDAS do not state is the implicit multiplication ie: 2(2 plus 2) as stated by Strogatz “implicit multiplication is given higher priority than explicit multiplication”, which needs to be evaluated first, that means the distributive law takes precedence. Yielding the value 8 and finally 8/8 giving the answer 1.
3) Mathematicians are lazy and they leave out certain symbols. For example 2(2 + 2) fully expanded is 2 x (2 + 2) or even 2.(2 + 2). So brackets are left out of the original equation and should be read as 8 / ( 2(2 + 2)), this is the explicit form of the equation. Which when worked out yields the answer 1.
So Wolfram and calculator manufactures need to implement the explicit form of an equation. That is the original question must be clearly defined.
Regards
Climate Heretic
Climate Heretic
August 8, 2019 at 3:02 pm
Heretic,
There is a logical reason why multiplication takes precedence in Algebra.
You have just clearly shown what happens when that rule openly broken,,,
a wrong non valid result.
In your try you clearly have broken that rule.
If the multiplication has precedence, then that is where the only valid place of separation could be in a given equation…something you have clearly infringed above.
So it should be like:
8/2
*
(2+2)
ha, vertical math seems easier….
cheers
“If the multiplication has precedence, then that is where the only valid place of separation could be in a given equation”
The spaces in the original expression specifically distinguish where the valid place of separation should be.
I do not know that algebra takes account of spaces.
Is that a proper “game”rule or a playing rule, how to play the game rule?
Sorry, simply missing the point you making there.
cheers
In written expressions spaces indicate groupings. Every calculus book I have writes the expression of a line as:
y = mx + b.
Not y=m*x+b
Implicit multiplication is part of every math book I have from basic algebra on up. The expression given is a *written* expression just like mx + b. It is not until programmers get involved that things get confusing. There is nothing in the example that indicates this expression is written in a programming language.
Tim Gorman
August 8, 2019 at 4:26 pm
Tim,
I still do not get your point.
These
y = mx + b.
y=m*x+b
both he same
In both, the multiplication rule means the same result, some like:
m+b=y/x or m=y/x-b,
and not:
m=(y-b)/x or m=y-b/x
It simply serves the purpose of guarding against such an error, I think.
It does not seem like spaces matter much or hold any real value, but the multiplication rule does, don’t you think?
cheers
I used the mx + b as an example of spacing defining groupings not as an example of precedence.
Again, if you read the 8 / 2(2+2) as it is written, the 2(2+2) forms its own grouping to be calculated on its own. If it had been written 8/2 (2+2) or 8 / 2 (2+2) then it would make no written sense since the implicit multiplication operator is lost. Actually no language compiler would be able to make sense of it either.
In computer-speak, if you will, spaces are ignored and the expression would be written 8/2*(2+2) and getting an answer of 16 would make sense. In written expressions, however, spaces (especially coupled with non-spaces) must not be ignored. In written form spaces carry information. Ignoring spaces causes that information to be lost.
Tim, you could save a lot of people a fair amount of time if you just posted a reference that supports your claim that spaces are algebraic operators.
I stumbled across no mention whatsoever when I was looking for a definitive description of multiplication by juxtaposition .
Ric: “Tim, you could save a lot of people a fair amount of time if you just posted a reference that supports your claim that spaces are algebraic operators.”
I never said that spaces are algebraic operators. I said they work as grouping indicators. When you ignore the spaces in a written expression meant to be solved manually then you are ignoring the information the spaces are meant to provide.
In a written expression you can substitute parenthesis for spaces (usually) but you simply cannot ignore the spaces like the computer programmers on here want to do.
Well, it sounds like we need to hear your definition of “algebraic operator”. Mine includes grouping symbols (including null strings).
Of course, some of that comes from formal descriptions of expressions in programming languages, but it all applies to things like diagramming sentences or expressions.
@whiten
“In your try you clearly have broken that rule.”
Absolutely not. I have not broken any rule. It is you that is wrong, multiplication and division have equal standing in the BODMAS OR PEMDAS. These rules do not subtly convey the nuances of in depth mathematics.
The problem is a numerator over a denominator which is the key. That is “The key is that the line separating the numerator from the denominator of a fraction (called the vinculum or solidus or obelus) is itself a grouping symbol.
Definition: Fraction Line (Vinculum or Solidus or obelus) The fraction line also acts as a grouping symbol. Everything above the line in the numerator is grouped together, and everything below the line in the denominator is grouped together.
Definition:A vinculum is a horizontal line used in mathematical notation for a specific purpose. It may be placed as an overline (or underline) over (or under) a mathematical expression to indicate that the expression is to be considered grouped together.
Definition: Obelus is a symbol consisting of a short horizontal line with a dot above and another dot below. In mathematics it is mainly used to represent the mathematical operation of division.
Definition: Solidus is a symbol representing a slash “/” used as the bar between numerator and denominator of an inline fraction. The solidus is also called a diagonal line.
Special care is needed when interpreting the meaning of division, because of the ambiguity in expressions such as a/bc. Whereas in many mathematical textbooks, “a/bc” is intended to denote a/(bc). For clarity, parentheses (brackets) should therefore always be used when delineating compound denominators.
Regards
Climate Heretic
@kid for your perusal
Heretic ==> well, your final answer is the same as Strogatz’. He gives the caveat that if we are to accept that, then we must all use the “more sophisticated” rules, which deal with implicit and explicit operations.
Unfortunately, much software does not use the rules needed to arrive at that answer.
Thus, lazy programmers, writing what they think are valid notation, can mangle the results. (say, on line 1,230 of a 5,000 line program segment….)
?Mordor/1 = ?
One does not simply go into Mordor
Does this equation behave badly with the transitive property? As we learned in high school, a(b+c) = ab + ac. So:
8 ÷ 2(2+2) becomes
8 ÷ 4 + 4 becomes
2 + 4 becomes
6!
It is simply not a valid expression. Anything that treats it as valid is wrong.
It can be interpreted as:
(8/2)*(2+2)
or
8/(2*(2+2))
Since both are valid, with different results, the expression as written is incomplete.
It shows how poor education is that there is even any discussion.
Phillip:
If I gave you the written expression ʃ x2 / x(x + 1) dx exactly how would you evaluate it manually?
Do you have a rule that says implies exponentiation? Why not just write x^2/x(x+1) and really confuse people?
Or, just keep it simple and consider a/bc or (since you’re enamored with spaces) a / b c?
Ric:
I wrote that expression in Lyx. I don’t know why the exponation symbol did not come through. I didn’t edit the final paste into the reply box closely enough.
Here it is rewritten: If I gave you the expression ʃ x∧2 / x(x + 1) dx exactly how would you evaluate it manually?
You forgot to state exactly how you would evaluate it, you just skipped over doing that.
Thank You Kip an interesting point.
Perhaps this small point of mathematical convention and computer programming could explain the anger from some of the Climate Modelling Teams when others question their results.
Your point with respect to the order of calculation specified within the model is an important observation.
I too remember programmes that gave very different results,depending on the hardware they were run on.
Politically nothing makes an argument more pointless than when both sides Know they are right.
The comments highlight this certainty of many,that the answer is obviously just so.1 or 16.
Maybe Garbage In Gospel Out is truly a matter of perspective.
For when we used slide rules,we had to have a good idea of what the answer should be,which is very different to todays culture where the phone tells us an result to 3 decimal places.
Faith in the machine?
Steve McIntyre called this over 10 years ago,we need an Engineering Grade review of all the processes of Climate Scrying.
Funny how that never happened,as we approach the 10 year anniversary of the CRU Emails.
John ==> I admit that I have been disappointed with the comments, as so few actually take any interest at all in the greater question of the order of calculation in complex computer models such as GCMs.
Despite Strogatz’ detailed analysis and discussion of the issues in the simple problem, we see so many insisting that what they learned in school is the ONLY right way.
I think that climate programmers have just been copying&pasting earlier code and making adjustments to it, without any real analysis of the order of calculation problems. Correcting or changing the order would be a massive new undertaking.
One reader offered a paper on this topic, which I have yet to read.
Fer chrissake, the rule, the rock-solid convention ,that I and millions of other learned regarding the order of operations was “My Dear Aunt Sal.”
Expressions within parens were to be dealt with FIRST, in the same order.
Ergo the answer is 1.
No airplane, no spacecraft will ever again be safe until these RULES are followed by everyone.
No WHAT-EV.
It is not ambiguous.
Using what you were taught in math.
8/2(2+2)
Handle inside the () and get 8/2(4)
Now handle the () and get 8/8
Now handle the “/” and get 1
Now if you want your calculator or spreadsheet to get the same answer, program it correctly.
One way is 8/(2*(2+2))
1
Also, GIGO and Learn to Code.
The answer is 1. Math expressions are spacially contextual. For example, how do we know a number is an exponent?…only by the way the number is spacially placed and sized.
What a calculator does, when the original expression is naively and poorly translated into text, is irrelevant.For example. For example, exponents can’t even be “properly” put into a calculator (the ‘^’ symbol is commonly used to symbolize superscript). Saying that the original expression is the same as “5/2(2+2)” is like saying that five squared is the same as “52”. Spacing and context matters and this is lost in translation when put into a monospaced, super/subscriptless textual calculator.
So, while the intent of the author of the original expression could be misinterpreted, given the spacing and the rest of the contextual clues, the most likely intended answer is “1”. More parentheses could have been used to “nail it down”, but more parentheses can be visual clutter and the spacing communicates the intent sufficiently.
In The Netherlands we use the following sentence to determin what comes first:
Men Vaart De Waal Op en Af.
(People sail the Waal up and down)
M: machtsverheffen = exponentiation
V: vermenigvuldigen = multiplying
D: delen = division
W: worteltrekken = rooting
O&A: optellen& aftrekken = add & deduct
So the answer is 1.
Multiplying goes before division
—–
Also used is: Meneer Van Dale Wacht Op Antwoord
(Mister Van Dale Waits For Answers)
This is considered less accurate because now adding seems to come before deduction
John Dilks,
You are assuming that the / in 8/2(4) applies to everything to the right of it.
Not so.
The slash / applies to the next value, 2 in this case, and the value is terminated by the (
If the writer of the original equation wanted to tell us the it was 8 divided by the remainder of the equation then they would have written it as 8/(2(2+2)) which is what you assume but the original was written as 8/2(2+2).
In every case written and explained fully in Bird: https://jpmccarthymaths.files.wordpress.com/2012/09/john_bird_engineering_mathematics_0750685557.pdf
there are plenty of examples with a / in the middle of a complex equation and it always, always applies to the following term only. If you want the / to apply to the remainder of the written equation, then you must put () around everything you wish to include.
How else could it be?
“How else could it be?”
You have the “computer programming” virus and are ignoring the spaces given in the expression.
If you include the spaces shown in the original expression then the / is no longer next to the 2, a space is. The 2(2+2) becomes a standalone grouping.
And you still haven’t provided any references that says spaces matter.
Ric: “And you still haven’t provided any references that says spaces matter.”
Jimminy Crickets! Look in any math book to see how expressions are written.
from wikipedia: “In mathematics, an expression or mathematical expression is a finite combination of symbols that is well-formed according to rules that depend on the context. Mathematical symbols can designate numbers (constants), variables, operations, functions, brackets, punctuation, and GROUPING (capitalization is mine, tim) to help determine order of operations, and other aspects of logical syntax.”
Please note carefully that grouping is specified separately from brackets, punctuation, and operations. Grouping by using spacing is perfectly legitimate as a perusal of any math book will show.
And you still haven’t provided any references that says spaces matter.
Look at my references, I used some from the early 20th century. One I didn’t copy (from the FB dicussion where I was more involved) is from Wikipedia. Since you tolerate Wikipedia, visit https://en.wikipedia.org/wiki/Order_of_operations where it says in part:
Again, for the umpteenth time, the original question is a play on ambiguity. In my book there is no excuse for writing ambiguous algebraic expressions, or for defending them, and I still haven’t found any references that refer to spaces as operators or whatever you wish to call them.
BTW, that page continues with more notes on ambiguity:
“And you still haven’t provided any references that says spaces matter.”
Spaces provide for grouping. Why is that so hard to understand?
And you have still not answered how you would evaluate the expression I gave you. Is it embarrassing for you?
Steve,
Please state the page number showing an equation using the / symbol.
From High precision calculator – keisan – Casio :
https://keisan.casio.com/calculator
The result is 1
Equation solving in the context of climate models are an iterative process and I don’t mean the time step, that is a different matter. This iterative process converges to the exact answer which generally is not reached unless one is lucky (the equation happens to be serendipitous …) A margin of error or precision is the target and this is so because of the limitations of the computing environment. There are limited resources, computing time and memory. The iterative process has to stop at one point and the remaining error in the calculation has to be accepted, but it can also be chosen, with trade offs. You can throw more iterations into the equations you don’t feel provide enough precision but you will have to give up something else in return, maybe reduce the precision of some other equation or wait a lot longer for your calculations to complete.
There are different mathematical methods of solving the same problem with variance on how fast convergence to the exact answer takes place, how many terms are used in the equation and how amenable the equation is to a computer implementation.
It is alright to have different calculated values depending on the order one processes the operations and this is something to be expected, because you are managing the margin of error. You get a different answer but it falls into the expected error range. Mixing the order of operations is a good way to check your algorithms. You don’t expect the exact same results, you check that they fall within an accepted range. Margin of error will always increase the further your time steps take you though.
It would be best to frame the problem as a real-world question and then write the correct algebraic formula, as the expression must have originated from something. I see 2 problems that could have led to the poorly written expression:
1. I have 8 apple seeds to put into pots, and there are 2 boys and 2 girls with 2 pots each. How many seeds per pot? 8 seeds divided by 8 pots = 1
2. I have 2 boys and 2 girls each bringing 2 seeds for my 8 pots which require 2 seeds each. How many seeds are the children bringing? 8 pots divided 2 seeds per pot times (2 seeds per boy plus 2 seeds per girl) = 16 seeds. (Sort of an over-specified problem).
Gee, that is an algebra test question… we were told to replace the order of operations word that had ‘and’ with then: addition then subraction then multiplication then division. work it from the inside out using polynomial fractions, if there is missing parenthesis or brackets. In this case, 8 over the rest, just like a good algebra calculator (some are wrong) answer is 1.
The correct answer is 8.5
We have two mathematical models, one gives 1 as the answer and the other 16.
If we do that climate scientists do, which is to take the average of the two models, the answer is 8.5
Kip,
The (2+2) is obviously 4 so what we have after the first step is … 8 / 2 * 4, where the * is implied.
BODMAS processes 8 / 2 * 4 as … (8/2) * 4
PEMDAS processes 8 /2 * 4 as … 8 / (2 * 4)
BOMDAS processes 8 / 2 * 4 as … 8 / (2 * 4)
Unlike additions, subtractions and multiple multiplications, division is not commutative – the order of operations is important.
Any programmer who knows his stuff knows to avoid mathematical ambiguities and will insert parentheses. The question is always whether a given programmer knows his stuff.
Kip…
Imagine you gave a class in university an exam. And at the end there was an extra paper returned with no name. As strange as it might sound, the climate model solution is to take unidentified paper and give everyone else in the class an equal share of the right and wrong answers. Otherwise, the climate models would create or destroy energy – something that is physically impossible.
From my own testing, a very simple problem is to try and build a computer model of a few hundred molecules bouncing around in a closed container under the influence of gravity. Then to realize just how difficult the problem is.
For each molecule you must calculate their trajectory, then calculate the time of the next collision, either with another molecule or the container, which is in itself a huge, a non trivial problem. Then bring the clock forward to that exact point in time of this next collision and move all the molecules to their new positions. Calculate the new paths created by the collision, then solve for the next collision.
You might imagine when molecules get compressed at the bottom of the container by gravity, the collisions can become extremely rapid, and very quickly you end up with round off and loss of precision errors in the calculations, and this shows up as a gain or loss of total energy in the system. The system begins to drift. even though you have not added or removed any energy – something that is not supposed to happen in the real world.
And this error occurs very quickly even using floating point processors with 80 bit precision and a few hundred molecules. It also happens in climate models. They drift – creating or destroying energy along the way. And the solution? The climate model builders calculate the drift at each iteration, and divide this delta up and add or subtract it from the individual elements of their simulation.
Thus, the result is very quickly a “smeared” version of reality, where the unidentified results are divided up among the other students in the class.
ferd ==> see this link:
http://www.miroc-gcm.jp/cfmip2017/presentation.html
Kip,
Here is an article I recently read about the use of mathematical modelling using computers in the world of economics, the same issues apply to climate change science.
T
he evolution of thinking went like this,
1.Holy shit! Do you see what you can do with a computer’s help.
2.Learning computer modeling puts you in a small class where only other members of the caste can truly understand you. This opens up huge avenues for fraud:
3.The main reason to learn stats is to prevent someone else from committing fraud against you.
4.More and more people will gain access to the power of statistical analysis. When that happens, the stratification of importance within the profession should be a matter of who asks the best questions.
https://rwer.wordpress.com/2019/08/09/econometric-illusions/
Vincent ==> One of the huge problems in many fields of science today is that researchers use Statistical Software Packages to handle the statistical analysis of their findings. Most researchers are not trained very well in statistics, so use just what seems right, or use what they have read that other researchers have used — without really understanding what the particular approaches do or what the results of the analyses can actually be used for….thus they get results that are not scientifically sound, thus “Most research findings are false.” John P. A. Ioannidis
Until this thread, I had not heard of different rules of precedence dependent upon whether an operator is written or implied.
I can see where it has come from, and to my mind, is a result of sloppy working.
From Texas Instruments help web page: https://epsstore.ti.com/OA_HTML/csksxvm.jsp?nSetId=103110
” Does implied multiplication and explicit multiplication have the same precedence on TI graphing calculators?
Implied multiplication has a higher priority than explicit multiplication to allow users to enter expressions, in the same manner as they would be written. For example, the TI-80, TI-81, TI-82, and TI-85 evaluate 1/2X as 1/(2*X), while other products may evaluate the same expression as 1/2*X from left to right. Without this feature, it would be necessary to group 2X in parentheses, something that is typically not done when writing the expression on paper.
This order of precedence was changed for the TI-83 family, TI-84 Plus family, TI-89 family, TI-92 Plus, Voyage™ 200 and the TI-Nspire™ Handheld in TI-84 Plus Mode. Implied and explicit multiplication is given the same priority. “
So the same manufacture (TI) has a number of calculators on the market that give different answers to the same input!! Looks like more recent calcs do it properly now.
This is why it is important that every formula, equation, question etc is written in an unambiguous manner.
By all means write down your equation how you want, enter it into any calculator you want, but if anyone else is to see your equation, you must remove ambiguity so they understand what you mean and it will not matter which calculator THEY use, they will get the same answer as you.
The answer remains 16.
Not to confound things but how do you know the proper way to pronounce “read”?
Is it “red” or is it “reed”?
Did you read the book?
Have you read the book?
Understanding how words go together to modify other words is a skill to be learned rather than just learning the word all by itself.
The same with this math question. You cannot take each operation solely by itself in a strict order. You need to understand the meaning of the symbols used. Because there is no additional operation indicated between the 2 and the (2+2), the 2 belongs to the (2+2) as an alternative way to express 8. Consequently the 2 does not belong to the 8 or to the division symbol.
Tom: “the 2 belongs to the (2+2) as an alternative way to express 8. Consequently the 2 does not belong to the 8 or to the division symbol.”
Not just this but there is a space between the division symbol and the 2 thus disassociating the 2 even further from the division symbol.
Back before calculators (the first calculator instrument I saw was the size of my school desk) were born, the blackboard symbol conventions were strictly adhered to in fine detail. A fraction line meant one thing, a division sign meant another thing. A multiplier immediately followed by parenthesis meant one thing, a multiplier followed by a times symbol followed by parenthesis meant another thing. When calculators came along the conventions were changed and now we have two different scientific calculators coming up with two different answers because one of them follows a modern convention while the other follows a more ancient one. I am old school. The answer is 1 sonny.
Do we know where the concept of implicit multiplication being given higher priority over explicit multiplication or explicit division.
Are there any university level texts or engineering texts that document it with authority?
go here: http://www.quora.com/What-is-implied-multiplication
Think about how you would evaluate this: 8y ÷ 2x where y=1 and x=4
How is this any different than what is written in the original post?
Simplify 8/2(2+2).
Let’s put this nonsense to bed, shall we?
This expression is not ambiguous and not incorrectly written. It is a very simple and elementary arithmetical exercise. According to mathematical convention, there is only one correct answer. Here is the rule, from Elementary Algebra for Schools by Hall and Knight, London, 1906. Quote;
“Article 58. A coefficient placed before any bracket indicates that every term of the expression within the bracket is to be multiplied by that coefficient.”
That means x(y+z) = xy + xz. So applied to this exercise;
8/2(2+2) = 8/2(4) = 8/8 = 1
That is the only correct answer to this exercise. If you get a different one, you are wrong. If you do not understand this, go away and study elementary mathematics until you do.
Google gives this; (8/2)(2+2) = 16. Google is wrong.
Where is the rule that says you can take the coefficient of bracketed terms in a expression and shove it somewhere else? What kind of genius are you that breaks up a bracketed expression and distributes terms before the operation is completed – oh, say, over there somewhere? BODMAS? Modern usage as per YouTube? That’ll be BIGMESS.
I’m not revisiting this, answering any responses, or generally wasting my time on mind-numbing ignorance. If you are writing code with incorrect mathematical operations, you are the one who needs to revisit Elementary Algebra and not display your lack of understanding on the www.
Oh; and something about GCMs? Are you serious?
“
I learned math before hand calculators existed. In math textbooks division is shown by a line with the dividend above and the divisor below, not with the “divided by” sign, which is ambiguous. Of course anything in parentheses is calculated independently of the things outside it. This was understood, if not explicitly stated. The big hairy equations thus existed in two dimensions, not one, and were not linearly input into a calculator. This is the crux of this imagined “problem.”
I don’t understand how can this even be problem to argue.
It always was 16 and always will be 16.
Even all the presented calculators are able to do it correctly.
On the second calculator the expression presented is just different one. It is not equivalent notation.
If you put there the expression correctly it calculates 16.
And the third calculator is also able to calculate it correctly. It just don’t know implicit multiplication. If you use explicit it calculates 16.
And why is anybody talking about the brackets in this expression is beyond my understanding. Brackets have meaning for expression that is inside of them not the one outside. So they have absolutely no impact on that multiplication.
“If you put there the expression correctly it calculates 16.”
In other words if you rewrite the expression you get the answer you expect. That doesn’t make it the correct answer.