The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

An (HP-15C, HP-...) mini-quiz
Message #1 Posted by Valentin Albillo on 5 Oct 2006, 9:07 a.m.

Hi, all:

    As the Forum's really quiet these past few days, I think you'll welcome the opportunity to engage this little mini-quiz I've concocted in a hurry for your leisurely HP-calc pleasure. It's quite simple, actually:

    The mini-quiz

    Assuming the correct FIX mode to display the decimal places shown, and assuming nothing else unless otherwise stated, find the minimum number of steps required to generate the following displays:

    ----------------------------------------------------------------------
       Display    Extra assumptions, if any          My HP-15C solution
    ----------------------------------------------------------------------

    -0.1416 assume 42 is in X, can't use Pi 3 steps

    0.1717 assume master-cleared machine 2 steps

    0.1122 assume master-cleared machine 4 steps

    1.43143 assume nothing else 4 steps

    22.755533 assume nothing else 5 steps

    ----------------------------------------------------------------------

    For the purposes of this mini-quiz, a 'step' is defined as any sequence of keystrokes that could be stored in a single program step if programmed, no matter how many or how few keystrokes it does take. For instance, to achieve a 0.5678 display, assuming nothing but the proper FIX 4 display mode, an allegedly minimum solution would be:
               31, SQRT, FRAC  ->  0.5678
    
    which is four steps long: 3, 1, SQRT, f FRAC

    Though this mini-quiz is intended for the HP-15C, and I'll give my original solutions in the stated number of steps exclusively for this specific machine, you can try your hand with any other classic HP calc models such as the 11C, 34C, etc. Newer models such as the 41C or 42S, say, that can store a whole multi-digit number in a single program step are not eligible, as the quiz is utterly trivial for them, of course.

    I'll post my solutions next Monday. Enjoy, see what you can do and ...

Best regards from V.

Edited: 5 Oct 2006, 9:15 a.m.

      
Re: An (HP-15C, HP-...) mini-quiz
Message #2 Posted by Gerson W. Barbosa on 5 Oct 2006, 6:01 p.m.,
in response to message #1 by Valentin Albillo

Hello Valentin,

The easiest ones first:

Assuming ON/- has just been executed:

RAN# ->H -> .1717

6.4 TAN -> .1122

Regards,

Gerson

            
Re: An (HP-15C, HP-...) mini-quiz
Message #3 Posted by Mike T. on 5 Oct 2006, 6:42 p.m.,
in response to message #2 by Gerson W. Barbosa

I'm impressed, but what made you think of

RAN# ->H -> .1717

Mike T.

                  
Re: An (HP-15C, HP-...) mini-quiz
Message #4 Posted by Gerson W. Barbosa on 5 Oct 2006, 9:08 p.m.,
in response to message #3 by Mike T.

Because Valentin asked us to assume a master-cleared machine, I thought he'd used trigs in degrees mode. I imagined also he might have used RAN# because this would also require resetting the calculator to its initial condition (assuming the random number generator seed to be zero would be too obvious :-). Doing this (0 STO #RAN) makes the first random number to be 0.101798. Then it was just a matter of finding a function that turned .1018 into .1717 (I should have noticed that 10 minutes = 0.1667 hours and tried ->H at first, but that was not necessary as the third or fourth function I tried worked...)

Gerson.

      
Re: An (HP-15C, HP-...) mini-quiz
Message #5 Posted by Paul Dale on 5 Oct 2006, 7:48 p.m.,
in response to message #1 by Valentin Albillo

Quote:

    0.1122    assume master-cleared machine         4 steps

A couple of other ways to achieve this one:

    4 1 SQRT TAN
    PI 2 8 /

- Pauli

      
Re: An (HP-15C, HP-...) mini-quiz
Message #6 Posted by Paul Dale on 9 Oct 2006, 3:58 a.m.,
in response to message #1 by Valentin Albillo

Quote:
----------------------------------------------------------------------
   Display    Extra assumptions, if any          My HP-15C solution
----------------------------------------------------------------------

-0.1416 assume 42 is in X, can't use Pi 3 steps


A little progress on this one. If we're in radians or complex mode then these two sequences work out but don't use the 42 on the stack:

    3 TAN ATAN
or  3 TAN TANH

Get the result. I don't see how to get the calculator into radians or complex mode without an extra keystroke (RAD, I or Re<>Im).

In degrees mode this sequence is pretty neat but still too long:

    SIN SINH LOG TANH

- Pauli

Edited: 10 Oct 2006, 3:42 a.m.

      
Re: An (HP-15C, HP-...) mini-quiz
Message #7 Posted by Paul Dale on 9 Oct 2006, 4:24 a.m.,
in response to message #1 by Valentin Albillo

Quote:
----------------------------------------------------------------------
   Display    Extra assumptions, if any          My HP-15C solution
----------------------------------------------------------------------

1.43143 assume nothing else 4 steps


My best so far for this is the five sequence:

    9 TAN SINH 9 *

which assumes both degrees and that we are not partially through entering a number. Neither is allowed by a strict interpretation of the rules.

- Pauli

      
Re: An (HP-15C, HP-...) mini-quiz
Message #8 Posted by Paul Dale on 9 Oct 2006, 5:30 a.m.,
in response to message #1 by Valentin Albillo

Quote:
For instance, to achieve a 0.5678 display, assuming nothing but the proper FIX 4 display mode, an allegedly minimum solution would be:
           31, SQRT, FRAC  ->  0.5678
which is four steps long: 3, 1, SQRT, f FRAC

Since I'm not making progress on the other problems, I had a stab at the example. I've found two other four step sequences but none shorter:

    3 1 ->RAD SINH
&   3 7 TAN x^2

The latter assumes degrees mode so it isn't as good.

- Pauli

      
Re: An (HP-15C, HP-...) mini-quiz
Message #9 Posted by Paul Dale on 17 Oct 2006, 2:30 a.m.,
in response to message #1 by Valentin Albillo

Are we going to see the solutions to this quiz? Monday has twice past.

- Pauli

            
HP-15C Mini-quiz: My original solutions
Message #10 Posted by Valentin Albillo on 17 Oct 2006, 5:46 a.m.,
in response to message #9 by Paul Dale

Certainly, certainly ! ...

    I've been out and about and just completely forgot about this simple mini-quiz which, as stated, I concocted on the fly to try and cheer up the forum at a time where new postings were really scarce.

    The forum's been much livelier since then, and I've been too busy so I simply forgot about it, sorry. Anyway, here you are, my original solutions:

      -0.1416    assume 42 is in X, can't use Pi       3 steps  

    STO RAN#, RAN#, LOG => -0.1416

    0.1717 assume master-cleared machine 2 steps

    RAN#, ->H => 0.1717

    0.1122 assume master-cleared machine 4 steps

    RAN#, SIGMA+, RCL 3, RCL+4 => 0.1122

    1.43143 assume nothing else 4 steps

    PI, STO RAN#, RAN#, COSH => 1.43143

    22.755533 assume nothing else 5 steps

    PI, GAMMA, STO RAN#, RAN#, ->DEG => 22.755533

    All of them work also on an HP-11C, except the one using RCL arithmetic that the HP-15C implements but the HP-11C doesn't.

    You may also notice that all my solutions make use of the random number functionality, which is identical for both models except that you can use RCL RAN# in the HP-15C to recall the seed actually stored in the internal RAN# register, which isn't possible in the HP-11C. Anyway, none of my solutions rely on this particular instruction.

    Thanks for your interest, sorry for the delay, and

Best regards from V.
                  
Re: HP-15C Mini-quiz: My original solutions
Message #11 Posted by Gerson W. Barbosa on 17 Oct 2006, 10:20 p.m.,
in response to message #10 by Valentin Albillo

Hello Valentin,

I thought of RAN#, SIGMA+, RCL 3, and RAN#, SIGMA+, RCL 4 , but never of something like RCL+4... I also tried the sequence STO RAN#, RAN#...

Just to show you I tried see this:

.48 1/x COSH x! LOG        => 1.43143 

or

.8 ->HMS 1/x COSH x! LOG   => 1.43143 

Seven steps though. It would have been much better if I just entered the constant :-)

These tricks were important to save a few steps on these old calculators. They were useful even on the not so old HP-32SII. For instance, in one of my 32SII programs I used at work I needed the constant 0.1965. I remember I used 2, 1/x, -> in instead of simply 0.1965. That was two steps longer but 5 bytes shorter (the 0.2% difference didn't matter). That was important in a 384-byte calculator (not on the HP-33S though).

As of quizzes, these are easy to create, but difficult to solve (if no clues are given :-)

22.75555555    (6 steps)

6.665555 (3 steps)

Assume nothing but the display format. They work also on the HP-11C. The latter doesn't work on the HP-33C. None works on the HP-12C. A math constant is needed in both (guess what!).

Best regards,

Gerson.

Edited: 17 Oct 2006, 10:24 p.m.

                        
Re: HP-15C Mini-quiz: My original solutions
Message #12 Posted by Paul Dale on 17 Oct 2006, 11:47 p.m.,
in response to message #11 by Gerson W. Barbosa

Quote:
22.75555555    (6 steps)
 6.665555      (3 steps)

Only tried the first so far but how are these possibilities:

    3 2 x^2 4 5 /
    3 2 x^2 1 ATAN /

The second requires degrees mode.

Also interesting are:

    2 ATAN 7 x^2 %change CHS
    2 ATAN 4 9 %change CHS

In either case, CHS could be replaced by absolute value.

- Pauli

                              
Re: HP-15C Mini-quiz: My original solutions
Message #13 Posted by Gerson W. Barbosa on 18 Oct 2006, 10:11 a.m.,
in response to message #12 by Paul Dale

Quote:
    3 2 x^2 4 5 /
    3 2 x^2 1 ATAN /

These are fine. Only we don't want the final '6' :-)

(Of course this wouldn't be a problem in real world, and still would be one step shorter than the equivalent fraction).

My solution involves squaring a two-digit integer first (or twice squaring a one-digit integer), as yours, and requires PI too, as I said. Your solution to the second problem obviously matches mine!

Gerson.

Edited: 18 Oct 2006, 12:31 p.m.

                                    
Re: HP-15C Mini-quiz: My original solutions
Message #14 Posted by Paul Dale on 18 Oct 2006, 6:33 p.m.,
in response to message #13 by Gerson W. Barbosa

Quote:
These are fine. Only we don't want the final '6' :-)

Oops, miscounted the 5's :-(

How about this instead:

    8 x^2 x^2 ->RAD pi /

where the 8 x^2 can be replaced by 64 if desired.

Interestingly these two permutations have a trailing '6' digit:

    8 x^2 x^2 pi / ->RAD
    8 x^2 x^2 pi ->DEG /

- Pauli

                                          
Re: HP-15C Mini-quiz: My original solutions
Message #15 Posted by Gerson W. Barbosa on 18 Oct 2006, 8:38 p.m.,
in response to message #14 by Paul Dale

Quote:
8 x^2 x^2 ->RAD pi /

Bingo! Next time I will give no tips. (I am kidding, there won't be more of these.)

Quote:
Interestingly these two permutations have a trailing '6' digit:
    8 x^2 x^2 pi / ->RAD
    8 x^2 x^2 pi ->DEG /

This is a case where the less accurate result was better :-)

Regards,

Gerson.

                        
Re: HP-15C Mini-quiz: My original solutions
Message #16 Posted by Paul Dale on 17 Oct 2006, 11:54 p.m.,
in response to message #11 by Gerson W. Barbosa

Quote:
 6.665555      (3 steps)

Figured out this one too:

    PI ->H.MS x!

- Pauli

Edited: 18 Oct 2006, 5:31 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall