Author Topic: A warning to engineers about calculators  (Read 8564 times)

0 Members and 1 Guest are viewing this topic.

Offline Someone

  • Super Contributor
  • ***
  • Posts: 5186
  • Country: au
    • send complaints here
Re: A warning to engineers about calculators
« Reply #75 on: December 15, 2024, 08:51:06 pm »
I wonder, how long such threads would be, if people did read earlier posts. Maybe half of the messages would be avoided, if anybody noticed their claims are already addressed earlier? Who knows, who knows…
Oh? like yourself?
Perhaps it’s time for OP to simply admit the blunder? This thread becomes one of many, where a trivial issue receives pages of discussion, despite the subject got exhausted after a few posts.

On my Casio FX-991DE plus:
(…)
On Dreamcalc (PC calculator software), HiPER Calc Pro (Android calculator), Wolfram Alpha or most of the online calculators I tried:
(…)
This is just inconsistent if not silly.
Did the meaning of word “inconsistent” change recently? All calculators consistently give 8.1. Yet you call them inconsistent, instead of the single one, which acts different…

And this behavior is consistent with how the percent key on physical calculators usually worked,(1) and also how the percent sign is used in writing. “5 V ±10 %” is range [4.95, 5.05] (corrected) [4.5, 5.5] V, not [4.9, 5.1] V. If you thought different… maybe it’s time to check all your designs.
a) there is not only a single example of % being interpreted as a unary operator as you claim here, but if you read the thread and the replies it is one example of many.
b) 5V ±10% adds enough context for ambiguity to be removed, as the units of Volts is incompatible with unitless addition so the lack of units on the second value implies the % is dependent on something else. Contrast with "5V ±1% full scale" as a real world example.

A calculator which shows "9-10%" is showing two unitless numbers and a subtraction, no hint as to how that % should be interpreted. So it is not surprising that some different calculators interpret it differently. There is the commonly accepted consumer version, and the strict mathematical version, but what's missing from the consumer versions is clear documentation of what the operator is expected to do (still no one has provided reference to any mathematical rules of this consumer % operator).

Which is completely different to whatever key sequence could be entered to calculate the different interpretations, after the user has made their own (as shown differing) interpretation.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #76 on: December 15, 2024, 09:50:17 pm »
what's missing from the consumer versions is clear documentation of what the operator is expected to do (still no one has provided reference to any mathematical rules of this consumer % operator)

I don't think it's missing. I think it's a matter of reading the manual. For example, here is the user guide for a family of Casio calculators:

 
The following users thanked this post: Someone, thm_w, MK14

Offline Someone

  • Super Contributor
  • ***
  • Posts: 5186
  • Country: au
    • send complaints here
Re: A warning to engineers about calculators
« Reply #77 on: December 15, 2024, 10:22:27 pm »
what's missing from the consumer versions is clear documentation of what the operator is expected to do (still no one has provided reference to any mathematical rules of this consumer % operator)
I don't think it's missing. I think it's a matter of reading the manual. For example, here is the user guide for a family of Casio calculators:
You're missing the distinction that is half of the "argument" people are throwing around.

Pressing keys on a calculator is not the same as what's written.

Is that example (of button sequences) from a calculator which shows a text representation on the screen? Does it show "9-10%" above/beside the result?

Despite that I'm not sure some examples from a user guide fully explain how that % operator works and its rules. What happens when it is included in the middle of several operators? what is its precedence? how is unary vs binary decided? The argument is mostly about how do you take what can be readily done with some button sequences on a calculator and represent that unambiguously to the user. % always as unary with high precedence achieves that, but isn't what most people expect from the % operator.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #78 on: December 16, 2024, 12:42:47 am »
Pressing keys on a calculator is not the same as what's written.

Yes, but I don't think there is any standard interpretation of the percent sign when writing text in a text window, other than the engineering interpretation of it being a unit of measure. In mathematical terms, 57% means the fraction 57/100 or 0.57. That's basically it.

To go beyond that, you can look at the syntax of programming languages, which is usually specified with extreme precision. But in many programming languages, the % symbol is used as the modulo operator, nothing to do with percentages.

In a calculator, the vendor is free to choose whatever behavior and meaning they wish, whatever they think is useful. As a user of a particular calculator you have to read the manual to find out how the % function works. And if you don't like the choice made by a particular vendor, you have to pick a different calculator. There are lots out there to choose from.
« Last Edit: December 16, 2024, 12:44:35 am by IanB »
 
