Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2005-08-29 10:28:32

John E. Franklin
Guest

Converting 3.14159265358979323846 into base-26 using alphabet

Imagine base-26 where Z=0, A=1, B=2, C=3, D=4, ..., T=20, U=21, V=22, W=23, X=24, Y=25.
What approach should I take to convert the first 20 decimals of pi into this base-26?
The answer would begin:   C.C I guess.   I am interested in pure methods and methods that only are useful to certain number of digits.

#2 2005-08-29 11:21:57

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,555

Re: Converting 3.14159265358979323846 into base-26 using alphabet

Hi John, you have made some very helpful posts and still a guest!

Base conversion of whole numbers is fairly easy if you think about remainders.

Let's a whole number that looks like PI but without "decimals"!

Watch this series of divisions (R means remainder, which is ignored in the next division):

31416 / 26 = 1208 R 8 
1208 / 26 = 46 R 12
46 / 26 = 1 R 20

Now, think about the last answer (1 R 20), it means that 31416/26/26/26 = 1 (plus bits), in other words it tells us that we should put a "1" in the "power of 3" column!!!

Likewise we should put a 20 in the hundreds, 12 in the tens and 8 in the units.

Why?

Becasue our division work just before has really said that:
31416 = 1208 × 26 + 8 (so 8 belongs in the units, and from here on we are dealing with the next column of digits)
1208 = 46 × 26 + 12 (so 12 belongs in the second column, and from here we go to the third column)
46 = 1 × 26 + 20 (so 20 belongs in the thirtd column, and we put one in the fourth column)

Let's see if it has worked:
1 × 26³ = 17576
20 × 26² = 13520
12 × 26 = 312
8 x 1 = 8
Total: 31416

So, to do whole numbers you do repeated divisions and put the numbers in from right to left

Now, if you have followed THAT, then we get to the tricky part: "decimals" (hmmm... not an accurate word becuase it implies base-10 but you know what I mean)

To do "decimals", you use repeated multiplies and build from left to right

.1416 × 26 = 3.6816
.6816 × 26 = 17.7216
.7216 × 26 = 18.7616
etc...

The first answer says to put a 3 in the first "decimals" column, the second answer says to put a 17 in the second column etc ..

So, I guess the answer is something like C.CQR

As a check I calculated 3 + 3/26 + 17/26² + 18/26³ = 3.141556...


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#3 2005-08-30 08:13:42

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,582

Re: Converting 3.14159265358979323846 into base-26 using alphabet

I wrote a "Just BASIC" program to compute the digits.  I used a max and min value for pi so I could see where the results diverged.  See results below.

C.CQRPK

piMax in decimal started out as: 14159265358979323847, This is: 20 digits.
piMin in decimal started out as: 14159265358979323846, This is: 20 digits.
(C,C)
(Q,Q)
(R,R)
(P,P)
(K,K)
(N,N)
(K,K)
(X,X)
(Q,Q)
(S,S)
(Q,Q)
(N,N)
(C,C)
(M,M)    fourteen digits!   Tuesday, August 30, 2005  
(F,W) This is where min and max diverge.
(V,P)
(F,H)
(M,T)
(B,E)
(L,C)
(U,T)
(Q,J)
(I,Y)
(F,F)
(R,V)
________________________________________
see code below by John E. Franklin...
'program name: base26pi_BBK.bas  (using Just BASIC v1.0 from internet)
piMax= 14159265358979323847''6'264338327950288419716939937511
piMin= 14159265358979323846   '264338327950288419716939937510
piMaxString$= STR$(piMax)
piMinString$= STR$(piMin)
piMaxLen= LEN(piMaxString$)
piMinLen= LEN(piMinString$)

print "piMax in decimal started out as: ";piMax;", This is: ";piMaxLen;" digits."
print "piMin in decimal started out as: ";piMin;", This is: ";piMinLen;" digits."

nextMax= piMax
nextMin= piMin

