The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

percent of total in rpn mode
Message #1 Posted by tropicflite on 16 May 2007, 2:13 a.m.

I have a 33s, and I cannot figure out how to find a percent of a total in RPN mode by using the % key.

i.e., 30 is 'what percent' of 50.

The best I can come up with is

30 enter 50 / 100 x

in ALG I can do

30 / 50% enter

isn't there a way to use the % key in RPN mode?

TIA,

tropicflite

      
Re: percent of total in rpn mode
Message #2 Posted by Walter B on 16 May 2007, 2:27 a.m.,
in response to message #1 by tropicflite

AFAIK this key is for another purpose, e.g.

50 ENTER 30 %

will display 15 in x while the base (50) stays in y, as it is done in earlier models. Never heard of the way you look for in RPN so far, but that doesn't mean it doesn't exist...

BTW, if you remember "%" abbreviates "per 100" you can save 1 keystroke to solve your problem in RPN, using

30 ENTER 50 E +/- 2 /

exactly equivalent to the expression you used in ALG.

HTH

Walter

Edited: 16 May 2007, 2:39 a.m.

            
Re: percent of total in rpn mode
Message #3 Posted by tropicflite on 16 May 2007, 10:01 a.m.,
in response to message #2 by Walter B

Your key sequence

30 ENTER 50 E +/- 2 /

is indeed one keystroke shorter than my version

30 ENTER 50 / 100 x

though I'm not sure it's an improvement over the the ALG

30 / 50% ENTER

BTW, I also tried making the equation

A / B x 100

and doing

30 R/S 50 R/S

This works well if you have a lot of percentages to compute, but it involves first writing the equation and then finding it in the list.

On my one-dollar LeWORLD 4-banger from Walmart, I can do

30 / 50%

which shaves a keystroke off the 33S's ALG version, and other HP's, (namely the 12C Platinum) have a %T key which allows

50 ENTER 30 %T

which is equally good, (though, thinking about it, wouldn't that key be better labeled as %Y ? But I digress..)

In the end, I think this a rare case where the ALG version is better, at least on the 33s.

Regards,

tropicflite

                  
1 buck LeWorld -- It's at LEAST a five-banger
Message #4 Posted by Paul Brogger on 16 May 2007, 12:30 p.m.,
in response to message #3 by tropicflite

"%" is a fifth bang. I'll bet it has a square root, too. (Another case of bang inflation.)

I wonder, are there any REAL four-bangers out there?

                        
Re: 1 buck LeWorld -- It's at LEAST a five-banger
Message #5 Posted by tropicflite on 16 May 2007, 1:49 p.m.,
in response to message #4 by Paul Brogger

You, sir, are absolutely correct. It has the standard four 'bangs', percent, square root, as well as MRC, M-, and M+. I happen to have the lovely green model.

Now this strictly meets the definition. Sadly, I don't have one.

                              
Re: 1 buck LeWorld -- It's at LEAST a five-banger
Message #6 Posted by Paul Brogger on 16 May 2007, 4:45 p.m.,
in response to message #5 by tropicflite

I believe Commodore had a couple of early, truly four-function models. (I believe I've got one buried in a box somewhere.)

I doubt there are any made these days.

The fact that yours is available for only one dollar (and the Scientific is like ~$4, right?) is pretty amazing -- especially given the value of a dollar these days. Times do change!

Edited: 16 May 2007, 4:48 p.m.

                                    
Re: "True" four-banger -- There's one on my Nokia cell phone!
Message #7 Posted by Paul Brogger on 17 May 2007, 7:03 p.m.,
in response to message #6 by Paul Brogger

Couldn't be more basic -- but with an interesting interface to compensate for the fact that the four operations are not mapped to any of the keys.

You key in a number, scroll to the desired operation, key in another number, and press "EQUALS" (assigned to the menu selection key).

      
Re: percent of total in rpn mode
Message #8 Posted by Vieira, L. C. (Brazil) on 16 May 2007, 7:11 a.m.,
in response to message #1 by tropicflite

Hi;

the shortest expression for %T (percent of total) would be:

                a
%T(b,a) = 100 × -
                b
being b the total and a the part. If you want to use the percent key, you should see the expression for percent, that is::
         a × b
%(b,a) = -----
          100
I cannot see an easy way to compute %T by using the % key, though.

Hope this clears the subject up... a bit.

Cheers.

Luiz (Brazil)

            
Re: percent of total in rpn mode
Message #9 Posted by tony(nz) on 16 May 2007, 8:55 p.m.,
in response to message #8 by Vieira, L. C. (Brazil)

Nice work Luis. What about [1/x] [%] [1/x] for a [%T] ? :-)

                  
%T in RPN mode: Unbeatable!
Message #10 Posted by Vieira, L. C. (Brazil) on 17 May 2007, 9:57 a.m.,
in response to message #9 by tony(nz)

Hi, Tony;

Quote:
Nice work Luis. What about [1/x] [%] [1/x] for a [%T] ? :-)
What to say? Yours is the very nice work. Unbeatable!

