Author Topic: EEVblog 1479 - Is Your Calculator WRONG?  (Read 13480 times)

0 Members and 1 Guest are viewing this topic.

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37728
  • Country: au
    • EEVblog
EEVblog 1479 - Is Your Calculator WRONG?
« on: June 15, 2022, 07:11:04 am »
Is your calculator WRONG? It could be!
Looking at the issue of implied multiplication and how it can affect your calculations. Why do some Casio and TI calculators give a different result to others? And why do they differ from your phone calculator, google calculator, or Wolfram Alpha?
How Order of Operations matters.

 
The following users thanked this post: SeanB, SilverSolder, Scherms

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3748
  • Country: ca
  • Living the Dream
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #1 on: June 15, 2022, 07:43:50 am »
As someone in the comments mentioned try Hiper Scientific Calculator or Hiper Calc Pro. Then you can pick which you'd prefer :)

It will even give a pop-up the first time you enter the expression asking which you want.
VE7FM
 
The following users thanked this post: EEVblog

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: ro
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #2 on: June 15, 2022, 08:10:06 am »
The expressions to evaluate shown in the video thumbnail are not the same (pocket calculator screen vs. the Wolfram webpage), notice the extra parentheses in the calculator's LCD.

Online wraper

  • Supporter
  • ****
  • Posts: 16844
  • Country: lv
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #3 on: June 15, 2022, 08:36:36 am »
The expressions to evaluate shown in the video thumbnail are not the same (pocket calculator screen vs. the Wolfram webpage), notice the extra parentheses in the calculator's LCD.
Thanks Captain Obvious. However if you watched the video for at least a few minutes, you would know why.
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: ro
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #4 on: June 15, 2022, 08:56:48 am »
The expressions to evaluate shown in the video thumbnail are not the same (pocket calculator screen vs. the Wolfram webpage), notice the extra parentheses in the calculator's LCD.
Thanks Captain Obvious. However if you watched the video for at least a few minutes, you would know why.

Thanks, Captain Smart Ass.  That was feedback for Dave.  The big red "Oops" button suggests there's something wrong with that result, though the thumbnail does not capture any unexpected results, so the thumbnail won't incite one to watch the video.
 
The following users thanked this post: Someone, grythumn

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16276
  • Country: za
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #5 on: June 15, 2022, 08:58:06 am »
Yes, and a good reason to actually teach how to do basic mathematics without using a calculator, so the pupils actually learn that the calculations work on certain assumptions, and that merely using a calculator is not always going to be definitely right. You really need to know how the operations take place before you just use a calculator, so I often will do some form of paper based calculation for simple things, to keep the memory fresh. Easiest is to work out VAT in your head, as that can be reasonably simple to do, just using simple addition and shifting digits for the division side. That or simple resistors in parallel, or to calculate the value needed to drive a LED at some specific current.
 
The following users thanked this post: EEVblog

Offline Cnoob

  • Regular Contributor
  • *
  • Posts: 132
  • Country: gb
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #6 on: June 15, 2022, 08:59:52 am »
The HP prime in Textbook entry mode gives the answer correctly as 1.
In Algebraic entry mode gives the answer 9.
 
The following users thanked this post: RAPo

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37728
  • Country: au
    • EEVblog
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #7 on: June 15, 2022, 11:09:48 am »
The expressions to evaluate shown in the video thumbnail are not the same (pocket calculator screen vs. the Wolfram webpage), notice the extra parentheses in the calculator's LCD.

Yes I know, it wouldn't let me get that shot without the calculator changing it.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37728
  • Country: au
    • EEVblog
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #8 on: June 15, 2022, 11:22:06 am »
Thanks, Captain Smart Ass.  That was feedback for Dave.  The big red "Oops" button suggests there's something wrong with that result, though the thumbnail does not capture any unexpected results, so the thumbnail won't incite one to watch the video.

You watched it.
I just Irfanviewed the thumbnail, better now?
 

Online RoGeorge

  • Super Contributor
  • ***
  • Posts: 6183
  • Country: ro
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #9 on: June 15, 2022, 12:18:13 pm »
Perfect now, IMHO.  :-+

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3035
  • Country: us
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #10 on: June 15, 2022, 06:33:15 pm »
Now that I'm aware of this difference I think I like the Classwiz way of handling implied multiplication. For instance, it makes it more convenient to enter a complicated denominator.

fwiw, SpeedCrunch also evaluates "6/2(2+1)" as 1.
 

Offline armandine2

  • Frequent Contributor
  • **
  • Posts: 596
  • Country: gb
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #11 on: June 15, 2022, 08:27:08 pm »
fwiw - The TI-nspire CX II-T CAS looks ok
Funny, the things you have the hardest time parting with are the things you need the least - Bob Dylan
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14440
  • Country: fr
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #12 on: June 15, 2022, 08:32:12 pm »
When I saw the title, I thought, "cool, maybe some interesting rounding issues", then I saw the first image of the video and immediately thought "oh no, not that again!".
And sure enough, it was "that" again. *Sighs*
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7938
  • Country: us
  • Retired, now restoring antique test equipment
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #13 on: June 15, 2022, 09:40:11 pm »
I am a die-hard RPN user.  (I first learned symbolic logic using "forward" Łukasiewicz notation.)
When proselytizing engineers, I watched them use their algebraic calculators and realized that they found it too difficult to keep the () organized, and either used storage (memory) locations or even Post-It notes for intermediate results.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #14 on: June 15, 2022, 09:53:15 pm »
Order of operations is over-simplified for school children. It gets more subtle in the real world.

For instance, in the real world of mathematics and engineering, adjacent terms bind more tightly than operators. Therefore a/bc is understood to be \$\frac{a}{bc}\$

Similarly, 6/2(2+1) would be read as \$\frac{6}{2(2+1)}\$

If there is any possibility of misinterpretation, then parentheses or formatting should be used to make the intention clear. Nobody should be playing games with readers in professional documents.
 
The following users thanked this post: CatalinaWOW, Scherms

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 7938
  • Country: us
  • Retired, now restoring antique test equipment
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #15 on: June 15, 2022, 11:01:53 pm »
Order of operations is over-simplified for school children. It gets more subtle in the real world.

For instance, in the real world of mathematics and engineering, adjacent terms bind more tightly than operators. Therefore a/bc is understood to be \$\frac{a}{bc}\$

Similarly, 6/2(2+1) would be read as \$\frac{6}{2(2+1)}\$

If there is any possibility of misinterpretation, then parentheses or formatting should be used to make the intention clear. Nobody should be playing games with readers in professional documents.

When in doubt, add parantheses and brackets as required to avoid mis-interpretation.  The conventional order is { [ (  ) ] } .
 

Offline ve7vie

  • Newbie
  • Posts: 9
  • Country: ca
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #16 on: June 16, 2022, 03:38:08 am »
I have a fx-991ES PLUS C, and it gives 1 as the answer for 6/2(2+1). The calculator was bought in Canada.  So does my CG10, which shows the parens it adds. Both machines give 9 for 6/2x(2+1). But my CG500 gives a syntax error without the x. No implication allowed!
 

Offline ve7vie

  • Newbie
  • Posts: 9
  • Country: ca
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #17 on: June 16, 2022, 03:51:51 am »
That's why I always programmed in APL. The only rule is right-to-left precedence.
 
The following users thanked this post: WN1X

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6234
  • Country: fi
    • My home page and email address
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #18 on: June 16, 2022, 11:50:31 am »
Is it an error that in general, the order of precedence for implicit multiplication is not well defined?  I don't think so.

Order of precedence in general is one of those things like the "I before E except after C" 'rule' in English.  Albeit it sounds good, it does not seize the crux of the matter.  In other words, the only problem here is that people are told that a rule exists, when it really is not a reliable rule at all.

Parentheses work, and should be used to indicate the order of precedence, unless an order has already been agreed upon.  The one taught at school is only a common one, not "the" only one used.  Calculators are a perfect example of this.

Personally, I would have emphasized more the fact that the conventions vary – not just US vs. the rest of the Western world.  That it is a convention and not really a rule at all.  Therefore, it's just one of those things that change from calculator/environment/programming language to the next, and can bite one in the ass if one assumes too much without checking the assumptions first.
« Last Edit: June 16, 2022, 11:52:42 am by Nominal Animal »
 
The following users thanked this post: SiliconWizard

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9007
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #19 on: June 16, 2022, 11:44:48 pm »
(Some) Casio calculators are weird.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 
The following users thanked this post: SeanB

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #20 on: June 17, 2022, 08:16:52 pm »
If that calculator feature will ruin your day, don't look up the Excel quirks!

And use reverse polish notation. ;)
6 2 2 1 + × ÷

Edit. Ps.
Or if you prefer nine
6 2 ÷ 2 1 + ×

...what about square root of negative number, how many insist that it doesn't have roots?

What about elementary math answer as two for square root of 4 .... where the negative plain did go to hide? Maybe it is only on paraboloid solving formula, hmmm.....
« Last Edit: June 17, 2022, 08:42:15 pm by Vtile »
 
The following users thanked this post: bd139, RAPo

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23018
  • Country: gb
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #21 on: June 17, 2022, 08:25:40 pm »
If that calculator feature will ruin your day, don't look up the Excel quirks!

And use reverse polish notation. ;)
6 2 2 1 + × ÷

No truer things said on the internet.

I know a company that did their economic projection modelling on Excel and due to an actual bug in regression modelling lost a lot of money. Microsoft know it exists and won't fix it because it might break millions of spreadsheets worldwide.

And yes, RPN, because the input is never ambiguous. I'm actually writing an RPL-ish calculator...

Code: [Select]
$ echo "eng in in inv swap inv + inv out" > prog
$ echo "12e3 12e3" | ./pec prog
6e3

This is part of a streaming programming environment I am trying to build out as a commercial product.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #22 on: June 17, 2022, 08:37:38 pm »
It's not RPN, it's NPR: "Notation, Polish, Reverse"  :)
 
The following users thanked this post: JohnG, bd139

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #23 on: June 17, 2022, 08:42:39 pm »
It's not RPN, it's NPR: "Notation, Polish, Reverse"  :)
:D
 
The following users thanked this post: bd139

Offline Vtile

  • Super Contributor
  • ***
  • Posts: 1144
  • Country: fi
  • Ingineer
Re: EEVblog 1479 - Is Your Calculator WRONG?
« Reply #24 on: June 17, 2022, 09:02:43 pm »
Kind of amusing thing is that with rigorous interpretation of PODMAS you get 9 and with rigorous interpretation of BEMDAS you get 1. That is if you do not give juxtaposition any weight.

6÷(2+1)2 ???
« Last Edit: June 17, 2022, 09:08:27 pm by Vtile »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf