▼
Posts: 1,755
Threads: 112
Joined: Jan 2005
Hi, all:
As the Forum's really quiet these past few days, I think you'll welcome
the opportunity to engage this little miniquiz I've concocted in a hurry for your
leisurely HPcalc pleasure. It's quite simple, actually:
The miniquiz
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 HP15C solution

0.1416 assume 42 is in X, can't use Pi 3 steps
0.1717 assume mastercleared machine 2 steps
0.1122 assume mastercleared machine 4 steps
1.43143 assume nothing else 4 steps
22.755533 assume nothing else 5 steps

For the purposes of this miniquiz, 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 miniquiz is intended for the HP15C, 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 multidigit 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.
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Hello Valentin,
The easiest ones first:
Assuming ON/ has just been executed:
RAN# >H > .1717
6.4 TAN > .1122
Regards,
Gerson
▼
Posts: 282
Threads: 46
Joined: Jul 2005
I'm impressed, but what made you think of
RAN# >H > .1717
Mike T.
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
Because Valentin asked us to assume a mastercleared 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.
Posts: 3,229
Threads: 42
Joined: Jul 2006
Quote:
0.1122 assume mastercleared machine 4 steps
A couple of other ways to achieve this one:
4 1 SQRT TAN
PI 2 8 /
 Pauli
Posts: 3,229
Threads: 42
Joined: Jul 2006
Quote:

Display Extra assumptions, if any My HP15C 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.
Posts: 3,229
Threads: 42
Joined: Jul 2006
Quote:

Display Extra assumptions, if any My HP15C 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
Posts: 3,229
Threads: 42
Joined: Jul 2006
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
Posts: 3,229
Threads: 42
Joined: Jul 2006
Are we going to see the solutions to this quiz?
Monday has twice past.
 Pauli
▼
Posts: 1,755
Threads: 112
Joined: Jan 2005
Certainly, certainly ! ...
I've been out and about and just completely forgot about this simple miniquiz 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 mastercleared machine 2 steps
RAN#, >H => 0.1717
0.1122 assume mastercleared 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 HP11C, except the one using RCL
arithmetic that the HP15C implements but the HP11C 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 HP15C to recall the seed actually stored in the internal RAN# register, which isn't possible in the HP11C. Anyway, none of my solutions rely on this particular instruction.
Thanks for your interest, sorry for the delay, and
Best regards from V.
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
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 HP32SII. 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 384byte calculator (not on the HP33S 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 HP11C. The latter doesn't work on the HP33C. None works on the HP12C. A math constant is needed in both (guess what!).
Best regards,
Gerson.
Edited: 17 Oct 2006, 10:24 p.m.
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
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
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
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 twodigit integer first (or twice squaring a onedigit 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.
▼
Posts: 3,229
Threads: 42
Joined: Jul 2006
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
▼
Posts: 2,761
Threads: 100
Joined: Jul 2005
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.
Posts: 3,229
Threads: 42
Joined: Jul 2006
Quote:
6.665555 (3 steps)
Figured out this one too:
PI >H.MS x!
 Pauli
Edited: 18 Oct 2006, 5:31 a.m.
