The Naked Scientists

The Naked Scientists Forum

Author Topic: One of the three R's  (Read 2999 times)

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3817
  • Thanked: 19 times
    • View Profile
One of the three R's
« on: 01/09/2012 21:28:28 »
I wonder how many correspondents can do simple arithmetic I saw this question on FaceBook and most of the replies were wrong !

Evaluate 6-1*0+2/2 = ?.

PS my calculator gives the correct answer moral never do arithmetic in your head !
« Last Edit: 01/09/2012 21:33:54 by syhprum »


 

Offline RD

  • Neilep Level Member
  • ******
  • Posts: 8128
  • Thanked: 53 times
    • View Profile
Re: One of the three R's
« Reply #1 on: 01/09/2012 22:52:55 »
clue ...
Quote
... in the expression 2 + 3 4, the answer is 14, the ... expression may also be rendered 2 + (3 4), but the brackets are unnecessary as multiplication still has precedence without them.
https://en.wikipedia.org/wiki/Order_of_operations
« Last Edit: 01/09/2012 22:55:31 by RD »
 

Offline SeanB

  • Neilep Level Member
  • ******
  • Posts: 1118
  • Thanked: 3 times
    • View Profile
Re: One of the three R's
« Reply #2 on: 02/09/2012 08:42:18 »
7

 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3817
  • Thanked: 19 times
    • View Profile
Re: One of the three R's
« Reply #3 on: 02/09/2012 08:56:51 »
The basic calculator provided with windows 7 gives the wrong answer but the scientific version gives the correct one also it can cope with cube root minus one that many software calculators cannot.
« Last Edit: 02/09/2012 09:00:45 by syhprum »
 

Offline RD

  • Neilep Level Member
  • ******
  • Posts: 8128
  • Thanked: 53 times
    • View Profile
Re: One of the three R's
« Reply #4 on: 02/09/2012 20:59:21 »
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3817
  • Thanked: 19 times
    • View Profile
Re: One of the three R's
« Reply #5 on: 02/09/2012 21:34:00 »
Try it with the basic calculator in accessaries on win 7 64bit it consistantly gives the wrong answer
 

Offline nicephotog

  • Sr. Member
  • ****
  • Posts: 387
  • Thanked: 7 times
  • H h H h H h H h H h
    • View Profile
    • Freeware Downloads
Re: One of the three R's
« Reply #6 on: 27/10/2012 07:52:02 »
I thought operator precedence was in comp languages whereas anything multiplied by zero "*" is 0 zero. so 2/2 is 1.
To obtain multiplication first required the brackets or it is done inline left to right?

Which rule-set(not a computer lang) does operator precedence and where is its statement docs?
« Last Edit: 27/10/2012 07:53:35 by nicephotog »
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3817
  • Thanked: 19 times
    • View Profile
Re: One of the three R's
« Reply #7 on: 27/10/2012 08:41:48 »
I wanted to know the value of my car assuming it depreciates 25 percent each year  so I entered .75^10 *30000 into mathematica but I got a funny answer but on my calculator it comes out as a correct if disappointing 1689.41.
I tried 30000*.75^10 and that came out correct.
« Last Edit: 27/10/2012 08:49:11 by syhprum »
 

Offline CliffordK

  • Neilep Level Member
  • ******
  • Posts: 6321
  • Thanked: 3 times
  • Site Moderator
    • View Profile
Re: One of the three R's
« Reply #8 on: 27/10/2012 12:22:38 »
Evaluate 6-1*0+2/2 = ?.
Operator precedence
Exponents and roots first
* & second
+ & - last.

So, the above is equivalent to:

6 - (1*0) + (2/2) = 6 - 0 + 1 = 7

I like to use parentheses when I'm doing calculations...  just to be sure.

I'm surprised that Microsoft has problems with the simple calculations...  well, not too surprised.  [xx(]
gcalctool & SpeedCrunch in Linux both did it correctly.

Of course, if we all just used Reverse Polish, it wouldn't be an issue.

Anybody have an old HP calculator laying around?

Anyway, so your equation:
 6-1*0+2/2
simply becomes
6 1 0* - 2 2 / +
No need to worry about operator precedence or parentheses. 
 

Offline syhprum

  • Neilep Level Member
  • ******
  • Posts: 3817
  • Thanked: 19 times
    • View Profile
Re: One of the three R's
« Reply #9 on: 31/10/2012 15:31:20 »
Facebook posses another seeming simple sum that seems to defeat both the windows scientific calculator and my TI machine.

 6/2(1+2)=? 

Mathematica gives what I consider the correct answer And I swear by this high grade program but I would like other opinions.
« Last Edit: 31/10/2012 16:55:50 by syhprum »
 

Offline CliffordK

  • Neilep Level Member
  • ******
  • Posts: 6321
  • Thanked: 3 times
  • Site Moderator
    • View Profile
Re: One of the three R's
« Reply #10 on: 31/10/2012 18:49:34 »
Hmmm
Perhaps that is a more "interesting" equation.  And, a reason why I like to put in lots of parenthesis. 

I came up with 9 in my head...  And, in Linux, gcalc also gives 9.
Speedcrunch gives an error as written.  With the modification: 6/2*(1+2), it also gives 9.

The problem, of course, is that visually, one might want to group everything after the division sign to give 1.  But, that is not how the equation is written.
 

Offline nicephotog

  • Sr. Member
  • ****
  • Posts: 387
  • Thanked: 7 times
  • H h H h H h H h H h
    • View Profile
    • Freeware Downloads
Re: One of the three R's
« Reply #11 on: 02/11/2012 04:40:16 »
Rules are only properly accountable in side a language or stipulated ruleset anyhow.
If you look at "view" on the Calc menu in Windows you get scientific mode but that does not change the answer from 7.
It's finally a non question here because its a bit alike any language itself, in context and that unspecific undefined you can't want an accurate answer.
However, if you want an answer in a ruleset , apply it that way because it was all done on paper in an operator template of "Delimiters".
 

The Naked Scientists Forum

Re: One of the three R's
« Reply #11 on: 02/11/2012 04:40:16 »

 

SMF 2.0.10 | SMF © 2015, Simple Machines
SMFAds for Free Forums