'commence loop
For loopAround= 1 to 25
nextMax= nextMax * 26
nextMin= nextMin * 26
nextMaxString$= STR$(nextMax)
nextMinString$= STR$(nextMin)
rightMaxString$= RIGHT$(nextMaxString$,piMaxLen)
rightMinString$= RIGHT$(nextMinString$,piMinLen)
leftMaxString$= LEFT$(nextMaxString$,LEN(nextMaxString$) - piMaxLen)
leftMinString$= LEFT$(nextMinString$,LEN(nextMinString$) - piMinLen)
'print "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
'print leftMaxString$;"%";rightMaxString$
'print leftMinString$;"%";rightMinString$
leftMax= val(leftMaxString$)
leftMin= val(leftMinString$)
'print "Next Max Digit is: ";CHR$(leftMax + 64);" ";leftMax
'print "Next Min Digit is: ";CHR$(leftMin + 64);" ";leftMin
nextMaxChar$=CHR$(leftMax + 64)
nextMinChar$=CHR$(leftMin + 64)
print "(";nextMinChar$;",";nextMaxChar$;")"

nextMax= val(rightMaxString$)
nextMin= val(rightMinString$)

next loopAround
_______________________________________________________
piMax in decimal started out as: 14160, This is: 5 digits.
piMin in decimal started out as: 14159, This is: 5 digits.
(C,C)
(Q,Q)
(R,R)
(O,S)  Diverges after 3rd digit.
(F,T)
(Z,U)
(R,V)
_______________________________________________
piMax in decimal started out as: 14159265358979323846264338327950288419716939937511, This is: 50 digits.
piMin in decimal started out as: 14159265358979323846264338327950288419716939937510, This is: 50 digits.
(C,C)
(Q,Q)
(R,R)
(P,P)
(K,K)
(N,N)
(K,K)
(X,X)
(Q,Q)
(S,S)
(Q,Q)
(N,N)
(C,C)
(M,M)
(K,K)
(G,G)
(M,M)
(P,P)
(S,S)
(F,F)
(J,J)
(T,T)
(C,C)
(P,P)
(F,F)
(S,S)
(T,T)
(H,H)
(Q,Q)
(W,W)
(M,M)
(D,D)
(P,P)
(A,A)
(B,B)
(E,M)  Diverges after 35 good digits
(Z,R)
(E,D)
(H,Z)
(D,W)
(N,R)
(B,W)
(R,Z)
(D,H)
(I,N)
(A,U)
(F,Y)
(O,S)
(L,C)
(Y,X)

__________________________________

piMax in decimal started out as: 1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303820, This is: 199 digits.
piMin in decimal started out as: 1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819, This is: 199 digits.
(min,max)
(C,C)
(Q,Q)
(R,R)
(P,P)
(K,K)
(N,N)
(K,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
(D,Y)
(Q,P)
(O,G)
(G,R)
(G,Q)
(G,Q)
(C,D)
(S,Z)
(P,S)
(E,N)
(U,X)
(H,W)
(N,Z)
(V,A)
(C,F)
(X,A)
(N,I)
(R,M)
(Q,V)
(Y,X)
(A,A)
(T,T)
(X,F)
(G,P)
(K,O)
(Y,C)
(E,V)
(Q,U)
(U,E)
(N,F)
(T,C)

__________________________________

igloo myrtilles fourmis

Offline

#4 2005-08-30 09:07:56

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,582

Re: Converting 3.14159265358979323846 into base-26 using alphabet

Hi again...

The BASIC program was a preliminary version.  I added these lines so the letter Z could be displayed not as an @ (at sign).  The @ sign precedes the capital letters in the ASCII chart, #64.
   if "@"= nextMinChar$ then nextMinChar$= "Z"
   if "@"= nextMaxChar$ then nextMaxChar$= "Z"
Also the loopAround number of times I changed as needed for different tests.
Also the last and longest one that min and max digits diverge at the 140th decimal place in base-26, that run of the program started off with 199 decimal places of pi in base-10.  I noticed it went off the screen to the right and couldn't be viewed even with
the horizontal scroll bar.  Anyway, it was kind of messy above, but I didn't want to edit the file or I might have accidentally deleted the correct data.  Finally, the left column is the minimum possible digit, and the right column is the maximum possible digit value.


igloo myrtilles fourmis

Offline

#5 2005-08-30 09:12:52

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,555

Re: Converting 3.14159265358979323846 into base-26 using alphabet

Very well done.

So now we have to know - are there any hidden messages in PI ???


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#6 2005-08-30 10:22:09

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,582

Re: Converting 3.14159265358979323846 into base-26 using alphabet

That would be cool to find words in pi!  Here are the results a little neater:

pi in base-26 where Z=0, A=1, B=2, C=3, ... X=24, Y=25.

C.
CQRPKNKXQSQNC
MKGMPSFJTCPFS
THQWMDPABJARY
HUPPUFCLDKLTD
WQNHPHXZKUTYU
DALHIOPPWKJOK
QMBEVIOAXLFFN
GILLPHRLRRBHD
JGUCTSBWSIORA
VGTENLPIZNRXF
ONVTOXLKHE


igloo myrtilles fourmis

Offline

#7 2005-08-30 13:01:53

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,582

Re: Converting 3.14159265358979323846 into base-26 using alphabet

I have been noticing something logarithmic that someone taught me years ago.
The number of digits in the base-26 number to be similar accuracy as the base-10 number
is approximately the length of the base-10 number divided by the common log of 26.
In other words, the base-26 number is shorter in digits by a factor of log(26) or 1.41.
My latest run of the program ran slower because the whole numbers were over 2400
digits long.  I haven't read the documentation of Just BASIC enough to know what the
limit is, but I am happy it seems to be working.  Here is pi in base-26 to over 1700 digits.

pi in base-26 where Z=0, A=1, B=2, C=3, ... X=24, Y=25.

C.
CQRPKNKXQSQNC
MKGMPSFJTCPFS
THQWMDPABJARY
HUPPUFCLDKLTD
WQNHPHXZKUTYU
DALHIOPPWKJOK
QMBEVIOAXLFFN
GILLPHRLRRBHD
JGUCTSBWSIORA
VGTENLPIZNRXF
ONVTOXLKHEREH
HYQNCOKXWODCN
RWLEPSPGLEWEO
UYDYQJEBVJWGS
GTGBOKDLKMTCS
LROVAAIEFRIGM
BNWYMCFGJUNYQ
MJVACLETZXIEN
YWXCJZXLMPTVK
XJZOKXAHYTXAQ
NTIYMCCILNIXN
YRBJRVOJOZCXK
OBSKICHKJTTVJ
PJVIJSYLDKFBN
GQAQIDMQPUGIS
GCKDDIUHEZEPH
BPRLSIEOOYWYN
GXPKVDCECPIQM
TGQKLBMJVPIOZ
LUMNSFUXIPMYL
TBTLXUMCAOFLY
UZLKTEAQYZOLT
JSRJATOEZUKRV
SVLZDSLUDCBHT
ISWLJMUWJCSEF
EGPAZMJNQMOEA
FMBCTJVYOJKSN
ADLNBNIFFWXAU
NZDSLGBSSLZIC
WZTVVOXULTERT
CIUNBLZGLHHGM
BKXVMOHNIDFPV
YLVQTXPDVIXUA
TGNNVZLBSTWQH
HHQURKKSZUTSV
AFWLDFFEIVPLR
UMWHODZYKACKM
GRWYDCPP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TQFFT
WKICWRZDFGRNB
DRRSTJMGMWSPU
GWWRCCUFFZSKJ
ZDGYPLZILDFJU
EJDRFLQXMFHZM
VSIZATHPVHKTK
UTVSCQSGAVIBC
IIZJFCSAMMHDI
MGVQODXTJNIEU
IUJFGK
Started with a base-10 accuracy of 2438 decimal places.
# of digits found is: 1722

smile


igloo myrtilles fourmis

Offline

#8 2005-08-31 19:33:14

wcy
Member
Registered: 2005-08-04
Posts: 117

Re: Converting 3.14159265358979323846 into base-26 using alphabet

visit http://www.geocities.com/chengyuanwu/baseconverter.html for a base converter.
removing the decimal point,  i get A4AJ8AI

Offline

Board footer

Powered by FluxBB