課題文は http://nalab.mind.meiji.ac.jp/~mk/syori2-2005/jouhousyori2-2005-10/node8.htmlにあります。
In[1]:= mysum[n_]:=Sum[1/2^k,{k,1,n}]
In[2]:= mysum[3]
7
Out[2]= -
8
In[3]:= mysum[{3,5,10,50}]
7 31 1023 1125899906842623
Out[3]= {-, --, ----, ----------------}
8 32 1024 1125899906842624
In[4]:= N[%,60]
Out[4]= {0.875000000000000000000000000000000000000000000000000000000000,
> 0.968750000000000000000000000000000000000000000000000000000000,
> 0.999023437500000000000000000000000000000000000000000000000000,
> 0.99999999999999911182158029987476766109466552734375000000000}
In[5]:= Sum[1/2^k,{k,1,{3,5,10,50}}]
7 31 1023 1125899906842623
Out[5]= {-, --, ----, ----------------}
8 32 1024 1125899906842624
In[6]:=
つまり
![]() |
root3[n_]:=(root3[n-1]+3/root3[n-1])/2;root3[1]=1 |
In[1]:= x[n_,a_]:=(x[n-1,a]+a/x[n-1,a])/2
In[2]:= x[1,a_]:=x[1,a]=1
In[3]:= Table[x[n,3],{n,10}]
7 97 18817 708158977 1002978273411373057
Out[3]= {1, 2, -, --, -----, ---------, -------------------,
4 56 10864 408855776 579069776145402304
2011930833870518011412817828051050497
> -------------------------------------,
1161588808526051807570761628582646656
80957313605578358908887795350602568324792950627495792571646543704878940\
> 17
> -------------------------------------------------------------------------
46740726803049617901689623601446146504427186362767757416581133707283760\
> 64
> , 131081732524639257263029684778781519606823938779762272955953002674777\
> 8869156184675079781409244667134996539912093324716384719508044596983036\
> 48792577 /
> 75680073558942998051938864505913119483609300954880808364006749884322706\
> 9878908253282990504235133535052004565728687501994425856460541545875032\
> 18176}
In[4]:= N[%,60]
Out[4]= {1.00000000000000000000000000000000000000000000000000000000000,
> 2.00000000000000000000000000000000000000000000000000000000000,
> 1.75000000000000000000000000000000000000000000000000000000000,
> 1.73214285714285714285714285714285714285714285714285714285714,
> 1.73205081001472754050073637702503681885125184094256259204713,
> 1.73205080756887729525435394607217191423510670911984376613038,
> 1.73205080756887729352744634150587236780369509078195667060132,
> 1.73205080756887729352744634150587236694280525381038062805581,
> 1.73205080756887729352744634150587236694280525381038062805581,
> 1.73205080756887729352744634150587236694280525381038062805581}
In[5]:= N[Sqrt[3],60]
Out[5]= 1.73205080756887729352744634150587236694280525381038062805581
In[6]:= %4 * %4
Out[6]= {1.00000000000000000000000000000000000000000000000000000000000,
> 4.00000000000000000000000000000000000000000000000000000000000,
> 3.06250000000000000000000000000000000000000000000000000000000,
> 3.00031887755102040816326530612244897959183673469387755102041,
> 3.00000000847267379690743339529456165503718758201548235406396,
> 3.00000000000000000598218342217178908328022472309684364547835,
> 3.00000000000000000000000000000000000298220987470891480206901,
> 3.00000000000000000000000000000000000000000000000000000000000,
> 3.00000000000000000000000000000000000000000000000000000000000,
> 3.00000000000000000000000000000000000000000000000000000000000}
In[7]:= N[N[Table[x[n,3]-Sqrt[3],{n,10}],400]]
-9
Out[7]= {-0.732051, 0.267949, 0.0179492, 0.0000920496, 2.44585 10 ,
-18 -37 -73 -146
> 1.72691 10 , 8.6089 10 , 2.13946 10 , 1.32135 10 ,
-293
> 5.04018 10 }
In[8]:=
これから、
誤差の常用対数に
の場合にどうなるかは各自に任せる。