Thanks for your ingenious suggestion (solution, indeed...)

Best regards.

Luiz (Brazil)

Edited: 17 May 2007, 10:06 a.m.

                  
Re: percent of total in rpn mode
Message #11 Posted by tropicflite on 17 May 2007, 1:31 p.m.,
in response to message #9 by tony(nz)

Quote:
What about [1/x] [%] [1/x] for a [%T] ?

Nice!

Works perfectly, and is perfectly compatible with RPN.

To be explicit:

50 ENTER 30 [1/x] % [1/x] --- returns 60

Beautiful!

Edited: 17 May 2007, 2:49 p.m.

      
Re: percent of total in rpn mode
Message #12 Posted by ECL on 16 May 2007, 3:11 p.m.,
in response to message #1 by tropicflite

Here's the sequence, using only 4 keystrokes:

3 ENTER 5 /

First, do a mental 30/50 = 3/5 calc. Also, you don't really need to multiply by 100, if you acknowledge that you are seeing the percent in decimal form. :)

ECL

      
Re: percent of total in rpn mode
Message #13 Posted by Robert H on 16 May 2007, 3:54 p.m.,
in response to message #1 by tropicflite

50 ENTER 30 %CH

-40.00

therefor 30=60% of 50

            
Re: percent of total in rpn mode
Message #14 Posted by tropicflite on 16 May 2007, 6:03 p.m.,
in response to message #13 by Robert H

Quote:
50 ENTER 30 %CH

-40.00

therefor 30=60% of 50


This is a step in the right direction, but it still needs

100 +

to get to the correct answer.

So, 30 ENTER 50 %CH 100 +

gets us there, but not any more efficiently than

30 ENTER 50 / 100 x

      
RPN, algebraic, and the % function
Message #15 Posted by Norris on 16 May 2007, 6:54 p.m.,
in response to message #1 by tropicflite

On an RPN calculator, it's impossible to implement a single % function that duplicates the % key on an algebraic calculator.

On an algebraic calculator, there are actually two different % functions, and the calculator chooses one or the other based on the preceding operation. For example, compare the following using an algebraic calculator, or on the 33S in ALG mode:

200 + 30%
200 - 30%
200 * 30%
200 / 30%

In the first two cases, an algebraic calculator generates the number "60" when you press the % key. In the next two cases, an algebraic calculator generates the number "0.30" when you press the % key. So the % function is defined differently, depending on whether the preceding operation is addition/subtraction or multiplication/division.

On an RPN calculator, no such ambiguity is possible. The % function will be followed, not preceded, by addition/subtraction or multiplication/division. The RPN calculator, while powerful, is not psychic, and does not know what operation will come next. So the % function can only be defined in one way. The 33S in RPN mode assumes that you are doing addition/subtraction with %. If you want to do multiplication/division with %, then you are out of luck (or you simply program an alternative function).

Note that the ambiguous % function can also cause issues on algebraic calculators. For example, algebraics (including the 33S in ALG mode) typically return different answers for the following equations:

200 + 30% = 260
30% + 200 = 200.30

Edited: 17 May 2007, 12:31 a.m. after one or more responses were posted

            
Re: RPN, algebraic, and the % function
Message #16 Posted by Norris on 16 May 2007, 7:08 p.m.,
in response to message #15 by Norris

If you want to add a % function for use with multiplication/division to the 33S, just program it in as follows:

[left-shift] PRGM
[left-shift] LBL I
100
/
[right-shift] RTN
[left-shift] PRGM

Now simply use XEQ %, instead of %, when you use % with multiplication and division operations. Example: 30 ENTER 50 XEQ % / yields 60. Continue to use the existing % function when you use % with addition and subtraction.

Edited: 16 May 2007, 7:18 p.m.

                  
Re: RPN, algebraic, and the % function
Message #17 Posted by tropicflite on 16 May 2007, 10:35 p.m.,
in response to message #16 by Norris

First, thanks for you efforts. Your program works a treat, and now lives in my 33S. That said, I was curious about the results of the 2 different % functions you mentioned, so I tried it on 3 different calculators, which yielded some interesting (and varying) results.

Calculator 1: LeWorld one-dollar six-banger

200 + 30 % --- returns 260

200 - 30 % --- returns 140

200 * 30 % --- returns 60

200 / 30 % --- returns 666.66666

Calculator 2: TI-30X IIS (2-line ALG scientific calc)

200 + 30 % --- returns 200.3

200 - 30 % --- returns 199.7

200 * 30 % --- returns 60

200 / 30 % --- returns 666.66666

Calculator 3: HP-33S (in ALG mode, results exactly as you stated)

200 + 30 % --- returns 60

200 - 30 % --- returns 60

200 * 30 % --- returns .30

200 / 30 % --- returns .30

Edited: 16 May 2007, 10:55 p.m.

                        
Re: RPN, algebraic, and the % function
Message #18 Posted by John Smitherman on 16 May 2007, 11:23 p.m.,
in response to message #17 by tropicflite

Quote:
Calculator 3: HP-33S (in ALG mode, results exactly as you stated)

200 + 30 % --- returns 60

200 - 30 % --- returns 60

200 * 30 % --- returns .30

200 / 30 % --- returns .30


Hi tropicflite. I believe that you need to press Enter after pressing the % key in order to complete the operation.

Regards,

John

                              
Re: RPN, algebraic, and the % function
Message #19 Posted by Norris on 17 May 2007, 12:02 a.m.,
in response to message #18 by John Smitherman

As stated above, if you add "ENTER" to the 33S operations, you will get the final results of the percentage calculations (which should be 260, 140, 60, 666.67). I omitted this step, because I wanted to emphasize the differences in the intermediate result obtained from the % function alone.

As you have probably figured out, for an equation like:

X + Y% =
then Y% is defined as XY/100

but for an equation like:

X / Y% =
then Y% is defined as Y/100 (which is different)

The algebraic calculator "knows" which Y% you want, because it "sees" the preceding operator (unless you feed it an equation without a preceding operator, like 30% + 200, in which case it may err). The RPN calculator doesn't "see" the preceding operator, and thefore can't make that determination.

Edited: 17 May 2007, 12:15 a.m.

                                    
Re: RPN, algebraic, and the % function
Message #20 Posted by Norris on 17 May 2007, 12:26 a.m.,
in response to message #19 by Norris

I have to say that I was surprised by the results that you got from the TI-30 IIS. The "200 + 30% = 200.30" is probably not the result that most people would expect. Like the 33S in RPN mode, the TI-30 IIS apparently uses only one of the two %-formulas (but the 33S/RPN uses the XY/100, while the TI-30 IIS apparently uses Y/100 instead).

I found a TI-30 IIS here in the office and tried it, and got the same result that you did. My old TI-30X Solar, on the other hand, returns the expected result of 260 for this calculation.

                                          
Re: RPN, algebraic, and the % function
Message #21 Posted by Bill Rice on 17 May 2007, 8:22 a.m.,
in response to message #20 by Norris

Truly "unexpected" is the result on a Casio fx-115MS: 200 + 30% = 766.66667

30% + 200 = 230

This is why I've never trusted that key on anything but a 12c.

                                          
RPN, algebraic, and the % function on TIs
Message #22 Posted by Norris on 17 May 2007, 11:45 a.m.,
in response to message #20 by Norris

I would expect that the most common use of the % key is to calculate costs, given discounts or surcharges. For example, what is the total cost of a $19.95 item if it is 25% off, and if there is 8% sales tax?

You can readily solve this problem with the % key on most cheapo algebraic calculators (19.95 - 25% + 8% = 16.16). Or you could use an HP RPN calculator, because its % function is designed to work with addition and subtraction.

But you can't solve this problem with some high-end TI calculators, including the "top-of-the-line" TI-89. On the TI-89, 19.95 - 25% + 8% ENTER yields 19.78. The % function is designed for use with multiplication/division, not addition/subtraction.

The "top-of-the-line" HPs, like the 48G series or 50G, have both the % and %T functions.

                                          
The % function on Casios
Message #23 Posted by Norris on 17 May 2007, 1:39 p.m.,
in response to message #20 by Norris

The % function on some Casios apparently can't be used with addition/subtraction either. On a Casio fx-260 Solar:

200 + 30% yields 766.66667 (as noted above for the Casio fx-115MS)
200 - 30% yields 566.66667

19.95 - 25% + 8% yields -20.2 (after subtracting 25%) and then -152.5 (after adding 8%). I have no clue how it gets these results.

I looked in the Casio manual for this model. It only provides examples for using % with multiplication/division. There is no warning about using % with adddition/subtraction.

Edited: 17 May 2007, 1:46 p.m.

                                                
Re: The % function on Casios
Message #24 Posted by Bill (Smithville, NJ) on 17 May 2007, 2:31 p.m.,
in response to message #23 by Norris

Hi Norris,

Check out the Casio FX-260 training guide (PDF):

Training Guide

It has the following example of how to add a percentage:

Quote:
To add a percentage 15% to 1000 (or 1000 increased by 15%)

[1000] [x] [15] [SHIFT] [%] [+]

Result = 1150


There's some other Percentage operations included in the guide.

Bill

Edited: 17 May 2007, 2:59 p.m.

                                                      
Re: The % function on Casios
Message #25 Posted by Norris on 17 May 2007, 3:00 p.m.,
in response to message #24 by Bill (Smithville, NJ)

OK, that procedure, while clumsy and unintuitive, does work on my fx-260, for both adding and subtracting percentages. For example:

[19.95] [x] [25] [%] [-] [x] [8] [%] [+] yields 16.16

But this procedure is not documented in the User's Manual that comes with the calculator. I don't think there was any "Training Guide" included.

Apparently the 260 only implements one form of the % function, designed for use with multiplication/division. So to add or subtract %, you have to append the addition or subtraction operator at the end of the equation, after you've calculated the percentage. It's almost like RPN ! (except, of course, for the preceding multiplication operations)

Edited: 17 May 2007, 5:37 p.m. after one or more responses were posted

                                                            
Re: The % function on Casios
Message #26 Posted by Bill (Smithville, NJ) on 17 May 2007, 3:22 p.m.,
in response to message #25 by Norris

Hi Norris,

Quote:
But this procedure is not documented in the User's Manual that comes with the calculator.

Is the User's manual you posted a link to the same that came with the calculator? If so, then check Example 3, at bottom of page 10 and Example 4 at top of Page 11:

EXAMPLE 3: To add 15% onto 2500

[2500] [X] [15] [SHIFT] [%] [+] yields 2875

The Training Guide I found by doing Google Search. I don't have any Casio's, but the Casioeducation site looks interesting. But I think it may need a login to get to the training guide through the normal way on their web site.

Bill

Edited: 17 May 2007, 3:23 p.m.

                                                                  
Re: The % function on Casios
Message #27 Posted by Norris on 17 May 2007, 5:38 p.m.,
in response to message #26 by Bill (Smithville, NJ)

Yup, you're right, I missed it.

                        
Re: RPN, algebraic, and the % function
Message #28 Posted by Paul Brogger on 17 May 2007, 4:19 p.m.,
in response to message #17 by tropicflite

All of the foregoing just underscores the point that the % "function" is a marketing gimmick, with varying implementations and interpretations.

In the interest of learning "real" math, far better to understand what "percent" means, and to become accustomed to (for example) multiply by 1.3 rather than "<n> + 30 %".

                              
Re: RPN, algebraic, and the % function
Message #29 Posted by Norris on 17 May 2007, 6:49 p.m.,
in response to message #28 by Paul Brogger

You're right. For example, I never really appreciated the variability in the % function before this tread started, because I never use this key myself.

      
Re: Percent of total in RPN mode
Message #30 Posted by Karl Schneider on 17 May 2007, 12:35 a.m.,
in response to message #1 by tropicflite

Quote:
I have a 33s, and I cannot figure out how to find a percent of a total in RPN mode by using the % key.

i.e., 30 is 'what percent' of 50.

The best I can come up with is

30 enter 50 / 100 x


That indeed is the best way to perform the calculation. But really, the mathematically-inclined user is expected to be able to mentally shift the decimal point two places to the right. That's probably why no built-in function was provided on RPN scientific models.

However, the financial models (e.g., HP-12C, HP-10B, HP-14B, and HP-17B), whether RPN or algebraic, usually include a "%T" (percent of total) function. This function is implemented where possible in a menu, which makes RPN or algebraic mode irrelevant.

-- KS

            
Re: Percent of total in RPN mode
Message #31 Posted by A Physicist on 17 May 2007, 11:17 a.m.,
in response to message #30 by Karl Schneider

Quote:
the mathematically-inclined user is expected to be able to mentally shift the decimal point two places to the right. That's probably why no built-in function was provided on RPN scientific models.

However, the financial models ... include a "%T" (percent of total) function.


Always knew there is a difference between science and business :-))


[ Return to Index | Top of Index ]

Go back to the main exhibit hall