RPN question

  • Follow


HOW is RPN faster? I just don't get it. I transferred from Casio (which I
used over 6 years) to HP 49G+ a year ago, and I still find RPN quite
confusing.
Yet I hear that "once you cross to RPN, you're not going back to ALG". 
How? Is there some RPN course or something? :))

-- 
When you dream, there are no rules.
People can fly...anything can happen.
0
Reply snnoopyREMOVETHIS (5) 3/11/2006 10:51:54 AM

RPN makes you pre-think and optimise the way you input your numbers when
doing your math i guess.
With time it will become seamless.
One thing is for sure,
-when you get used to it you will never wanna go back to "normal
calculator".

It takes time though -in my case it took 2 weeks.
At first i was very frustrated but like i said when i got used to it it was
simply woderfull.

manjo

I'm one million killometter from star's corona.

I'm actualy flying in to a star...

This is incredible...


0
Reply manjo 3/11/2006 12:49:38 PM


On 3/11/2006 5:51 AM, sNNooPY wrote:

> HOW is RPN faster? I just don't get it. I transferred from Casio (which I
> used over 6 years) to HP 49G+ a year ago, and I still find RPN quite
> confusing.
> Yet I hear that "once you cross to RPN, you're not going back to ALG". 
> How? Is there some RPN course or something? :))
> 

I don't know if it's "faster" but it is certainly more efficient in
the way it may save you on keystrokes.  This is especially true when
you have a complex expression with lots of parentheses.  What I find
very helpful is, because of the stack, you can see intermediate
answers.

For a quick explanation see http://www.hpmuseum.org/rpn.htm

For purists, the term RPN refers to the older 4-level stack.  On the
49G+, it's really RPL.  However, I use and understand RPN to mean the
system used on HP calculators.  The page above offers links to explain
all that stuff.

As a former algebraic calculator user, I was exposed to the wonderful
HP calculators back in 1986 and have been using them ever since.

Have fun exploring.

John
0
Reply John 3/11/2006 9:08:20 PM

In article <6YGQf.1827$96.1465@bignews8.bellsouth.net>,
John Nguyen  <jdn502@bellsouth.net> wrote:
 
> On 3/11/2006 5:51 AM, sNNooPY wrote:
> 
>> HOW is RPN faster? I just don't get it. I transferred from Casio (which I
>> used over 6 years) to HP 49G+ a year ago, and I still find RPN quite
>> confusing.
>> Yet I hear that "once you cross to RPN, you're not going back to ALG". 
>> How? Is there some RPN course or something? :))
> 
> I don't know if it's "faster" but it is certainly more efficient in
> the way it may save you on keystrokes.  This is especially true when
> you have a complex expression with lots of parentheses.  What I find
> very helpful is, because of the stack, you can see intermediate
> answers.
 
To be fair, algebraic calculators will let you see some of the
intermediate results too (when you press the closing parentheses, the
intermediate result of whatever was inside that parenthesis will be
displayed).  But RPN is clearly superior here - it shows ALL
intermediate results.  And if you get one partial result wrong, you
can, in RPN, redo just that part and need not redo the entire
expression.
 
> For a quick explanation see http://www.hpmuseum.org/rpn.htm
> 
> For purists, the term RPN refers to the older 4-level stack.  On the
> 49G+, it's really RPL.  However, I use and understand RPN to mean the
> system used on HP calculators.  The page above offers links to explain
> all that stuff.
 
Actually RPN was originally a mathematical notation, free of
parentheses and precendence rules and yet unambiguous, which was
introduced by a Polish mathematician.  He introduced two varieties
(the example computes the expression 2*3+4*5):
 
Forward Polish Notation - example:    ADD MULTIPLY 2 3 MULTIPLY 4 5
Reverse Polish Notation - example:    2 3 MULTIPLY 4 5 MULTIPLY ADD
 
The FPN was used in the programming language LISP, while the RPN was
used in the programming language FORTH, and in HP calculators.
 
There's no 4-level limit on the stack accompanied in RPN
implementations, that 4-level limit was a peculiarity in earlier HP
calculators.  FORTH has no such limit, for instance - there the
limit is determined by the available stack space.
 
 
> As a former algebraic calculator user, I was exposed to the wonderful
> HP calculators back in 1986 and have been using them ever since.
 
