The Linear Diophantine Equation
Definition 1. Let a,b,c∈Z with a≠0,b≠0. The equation ax+by=c that is to be solved in the integers is called the linear diophatine equation in two unknowns.
교과과정에서는 일차 부정방정식으로 소개되는 선형 디오판토스 방정식이다. 보통 정수를 계수로 가지는 다항식의 정수해를 찾는 것을 의미한다. 해를 가지는 조건과 해의 구체적인 형태가 깔끔하게 알려져 있다.
Theorem 1
Theorem 1. The linear diophantine equation ax+by=c has a solution ⟺ d|c, where d=gcd(a,b). If x0,y0 is any particular solution of this equation, then all other solutions are given by x=x0+(bd)ty=y0−(ad)t, where t∈Z.
Proof. Denote (x0,y0) to be a solution of the equation. Then d|ax0+y0=c. Conversely, suppose that c=md for some m∈Z. By Theorem 3, d=ax0+by0 for some x0,y0∈Z. Then c=md=m(ax0+by0)=a(mx0)+b(my0). Thus the equation has a solution.
If x′,y′ are any other solution, then ax0+by0=c=ax′+by′⟹a(x′−x0)=b(y0−y′). Since gcd(a,b)=d, a=rd,b=sd for some r,s∈Z. Then a(x′−x0)=b(y0−y′)⟹r(x′−x0)=s(y0−y′). Note that r|s(y0−y′) and s|r(x′−x0). Since gcd(r,s)=1, r|y0−y′ and s|x′−x0 by Euclid Lemma. Then y0−y′=rt for some t∈Z. Thus r(x′−x0)=s(y0−y′)⟹x′−x0=st⟹x′=x0+st=x0+(bd)t. Similarly, r(x′−x0)=s(y0−y′)⟹rt=y0−y′⟹y′=y0−rt=y0−(ad)t.
For any integer t, ax′+by′=a(x0+(bd)t)+b(y0−(ad)t)=ax0+by0+(abd−abd)t=c+0=c. ◼
만일 자연수 해 만을 찾고 싶다면 조건 x′>0,y′>0으로부터 t에 관한 부등식을 잡아내서 해당하는 값 만을 택하면 된다.