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?
-36-6**2
36(-6)**2
NY <me@privacy.invalid> wrote:
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.
-36-6**2
36(-6)**2
** is the 'to the power of' operator in Python. In the second example the brackets take precedence over order.
"Theo" <theom+news@chiark.greenend.org.uk> wrote in message news:I9j*cHGmz@news.chiark.greenend.org.uk...
NY <me@privacy.invalid> wrote:
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.
-36-6**2
36(-6)**2
** 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.
- 6²= 36-(6)²= -36
NY wrote:
-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.
NY <me@privacy.invalid> wrote:
"Theo" <theom+news@chiark.greenend.org.uk> wrote in message
news:I9j*cHGmz@news.chiark.greenend.org.uk...
NY <me@privacy.invalid> wrote:
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. >>>>>> -6**2
-36
36(-6)**2
** 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 wrote:
NY wrote:
-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.
On Mon, 31 Jul 2023 21:36:13 +0100, NY wrote:
- 6²= 36-(6)²= -36
E.g. if I saw -(6^2) I'd be unsure what was meant by 3/(136-6^2).
"Robin" <rbw@outlook.com> wrote in message news:5e080482-3f3a-1ddd-9dbe-69e61671bedb@outlook.com...
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.
The square root of minus 1 is etched in my mind as "error".
"Adrian Caspersz" <email@here.invalid> wrote in message news:kis4obFfjhuU3@mid.individual.net...
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" ;-)
The square root of minus 1 is etched in my mind as "error".It can also be i or j
--
On 8/1/23 10:53, NY wrote:
"Robin" <rbw@outlook.com> wrote in message >>news:5e080482-3f3a-1ddd-9dbe-69e61671bedb@outlook.com...
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".
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].)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (0 / 16) |
Uptime: | 116:50:50 |
Calls: | 6,662 |
Files: | 12,209 |
Messages: | 5,334,234 |