연분수

연분수(連分數, Continued Fraction)는 임의의 실수를 연속적인 분수로 나타내는 것을 말한다. 그렇다고 해서 아무 분수로 막 쪼개는 것은 아니고, 실수 + 분자가 1인 분수의 형태로 나타낸 것을 말한다.

예로, [math]\displaystyle{ \frac{91}{72} }[/math]를 연분수로 나타내 보자. 그럼,

[math]\displaystyle{ \begin{align}\frac{91}{72}&=1+\frac{19}{72}=1+\frac{1}{\frac{72}{19}}=1+\frac{1}{3+\frac{15}{19}}=1+\frac{1}{3+\frac{1}{\frac{19}{15}}}=1+\frac{1}{3+\frac{1}{1+\frac{4}{15}}}\\&=1+\frac{1}{3+\frac{1}{1+\frac{1}{\frac{15}{4}}}}=1+\frac{1}{3+\frac{1}{1+\frac{1}{3+\frac{3}{4}}}}=1+\frac{1}{3+\frac{1}{1+\frac{1}{3+\frac{1}{\frac{4}{3}}}}}=1+\frac{1}{3+\frac{1}{1+\frac{1}{3+\frac{1}{1+\frac{1}{3}}}}}\end{align} }[/math]

이다. 참고로 마지막의 [math]\displaystyle{ \frac{1}{3} }[/math][math]\displaystyle{ \frac{1}{2+\frac{1}{1}} }[/math]로 쪼갤 수도 있지만, 일반적으로 [math]\displaystyle{ \frac{1}{1} }[/math]은 쓰지 않는 것으로 약속한다.

그런데, 연분수를 나타낼 때마다 이렇게 길게 표현하는 것은 상당히 불편하기 때문에, 대괄호를 이용한 표기를 도입한다. 양의 실수 [math]\displaystyle{ a_i }[/math]에 대해, [math]\displaystyle{ \left[a_0;\,a_1\,a_2\,\ldots,\,a_n\right] }[/math][math]\displaystyle{ a_0+\frac{1}{a_1+\frac{1}{\ddots+\frac{1}{a_n}}} }[/math]로 정의한다. 만약 모든 [math]\displaystyle{ a_i }[/math]정수라면, 이 연분수를 단순(simple)하다고 한다. 위 예시의 경우, [math]\displaystyle{ \frac{91}{72}=\left[1;\,3\,1\,3\,1\,3\right] }[/math]이다.

괄호 표기로 주어진 연분수를 중간에 끊어서 근삿값을 추정할 수도 있다. 예를 들면, [math]\displaystyle{ \frac{91}{72}=\left[1;\,3\,1\,3\,1\,3\right] }[/math]에서 [math]\displaystyle{ \left[1;\,3\,1\,3\right] }[/math]까지만 나타내어 원래 값을 추정하는 것이다. 이를 convergent라 부른다. 좀 더 정확한 정의는 다음과 같다.

연분수 [math]\displaystyle{ \left[a_0;\,a_1,\,a_2,\,\ldots,\,a_n\right] }[/math]가 주어졌다 하자. [math]\displaystyle{ k\leq n }[/math]에 대해, [math]\displaystyle{ k }[/math]번째 convergent[math]\displaystyle{ c_k=\left[a_0;\,a_1,\,a_2,\,\ldots,\,a_k\right] }[/math]로 정의한다.

성질[편집 | 원본 편집]

  1. 모든 유한한 단순 연분수는 유리수이다. 역으로, 모든 유리수는 유한한 단순 연분수로 나타낼 수 있다.
    유한 단순 연분수가 유리수라는 사실은 자명하다. 역은 유클리드 호제법을 사용하면 증명할 수 있다 (몫들을 쭉 나열하면 된다). 참고로 유일하지는 않다. 제일 마지막을 [math]\displaystyle{ \frac{1}{1} }[/math]로 쪼개면 되기 때문. 즉, 위에서 든 예시의 경우, [math]\displaystyle{ \frac{91}{72}=\left[1;\,3\,1\,3\,1\,3\right]=\left[1;\,3\,1\,3\,1\,2\,1\right] }[/math]의 서로다른 두 표현이 존재한다. 하지만 [math]\displaystyle{ \frac{1}{1} }[/math]을 쓰지 않는다면 유한 단순 연분수 표기는 유일하다.
  2. [math]\displaystyle{ \left[a_0;\,a_1,\,a_2,\,\ldots,\,a_n\right] }[/math]에 대해, [math]\displaystyle{ p=a_0,\,q_0=1 }[/math]이라 하자. 그리고, [math]\displaystyle{ p_1=a_0a_1+1,\,q_1=a_1 }[/math]이라 정의하고, [math]\displaystyle{ k\geq2 }[/math]에 대해 [math]\displaystyle{ p_k=a_kp_{k-1}+p_{k-2},\,q_k=a_kq_{k-1}+q_{k-2} }[/math]로 귀납적으로 정의하자. 그럼, [math]\displaystyle{ c_k=\frac{p_k}{q_k} }[/math]이다.
    증명은 수학적 귀납법을 사용한다.
  3. [math]\displaystyle{ p_kq_{k-1}-p_{k-1}q_k=\left(-1\right)^{k-1} }[/math]이다.
    역시 수학적 귀납법을 사용하여 증명한다.

3번 성질에는 세 가지 따름정리가 존재한다.

  1. [math]\displaystyle{ \gcd\left(p_k,q_k\right)=1 }[/math]
    증명은 최대공약수베주 항등식을 참조하자.
  2. [math]\displaystyle{ c_k-c_{k-1}=\frac{\left(-1\right)^{k-1}}{q_kq_{k-1}} }[/math]
  3. [math]\displaystyle{ c_k-c_{k-2}=\frac{\left(-1\right)^{k-1}}{q_kq_{k-2}} }[/math]
    직접 계산으로 쉽게 보일 수 있다.

무한 연분수[편집 | 원본 편집]

위 성질 가운데 제일 눈여겨 봐야할 것은 제일 마지막 성질이다. 제일 마지막 따름정리에서, [math]\displaystyle{ c_0\lt c_2\lt c_4\lt \ldots }[/math]이고 [math]\displaystyle{ c_1\gt c_3\gt c_5\gt \ldots }[/math]임을 알 수 있다. 그리고 두 번째 따름정리에서 수열 [math]\displaystyle{ \left\{c_{2k}\right\} }[/math]의 한 상계는 [math]\displaystyle{ c_1 }[/math]이고, [math]\displaystyle{ \left\{c_{2k-1}\right\} }[/math]의 한 하계는 [math]\displaystyle{ c_0 }[/math]임을 알 수 있다. 따라서, 단조 수렴 정리에 의해 [math]\displaystyle{ \left\{c_{2k}\right\} }[/math][math]\displaystyle{ \left\{c_{2k-1}\right\} }[/math]는 수렴한다. 한편, 두 번째 따름정리에서 [math]\displaystyle{ \lim_{k\to\infty}c_k-c_{k-1}=0 }[/math]이므로, [math]\displaystyle{ \lim_{k\to\infty}c_{2k}=\lim_{k\to\infty}c_{2k-1} }[/math]이다. 따라서, [math]\displaystyle{ \lim_{k\to\infty}c_k=\alpha }[/math]는 존재한다. 그리고 이 [math]\displaystyle{ \alpha }[/math]를 무한 연분수 [math]\displaystyle{ \left[a_0;\,a_1,\,a_2,\,\ldots\right] }[/math]의 값이라 부른다. 단, 모든 [math]\displaystyle{ a_i }[/math]는 양수이다.

유한 연분수와 유리수는 서로 필요충분 조건임을 위 1번 성질에서 보였으므로, 모든 무한 연분수는 필연적으로 무리수가 된다. 여기서 당연히 떠오르는 질문은, "주어진 무리수를 무한 연분수로 어떻게 나타내는가?"이다. 방법은 다음과 같다.

[math]\displaystyle{ a_0=\left[\alpha\right] }[/math] (대괄호는 최대 정수 함수). [math]\displaystyle{ \alpha_1=\frac{1}{\alpha-a_0},\,a_1=\left[\alpha_1\right] }[/math]로 정의한다. 그리고, [math]\displaystyle{ \alpha_n=\frac{1}{\alpha_{n-1}-a_{n-1}},\,a_n=\left[\alpha_n\right] }[/math]으로 귀납적으로 정의하면, [math]\displaystyle{ \alpha=\left[a_0;\,a_1,\,a_2,\,\ldots\right] }[/math]이다.

뭔가 복잡해 보이지만, 실은 유리수를 연분수로 나타내는 과정과 완벽히 동일하다. 다만 그 과정이 무한할 뿐. 아래 예시도 같이 확인하자.

[math]\displaystyle{ \alpha=\sqrt2 }[/math]라 하자. 그럼, [math]\displaystyle{ a_0=\left[\alpha\right]=1 }[/math]이고, [math]\displaystyle{ \alpha_1=\frac{1}{\sqrt2-1}=\sqrt2+1 }[/math]이다. 따라서, [math]\displaystyle{ a_1=\left[\sqrt2+1\right]=2 }[/math]이고, [math]\displaystyle{ \alpha_2=\frac{1}{\sqrt2+1-2}=\frac{1}{\sqrt2-1}=\alpha_1 }[/math]이다. 따라서, [math]\displaystyle{ n\geq1 }[/math]에 대해 [math]\displaystyle{ a_n=2 }[/math]이다. [math]\displaystyle{ \therefore\sqrt2=\left[1;\,2,\,2,\,\ldots\right] }[/math]

참고로, 황금비[math]\displaystyle{ \left[1;\,1,\,1,\,1,\,\ldots\right] }[/math]이다.

무한 연분수의 성질[편집 | 원본 편집]

  • 순환하는 무한 연분수는 정수 계수 이차방정식의 근이다.
  • [math]\displaystyle{ k }[/math]번째 convergent [math]\displaystyle{ c_k=\frac{p_k}{q_k} }[/math]에 대해, [math]\displaystyle{ \left|\alpha-c_k\right|\lt \frac{1}{{q_k}^2} }[/math]이다. 게다가, 만약 [math]\displaystyle{ \left|\alpha-\frac{r}{s}\right|\lt \left|\alpha-c_k\right| }[/math]라면, [math]\displaystyle{ s\geq q_{k+1} }[/math]이다.
    이게 왜 중요하냐면, [math]\displaystyle{ c_k }[/math]는 분모가 [math]\displaystyle{ q_{k+1} }[/math]보다 작은 분수 중, [math]\displaystyle{ \alpha }[/math]와 제일 가까운 값이라는 뜻이기 때문이다. 예를 들면, [math]\displaystyle{ \pi=\left[3;\,7,\,15,\,1,\,292,\,\ldots\right] }[/math]이고, [math]\displaystyle{ c_0=3,\,c_1=\frac{22}{7},\,c_2=\frac{333}{106},\,c_3=\frac{355}{113} }[/math]이다. 이 정리에 의해, 분모가 7보다 작은 분수 중에 원주율에 제일 근사한 값은 3이고, 분모가 106보다 작은 분수 중에 제일 근사한 값은 [math]\displaystyle{ \frac{22}{7} }[/math]임을 알 수 있다. 오차 값은 덤.

같이 보기[편집 | 원본 편집]

각주