The Museum of HP Calculators

HP Forum Archive 18

[ Return to Index | Top of Index ]

And another 12c mini-challenge (phi)
Message #1 Posted by Paul Dale on 15 Jan 2009, 4:56 p.m.

After the rather difficult pi challenge, I thought I'd propose another (hopefully) easier challenge. This time we're after the golden ratio, phi, which is approximately 1.6180339887...

Now, the obvious six command / seven keystroke sequence on the 12c is:

    5 g-sqrt 1 + 2 /

This results in 1.618033989 on the display (assume FIX 9 is already set). I think it would be difficult to better this but I would be very interested in a shorter sequence if such is found.

However, let us presume for some unknown reason that we want the resulting digits correct and unrounded. That is, we want 1.618033988 on the display. Now clearly this can be done in four additional steps/keystrokes with

    5 sqrt 1 + 2 / EEX 9 CHS -

However, it can be done with fewer. Specifically, it can be done in at most the same number of operations and keystrokes as the correctly rounded version I gave initially. That is, six operations maximum and seven keystrokes maximum.

Is anybody up to this challenge?

- Pauli

      
Re: And another 12c mini-challenge (phi)
Message #2 Posted by Namir on 15 Jan 2009, 8:11 p.m.,
in response to message #1 by Paul Dale

How about

[3] [6] [cos] [2] [x]

You get phi. I assume the angle mode is degrees.

Namir

            
Re: And another 12c mini-challenge (phi)
Message #3 Posted by Paul Dale on 15 Jan 2009, 8:20 p.m.,
in response to message #2 by Namir

Nice solution, which for some reason I didn't remember. Still it would save a key stroke on a 15c.

However, we're on a 12c which doesn't have COS and I asked for phi unrounded which is (phi - 10^-9).

- Pauli

edit: got the keystroke count wrong

edit: and then realised I hadn't

Edited: 15 Jan 2009, 11:18 p.m. after one or more responses were posted

                  
Re: And another 12c mini-challenge (phi)
Message #4 Posted by Namir on 15 Jan 2009, 8:32 p.m.,
in response to message #3 by Paul Dale

You are right. There is no cos in the 12c. However, one who needs to work with phi will most likely use an 11c, 15c, 41c, 42s, and so on. So why not use the more appropriate tool?

Namir

                        
Re: And another 12c mini-challenge (phi)
Message #5 Posted by Paul Dale on 15 Jan 2009, 8:38 p.m.,
in response to message #4 by Namir

This is a challenge and for scientific things the 12c is often not the best suited which makes it more interesting...

- Pauli

                              
Re: And another 12c mini-challenge (phi)
Message #6 Posted by Namir on 15 Jan 2009, 10:15 p.m.,
in response to message #5 by Paul Dale

So how is it best suited for trig functions (for example)? It takes pretty much a long set of keystrokes to emulate predefined trig functions in the scientific calculators. I learned that it is better to work smarter than harder.

                  
Re: And another 12c mini-challenge (phi)
Message #7 Posted by Namir on 16 Jan 2009, 9:53 a.m.,
in response to message #3 by Paul Dale

I forgot to mention that MY Hp-12C has a COS key!!!

Minor detail! Sorry!

Edited: 16 Jan 2009, 9:54 a.m.

      
Re: And another 12c mini-challenge (phi)
Message #8 Posted by Anthony L. Mach on 15 Jan 2009, 11:40 p.m.,
in response to message #1 by Paul Dale

It looks like replacing EEX 9 CHS - with 1 - 1/x seems to do the trick as well. Interesting...

Tony

            
Re: And another 12c mini-challenge (phi)
Message #9 Posted by Paul Dale on 15 Jan 2009, 11:56 p.m.,
in response to message #8 by Anthony L. Mach

Yes, one of the many self referential formulas involving phi rounds the other way.

Unfortunately, 9 commands / 10 keystrokes.

- Pauli

                  
Re: And another 12c mini-challenge (phi)
Message #10 Posted by Chris Dean on 16 Jan 2009, 9:49 a.m.,
in response to message #9 by Paul Dale

How about the ratio of two consecutive Fibonacci numbers?

196418 enter 121393 / = 1.6180339887... (displayed as 1.618033989)

Regards

Chris Dean

                        
Re: And another 12c mini-challenge (phi)
Message #11 Posted by Namir on 16 Jan 2009, 9:52 a.m.,
in response to message #10 by Chris Dean

Chris,

That requires "beaucoup" keystrokes!!!

Namir

                              
Re: And another 12c mini-challenge (phi)
Message #12 Posted by Chris Dean on 16 Jan 2009, 11:43 a.m.,
in response to message #11 by Namir

Ah but so simple

                                    
Re: And another 12c mini-challenge (phi)
Message #13 Posted by Namir on 16 Jan 2009, 2:49 p.m.,
in response to message #12 by Chris Dean

I think Paul is counting keystrokes. The one that is even simpler is to simply type they value of phi.

:-)

Namir

      
Re: And another 12c mini-challenge (phi)
Message #14 Posted by Paul Dale on 16 Jan 2009, 5:21 p.m.,
in response to message #1 by Paul Dale

Time for a hint. Skip this post if you want to try the challenge unaided.

The formula I used for phi (sqrt(5) + 1)/2 is still used, however you'll have to juggle the percentages to obtain the answer.

- Pauli

      
Re: And another 12c mini-challenge (phi)
Message #15 Posted by Gerson W. Barbosa on 16 Jan 2009, 8:40 p.m.,
in response to message #1 by Paul Dale

Obviously this is not a solution, just a different way to get phi on the 12C:

01 1
02 sqrt
03 PSE
04 1
05 +
06 GTO 02

After 19 or so iterations it will display the unrounded value of phi. However the next ones will show the properly rounded answer.

There is another 9-step solution around but it will take too long before the answer briefly appears :-)

Gerson.

      
Re: And another 12c mini-challenge (phi)
Message #16 Posted by Namir on 16 Jan 2009, 9:09 p.m.,
in response to message #1 by Paul Dale

Here is an approximation for phi that has a 5-decimal accuracy:

[5] [LN] [9] [EEX] [CHS] [3] [+]

Seven steps.

Namir

Edited: 16 Jan 2009, 9:13 p.m.

      
Re: And another 12c mini-challenge (phi)
Message #17 Posted by Paul Dale on 18 Jan 2009, 3:58 p.m.,
in response to message #1 by Paul Dale

Even with the hint, no success :-(

I was seeking this solution:

    5 SQRT 5 delta% 2 %T 

- Pauli

Edited: 18 Jan 2009, 3:58 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall