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

0 Members and 1 Guest are viewing this topic.

Offline Mahagam

  • Regular Contributor
  • *
  • Posts: 60
  • Country: pl
Re: A warning to engineers about calculators
« Reply #100 on: December 19, 2024, 09:41:54 am »
The same application, the same expression. Just two different modes. And two different results. Where is my *trollface* smile icon?
 
The following users thanked this post: Someone, halfwave, RAPo

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 #101 on: December 19, 2024, 10:44:08 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.

I'm not surprised a university textbook doesn't mention operator precedence: it would be assumed that you had previously been taught it and understood it.

We were taught that at 11yo, since it is a fundamental prerequsite for doing any and all basic algebraic manipulations. By basic I'm thinking of factorisation such as 3y2+12y = 3y(y+4)

Discussing operator precedence in the context of the book's title would be like a university chemistry textbook discussing the difference between atoms, molecules, mixtures, compounds.
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 tggzzz

  • Super Contributor
  • ***
  • Posts: 21461
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #102 on: December 19, 2024, 10:50:03 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.

Ah. Bizarre and unnecessary substitution.

Makes me think of the way Humpty Dumpty used the symbol "glory" (which was, of course, written by the mathematician Lewis Carroll).
« Last Edit: December 19, 2024, 10:53:14 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
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: gb
    • Electronic controls
Re: A warning to engineers about calculators
« Reply #103 on: December 19, 2024, 12:29:03 pm »
Even the big boys get it wrong sometimes.
I remember many years ago Intel had a calculation bug in a processor.
If the answer was 65535 it gave answer -1.

 

Offline MK14

  • Super Contributor
  • ***
  • Posts: 5015
  • Country: gb
Re: A warning to engineers about calculators
« Reply #104 on: December 19, 2024, 12:51:32 pm »
Even the big boys get it wrong sometimes.
I remember many years ago Intel had a calculation bug in a processor.
If the answer was 65535 it gave answer -1.

I don't remember, any such bug.  Unless you were referring to a divide bug, on the earliest Pentiums.

65535 in (very old versions of) Excel, apparently can cause it to show the wrong value (100,000), found by me, using Search and/or AI (ChatGPT or similar).

https://www.joelonsoftware.com/2007/09/26/explaining-the-excel-bug/
 

Online nfmax

  • Super Contributor
  • ***
  • Posts: 1627
  • Country: gb
Re: A warning to engineers about calculators
« Reply #105 on: December 19, 2024, 01:12:02 pm »
The warning to engineers must surely be: ‘Know Your Tools’. A calculators is a tool like any other. Check, don’t assume
 
The following users thanked this post: MK14, RAPo

Online RAPo

  • Frequent Contributor
  • **
  • Posts: 904
  • Country: nl
Re: A warning to engineers about calculators
« Reply #106 on: December 19, 2024, 02:01:27 pm »

I think Nigel was referring to the FDIV bug. in the Pentium processor.
65535<->-1 is indeed more excel like.
Even the big boys get it wrong sometimes.
I remember many years ago Intel had a calculation bug in a processor.
If the answer was 65535 it gave answer -1.

I don't remember, any such bug.  Unless you were referring to a divide bug, on the earliest Pentiums.

65535 in (very old versions of) Excel, apparently can cause it to show the wrong value (100,000), found by me, using Search and/or AI (ChatGPT or similar).

https://www.joelonsoftware.com/2007/09/26/explaining-the-excel-bug/
 
The following users thanked this post: MK14

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 #107 on: December 19, 2024, 02:41:24 pm »
The warning to engineers must surely be: ‘Know Your Tools’. A calculators is a tool like any other. Check, don’t assume

Just so.

A variant of that (one of the two mottos that I think are worth repeating) is "trust, but verify".

Applies to non-engineers too, but engineers don't have an excuse :)
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 #108 on: December 19, 2024, 08:57:30 pm »
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.

I'm not surprised a university textbook doesn't mention operator precedence: it would be assumed that you had previously been taught it and understood it.

We were taught that at 11yo, since it is a fundamental prerequsite for doing any and all basic algebraic manipulations. By basic I'm thinking of factorisation such as 3y2+12y = 3y(y+4)

Well, I can assure you that the topic never came up in high-school algebra class either. (I took the college course as a refresher.) Maybe things are different over there in the UK.
« Last Edit: December 19, 2024, 08:59:02 pm by Analog Kid »
 

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 #109 on: December 19, 2024, 09:07:42 pm »
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.

I'm not surprised a university textbook doesn't mention operator precedence: it would be assumed that you had previously been taught it and understood it.

We were taught that at 11yo, since it is a fundamental prerequsite for doing any and all basic algebraic manipulations. By basic I'm thinking of factorisation such as 3y2+12y = 3y(y+4)

Well, I can assure you that the topic never came up in high-school algebra class either. (I took the college course as a refresher.) Maybe things are different over there in the UK.

If it wasn't taught, how could you proceed to understand and then do factorisation?
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 #110 on: December 19, 2024, 09:16:31 pm »
Well, I can assure you that the topic never came up in high-school algebra class either. (I took the college course as a refresher.) Maybe things are different over there in the UK.

If it wasn't taught, how could you proceed to understand and then do factorisation?

Wellll, it was quite a few years decades ago, so memory is a little fuzzy: I'm guessing we were taught to do multiplication and division before addition and subtraction, but I think that was about it. Never heard any mnemonics like BODMAS back then. (Would have been helpful for sure, like "Roy G. Biv" which I do remember from back then.)
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 3315
  • Country: gb
Re: A warning to engineers about calculators
« Reply #111 on: December 19, 2024, 11:27:51 pm »
Quote
Never heard any mnemonics like BODMAS back then
we had it drummed into us around the same time we learned that some old horses can always hear there owners approach
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #112 on: December 19, 2024, 11:55:14 pm »
Wellll, it was quite a few years decades ago, so memory is a little fuzzy: I'm guessing we were taught to do multiplication and division before addition and subtraction, but I think that was about it. Never heard any mnemonics like BODMAS back then. (Would have been helpful for sure, like "Roy G. Biv" which I do remember from back then.)

Yeah, it was quite a few decades ago for me too, and I don't remember any mnemonics at that time either. BODMAS, PEMDAS, they seem to be new-fangled things that only became apparent in the Internet age. I do remember SOHCAHTOA though.

However, the order of operations, where you do powers first, then multiplication, then addition, was an elementary thing taught in the very first algebra class. It was about the second thing taught after the introduction of using letters to represent numbers.
 
The following users thanked this post: RAPo

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 7654
  • Country: ca
  • Non-expert
Re: A warning to engineers about calculators
« Reply #113 on: December 20, 2024, 12:34:58 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.

https://archive.org/details/algebraandtrigon033520mbp/page/n37/mode/2up
Quote
ORDER OF FUNDAMENTAL OPERATIONS
Parentheses and other symbols of grouping are useful in indicating which operation is to be performed first. We have used them in this way from the outset. In order to avoid using them unnecessarily, as has been already pointed out, the convention is adopted to perform all multiplications first and then the additions (or subtractions). If two or more of these symbols of grouping are used in the same expression, we usually (though not necessarily) remove the innermost pair of symbols first.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5621
  • Country: us
Re: A warning to engineers about calculators
« Reply #114 on: December 20, 2024, 01:14:28 am »
As the prior example from APL demonstrates there is a big difference between being canonically correct and being clear.

Yes, everyone should be familiar with the formal order of operations.  But as the huge number of "trick" presentations floating around the internet demonstrates a completely correct expression can be far from clear.  It may require some extra characters, maybe even some typesetting, but it is always worth making your intentions clear and correct.
 
The following users thanked this post: Someone

Offline Analog Kid

  • Super Contributor
  • ***
  • Posts: 1328
  • Country: us
Re: A warning to engineers about calculators
« Reply #115 on: December 20, 2024, 01:45:12 am »
Well then, if one is truly interested in accurately showing a math expression, then one should use parentheses (not "brackets"--brackets are [ ] { }) to make the order of operations perfectly clear, yes?

Or you could not do that and just browbeat anyone who misinterprets it.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #116 on: December 20, 2024, 04:20:31 am »
Well then, if one is truly interested in accurately showing a math expression, then one should use parentheses (not "brackets"--brackets are [ ] { }) to make the order of operations perfectly clear, yes?

Only when needed. Not always (or often).

For example, given a matrix
$$A = \begin{bmatrix}a & b \\ c & d\end{bmatrix}$$
then the determinant is given by
$$|A|=ad-bc$$
Everyone universally knows how to read this, and it is not necessary, even ugly, to write:
$$|A|=(ad)-(bc)$$
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #117 on: December 20, 2024, 04:26:25 am »
But as the huge number of "trick" presentations floating around the internet demonstrates a completely correct expression can be far from clear.

Well then, if one is truly interested in accurately showing a math expression, then one should use parentheses (not "brackets"--brackets are [ ] { }) to make the order of operations perfectly clear, yes?

In the case of those "trick" questions, then absolutely, yes. But then they wouldn't be trick questions anymore, and the trolling impact would be lost.
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5621
  • Country: us
Re: A warning to engineers about calculators
« Reply #118 on: December 20, 2024, 06:09:34 am »
Well then, if one is truly interested in accurately showing a math expression, then one should use parentheses (not "brackets"--brackets are [ ] { }) to make the order of operations perfectly clear, yes?

Only when needed. Not always (or often).

For example, given a matrix
$$A = \begin{bmatrix}a & b \\ c & d\end{bmatrix}$$
then the determinant is given by
$$|A|=ad-bc$$
Everyone universally knows how to read this, and it is not necessary, even ugly, to write:
$$|A|=(ad)-(bc)$$

I agree.  This expression doesn't need parenthesis to be clear. 

The real message is that thought is required to write a proper (and clear) expression.  Reading the expression is not the only opportunity for brainpower.  And writing a deliberately unclear expression is the arithmetic equivalent of putting a whoopee cushion on a chair.  A juvenile prank that gets old very quickly.
 

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 #119 on: December 20, 2024, 12:36:54 pm »
As the prior example from APL demonstrates there is a big difference between being canonically correct and being clear.

It is a fundamental mistake, of course, to confuse computer calculations with mathematics. :)

Quote
Yes, everyone should be familiar with the formal order of operations.  But as the huge number of "trick" presentations floating around the internet demonstrates a completely correct expression can be far from clear.  It may require some extra characters, maybe even some typesetting, but it is always worth making your intentions clear and correct.

The internet is indeed full of "alternative facts" and "opinions of equal value". Sickening, isn't it.
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 tggzzz

  • Super Contributor
  • ***
  • Posts: 21461
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: A warning to engineers about calculators
« Reply #120 on: December 20, 2024, 12:43:19 pm »
Well then, if one is truly interested in accurately showing a math expression, then one should use parentheses (not "brackets"--brackets are [ ] { }) to make the order of operations perfectly clear, yes?

Or you could not do that and just browbeat anyone who misinterprets it.

Presumably you also expect people to make the meaning of every word clear? What a glory[1] that would be.

[1] in the sense that Humpty Dumpty used it
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 CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5621
  • Country: us
Re: A warning to engineers about calculators
« Reply #121 on: December 20, 2024, 05:12:31 pm »
 Confusing computer calculations with mathematics.  I interesting.  So in your opinion the exhaustive proofs done in recent years using computers to test the many possibilities are not mathematics?

Computer languages are formal definitions (at least when done properly) of a set of operations.  As are rules for describing mathematical relations and expressions.  In both cases it's is possible to be formally correct, but unclear.  It is worth thinking about why they are unclear, even though following the rules precisely.  The reasons all come from the fact that our brains aren't computers, not matter how hard we try to force them to be.
 

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 #122 on: December 20, 2024, 05:52:16 pm »
Confusing computer calculations with mathematics.  I interesting.  So in your opinion the exhaustive proofs done in recent years using computers to test the many possibilities are not mathematics?

By "calculations" I was meaning arithmetic calculations. I don't class "if X then Y else Z" (or any glorified variant) as being a calculation.

I'll leave professional mathematicians to answer the latter. Question: if nobody can understand such a proof, is the proof valid? That has (does?) worry mathematicians.

Quote
Computer languages are formal definitions (at least when done properly) of a set of operations.  As are rules for describing mathematical relations and expressions.  In both cases it's is possible to be formally correct, but unclear.  It is worth thinking about why they are unclear, even though following the rules precisely.  The reasons all come from the fact that our brains aren't computers, not matter how hard we try to force them to be.

Where they are decently formally defined (i.e. no undefined and implementation defined behaviour), then it is clear that the arithmetic calculation does not follow mathematics definitions.
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 IanB

  • Super Contributor
  • ***
  • Posts: 12570
  • Country: us
Re: A warning to engineers about calculators
« Reply #123 on: December 20, 2024, 07:23:00 pm »
Sometimes you need parentheses. Even BODMAS/PEMDAS can't save you. For example:

    12÷3÷2 = ?

In reality nobody would ever write that, and it does become something of a game.
 
The following users thanked this post: Someone

Offline Zoli

  • Frequent Contributor
  • **
  • Posts: 589
  • Country: ca
  • Grumpy old men
Re: A warning to engineers about calculators
« Reply #124 on: December 20, 2024, 07:29:56 pm »
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.

Ah. Bizarre and unnecessary substitution.

Makes me think of the way Humpty Dumpty used the symbol "glory" (which was, of course, written by the mathematician Lewis Carroll).
ISO 80000-2 allows the use of the colon( : ) as ratio(a:b=0.375); the symbol ÷ should not be used. IIRC, the Greek, Latin and Arab arithmetic used colon( : ) as division sign, since fractional arithmetic was treated differently. Maybe the extended use of the fractional sign( /) should be considered bizarre and unnecessary substitution?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf