Golden ratio base useful? Easy logarithm in phinary system

Click For Summary
SUMMARY

The discussion centers on the utility of the Golden ratio base, known as the phinary system, particularly in calculating logarithms. A Python algorithm is presented that computes logarithms in base phi using only two multiplications or divisions per digit, demonstrating efficiency in digit generation. The conversation also touches on the ease of division in this system, with participants questioning the complexity of converting between phinary and other bases like base 10 or base 2. The potential for irrational bases with similar properties is also explored.

PREREQUISITES
  • Understanding of the Golden ratio (phi) and its mathematical significance
  • Familiarity with logarithmic functions and their properties
  • Basic knowledge of Python programming and algorithm implementation
  • Concepts of number bases, particularly base phi and binary systems
NEXT STEPS
  • Explore the implementation of logarithmic functions in different bases, such as "Learn logarithms in base 10 and base 2."
  • Investigate the properties of irrational bases and their computational efficiencies, focusing on "Research irrational bases in mathematics."
  • Study performance optimization techniques in algorithms, particularly "Learn about algorithmic complexity and optimization strategies."
  • Read about the historical context and applications of the Golden ratio in design and mathematics, such as "Examine Le Corbusier's use of the Golden ratio in architecture."
USEFUL FOR

Mathematicians, software developers, and researchers interested in logarithmic calculations, algorithm optimization, and the applications of the Golden ratio in various fields.

Gerenuk
Messages
1,027
Reaction score
5
I was wondering if the Golden ratio base (phinary system) has any use somewhere and if arithmetics with it is easy?

I programmed a surprisingly simple algorithm to calculate the logarithm yielding digits in base phi using nothing more than 2 multiplications/divisions per result digit. Can it be useful?

Here the python programm if you want to see:
Code:
phi=(sqrt(5)+1)/2
base=2
digits=5
totalDigits=30

a0,b0=1/base**(phi**digits),base**(phi**(digits-1))

def logPhinary(x):
  a,b=a0,b0
  result=""
  x*=a
  switch=0
  for i in range(totalDigits):
    if switch==0:
      a*=b
      if x > 1:
        result+="1"
        b*=a
        x*=a
      else:
        switch=1
        x/=a
    else:
      b*=a
      if x > 1:
        result+="1"
        a*=b
        x/=b
      else:
        switch=0
        x*=b
    result+="0"
  return result[0:digits+1]+"."+result[digits+1:] #insert decimal point
 
Mathematics news on Phys.org
how difficult is it to convert to base 10 or base 2? and vice versa.

i found it especially interesting that 1/0 is (apparently) easy to calculate. doesn't that mean that division can be done as quickly as multiplication?

are there lots of irrational bases that have these properties or is (1+ sqr(5))/2 unique?
 
Last edited:
granpa said:
how difficult is it to convert to base 10 or base 2? and vice versa.

You mean to convert the result of the logarithm (which is in base phi) to binary again?
Haven't checked yet. Just learned about them and noticed that logarithm should be quite easy.

Maybe one can stay phinary for a while in calculations :-)
 
granpa said:
i found it especially interesting that 1/0 is (apparently) easy to calculate. doesn't that mean that division can be done as quickly as multiplication?
Actually there are ways to avoid division in my algorithm, but I thought division and multiplication are equally complex for floats. Not sure about that though...
 
well I know that there are tricks that make multiplication quite fast. I was assuming that division would necessarily be slower.
 
division is slower
 
actually calculating 1/x isn't any faster in phinary.

the result of your function is in phinary. what is the input to the function?
 
OK, then here is the algorithm without division (for performance unfolding of the variable swapping can be also done)
Code:
from math import *
phi=(sqrt(5)+1)/2
base=2
digits=5
totalDigits=30
x=100
a0,b0,y0=1/base**(phi**digits),base**(phi**(digits-1)),base**(phi**digits)

def logPhinary(x):
  a,b,y=a0,b0,y0
  result=""
  while 1:
    while x>y:
      result+="10"
      a*=b
      b*=a
      x*=a
    a,b,x,y=b,a,-y,-x
    result+="0"
    b*=a
    x*=b
    if len(result)>=totalDigits: break
  return result[0:digits+1]+"."+result[digits+1:]

The input can be any system, where you are able to store the initial values a0,b0,y0, do multiplications and compare. So probably the internal machine binary is best.
 
If you are still interested in this, there's an interesting passage in a book called the Modulor 2 by Le Corbusier, he was interested in the golden ratio as a tool to dictate design, but he was looking for people to affirm his ideas, so he asked some mathematicians to look at what he did. In the passage a mathematician ( I can find his name for you if you want) wrote about how the golden ratio may become a the new base to use - how the study and analysis of logarithm were largely forgotten after 1900, especially after people new topics in physics prioritized theoretical physics and quantum mechanics - and how maybe the logarithm of the golden ratio may revive studies in them.
 
  • #10
The Golden ratio doesn't help to study logarithms directly - I mean not the algebra.
But calculating the digits might be easy. I couldn't think of an overall performance increase in calculations though, as the phinary system isn't easy in other contexts.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 6 ·
Replies
6
Views
16K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K