5+5*5-5+5=? what is the answer?

Status
Not open for further replies.
Solution
Because when the expression isn't parenthesized multiplication and division are done before addition and subtraction. Then it proceeds left to right. So it's as if it were
5+(5*5)-5+5
5+25-5+5
30-5+5
25+5
30

There is a rule somewhere about posting your homework questions here, and this really feels like a homework question.
Because when the expression isn't parenthesized multiplication and division are done before addition and subtraction. Then it proceeds left to right. So it's as if it were
5+(5*5)-5+5
5+25-5+5
30-5+5
25+5
30

There is a rule somewhere about posting your homework questions here, and this really feels like a homework question.
 
Solution


what you are looking for is the order of operations P.E.M.D.A.S or please excuse my dear aunt sally.

Parentheses
Exponents
Multiply
Divide
Add
Subtract
 
PEMDAS, indeed. But I think that you have to give equal weights to mult / div and add / subtract instead of presenting them in a hierarchy. Otherwise

10-5+5

would do the addition first and become

10 - 10

and equal zero. I'm pretty sure that 10 - 5 + 5 is 10. I had forgotten that mnemonic, though.

Parentheses
Exponents (evaluate sequential exponents right to left!)
Multiply or Divide
Add or Subtract

Pedantic, ain't I?
 
No, you are not being pedantic at all. It is essential to take account of the fact that some operators have equal weight and that you evaluate the expression left to right bearing that in mind. Basically you have to scan the expression left to right a number of times, each time reducing it by applying the rules at a particular level of the hierarchy.

Without doing that even the current expression would evaluate differently. So no pedantry involved. And also no pedantry in my rather jocular previous reply. Without stating what base we are working in it's not possible to give a definitive answer.
 
Status
Not open for further replies.