To celebrate 3.14 for 2009, I made the attached worksheet with an interactive Pi Chart (also a pie chart) to plot the relative frequency of the digits of pi in various bases.  Enjoy.


View 5480_PiFreq-component.mw on MapleNet or Download 5480_PiFreq-component.mw
View file details

 

The guts of the worksheet is the following:

basesymbols := Array(0..35, ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]):

n := 200; # number of digits
k := 10; # base 
N := ceil(log[10](k)*n)+1;

approxPi := round(evalf[N+1]((Pi-3)*10^(N))):

PiList := map(x->basesymbols[x],convert(approxPi, base, k)): 

PiString := cat(op(map(convert, PiList[1..n], string))):

T := [StringTools:-CharacterFrequencies(PiString)]:

Statistics:-PieChart(T, color=blue..magenta);

 


Please Wait...