Discussion:
OT: Calling mathematicians (there may be some in this group)
(too old to reply)
NY
2023-07-31 20:36:13 UTC
Permalink
I've seen a question which was apparently a Who Wants to be a Millionaire
question. It gives four answers for

-6² (or -6^2 if the superscript 2 character doesn't reproduce)

Without any brackets, how should this be parsed? -(6^2) or (-6)^2. In other
words, is the answer +36 or -36?

For what it's worth, three of the four answers were 12, -12 and 12i (I
presume they are using i as sqrt(-1)) so the correct answer stands out. It
would have been more cunning if the four answers had been 12, -12, 36, -36.


My gut feeling is that the expression should be parsed as (-6)^2 = 36, but
from comments in the Facebook posting where it is discussed, it seems I'm
wrong and the expression should be parsed as -(6^2) = -36. Of course, I
would never rely on implied rules and would always use brackets to indicate
my meaning, even if they were technically superfluous.
Theo
2023-07-31 21:00:58 UTC
Permalink
Post by NY
I've seen a question which was apparently a Who Wants to be a Millionaire
question. It gives four answers for
-6² (or -6^2 if the superscript 2 character doesn't reproduce)
Without any brackets, how should this be parsed? -(6^2) or (-6)^2. In other
words, is the answer +36 or -36?
The order of precedence goes:

Brackets
Order (=exponents or powers)
Division
Multiplication
Addition
Subtraction

so the 'order' takes precedence over 'subtraction', and you would do (6*6)
and then make the result negative, ie -36.

Let's confirm that:

$ python3 -i
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Post by NY
-6**2
-36
Post by NY
(-6)**2
36

** is the 'to the power of' operator in Python. In the second example the
brackets take precedence over order.

Theo
NY
2023-07-31 21:13:05 UTC
Permalink
Post by Theo
Post by NY
I've seen a question which was apparently a Who Wants to be a Millionaire
question. It gives four answers for
-6² (or -6^2 if the superscript 2 character doesn't reproduce)
Without any brackets, how should this be parsed? -(6^2) or (-6)^2. In other
words, is the answer +36 or -36?
Brackets
Order (=exponents or powers)
Division
Multiplication
Addition
Subtraction
so the 'order' takes precedence over 'subtraction', and you would do (6*6)
and then make the result negative, ie -36.
$ python3 -i
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Post by NY
-6**2
-36
Post by NY
(-6)**2
36
** is the 'to the power of' operator in Python. In the second example the
brackets take precedence over order.
Ah, I wasn't sure whether the "-" as a prefix to the 6 was treated the same
as a minus operator (as in 6-4=2), or whether it was an unstated case that
was higher up the BODMAS list.
Liz Tuddenham
2023-08-01 07:51:53 UTC
Permalink
Post by NY
Post by Theo
Post by NY
I've seen a question which was apparently a Who Wants to be a Millionaire
question. It gives four answers for
-6Â" (or -6^2 if the superscript 2 character doesn't reproduce)
Without any brackets, how should this be parsed? -(6^2) or (-6)^2. In other
words, is the answer +36 or -36?
Brackets
Order (=exponents or powers)
Division
Multiplication
Addition
Subtraction
so the 'order' takes precedence over 'subtraction', and you would do (6*6)
and then make the result negative, ie -36.
$ python3 -i
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Post by NY
-6**2
-36
Post by NY
(-6)**2
36
** is the 'to the power of' operator in Python. In the second example the
brackets take precedence over order.
Ah, I wasn't sure whether the "-" as a prefix to the 6 was treated the same
as a minus operator (as in 6-4=2), or whether it was an unstated case that
was higher up the BODMAS list.
I think the answer is to ask them to specify what system they are using
or tell them to write it properly with the appropriate brackets.
Without that information the answer is guesswork and the question is
just a waste of everyone's time.
--
~ Liz Tuddenham ~
(Remove the ".invalid"s and add ".co.uk" to reply)
www.poppyrecords.co.uk
Andy Burns
2023-08-01 08:21:06 UTC
Permalink
Post by Liz Tuddenham
-6^2 Without any brackets, how should this be parsed? -(6^2) or (-6)^2.
I think the answer is to ask them to specify what system they are using
or tell them to write it properly with the appropriate brackets.
Without that information the answer is guesswork and the question is
just a waste of everyone's time.
With this type of question, *not* stating it clearly is a deliberate
ploy to generate argument and discussion.
Liz Tuddenham
2023-08-01 09:00:23 UTC
Permalink
Post by Andy Burns
Post by Liz Tuddenham
-6^2 Without any brackets, how should this be parsed? -(6^2) or (-6)^2.
I think the answer is to ask them to specify what system they are using
or tell them to write it properly with the appropriate brackets.
Without that information the answer is guesswork and the question is
just a waste of everyone's time.
With this type of question, *not* stating it clearly is a deliberate
ploy to generate argument and discussion.
I appreciate that it is supposed to be entertainment, but that
particular question leaves no room for any real discussion. The answer
is indisputable once the system is known, so it is just a matter of
guessing which system the question-setter used. Tossing a coin would be
just as interesting.

As I was never very good a mathematics, I tend to use brackets quite
liberally in equations, so there is never any doubt about my intentions
(particularly as I am liable to forget what those were when I try to
read the programs a few days later). The down-side of this is the risk
of losing count of the depth of nesting and then having the program fail
because there was a bracket missing or duplicated.
--
~ Liz Tuddenham ~
(Remove the ".invalid"s and add ".co.uk" to reply)
www.poppyrecords.co.uk
Robin
2023-08-01 08:48:43 UTC
Permalink
Post by Liz Tuddenham
Post by NY
Post by Theo
Post by NY
I've seen a question which was apparently a Who Wants to be a Millionaire
question. It gives four answers for
-6Â" (or -6^2 if the superscript 2 character doesn't reproduce)
Without any brackets, how should this be parsed? -(6^2) or (-6)^2. In other
words, is the answer +36 or -36?
Brackets
Order (=exponents or powers)
Division
Multiplication
Addition
Subtraction
so the 'order' takes precedence over 'subtraction', and you would do (6*6)
and then make the result negative, ie -36.
$ python3 -i
Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
Post by NY
-6**2
-36
Post by NY
(-6)**2
36
** is the 'to the power of' operator in Python. In the second example the
brackets take precedence over order.
Ah, I wasn't sure whether the "-" as a prefix to the 6 was treated the same
as a minus operator (as in 6-4=2), or whether it was an unstated case that
was higher up the BODMAS list.
I think the answer is to ask them to specify what system they are using
or tell them to write it properly with the appropriate brackets.
Without that information the answer is guesswork and the question is
just a waste of everyone's time.
"Properly" is using brackets only where they are necessary. If you
don't then you'd better use brackets consistently in all such cases else
the reader can't be sure what you want.

E.g. if I saw -(6^2) I'd be unsure what was meant by 3/(136-6^2).
--
Robin
reply-to address is (intended to be) valid
NY
2023-08-01 09:53:34 UTC
Permalink
Post by Robin
E.g. if I saw -(6^2) I'd be unsure what was meant by 3/(136-6^2).
I think 3/(136-6^2) is unambiguous by BODMAS rules: you square the 6 first
and then subtract it from the 136, because the "-" is the binary operator
between 136 and 6^2. -6^2 is more debatable: is the unary operator "-" a
property of the number 6, implying that you square -6, or is it a property
of the term 6^2?

I would make a distinction between the binary operator "-" in "136-36" and
the unary operator "-" in "-6". But evidently I'm wrong to do so. I'm guilty
of over-thinking things ;-)

It's probably one of those situations where you could make a strong case
either way and you need to be taught which way happens to be the convention.
Adrian Caspersz
2023-08-01 10:23:07 UTC
Permalink
Post by NY
Post by Robin
E.g. if I saw -(6^2) I'd be unsure what was meant by 3/(136-6^2).
I think 3/(136-6^2) is unambiguous by BODMAS rules: you square the 6
first and then subtract it from the 136, because the "-" is the binary
operator between 136 and 6^2. -6^2 is more debatable: is the unary
operator "-" a property of the number 6, implying that you square -6, or
is it a property of the term 6^2?
I would make a distinction between the binary operator "-" in "136-36"
and the unary operator "-" in "-6". But evidently I'm wrong to do so.
I'm guilty of over-thinking things ;-)
It's probably one of those situations where you could make a strong case
either way and you need to be taught which way happens to be the convention.
Folks these days are "taught" by whatever their calculator tells them.

Pressing the keys in sequence gives 36.

It is fact, gospel, the unshakable truth ...


The square root of minus 1 is etched in my mind as "error".
--
Adrian C
NY
2023-08-01 13:01:13 UTC
Permalink
Post by Adrian Caspersz
The square root of minus 1 is etched in my mind as "error".
The word is divided into three types of people: mathematicians who call it
"i", electrical engineers who call it "j" and the rest who call it "error"
;-)

My head of department in an electronics firm was called Bill Taylor - James
William Taylor. It didn't take people long to realise that he was destined
for a job in electronics because his initials jwt spelled the mathematical
term that appears in equations of sinusoidal variation of electric currents.
He was referred to as "J Omega".
Robin
2023-08-01 13:43:15 UTC
Permalink
Post by NY
Post by Adrian Caspersz
The square root of minus 1 is etched in my mind as "error".
The word is divided into three types of people: mathematicians who call
it "i", electrical engineers who call it "j" and the rest who call it
"error" ;-)
I never knew a physicist call it "error".
--
Robin
reply-to address is (intended to be) valid
Stephen Wolstenholme
2023-08-01 14:07:34 UTC
Permalink
On Tue, 1 Aug 2023 11:23:07 +0100, Adrian Caspersz
Post by Adrian Caspersz
The square root of minus 1 is etched in my mind as "error".
--
It can also be i or j
--
Neural Network Software for Windows http://www.npsnn.com
J. P. Gilliver
2023-08-01 14:17:49 UTC
Permalink
Post by Adrian Caspersz
Post by NY
Post by Robin
E.g. if I saw -(6^2) I'd be unsure what was meant by 3/(136-6^2).
I think 3/(136-6^2) is unambiguous by BODMAS rules: you square the 6
first and then subtract it from the 136, because the "-" is the binary
operator between 136 and 6^2. -6^2 is more debatable: is the unary
operator "-" a property of the number 6, implying that you square -6,
or is it a property of the term 6^2?
I would make a distinction between the binary operator "-" in
"136-36" and the unary operator "-" in "-6". But evidently I'm wrong
to do so. I'm guilty of over-thinking things ;-)
It's probably one of those situations where you could make a strong
case either way and you need to be taught which way happens to be the
convention.
Folks these days are "taught" by whatever their calculator tells them.
Pressing the keys in sequence gives 36.
It is fact, gospel, the unshakable truth ...
The square root of minus 1 is etched in my mind as "error".
Simple calculators implement the operations as you give them them.
"Scientific" ones _sometimes_ implement some degree of BODMAS. The one
in Windows can be set to various modes.

Even "pressing the keys" is open to interpretation, especially if your
calculator has a "change sign" key (often labelled "+/-") as well as a
"subtract" key. Would you enter -6^2 as subtract, six, squared, or six,
negate, squared, or six, squared, negate? (Assuming you have a "squared"
key. Same question applies if you have a ^ key [usually "xy" with the y
raised].)
--
J. P. Gilliver. UMRA: 1960/<1985 MB++G()AL-IS-Ch++(p)***@T+H+Sh0!:`)DNAf

How do you govern a country that seems to have decided that facts are the work
of the devil? - Andy Hamilton on HIGNFY, 2010
NY
2023-08-01 15:47:05 UTC
Permalink
Post by J. P. Gilliver
Even "pressing the keys" is open to interpretation, especially if your
calculator has a "change sign" key (often labelled "+/-") as well as a
"subtract" key. Would you enter -6^2 as subtract, six, squared, or six,
negate, squared, or six, squared, negate? (Assuming you have a "squared"
key. Same question applies if you have a ^ key [usually "xy" with the y
raised].)
I can remember by dad bringing home from work a Hewlett Packard calculator
with reverse Polish notation. That confused the crap out of anyone who tried
to use it:

7 ENTER 3 *

rather than

7 * 3 =

jon
2023-08-01 08:06:46 UTC
Permalink
- 6²= 36
-(6)²= -36
Robin
2023-08-01 08:52:46 UTC
Permalink
Post by jon
- 6²= 36
-(6)²= -36
so what's 100 - 6² ?
--
Robin
reply-to address is (intended to be) valid
Loading...