I was exposed to RPN in 1974 and have been enjoying it since then.  But
I don't refuse to use algebraic calculators -- for fairly simple expressions
it doesn't matter to me whether I use RPN or alebgraic calculators.  It's
only if the expression is quite complex that I find algebraic calculators
unusuable.  And if I want to be able to change my mind about what to compute
right in the middle of expression -- that can be done only with RPN.
 
> Have fun exploring.
> 
> John
 
-- 
----------------------------------------------------------------
Paul Schlyter,  Grev Turegatan 40,  SE-114 38 Stockholm,  SWEDEN
e-mail:  pausch at stockholm dot bostream dot se
WWW:     http://stjarnhimlen.se/
0
Reply pausch 3/12/2006 9:42:48 AM

In article <duuh1g$rb7$1@ss405.t-com.hr>,
manjo <not-available-spam@rocketmail.com> wrote:
 
> RPN makes you pre-think and optimise the way you input your numbers when
> doing your math i guess.
> With time it will become seamless.
> One thing is for sure,
> -when you get used to it you will never wanna go back to "normal
> calculator".
 
Well, that's actually a matter of personal preference.  Disabling
yourself from using an algebraic calculator does have its
disadvantages too (imagine yourself wanting to calculate something,
and asking around to borrow a calculator - most likely you'll only be
able to borrow a "normal" i.e.  algebraic calculator - wouldn't it then
be bad if you frowned at it so forcefully that you preferred using
pencil and paper only).
 
I've been using, and enjoying, RPN calculators for decades.  But if
the expression I want to calculate isn't that complex, using an
algebraic calculator is fine too IMO.  The real virtue of RPN appears
when you want to calculate something more complex, since in RPN
you'll be able to see each and every intermediate result, you can
redo just an intermediate result if you got it wrong (i.e.  you don't
have to start from tbe beginning of the entire expression), and you
can even change your mind in the middle of the expression about how
you want to calculate it, and choose some other route than the one
you intended at the start.  That's when RPN really shines !
 
But if you just want to quickly calculate a not so complex expression,
RPN or algebraic will both do fine.
 
 
> It takes time though -in my case it took 2 weeks.
> At first i was very frustrated but like i said when i got used to it it was
> simply woderfull.
> 
> manjo
> 
> I'm one million killometter from star's corona.
> 
> I'm actualy flying in to a star...
> 
> This is incredible...
 
.....ok, ok, RPN does indeed have its virtues, but it's not THAT powerful... <g>
 
-- 
----------------------------------------------------------------
Paul Schlyter,  Grev Turegatan 40,  SE-114 38 Stockholm,  SWEDEN
e-mail:  pausch at stockholm dot bostream dot se
WWW:     http://stjarnhimlen.se/
0
Reply pausch 3/12/2006 9:42:48 AM

> HOW is RPN faster? I just don't get it.

While it's true that RPN is usually faster and typically requires fewer
keystrokes, the most important reason for using RPN, in my opinion, is
that you are much less likely to make an entry error.

By far, the most common mistake my students make in doing calculations
is misplaced parentheses.  This mistake accounts for more errors than
all of the others combined.  With RPN, you will never make parentheses
errors, because perentheses are never used.

This past week on a test, several students came up with the same wrong
answer to a problem.  I tracked it down to mistyping the distance
formula.  They typed something like

     sqrt(-5^2 + 7^2)

instead of

     sqrt((-5)^2 + 7^2)

To do this in RPN, you simply enter it the way you would do it in your
head.  You would start with -5.  What are you want to do to -5?  You
want to square it

     -5 SQ

Then you want to do the same with 7

     -5 SQ 7 SQ

Then, what do you want to do with these two results?  You want to add
them together.

     -5 SQ 7 SQ +

Finally, you want to take this result and take the square root of it.
(I'm using sqrt for the square root button.)

     -5 SQ 7 SQ + sqrt


Just remember, put the values in first, then indicate what you want to
do with those values.



Here's another common error.  Casio calculators don't put a automatic
parenthesis after a function name, so it allows you to type

     sin pi/4

Which means

     (sin pi)/4

when the person may have wanted

     sin(pi/4)

If you want the sin(pi/4), you start with pi and 4 and do division

     pi 4 /

THEN take the result and take the sine of it

     pi 4 / sin

If by chance you really wanted (sin pi)/4, then you'd start with pi and
take the sine of it.  Then take that result and 4 and perform the
division.

     pi sin 4 /


RPN also avoids other ambiguous meanings.  For example, sin 2y could
mean sin(2y), or it could mean sin(2)y.  If I recall, Casios and early
TI's give it the first meaning, while later TI's give it the latter.
In RPN, YOU control the order of operations, so it's whatever you want
it to be. So sin(2y) would be

     2 y * sin (take 2 and y and multiply them, then take the sine of
that result)

while sin(2)y would be

     2 sin y * (start with 2 and take the sine of it, then take that
result and y and multiply them)



Other confusing ones that I run into are 1/2pi (could be 1/(2pi) or
(1/2)pi ) and e^-x^2 (could be mean e^(-x^2) or (e^-x)^2 ).  With RPN,
you control the order of operations, so you can make it whatever you
intended.

     1 2 pi * /
     1 2 / pi *
     X SQ NEG EXP
     X NEG EXP SQ


The point is that YOU control the order of operations, so you'll never
have a misplaced parenthsis ever again.

Hope this help,
-Wes Loewer

0
Reply Wes 3/12/2006 2:03:47 PM

In article <1142172227.634525.90790@u72g2000cwu.googlegroups.com>,
Wes <wjltemp-gg@yahoo.com> wrote:
>> HOW is RPN faster? I just don't get it.
>
>While it's true that RPN is usually faster and typically requires fewer
>keystrokes, the most important reason for using RPN, in my opinion, is
>that you are much less likely to make an entry error.
>
>By far, the most common mistake my students make in doing calculations
>is misplaced parentheses.  This mistake accounts for more errors than
>all of the others combined.  With RPN, you will never make parentheses
>errors, because perentheses are never used.

:-) ..... however you can still, even in RPN, compute things in the wrong
order....

>This past week on a test, several students came up with the same wrong
>answer to a problem.  I tracked it down to mistyping the distance
>formula.  They typed something like
>
>     sqrt(-5^2 + 7^2)
>
>instead of
>
>     sqrt((-5)^2 + 7^2)

The former is correct.  The latter shouldn't be needed, since unary minus
should have higher priority than the power operator.

>To do this in RPN, you simply enter it the way you would do it in your
>head.  You would start with -5.  What are you want to do to -5?  You
>want to square it
>
>     -5 SQ
>
>Then you want to do the same with 7
>
>     -5 SQ 7 SQ
>
>Then, what do you want to do with these two results?  You want to add
>them together.
>
>     -5 SQ 7 SQ +
>
>Finally, you want to take this result and take the square root of it.
>(I'm using sqrt for the square root button.)
>
>     -5 SQ 7 SQ + sqrt

Actually, this would correspond to:

sqrt(sq(-1) + sq(7))

in algebraic form.  To make it correspond to:

sqrt(-5^2 + 7^2)

make it either:

  5 2 y^x NEG 7 2 y^x +

or:

  5 NEG 2 y^x 7 2 y^x +

in RPN, depending on whether unary minus should have higher or lower priority
than the power operator.  Of course, the latter form assumes that y^x is smart
enough to be able to raise a negative number to the power 2 -- the naive way
of implementing y^x as  exp(log(y)*x) will fail if y is not positive.


>Just remember, put the values in first, then indicate what you want to
>do with those values.
>
>
>
>Here's another common error.  Casio calculators don't put a automatic
>parenthesis after a function name, so it allows you to type
>
>     sin pi/4
>
>Which means
>
>     (sin pi)/4
>
>when the person may have wanted
>
>     sin(pi/4)
>
>If you want the sin(pi/4), you start with pi and 4 and do division
>
>     pi 4 /
>
>THEN take the result and take the sine of it
>
>     pi 4 / sin
>
>If by chance you really wanted (sin pi)/4, then you'd start with pi and
>take the sine of it.  Then take that result and 4 and perform the
>division.
>
>     pi sin 4 /
>
>
>RPN also avoids other ambiguous meanings.  For example, sin 2y could
>mean sin(2y), or it could mean sin(2)y.  If I recall, Casios and early
>TI's give it the first meaning, while later TI's give it the latter.
>In RPN, YOU control the order of operations, so it's whatever you want
>it to be. So sin(2y) would be
>
>     2 y * sin (take 2 and y and multiply them, then take the sine of
>that result)
>
>while sin(2)y would be
>
>     2 sin y * (start with 2 and take the sine of it, then take that
>result and y and multiply them)
>
>
>
>Other confusing ones that I run into are 1/2pi (could be 1/(2pi) or
>(1/2)pi ) and e^-x^2 (could be mean e^(-x^2) or (e^-x)^2 ).  With RPN,
>you control the order of operations, so you can make it whatever you
>intended.
>
>     1 2 pi * /
>     1 2 / pi *
>     X SQ NEG EXP
>     X NEG EXP SQ
>
>
>The point is that YOU control the order of operations, so you'll never
>have a misplaced parenthsis ever again.
>
>Hope this help,
>-Wes Loewer
>


-- 
----------------------------------------------------------------
Paul Schlyter,  Grev Turegatan 40,  SE-114 38 Stockholm,  SWEDEN
e-mail:  pausch at stockholm dot bostream dot se
WWW:     http://stjarnhimlen.se/
0
Reply pausch 3/12/2006 2:43:19 PM

>> With RPN, you will never make parentheses
>>errors, because perentheses are never used.

> :-) ..... however you can still, even in RPN, compute things in the wrong
> order....

You are certainly right about that.  Perhaps that marks the difference
in the two approaches.  RPN _requires_ that you understand what order
you want.  Alg mode gives the false appearance of not requiring you to
understand the proper order.  I have no doubt that some students type
in an algebraic expression without fully thinking about what it means
-- "The calculator will figure it out for me."

>>They typed something like
>>     sqrt(-5^2 + 7^2)
>>instead of
>>     sqrt((-5)^2 + 7^2)

> The former is correct.  The latter shouldn't be needed, since unary minus
> should have higher priority than the power operator.

I don't know of any editable command line algebraic calculator
(including hp in alg mode) that gives unary minus a higher priority
than the power operator.  Try -3^2 and you'll get -9, not 9.

You would think that a student would just drop the negative anyway
since it's getting squared, but in the heat of the battle of a test,
sometimes they don't think so clearly.

Here's another debatable one for algebraic mode:

     2^3^4

Try to guess if it means (2^3)^4 or 2^(3^4) before you try it on your
calc.  Casio's, TI 80-86, and HP 28/48 give a different answer than TI
89/92/Voyage and HP 49/49g+.  In RPN, there's no ambiguity

     2 3 ^ 4 ^
or
     2 3 4 ^ ^

depending on what you wanted.

-Wes Loewer

0
Reply Wes 3/12/2006 5:57:15 PM

Paul Schlyter wrote:




> 
> in RPN, depending on whether unary minus should have higher or lower priority
> than the power operator.  Of course, the latter form assumes that y^x is smart
> enough to be able to raise a negative number to the power 2 -- the naive way
> of implementing y^x as  exp(log(y)*x) will fail if y is not positive.
> 

'will fail if y is not positive',  you mean most of 'scientific' 
calculators cannot handle complex number space in math functions and 
give error?



If I try on my 18 year old hp42s...

y=-3
x=2

log(-3) = 0.4771+i1.3644 (every scientific calculator worth the name
                           can do it easy and without error, ehh... ;*) )

0.4771+i1.3644 * 2 =  0.9542+i2.7288

exp(0.9542+i2.7288) = 9.00000+i7.62E-11 (small rounding artefact)

~ 9

(calculated as '3 +/- LOG 2 * 10^x', for 'exp(log(-3)*2)' on hp42s)

only 'fail' I can see here, is a small rounding artefact in imaginary 
space...

:*)


---




0
Reply torbjorn 3/12/2006 9:49:22 PM

8 Replies
237 Views

(page loaded in 5.931 seconds)

Similiar Articles:













7/25/2012 10:48:48 PM


Reply: