"산술 기하 평균을 이용한 원주율의 계산"의 두 판 사이의 차이

수학노트
둘러보기로 가기 검색하러 가기
잔글 (찾아 바꾸기 – “<h5 (.*)">” 문자열을 “==” 문자열로)
잔글 (Pythagoras0 사용자가 산술기하평균함수(AGM)와 파이값의 계산 문서를 산술 기하 평균을 이용한 원주율의 계산 문서로 옮겼습니다.)
(같은 사용자의 중간 판 9개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==이 항목의 스프링노트 원문주소==
 
 
* [[산술기하평균함수(AGM)와 파이값의 계산]]
 
 
 
 
 
 
 
 
 
==개요==
 
==개요==
  
* 산술기하평균함수(AGM, arithmetic-geometric mean)을 활용하여 파이값을 빠르게 계산할 수 있는 알고리즘
+
* [[산술 기하 평균 (arithmetic-geometric mean)]]을 활용하여 파이값을 빠르게 계산할 수 있는 알고리즘
 
 
 
 
 
 
 
 
  
==타원적분==
 
  
 +
==타원적분과 산술 기하 평균==
 +
===타원적분===
 
* [[타원적분]] 항목 참조
 
* [[타원적분]] 항목 참조
 +
* <math>K(k) = \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-k^2 \sin^2\theta}}</math>
 +
* <math>E(k) = \int_0^{\frac{\pi}{2}} \sqrt{1-k^2 \sin^2\theta}d\theta</math>
 +
* <math>k'=\sqrt{1-k^2}</math>
 +
* <math>K'(k) : = K(k')</math>
 +
* <math>E'(k) : = E(k')</math>
  
<math>K(k) = \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-k^2 \sin^2\theta}}</math>
+
===타원적분에 대한 르장드르 항등식===
 
 
<math>E(k) = \int_0^{\frac{\pi}{2}} \sqrt{1-k^2 \sin^2\theta}}d\theta}{</math>
 
 
 
<math>k'=\sqrt{1-k^2}=\frac{\theta_4^2(\tau)}{\theta_3^2(\tau)}</math>
 
 
 
<math>K'(k) = K(k')</math>
 
 
 
<math>E'(k) = E(k')</math>
 
 
 
 
 
 
 
 
 
 
 
==타원적분에 대한 르장드르 항등식==
 
 
 
 
* 르장드르 항등식
 
* 르장드르 항등식
 
+
:<math>E(k)K'(k)+E'(k)K(k)-K(k)K'(k)=\frac{\pi}{2}</math>
<math>E(k)K'(k)+E'(k)K(k)-K(k)K'(k)=\frac{\pi}{2}</math>
 
 
 
 
* 특별히 다음과 같은 관계가 성립함
 
* 특별히 다음과 같은 관계가 성립함
 +
:<math>2K(\frac{1}{\sqrt{2}})E(\frac{1}{\sqrt{2}})-K(\frac{1}{\sqrt{2}})^2=\frac{\pi}{2} \label{leg}</math>
 +
* [[타원적분]] 항목 참조
  
<math>2K(\frac{1}{\sqrt{2}})E(\frac{1}{\sqrt{2}})-K(\frac{1}{\sqrt{2}})^2=\frac{\pi}{2}</math>
+
===타원적분과 산술 기하 평균의 관계===
 +
* [[란덴변환(Landen's transformation)]]에서 다음을 얻었다
 +
:<math>K(k)=\frac{\pi}{2M(1,\sqrt{1-k^2})}</math>
 +
* 특별히 다음이 성립
 +
:<math>K(\frac{1}{\sqrt2})=\frac{\pi}{2M(1,\frac{1}{\sqrt2})} \label{mk}</math>
 +
* 참고로 이 등식은 [[렘니스케이트(lemniscate) 곡선의 길이와 타원적분]]에도 등장한다
  
* [[타원적분(통합됨)|타원적분]] 항목 참조
 
  
 
+
==가우스-살라민 알고리즘==
 
+
;보조정리
 
+
주어진 양수 $0<k<1$에 대하여 다음과 같이 수열 <math>a_n,b_n,c_n</math>을 정의하자.
 
+
:<math>
==산술기하평균함수==
+
a_0=1,b_0=\sqrt{1-k^2} \\
 
+
a_{n+1}={a_n+b_n \over 2},b_{n+1}=\sqrt{a_n b_n}\\
양수 k가 주어졌을 때, 산술기하평균을 이용하여 다음과 같이 두 수열을 정의할 수 있다<br><math>a_0=1</math>, <math>b_0=\sqrt{1-k^2}</math>,  <math>a_{n+1}={a_n+b_n \over 2}</math>,  <math>b_{n+1}=\sqrt{a_n b_n}</math><br>
+
c_n=\sqrt{a_n^2-b_n^2}
* 두 수열 <math>a_n</math>과 <math>b_n</math>은 같은 수로 수렴한다
+
</math>
* 이 수렴값 <math>M(k)</math>를 이용하여 정의된 함수 M을 산술기하평균함수라 하자
+
다음이 성립한다
 +
:<math>\sum_{i=0}^{\infty} 2^{i-1} c_i^2  = 1 - \frac{E(k)}{K(k)} \label{lem}</math>
  
 
 
 
 
 
 
==렘니스케이트 곡선과 파이==
 
 
* [[렘니스케이트(lemniscate) 곡선의 길이와 타원적분|렘니스케이트(lemniscate) 곡선과 타원적분]] 에서 다음을 알 수 있다<br><math>\frac{\omega}{2}=\frac{1}{\sqrt{2}}K(\frac{1}{\sqrt2})</math><br><math>\frac{\pi}{\omega}=M(1,{\sqrt2})</math><br>
 
 
 
 
 
 
 
 
==타원적분과 AGM의 관계==
 
 
* 위의 렘니스케이트에 등장하는 공식 또는 [[란덴변환(Landen's transformation)]] 에 의해 다음이 성립함.
 
 
<math>K(k)=\frac{\pi}{2M(1,\sqrt{1-k^2})}</math>
 
 
특별히, <math>K(\frac{1}{\sqrt2})=\frac{\pi}{2M(1,\frac{1}{\sqrt2})}</math>
 
 
*  AGM 수열과 타원적분<br>  <math>a_{n+1}={a_n+b_n \over 2}</math>,  <math>b_{n+1}=\sqrt{a_n b_n}</math> , <math>a_0=1</math>, <math>b_0=\sqrt{1-k^2}</math> ,  <math>c_n=\sqrt{a_n^2-b_n^2}</math><br>
 
 
<math>\sum_{i=0}^{\infty} 2^{i-1} c_i^2  = 1 - \frac{E(k)}{K(k)}</math>
 
 
 
 
 
 
 
 
==가우스-살라민 알고리즘==
 
  
 +
;정리
 
다음과 같이 수열 <math>a_n,b_n,c_n,\pi_n</math>을 정의하자.
 
다음과 같이 수열 <math>a_n,b_n,c_n,\pi_n</math>을 정의하자.
 +
$$
 +
a_0=1,b_0=\frac{1}{\sqrt{2}}\\
 +
a_{n+1}={a_n+b_n \over 2},b_{n+1}=\sqrt{a_n b_n}\\
 +
c_n=\sqrt{a_n^2-b_n^2}=\frac{c_{n-1}^2}{4a_n} \\
 +
\pi_n=\frac{2a_{n+1}^2}{1-\sum_{k=0}^{n} 2^kc_k^2}
 +
$$
 +
이 때, 수열 $\pi_n$은 <math>\pi</math>로 수렴한다.
  
<math>a_0=1</math>, <math>b_0=\frac{1}{\sqrt{2}}</math>
+
;증명
 +
<math>M=M(1,1/\sqrt{2})</math>, <math>K=K(1/\sqrt{2})</math>, <math>E=E(1/\sqrt{2})</math>로 두자
  
<math>c_n=\sqrt{a_n^2-b_n^2}=\frac{c_{n-1}^2}{4a_n}</math>
+
\ref{leg}로부터 다음을 얻는다
 
+
:<math>2KE-K^2=\frac{\pi}{2}</math>
<math>\pi_n=\frac{2a_{n+1}^2}{1-\sum_{k=0}^{n} 2^kc_k^2}</math>
+
즉,
 
+
:<math>\frac{2E}{K}-1=\frac{\pi}{2K^2}</math>
수열 <math>\pi_n</math>은 <math>\pi</math>로 수렴한다.
+
\ref{mk}로부터 <math>2MK=\pi</math>를 얻는다
 
 
(증명)
 
 
 
<math>M=M(1,1/\sqrt{2})</math>, <math>K=K(1/\sqrt{2})</math>, <math>E=E(1/\sqrt{2})</math>로 두면,
 
 
 
<math>2KE-K^2=\frac{\pi}{2}</math> 즉, <math>\frac{2E}{K}-1=\frac{\pi}{2K^2}</math>
 
 
 
<math>2MK=\pi</math>
 
 
 
<math>\sum_{i=0}^{\infty} 2^{i-1} c_i^2 = 1 - \frac{E}{K}</math>이다.
 
 
 
따라서
 
 
 
<math>\lim_{n\to \infty}\pi_n=\frac{2M^2}{1-2(1-E/K)}=\frac{2M^2}{{\pi}/{2K^2}}=\frac{\pi^2/2K^2}{{\pi}/{2K^2}}=\pi</math>
 
 
 
*  수열 <math>\pi_n</math>의 처음 여섯항을 계산한 결과<br>3.1405792505221682483113312689758233117734402375129<br> 3.1415926462135422821493444319826957743144372233456<br> 3.1415926535897932382795127748018639743812255048354<br> 3.1415926535897932384626433832795028841971146782836<br> 3.1415926535897932384626433832795028841971693993751<br> 3.1415926535897932384626433832795028841971693993751
 
  
 +
\ref{lem}로부터
 +
:<math>
 +
\begin{aligned}
 +
\lim_{n\to \infty}\pi_n&=\lim_{n\to \infty} \frac{2a_{n+1}^2}{1-\sum_{k=0}^{n} 2^kc_k^2}\\
 +
&=\frac{2M^2}{1-2(1-E/K)}=\frac{2M^2}{{\pi}/{2K^2}}=\frac{\pi^2/2K^2}{{\pi}/{2K^2}}\\
 +
&=\pi
 +
\end{aligned}
 +
</math>■
 +
===수치 계산===
 +
*  수열 <math>\pi_n</math>의 처음 여섯항을 계산한 결과
 +
$$
 +
3.1405792505221682483113312689758233117734402375129\\ 3.1415926462135422821493444319826957743144372233456\\ 3.1415926535897932382795127748018639743812255048354\\ 3.1415926535897932384626433832795028841971146782836\\ 3.1415926535897932384626433832795028841971693993751\\ 3.1415926535897932384626433832795028841971693993751
 +
$$
 
 
 
 
  
 
 
  
 
==또다른 알고리즘==
 
==또다른 알고리즘==
 
+
* 수열 $x_n, y_n, \pi_n$을 다음과 같이 정의하자
<math>x_0=\sqrt{2}</math> ,<math>\pi_0=2+\sqrt{2}}</math>, <math>y_1=\sqrt[4]{2}</math><br><math>x_n=\frac{1}{2}(\sqrt{x_n}+\frac{1}{\sqrt{x_n}})}, n\geq0</math> , <math>y_n=\frac{y_{n+1}\sqrt{x_n}+\frac{1}{\sqrt{x_{n}}}}{y_n+1}}, n\geq1</math> , <math>\pi_n=\pi_{n-1}\frac{x_n+1}{y_n+1}}, n\geq1</math>
+
$$
 
+
x_0=\sqrt{2},\pi_0=2+\sqrt{2},y_1=\sqrt[4]{2} \\
* 위에 정의된 수열 <math>\pi_n</math>은 파이로 수렴하게 된다. 다음은 처음 여섯개의 항을 계산한 결과.
+
x_{n+1}=\frac{1}{2}(\sqrt{x_{n}}+\frac{1}{\sqrt{x_{n}}}),\quad n\geq0 \\
 
+
y_{n+1}=\frac{y_{n}\sqrt{x_n}+\frac{1}{\sqrt{x_{n}}}}{y_n+1}, \quad n\geq1 \\
'''3.14'''26067539416226007907198236183018919713562462772<br>'''3.1415926'''609660442304977522351203396906792842568645<br>'''3.141592653589793238'''6457739917571417940347896238675<br>'''3.141592653589793238462643383279502884197'''2241204666<br> 3.1415926535897932384626433832795028841971693993751<br> 3.1415926535897932384626433832795028841971693993751
+
\pi_n=\pi_{n-1}\frac{x_n+1}{y_n+1}, \quad n\geq1
 
+
$$
 +
* 수열 <math>\pi_n</math>은 원주율로 수렴한다
 +
* 다음은 처음 여섯개의 항을 계산한 결과.
 +
$$
 +
3.1426067539416226007907198236183018919713562462772\\3.1415926609660442304977522351203396906792842568645\\3.1415926535897932386457739917571417940347896238675\\3.1415926535897932384626433832795028841972241204666\\ 3.1415926535897932384626433832795028841971693993751\\ 3.1415926535897932384626433832795028841971693993751
 +
$$
 
* 한번씩 계산할 때마다, 대략 두 배 정도 정확한 자리수
 
* 한번씩 계산할 때마다, 대략 두 배 정도 정확한 자리수
 
* 9번째까지 계산한다면, 1000자리 이상의 파이값을 계산
 
* 9번째까지 계산한다면, 1000자리 이상의 파이값을 계산
142번째 줄: 107번째 줄:
 
==관련된 항목들==
 
==관련된 항목들==
  
* [[타원적분|타원적분, 타원함수, 타원곡선]]<br>
+
* [[타원함수]]
** [[타원적분(통합됨)|타원적분]]
+
* [[타원적분]]
** [[렘니스케이트(lemniscate) 곡선의 길이와 타원적분|lemniscate 적분]]
+
* [[렘니스케이트(lemniscate) 곡선의 길이와 타원적분|lemniscate 적분]]
 
* [[자코비 세타함수]]
 
* [[자코비 세타함수]]
 
* [[라마누잔과 파이]]
 
* [[라마누잔과 파이]]
154번째 줄: 119번째 줄:
 
==매스매티카 파일 및 계산 리소스==
 
==매스매티카 파일 및 계산 리소스==
  
* [https://docs.google.com/leaf?id=0B8XXo8Tve1cxNjc0NTM0ZGUtNWVmYS00YjFjLWE1OWMtZTVmMDkxNTI5OWRk&sort=name&layout=list&num=50 ]https://docs.google.com/leaf?id=0B8XXo8Tve1cxNjc0NTM0ZGUtNWVmYS00YjFjLWE1OWMtZTVmMDkxNTI5OWRk&sort=name&layout=list&num=50
+
* https://docs.google.com/leaf?id=0B8XXo8Tve1cxNjc0NTM0ZGUtNWVmYS00YjFjLWE1OWMtZTVmMDkxNTI5OWRk&sort=name&layout=list&num=50
 
* 파이썬 http://www.johndcook.com/blog/2012/06/03/calculating-pi-with-agm-and-mpmath/
 
* 파이썬 http://www.johndcook.com/blog/2012/06/03/calculating-pi-with-agm-and-mpmath/
 
* [[매스매티카 파일 목록]]
 
 
 
 
  
 
 
 
 
168번째 줄: 129번째 줄:
 
* http://en.wikipedia.org/wiki/Salamin-Brent_algorithm
 
* http://en.wikipedia.org/wiki/Salamin-Brent_algorithm
  
 
 
  
 
 
  
 
==관련도서==
 
==관련도서==
177번째 줄: 136번째 줄:
 
** Jonathan M. Borwein, Peter B. Borwein, 1998
 
** Jonathan M. Borwein, Peter B. Borwein, 1998
  
 
 
  
 
 
 
 
189번째 줄: 147번째 줄:
 
*  Gauss and the arithmetic-geometric mean<br>
 
*  Gauss and the arithmetic-geometric mean<br>
 
** D.A. Cox, Notices Amer. Math. Soc. 32(2) (1985) 147-151
 
** D.A. Cox, Notices Amer. Math. Soc. 32(2) (1985) 147-151
 
 
* [http://www.jstor.org/stable/2323302 Gauss, Landen, Ramanujan, the Arithmetic-Geometric Mean, Ellipses, π, and the Ladies Diary]<br>
 
* [http://www.jstor.org/stable/2323302 Gauss, Landen, Ramanujan, the Arithmetic-Geometric Mean, Ellipses, π, and the Ladies Diary]<br>
 
** Gert Almkvist and Bruce Berndt
 
** Gert Almkvist and Bruce Berndt
203번째 줄: 160번째 줄:
 
*  Computation of pi Using Arithmetic-Geometric Mean ([[1939326/attachments/1341646|pdf]])<br>
 
*  Computation of pi Using Arithmetic-Geometric Mean ([[1939326/attachments/1341646|pdf]])<br>
 
** E. Salamin, Mathematics of Computation 30(1976) 565-570
 
** E. Salamin, Mathematics of Computation 30(1976) 565-570
 +
[[분류:원주율]]

2014년 1월 24일 (금) 02:45 판

개요


타원적분과 산술 기하 평균

타원적분

  • 타원적분 항목 참조
  • \(K(k) = \int_0^{\frac{\pi}{2}} \frac{d\theta}{\sqrt{1-k^2 \sin^2\theta}}\)
  • \(E(k) = \int_0^{\frac{\pi}{2}} \sqrt{1-k^2 \sin^2\theta}d\theta\)
  • \(k'=\sqrt{1-k^2}\)
  • \(K'(k) : = K(k')\)
  • \(E'(k) : = E(k')\)

타원적분에 대한 르장드르 항등식

  • 르장드르 항등식

\[E(k)K'(k)+E'(k)K(k)-K(k)K'(k)=\frac{\pi}{2}\]

  • 특별히 다음과 같은 관계가 성립함

\[2K(\frac{1}{\sqrt{2}})E(\frac{1}{\sqrt{2}})-K(\frac{1}{\sqrt{2}})^2=\frac{\pi}{2} \label{leg}\]

타원적분과 산술 기하 평균의 관계

\[K(k)=\frac{\pi}{2M(1,\sqrt{1-k^2})}\]

  • 특별히 다음이 성립

\[K(\frac{1}{\sqrt2})=\frac{\pi}{2M(1,\frac{1}{\sqrt2})} \label{mk}\]


가우스-살라민 알고리즘

보조정리

주어진 양수 $0<k<1$에 대하여 다음과 같이 수열 \(a_n,b_n,c_n\)을 정의하자. \[ a_0=1,b_0=\sqrt{1-k^2} \\ a_{n+1}={a_n+b_n \over 2},b_{n+1}=\sqrt{a_n b_n}\\ c_n=\sqrt{a_n^2-b_n^2} \] 다음이 성립한다 \[\sum_{i=0}^{\infty} 2^{i-1} c_i^2 = 1 - \frac{E(k)}{K(k)} \label{lem}\]


정리

다음과 같이 수열 \(a_n,b_n,c_n,\pi_n\)을 정의하자. $$ a_0=1,b_0=\frac{1}{\sqrt{2}}\\ a_{n+1}={a_n+b_n \over 2},b_{n+1}=\sqrt{a_n b_n}\\ c_n=\sqrt{a_n^2-b_n^2}=\frac{c_{n-1}^2}{4a_n} \\ \pi_n=\frac{2a_{n+1}^2}{1-\sum_{k=0}^{n} 2^kc_k^2} $$ 이 때, 수열 $\pi_n$은 \(\pi\)로 수렴한다.

증명

\(M=M(1,1/\sqrt{2})\), \(K=K(1/\sqrt{2})\), \(E=E(1/\sqrt{2})\)로 두자

\ref{leg}로부터 다음을 얻는다 \[2KE-K^2=\frac{\pi}{2}\] 즉, \[\frac{2E}{K}-1=\frac{\pi}{2K^2}\] \ref{mk}로부터 \(2MK=\pi\)를 얻는다

\ref{lem}로부터 \[ \begin{aligned} \lim_{n\to \infty}\pi_n&=\lim_{n\to \infty} \frac{2a_{n+1}^2}{1-\sum_{k=0}^{n} 2^kc_k^2}\\ &=\frac{2M^2}{1-2(1-E/K)}=\frac{2M^2}{{\pi}/{2K^2}}=\frac{\pi^2/2K^2}{{\pi}/{2K^2}}\\ &=\pi \end{aligned} \]■

수치 계산

  • 수열 \(\pi_n\)의 처음 여섯항을 계산한 결과

$$ 3.1405792505221682483113312689758233117734402375129\\ 3.1415926462135422821493444319826957743144372233456\\ 3.1415926535897932382795127748018639743812255048354\\ 3.1415926535897932384626433832795028841971146782836\\ 3.1415926535897932384626433832795028841971693993751\\ 3.1415926535897932384626433832795028841971693993751 $$  


또다른 알고리즘

  • 수열 $x_n, y_n, \pi_n$을 다음과 같이 정의하자

$$ x_0=\sqrt{2},\pi_0=2+\sqrt{2},y_1=\sqrt[4]{2} \\ x_{n+1}=\frac{1}{2}(\sqrt{x_{n}}+\frac{1}{\sqrt{x_{n}}}),\quad n\geq0 \\ y_{n+1}=\frac{y_{n}\sqrt{x_n}+\frac{1}{\sqrt{x_{n}}}}{y_n+1}, \quad n\geq1 \\ \pi_n=\pi_{n-1}\frac{x_n+1}{y_n+1}, \quad n\geq1 $$

  • 수열 \(\pi_n\)은 원주율로 수렴한다
  • 다음은 처음 여섯개의 항을 계산한 결과.

$$ 3.1426067539416226007907198236183018919713562462772\\3.1415926609660442304977522351203396906792842568645\\3.1415926535897932386457739917571417940347896238675\\3.1415926535897932384626433832795028841972241204666\\ 3.1415926535897932384626433832795028841971693993751\\ 3.1415926535897932384626433832795028841971693993751 $$

  • 한번씩 계산할 때마다, 대략 두 배 정도 정확한 자리수
  • 9번째까지 계산한다면, 1000자리 이상의 파이값을 계산

 

 

관련된 학부 과목과 미리 알고 있으면 좋은 것들

 

 

관련된 항목들

 

 

매스매티카 파일 및 계산 리소스

 

사전형태의 자료


관련도서


 

관련논문