Sonsivri

Others => General => Topic started by: Sideshow Bob on September 26, 2023, 01:31:58 13:31



Title: How would you evaluate this expression
Post by: Sideshow Bob on September 26, 2023, 01:31:58 13:31
Ok so if a person wrote this down on a piece of paper this expression
-22
How would you evaluate it
would it be as -(22)=-4
or (-2)2=4
I am in =4 camp. because I read it as minus two squared. If I was to type this into my HP50g or the windows calculator I would key in 2+(+/-)+X2. But if you try the google calculator you will get -4. It will also depend highly on what brand of scientific calculator you have. If you write it out on paper. It looks like people in North America will say -4 because at least up to high-school they learn to follow a very strict PEMDAS regime https://www.mathsisfun.com/operation-order-pemdas.html (https://www.mathsisfun.com/operation-order-pemdas.html)
But in other countries it is learned the unary minus operator negates the value of the operand so it is  (-2)2=4. What do you think? But please bury any flamethrowers in the discussion. It will depend on many factors


Title: Re: How would you evaluate this expression
Post by: Parad1gm on September 26, 2023, 02:28:19 14:28
I was raised using the BEDMAS system and seeing as the "-" is in front of the 2 without a bracket that is -2.  Even -(22) is wrong because it should read -1 x (22) (Can't really have a - in front of a bracket without some number)



Title: Re: How would you evaluate this expression
Post by: Catcatcat on September 27, 2023, 07:02:32 07:02
This should be understood as the number minus two squared. Those, the number minus two must be multiplied by the number minus two and this is equal to four.
-22 = 4


Title: Re: How would you evaluate this expression
Post by: Sideshow Bob on September 27, 2023, 09:02:13 09:02
Even -(22) is wrong because it should read -1 x (22) (Can't really have a - in front of a bracket without some number)
I am not sure I follow what you are saying here. So you are saying -(-3-4) has to written as -1*(-3-4). That was new to me, although purely mathematical both expressions are correct and equal. And also google calculator accept both and give 7 as answer 


Title: Re: How would you evaluate this expression
Post by: Parad1gm on September 27, 2023, 05:35:15 17:35
We have adapted -( as a short hand for -1 * (.  When learning order of operation the teach explicitly explained that was the case.


Title: Re: How would you evaluate this expression
Post by: 2Code on September 28, 2023, 08:42:30 20:42
From 100 years ago I remember something like below, 1 is put there just to be more logic when you multiply with the sign, most of the time is not used. Maybe some education system have different methods for it
-22=(-1)*(2)2 =(-1)*2*2=-4
(-2)2=(+1)*(-2)2=1*(-2)*(-2)=4


Title: Re: How would you evaluate this expression
Post by: Magnox on September 30, 2023, 12:09:05 00:09
From my learning I agree with 2Code (-22 = -4), although I've certainly come across the opposite perspective where a negative sign alone preceding a number is taken to be part of the number, not an operator. That's what causes the confusion/difference. It should always be treated as an operator (written as just - instead of -1* for short).

Qalculate gives the correct answer of -4; it even helpfully expands it as: -2^2 = -(2^2) = -4.
Excel gives an incorrect answer of 4 for -2^2. MS is aware of this... their answer is basically that Excel is for accountants, not mathematicians  ::)

Parentheses are our friends  ;D


Title: Re: How would you evaluate this expression
Post by: Vineyards on April 25, 2024, 07:50:46 07:50
I am not a mathematician, but we need to consider mathematics as a set of methods agreed upon by people to ease certain aspects of quantifying objects, understanding their magnitudes, etc. Several number types are used, and negative numbers are not considered natural. They were historically needed to demonstrate, for example, the balance of accounts between entities or persons. Bookkeeping runs around a set of agreed-upon rules, and whatever is represented here doesn't have to make sense, it is just how you regard it. There are many more methods where having both positive and negative numbers help people keep track of things.


Title: Re: How would you evaluate this expression
Post by: OscarH on April 25, 2024, 10:17:12 10:17
To what I remember, and Wiki confirms that, there are differing conventions concerning the unary operation '−' (usually pronounced "minus").
In written or printed mathematics, the expression −3² is interpreted to mean −(3²) = −9
Now, it appears some programming languages consider the 'minus' sign is part of the number, thus taking the square of this number is always a positive number...

IMO, the question is there only to highlight the risk of misunderstanding in between people, and in any case, it would had been better to add parenthesis i.e. (-3)² or -(3²).

https://en.wikipedia.org/wiki/Order_of_operations