The following users thanked this post: Someone

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 21461
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #79 on: December 16, 2024, 08:53:59 am »
Pressing keys on a calculator is not the same as what's written.

Yes, but I don't think there is any standard interpretation of the percent sign when writing text in a text window, other than the engineering interpretation of it being a unit of measure. In mathematical terms, 57% means the fraction 57/100 or 0.57. That's basically it.

To go beyond that, you can look at the syntax of programming languages, which is usually specified with extreme precision. But in many programming languages, the % symbol is used as the modulo operator, nothing to do with percentages.

In a calculator, the vendor is free to choose whatever behavior and meaning they wish, whatever they think is useful. As a user of a particular calculator you have to read the manual to find out how the % function works. And if you don't like the choice made by a particular vendor, you have to pick a different calculator. There are lots out there to choose from.

That's pretty much the case.

I've already given examples of "non-standard" +,-,*,/,= keys. And, of course, there are two interpretations of 1+2*3 in common use.

There are also many calculators that have functions important to specific industries. One variant of my calculator has "cosine squared" and "sine multiplied by cosine", which is apparently useful in surveying.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3580
  • Country: it
Re: A warning to engineers about calculators
« Reply #80 on: December 16, 2024, 09:24:24 am »
I've been in contact with the developer and they're claiming that's the correct way of doing percentages.

it is! have you ever used the 4 operation + % calculators everybody except us uses (because we use scientific calculators)?
 
The following users thanked this post: MK14

Offline Tation

  • Regular Contributor
  • *
  • Posts: 108
  • Country: pt
Re: A warning to engineers about calculators
« Reply #81 on: December 16, 2024, 09:38:05 am »
I think that the final conclusion about "A warning to engineers about calculators" is: read the manual!
 
The following users thanked this post: Someone, thm_w, tggzzz, DimitriP, MK14

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3401
  • Country: gb
Re: A warning to engineers about calculators
« Reply #82 on: December 17, 2024, 09:38:39 pm »
No. The Casio calculator shows 8.9, the correct value.

No, this is one possible interpretation of the sequence of inputs you provided.  There is an alternative interpretation that is equally correct, as many examples in this thread have shown.
 
The following users thanked this post: thm_w, MK14

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 7654
  • Country: ca
  • Non-expert
Re: A warning to engineers about calculators
« Reply #83 on: December 17, 2024, 10:32:51 pm »
If I say 'ten minus ten percent' I mean that ten percent is off from ten.
So 5 + 5 - 10% should be 9.

I've never trusted calculators % calculations.
Usually it seems to be 5 + 5 = a; a - a * 0.1 = result.

Use parenthesis if you want that result (5 + 5) - 10%

English is not a good representation, "five plus five squared". Is that 5+52 or (5+5)2? Who knows. Has to be written out or explained in extreme detail.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1426
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: A warning to engineers about calculators
« Reply #84 on: December 17, 2024, 10:55:33 pm »
No. The Casio calculator shows 8.9, the correct value.

No, this is one possible interpretation of the sequence of inputs you provided.  There is an alternative interpretation that is equally correct, as many examples in this thread have shown.


Always follow manufacturers instructions.


   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 
The following users thanked this post: MK14

Offline Analog Kid

  • Super Contributor
  • ***
  • Posts: 1328
  • Country: us
Re: A warning to engineers about calculators
« Reply #85 on: December 18, 2024, 02:32:59 am »
Too many people seriously believe 1+2*3 is 9.

(1+2)*3 = 9
1+(2*3) = 7

But then you must have known that you were posting an ambiguous expression, absent any stated rules of precedence. (I don't believe there are any such implicit rules for an arbitrary expression posted on an Internet forum.)
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 3315
  • Country: gb
Re: A warning to engineers about calculators
« Reply #86 on: December 18, 2024, 02:41:23 am »
Quote
absent any stated rules of precedence
bodmas
 

Offline Analog Kid

  • Super Contributor
  • ***
  • Posts: 1328
  • Country: us
Re: A warning to engineers about calculators
« Reply #87 on: December 18, 2024, 02:47:25 am »
Never hoid of that before this.
So "BODMAS" gets you 7 here.
I'll have to remember that.
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1393
  • Country: au
Re: A warning to engineers about calculators
« Reply #88 on: December 18, 2024, 02:52:54 am »
I used to get these kind of videos in my YouTube recommendations algorithm, but now I no longer get these random math trivia in my recommendations anymore (from any creator, not just this one), even though my browsing has remained the same:

« Last Edit: December 18, 2024, 02:54:42 am by Andy Chee »
 
The following users thanked this post: shabaz

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 611
Re: A warning to engineers about calculators
« Reply #89 on: December 18, 2024, 03:49:32 am »
I used to get these kind of videos in my YouTube recommendations algorithm

Interesting video, but despite there being operator precedence rules, and despite that guy in the video possibly being right on a technicality (I'm not 100% sure; been ages since I studied maths, and maybe that fell under the 'Of' in BODMAS despite what Wikipedia says - no idea. From memory, I don't recall the 'Of' in BODMAS meaning what Wikipedia says it does, but I don't have a textbook at hand to know for sure), nevertheless, I think if anything he could only be right in an exam. I wouldn't trust him with an actual formula in real life, if he just assumed like that.

In real life, there's a very high chance he would be wrong if he relied on that, because just seeing that ought to have made him question the actual intent of the person who wrote it. He shouldn't just assume that whoever wrote it like that, actually meant for the result to come out to what he believes it does.

Ordinarily, just seeing something so intimate next to parenthesis makes one think if the author actually meant that portion to override, so it would be right to question it, or at least try out both ways, and see which one gives a value closer to what you estimate the result should be (i.e. rely on context and don't assume everyone will understand operator precedence rules or be perfect in their execution of them). There are plenty of mistakes in papers, one has to do a dry run with formulas with known input/output to see if it approximately agrees with reality, or if there's an error in the document.

If I try that on my Casio calculator (fx-CG50), when I press EXE, it actually inserts extra parenthesis for me, giving the opposite result to what that guy in the video mentions is correct. And, intuitively, if I had seen that written, mentally I too would have assumed that author intended for the right side to be multiplied first too, i.e. I would have come up with a result of 1. (But I would have been aware that possibly the result may be 16, i.e. time to now look beyond that and see which result actually makes sense, e.g. by looking elsewhere).
« Last Edit: December 18, 2024, 04:08:24 am by shabaz »
 
The following users thanked this post: Someone

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 21461
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #90 on: December 18, 2024, 10:34:30 am »
In response to
Quote
absent any stated rules of precedence
bodmas
you wrote
Never hoid of that before this.
So "BODMAS" gets you 7 here.
I'll have to remember that.

Never been taught BODMAS or one of the equivalents?

That illustrates how difficult it is to follow your suggestion "Math? Yes, obviously; but tailored to the student's level." in your post https://www.eevblog.com/forum/beginners/show-us-your-recommended-electronics-curriculum-for-beginners/msg5747835/#msg5747835

It also helps us realise why you find Ebers-Moll a problem "(Please, please, no Ebers-Moll! that stuff gives me a headache.)" in your post https://www.eevblog.com/forum/beginners/show-us-your-recommended-electronics-curriculum-for-beginners/msg5747835/#msg5747835
« Last Edit: December 18, 2024, 10:37:22 am by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: nl
Re: A warning to engineers about calculators
« Reply #91 on: December 18, 2024, 11:13:16 am »
Ah it is a question of which rules are vouque.
I've learned the old way, typing it in my HP calc (a HP41CX) gives me one.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 21461
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #92 on: December 18, 2024, 12:11:13 pm »
Ah it is a question of which rules are vouque.
I've learned the old way, typing it in my HP calc (a HP41CX) gives me one.

Arithmetic rules of precedence are not a fashion accessory.

Arithmetic operations have well-defined associative properties and commutative properties. https://en.wikipedia.org/wiki/Commutative_property https://en.wikipedia.org/wiki/Associative_property
The order of arithmetic operations follows from those.

If you want to rewrite mathematics, be our guest. But make very sure you unambiguously state your rules and justify them.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: nl
Re: A warning to engineers about calculators
« Reply #93 on: December 18, 2024, 12:27:26 pm »
I have a degree in math and published results.
In the wiki order of operations there is a special paragraph "Mixed division and multiplication" stating (bold is from my hand)

There is no universal convention for interpreting an expression containing both division denoted by '÷' and multiplication denoted by '×'. Proposed conventions include assigning the operations equal precedence and evaluating them from left to right, or equivalently treating division as multiplication by the reciprocal and then evaluating in any order;[10] evaluating all multiplications first followed by divisions from left to right; or eschewing such expressions and instead always disambiguating them by explicit parentheses.


and a special text  regarding precisely the 8:2(2+2):

"Several commenters appear to be using a different (and more sophisticated) convention than the elementary PEMDAS convention I described in the article. In this more sophisticated convention, which is often used in algebra, implicit multiplication (also known as multiplication by juxtaposition) is given higher priority than explicit multiplication or explicit division (in which one explicitly writes operators like × * / or ÷). Under this more sophisticated convention, the implicit multiplication in 2(2 + 2) is given higher priority than the explicit division implied by the use of ÷. That’s a very reasonable convention, and I agree that the answer is 1 if we are using this sophisticated convention.



I was referring to the maker of the video who stresses the words nowadays, modern interpretation.
I' have no intend to rewrite mathematics.

Maybe this article with the conclusion
The bottom line is that “order of operations” conventions are not universal truths in the same way that the sum of 2 and 2 is always 4. Conventions evolve throughout history in response to cultural and technological shifts. Meanwhile, those ranting online about gaps in U.S. math education and about the “right” answer to these intentionally ambiguous math problems might be, ironically, missing a bigger point.

“To my mind,” says Grabiner, “the major deficit in U.S. math education is that people think math is about calculation and formulas and getting the one right answer, rather than being about exciting ideas that cut across all sorts of intellectual categories, clear and logical thinking, the power of abstraction and a language that lets you solve problems you’ve never seen before.” Even if that language, like any other, can be a bit ambiguous sometimes.

is a valuable thing to read

Ah it is a question of which rules are vouque.
I've learned the old way, typing it in my HP calc (a HP41CX) gives me one.

Arithmetic rules of precedence are not a fashion accessory.

Arithmetic operations have well-defined associative properties and commutative properties. https://en.wikipedia.org/wiki/Commutative_property https://en.wikipedia.org/wiki/Associative_property
The order of arithmetic operations follows from those.

If you want to rewrite mathematics, be our guest. But make very sure you unambiguously state your rules and justify them.
« Last Edit: December 18, 2024, 12:37:35 pm by RAPo »
 
The following users thanked this post: Someone

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 21461
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #94 on: December 18, 2024, 01:24:05 pm »
I have a degree in math and published results.

I have a degree in electronics and several patents. I don't fall into the trap of thinking I know everything about electronics, nor that everything I write about electronics is correct.

Quote
In the wiki order of operations there is a special paragraph "Mixed division and multiplication" stating (bold is from my hand)

There is no universal convention for interpreting an expression containing both division denoted by '÷' and multiplication denoted by '×'. Proposed conventions include assigning the operations equal precedence and evaluating them from left to right, or equivalently treating division as multiplication by the reciprocal and then evaluating in any order;[10] evaluating all multiplications first followed by divisions from left to right; or eschewing such expressions and instead always disambiguating them by explicit parentheses.


Of course that's not relevant to the example 1+2*3.


Quote

and a special text  regarding precisely the 8:2(2+2):

"Several commenters appear to be using a different (and more sophisticated) convention than the elementary PEMDAS convention I described in the article. In this more sophisticated convention, which is often used in algebra, implicit multiplication (also known as multiplication by juxtaposition) is given higher priority than explicit multiplication or explicit division (in which one explicitly writes operators like × * / or ÷). Under this more sophisticated convention, the implicit multiplication in 2(2 + 2) is given higher priority than the explicit division implied by the use of ÷. That’s a very reasonable convention, and I agree that the answer is 1 if we are using this sophisticated convention.


What does the colon in "8:2(2+2)" mean?

Of course that's not relevant to the example 1+2*3.

Quote
I was referring to the maker of the video who stresses the words nowadays, modern interpretation.
I' have no intend to rewrite mathematics.

Maybe this article with the conclusion
The bottom line is that “order of operations” conventions are not universal truths in the same way that the sum of 2 and 2 is always 4. Conventions evolve throughout history in response to cultural and technological shifts. Meanwhile, those ranting online about gaps in U.S. math education and about the “right” answer to these intentionally ambiguous math problems might be, ironically, missing a bigger point.

“To my mind,” says Grabiner, “the major deficit in U.S. math education is that people think math is about calculation and formulas and getting the one right answer, rather than being about exciting ideas that cut across all sorts of intellectual categories, clear and logical thinking, the power of abstraction and a language that lets you solve problems you’ve never seen before.” Even if that language, like any other, can be a bit ambiguous sometimes.

is a valuable thing to read

There's some truth there.

Associative and commutative properties have been shown to be very useful and are accepted for arithmetic. That leads to BODMAS, which could equally well be written BOMDSA, but that acronym isn't as easy to say/remember.

Nobody should fall into the trap of confusing computer languages with arithmetic; they have their own evaluation orders.

For amusement, you could look at APL; at https://tryapl.org/ try typing in each of these expressions, and explain the results :)
      7 - 7
      7 - 7 - 7
      7 - 7 - 7 - 7
      7 - 7 - 7 - 7 - 7
« Last Edit: December 18, 2024, 01:55:15 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Analog Kid

  • Super Contributor
  • ***
  • Posts: 1328
  • Country: us
Re: A warning to engineers about calculators
« Reply #95 on: December 19, 2024, 12:13:20 am »
In response to
Quote
absent any stated rules of precedence
bodmas
you wrote
Never hoid of that before this.
So "BODMAS" gets you 7 here.
I'll have to remember that.

Never been taught BODMAS or one of the equivalents?

Nope, never been taught that. How 'bout that?
And I'm not going to bother answering the rest of your fucking scurrilous post.
I believe what you did there is called "shooting the messenger", or poisoning the well, or some other well-known fraudulent argumentation technique.
« Last Edit: December 19, 2024, 04:42:30 am by Analog Kid »
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 1393
  • Country: au
Re: A warning to engineers about calculators
« Reply #96 on: December 19, 2024, 04:07:46 am »
What does the colon in "8:2(2+2)" mean?
In context, I think it's just a placeholder for the classical divide operator symbol (instead of slash), whose unicode I do not recall.
 

Offline DimitriP

  • Super Contributor
  • ***
  • Posts: 1426
  • Country: us
  • "Best practices" are best not practiced.© Dimitri
Re: A warning to engineers about calculators
« Reply #97 on: December 19, 2024, 06:26:56 am »
Quote
Arithmetic rules of precedence are not a fashion accessory.
   :-+
That's T-Shirt worthy !!!   

As for
Quote
“To my mind,” says Grabiner, “the major deficit in U.S. math education is that people think math is about calculation and formulas and getting the one right answer, rather than being about exciting ideas that cut across all sorts of intellectual categories, clear and logical thinking, the power of abstraction and a language that lets you solve problems you’ve never seen before.” Even if that language, like any other, can be a bit ambiguous sometimes.
    :palm:



   If three 100  Ohm resistors are connected in parallel, and in series with a 200 Ohm resistor, how many resistors do you have? 
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #98 on: December 19, 2024, 07:15:05 am »
Never been taught BODMAS or one of the equivalents?

Nope, never been taught that. How 'bout that?

Just in case anyone is baffled by differences between math and maths on each side of the pond, BODMAS in Britain is usually taught as PEMDAS in the USA.

You have "Brackets, Orders, Division and Multiplication, Addition and Subtraction" vs "Parentheses, Exponents, Multiplication and Division, Addition and Subtraction".

Though it has to be said this is usually applied in the context of algebra, when evaluating a formula such as:
$$y=ax^2+bx+c$$
It is fundamental that you evaluate \$x^2\$ before multiplying by \$a\$, and before adding \$bx\$ to this.

Applying it to simple arithmetic is not really the point.
 

Offline Analog Kid

  • Super Contributor
  • ***
  • Posts: 1328
  • Country: us
Re: A warning to engineers about calculators
« Reply #99 on: December 19, 2024, 07:24:30 am »
I still have my algebra textbook (from college, not high school).
Algebra and Trigonometry: A Functions Approach, Keedy & Bittinger, 1975

I just had a look through it. Nothing, not a single word, about operator precedence, "BODMAS", "PEDMAS", none of that.
« Last Edit: December 19, 2024, 08:55:07 pm by Analog Kid »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf