All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Phi Proximity Poser (Posted on 2023-02-07) Difficulty: 3 of 5
Using each of the digits 1 to 9 exactly once, and the standard arithmetic operators, +,-, *, /, and, () as many times as required; come up with a value that is closest to φ.
This means, minimizing abs(V - φ), where V is the obtained value and, abs is the absolute function.

(I) Use only the individual digits. Concatenations like (98-34)/(1*2) - (56/7) are NOT allowed.

(II) Concatenations are allowed.

Note: φ is the golden ratio or the golden mean.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Slightly improved Part (II) Comment 3 of 3 |
Best so far:   34/21 - 7/6895 with error= 1.5981286718425025e-06

Starting with the template of 34/21 - a/bcde where {a,b,c,d,e} are {5,6,7,8,9}
I found the closest solution of that particular format as:
34/21 - 7/6895 = 1.618032390621223 error= 1.5981286718425025e-06

Other templates based on Fibonacci ratios not as close:
Starting with a format of 13/8 - ab/cdef :
13/8 - 52/7469 = 1.6180378899451064 error= 3.9011952115419746e-06 which was not quite as good

And the best of 8/5 - ab/cdefg was
8/5 + 97/12346 = 1.6078567957233112 error= 0.010177193026583709 which is nowhere near as close

------------
sample code; modified for each variation of the template
frac = 34/21
others = '56789'
others = [int(a) for a in others]
smallerr = 1
from itertools import permutations
for p  in permutations(others):
    errorterm = p[0]/(1000*p[1] + 100*p[2] + 10*p[3] + p[4])
    err = abs(phi - (frac - errorterm))
    if err < smallerr:
        guess = frac - errorterm
        best = p
        print('34/21 - {}/{}{}{}{} = {} error= {}'.format(p[0],p[1],p[2],p[3],p[4],guess, err))
        smallerr = err

  Posted by Larry on 2023-02-08 10:37:41
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information