Unverified Commit 968d44d1 authored by Sshwy's avatar Sshwy Committed by GitHub
Browse files

Merge pull request #1780 from Phemon/patch-2

Update linear-equation.md - Fix a mistake
parents d087455c 27f713d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,9 +16,9 @@

定理 2:

> 若 $\gcd(a,b)=1$ ,且 $x_0,y_0$ 为方程 $ax+by=c$ 的一组解,则该方程的任意解可表示为: $x=x_0+bt,y=y_0+at$ , 且对任意整数 $t$ 都成立。
> 若 $\gcd(a,b)=1$ ,且 $x_0,y_0$ 为方程 $ax+by=c$ 的一组解,则该方程的任意解可表示为: $x=x_0+bt,y=y_0-at$ , 且对任意整数 $t$ 都成立。

根据定理 2,可以求出方程的所有解。但在实际问题中,我们往往被要求求出一个最小整数解,也就是一个特解 $x,t=b/\gcd(a,b),x=(x \mod t+t)\mod t$ 。
根据定理 2,可以求出方程的所有解。但在实际问题中,我们往往被要求求出一个最小整数解,也就是一个特解 $x,t=b/\gcd(a,b),x=(x \bmod t+t) \bmod t$ 。

代码: