互质整数线性组合的贝祖定理

Before this, know基本的欧几里德算法:$\gcd(a, b) = \gcd(a, b-a)$余数和除法

Read · 1 min

When we are given two intgers, we ask, "What numbers can we make from (linear) combinations of them?"

Bezout's Identity: Given distinct integers a,ba,b with gcd⁡(a,b)=d\gcd(a,b)=d, there exists integers x,yx,y such that ax+by=dax+by=d.

Proof: Fix aa and bb (that is, we don't change their values). Consider the set S={s>0:s=ax+by for some x,y∈Z}\mathcal{S}=\left\{s>0:s=ax+by\text{ for some }x,y\in\mathbb{Z} \right\}. We know that ∣a∣+∣b∣|a|+|b| is in S\mathcal{S}, and this number is positive. Thus, S\mathcal{S} is nonempty. Also, all elements are greater than 00, so it has a smallest element. Let the smallest element be s0s_0, and let x0x_0 and y0y_0 be such that s0=ax0+by0s_0=ax_0+by_0.

By the division algorithm there exists q,r∈Zq,r\in\mathbb{Z} such that a=s0q+ra=s_0q+r and 0≤r<s00\leq r<s_0. Since r<s0r<s_0, r∉Sr\notin\mathcal{S}. But

r=a−s0q=a−(ax0+by0)q=a(1−x0q)+b(−y0q),r=a-s_0q=a-(ax_0+by_0)q=a(1-x_0q)+b(-y_0q),

so in order for it to not be in S\mathcal{S}, r∉Nr\not\in\mathbb{N}, but r≥0r\geq 0, so r=0r=0. Thus, a=s0qa=s_0q, and s0∣as_0\mid a. Similarly, s0∣bs_0\mid b.

Let gcd⁡(a,b)=d\gcd(a,b)=d. Since s0∣as_0 \mid a and s0∣bs_0 \mid b we have s0∣ds_0 \mid d. Additionally, we have that d∣ad\mid a and d∣bd\mid b, so d∣ax0+by0=s0d\mid ax_0+by_0=s_0. Since s0s_0 and dd divide each other, they must be equal. Thus, d=ax0+by0d=ax_0+by_0, and we have found x,yx,y such that ax+by=dax+by=d. □\Box

Additionally, once we found xx and yy, we can form every multiple of dd like so:

Let ax+by=dax+by=d. Then, dk=a(xk)+b(yk)dk=a(xk)+b(yk).

This actually holds for any k∈Zk \in \mathbb{Z}, including the negative values. It just so happens dkdk might be negative, but there's nothing wrong with that.

Preparing for a math contest?

Working through past problems on one idea at a time is one of the most effective ways to prepare. These are real problems from the AMC 8, AMC 10, AMC 12 and AIME, the national math competitions for middle and high school students, each with a worked solution on LIVE by Po-Shen Loh.

Read · 2 min

An Elegant Proof of Bezout's Identity

Bezout's identity says that, for any two integers a,ba,b there are two integers x,yx,y such that ax+by=dax+by=d. The idea used here is a very technique in olympiad number theory.

Since gcd⁡(a,b)=d\gcd(a,b)=d, we can assume a=dma=dm and b=dnb=dn so that gcd⁡(m,n)=1\gcd(m,n)=1. Then we just need to prove that mx+ny=1mx+ny=1 is possible for integers x,yx,y.

Let's think on how to do that. The equation can also be stated this way: If we divide mxmx by nn, the remainder should be 11. Now, the problem is reduced even further. And we should check an example to understand what we are asked to do.

Take m=11m=11 and n=6n=6. We need to check the remainders of mx=11xmx=11x when divided by n=6n=6.

11⋅1=11 remainder 511⋅2=22 remainder 411⋅3=33 remainder 311⋅4=44 remainder 211⋅5=55 remainder 1\begin{align} 11\cdot1 & = 11\quad\text{ remainder }5\\ 11\cdot2 & = 22\quad\text{ remainder }4\\ 11\cdot3 & = 33\quad\text{ remainder }3\\ 11\cdot4 & = 44\quad\text{ remainder }2\\ 11\cdot5 & = 55\quad\text{ remainder }1 \end{align}

Bingo! We need the remainder 11 and now we have it. Not just that, playing with some more examples, you will see that actually all the remainders from 11 to n−1n-1 appear. Which means, all the remainders of mxmx divided by nn are distinct! This is even a stronger claim.

If gcd⁡(m,n)=1\gcd(m,n)=1, then the remainder of multiples of mm when divided by nn are distinct. That is, mimi and mjmj don't have the same remainder when divided by nn if i≠ji\neq j. You should understand how it implies that Bezout's identity holds. Because then we will have the remainder 11 as well. If the remainder of mxmx divided by nn is 11 then mx−1mx-1 is divisible by nn. If we take mx−1=nzmx-1=nz then setting y=−zy=-z, we get mx+ny=1mx+ny=1, which was what we wanted. Only the claim is left to prove.

Now let's get to proving this claim. For the sake of contradiction, assume that mimi and mjmj leave the same remainder when divided by nn. Then the difference mi−mjmi-mj must be divisible by nn. This means nn divides m(i−j)m(i-j). Since mm and nn share no factor at all, we can safely say nn has to divide i−ji-j. We can also say that 1≤j<i<n1\leq j<i<n, because even if jj or ii is greater than nn, nq+jnq+j or nq+inq+i has the same remainder as jj or ii. This assumption gives us i−j<ni-j<n, which is impossible since nn divides i−ji-j.

Hope now you understand!

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems