Linear Congruences
linear congruence equations having the form
ax≡b(modn)
If x is a solution and x≡x′(modn), then ax≡ax′≡b and so x′ is also a solution; thus the solution ( if they exist) form a union of congruence classes.Now ax≡b(modn) if and only if ax−b is a multiple of n.So x is a solution of this linear congruence if and only if there is integer y such that x and y satisfy the linear Diophantine equation ax+ny=b
Theorem:
if d=gcd(a,n) , then the linear congruence
ax≡b(modn)
has a solution if and only if d divides b.if d does divide b, and if x0 is any solution, then the general solution is given by
x=x0+n.td
x=x0,x0+nd,x0+2nd,⋯,x0+(d−1)nd
Example:
Consider the congruence
10x≡6(mod12)
gcd(a,n)=gcd(10,12)=2
gcd(a,n)|b=>2|6, so there are two classes of solutions. We can take x0=3 as a particular solution, so the general solution has the form
x=x0+ntd=3+12t2=3+6t
where t∈Z. These solutions form two congruence classes [3] and [9] (mod12) with representatives x0=3 and x0+n/d=9; equivalently the form a single congruent class [3](mod6)
Example:
Consider the congruence 10x≡3(mod12). Here gcd(10,12)=2 which does not divide 3.So there are no solutions.(This can be seen directly: the elements of the congruence class [3] in Z12 are odd, whereas any elements of 10[x] must be even).
Corollary:
if gcd(a,n)=1, then the solutions x of the linear congruence ax≡b(modn) form a single congruence class (modn)
Example:
Consider the congruence
7x≡3(mod12)
Here a=7 and n=12 and since gcd(7,12)=1, they are coprime and there is a single class of solutions; this is the class [x]=9, since 7×9=63≡3(mod12)
Note: In the above examples n is small and it is feasible to find the all solutions of a congruence ax≡b(modn) by inspection: one can simply calculate ax for each of the n elements x of a complete set of residues (modn), and see which of these products are congruent to b.When n is larger, however, a more efficient method is needed for solving linear congruences.
Lemma:
1)Let m divide a,b, and n and let a′=a/m,b′=b/m and n′=n/m; then
ax≡b(modn), if and only a′x≡b′(modn′)
2)Let a and n be coprime, let m divide a and b and let a′=a/m and b′=b/m; then
ax≡b(modn) if and only if a′x≡b′(modn)
Algorithm to Solve Linear Congruence
Step1: We calculate d=gcd(a,n), and see whether d divides b.If it does not, there are no solutions, so we stop.If it does, we go on to Step 2.
Step2: Since d divides a,b and n, as per lemma 1) implies that, we can replace the original congruence with
a′x≡b′(modn′)
where a′=a/d,b′=b/d and n′=n/d
Now a′ and n′ are coprime , so we can use lemma 2)
Step3:Now as per lemma 2) divide this new congruence through by m=gcd(a′,b′), giving a congruence
a″x≡b″(modn′)
where a″=a′/m and b″=b′/m.Now a″ is coprime to both b″ and n′.If a″=±1, then x0=±b″ is the required solution.Otherwise goto step 4.
Step4:Noting that
b″≡b″±n′≡b″±2n′≡…(modn′)
we may be able to replace b″ with some congruent number b‴=b″+kn′such that gcd(a″,b‴)>1; by applying Step3 to the congruence a″x≡b‴(modn′), we can gain reduce |a″|. An alternative at this stage is to multiply through by some suitably chosen constant c, giving ca″x≡cb″(modn′); if c is chosen so that the least absolute residue a‴ of ca″ satisfies |a‴|<|a″|, then we have reduced |a″| to give a linear congruence a‴x≡b‴x(modn) with b‴=cb″.
A combination of the methods in Step 4 will eventually reduce a to ±1, in which case the solution x0 can be read off; then the general solution can be found.
Example:
Consider the congruence 10x≡6(mod14)
Step1 gives gcd(10,14)=2, which divides 6. So the solution do exist.if x0 is the particular solution then the general solution is x=x0+(14/2)t=x0+7t, where t∈Z. These form the congruence class [x0] and [x0+7] in z14
To find x0 use step 2.divide the congruence by gcd(10,14)=2 to give
5x≡3(mod7)
Since gcd(5,3)=1 step 3 has no effect.so we move on to step 4.Noting that 3≡10mod(7) ,with 10 divisible by 5, we replace the congruence with
5x=10(mod7)
and then divide by 5 (which is coprime to 7) to give
x=2(mod7)
Thus x0=2 is a solution, so the general solution has the form
c=2+7t(t∈Z)
Example:
Consider the congruence
4x=13(mod47)
Step 1 gives gcd(4,47)=1, which divides 13, so the congruence has solutions.
If x0 is any solution, then the general solution is x=x0+47t where t∈Z forming a single congruence class [x0] in Z47.
Since gcd(4,47)=1, step 2 has no effect, so we move on to step 3.
Since gcd(4,13) = 1, step 3 also has no effect,so we go to step 4.
We could now employ the method used in the previous example, but as an alternative we will illustrate the other technique described in step 4:
noting that 4×12≡48≡1(mod47)
48x≡12×13(mod47)
that is,
x≡3×4×13≡3×52≡3×5≡15(mod47)
Thus we can take x0=15, so the general solution is x=15+47t
Example: Solve the linear congruence 3x≡2(mod7).Check if a solution exists: 3 and 7 are coprime, so proceed.
Find the modular inverse: The modular inverse of 3 modulo 7 is 5 since
3⋅5≡1(mod7)
Solve for x≡2⋅5≡10≡3(mod7). So, x0=3 is the solution.x=3+7t is the general solution.
Example:
Solve the linear congruence 4x≡6(mod10).Check if a solution exists: 4 and 10 are not coprime (they share a common divisor of 2). However, 6 is divisible by 2, so divide both sides by 2: 2x≡3(mod5)
Find the modular inverse: The modular inverse of 2 modulo 5 is 3 since 2⋅3≡1(mod5)
Solve for x≡3⋅3≡9≡4(mod5). So, x0=4 ,is the solution.x=4+5t is the general solution.
Comments
Post a Comment