Linear Congruences

linear congruence equations having the form

axb(modn)

If x is a solution and xx(modn), then axaxb and so x is also a solution; thus the solution ( if they exist) form a union of congruence classes.Now axb(modn) if and only if  axb 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 

axb(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

, where tZ; in particular, the solutions form exactly d congruence classes (mod n), with representatives

x=x0,x0+nd,x0+2nd,,x0+(d1)nd

Example:

Consider the congruence 

10x6(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 tZ. 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 10x3(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 axb(modn) form a single congruence class (modn)

Example:

Consider the congruence

7x3(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=633(mod12)

 Note: In the above examples  n is small and it is feasible to find the all solutions of a congruence axb(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 

axb(modn), if and only axb(modn)

2)Let a and n be coprime, let m divide a and b and let a=a/m and b=b/m; then

axb(modn) if and only if axb(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

axb(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 

axb(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

bb±nb±2n(modn)

we may be able to replace b with some congruent number b=b+knsuch that gcd(a,b)>1; by applying Step3 to the congruence axb(modn), we can gain reduce  |a|. An alternative at this stage  is to multiply through by some suitably chosen constant c, giving caxcb(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 axbx(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 10x6(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 tZ. 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 

5x3(mod7)

Since gcd(5,3)=1 step 3 has no effect.so we move on to step 4.Noting that 310mod(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(tZ)

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 tZ 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×12481(mod47)

, we multiply by 12 to give 

48x12×13(mod47)



that is,

x3×4×133×523×515(mod47)



Thus we can take x0=15, so the general solution is x=15+47t

Example: Solve the linear congruence 3x2(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 

351(mod7)

Solve for x25103(mod7). So, x0=3 is the solution.x=3+7t is the general solution.

Example:

Solve the linear congruence 4x6(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: 2x3(mod5)


Find the modular inverse: The modular inverse of 2 modulo 5 is 3 since 231(mod5)

Solve for x3394(mod5). So, x0=4 ,is the solution.x=4+5t is the general solution.

Comments

Popular posts from this blog

Number Theory CST 292 KTU IV Semester Honors Course Notes Dr Binu V P 9847390760

Sum of Squares

Well Ordering Principle