#Maple code for Lecture 15 of Dr. Z.'s "Experimental Mathematics (Game Theory)" class. Celebrating early Pi Day Help15:=proc(): print(`ArcTanT(x,k), ATAN(L) , FindMcahin(a,k), ArcA(k,N), ArkP(k,N) `):end: #ArcTanT(x,k): The truncation of the Taylor series of arctan(x) after k terms, followed by the rigorous error bound #x^(2*k+1)/(2*k+1) ArcTanT:=proc(x,k) local i: [4*add((-1)^i*x^(2*i+1)/(2*i+1),i=0..k), 4*x^(2*k+3)/(2*k+3)]: end: #ATAN(L): Inputs a list of numbers (or symbols) L finds the quantity A such that #arctan(A)= arctan(L[1])+...+arctan(L[k]) # #arctan(a)+arctan(b)=arctan((a+b)/(1-a*b)): ATAN:=proc(L) local a,b: if nops(L)=1 then RETURN(L[1]): fi: a:=ATAN([op(1..nops(L)-1,L)]): b:=L[nops(L)]: normal((a+b)/(1-a*b)): end: #FindMachin(a,k): finds the unique b such that ATAN([a$k,b])=1 FindMachin:=proc(a,k) local b: solve(ATAN([a$k,b])=1,b): end: #NorthM(N): The truncated Gregory-Leibnitz formula at N, giving most correct digits of Pi when N=10^k/2, e.g. NorthM(500000); It was discovered emprically, in 1988, by #at the time undergraudate R.D. North NorthM:=proc(N) local k: evalf(4*add((-1)^(k-1)/(2*k-1),k=1..N)): end: #ADDED AFTER CLASS #Lower bound for Pi using the AREA of a k*2^N-polygon ArcA:=proc(k,N) local p,i: p:=sin(Pi/k): for i from 2 to N do p:=sqrt((1-sqrt(1-p^2))/2): od: k*2^(N-1)*p: end: #ArcP(k,N): Archimedes' lower bounds and upper bounds using the PERIMETER inscribed and circumsribed polygons with k*2^N, sides. For example, to get #the Archimedes original values of 96-gons, do Arch(3,5); Based on #https://sites.math.rutgers.edu/~zeilberg/EM22/archimedes.pdf ArcP:=proc(k,N) local p,P,i: p:=k*sin(Pi/k): P:=k*tan(Pi/k): for i from 2 to N do P:=1/2*(1/P+1/p): P:=1/P: p:=sqrt(P*p): od: [p,P]: end: