400 likes | 613 Views
CENG536 Computer Engineering department Ç ankaya University . Advanced Computer Arithmetic Solving of Elementary Congruences (Continuing) Week 6. Consequence . First order congruence can have only one solution for
E N D
CENG536 Computer Engineering department Çankaya University Advanced Computer ArithmeticSolving of ElementaryCongruences (Continuing)Week 6
Consequence. First order congruence can have only one solution for According the theorem 1 all solutions are the numbers of sequence . Let 1 is such a solution. For that And let there is 2 - another solution of this congruence, i.e. Subtraction gives (*) Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
As the right hand part is multiple to p, the left hand part should be multiple to p. but 1 –2 is the difference of numbers where each is less than p and cant be divided by p. From this, the number a must be multiple to p, but this violates the hypothesis of theorem, and equality (*) can not take place. This states, that assumption of the existence of the second solution is erroneous, and congruence may have the only solution. Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 2 (Fermat's little theorem). If a is not multiple to p, for prime p is correct congruence Let for numbers from sequence where no numbers satisfying we have Multiplying this congruences we have Suppose, we have numbers satisfying that leads to Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
From this congruences we again have the two solutions ki and kj from sequence . This statement is impossible, because of consequence of theorem 1. We can state, that numbers in sequence are different and no number , as this gives, that a is multiple to p, but this violates the hypothesis of theorem. Combining these statements together we get, that numbers are different and no 0 among them; from this we have that Reducing both sides of the equality by gives which is the proof of the theorem. Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: • Let • The number • and this number is divisible by 5. Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 3. (Euler’s theorem) If a is relatively prime to p , the congruence of form is correct. Here is set of numbers from sequence (*) that are relatively prime to p and having no common multiples. Let - relatively prime numbers to p from the same sequence (*), and the numbers of the same sequence (*) defined by congruences: Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
(*) Multiplying this congruences gives new congruence Numbers must be relatively prime to p. Suppose contraire, that has common multiple to p, that is, if then where m, s and t are integers. Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Lets rewrite one of congruences from (*) in another form or in form of equality from the latest we have that should be multiple to m. But a and ki can not be divided by m as they have no common dividers to p and from this their product can not be divided by m. This shows the failure of assumption that i is not a relatively prime to p. We can show, like it was done in previous theorem, that each iis different of others. Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
As quantity of numbers i is the sequence is the set of numbers, relatively prime to p and this sequence is completely identical to From which follows that proof the theorem: Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: • Let a = 5 and p = 12. Lets compute • The sequence for p = 12 is • 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. • The numbers relatively prime to 12are marked out by bold and underline font. • There we have three numbers and then • From this, must be satisfied congruence • Producing calculations • we can show that result can be divided into 12 and this confirm validity of the solution. Solving of Elementary Congruences CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 4. Let congruence where p – prime and a – relatively prime to b numbers, has solution x = . Another solution to this congruence will be any number z, which is congruent to by modulo p– 1, i.e. (*) If there is satisfied (*), we can write equality and According Fermat's little theorem which entails and because we get that proves the theorem. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 5. If solution satisfies congruence another number where k – is integer, will satisfies it. Multiplying congruence by itself k times gives congruence that constitutes the statement of the theorem. In general, depending of a and p there may be arbitrary number of solutions. In particular case, when for a and p there is the only solution number a is referred to as primitive root of number p. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: • We want find all primitive roots of number p = 7. • According Fermat's little theorem the x = 6 satisfies congruence . • Lets test number a = 2. Now • From these, we see that congruence has additional solution x = 3 , and 2 is not the primitive root. • Now lets test number a = 3. • The only number 6 satisfies congruence • i.e. number 3 is the primitive root of number 7. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Testing number a = 4,we get x = 3 is solution of congruence and 4 is not a primitive root of number 7. Next number a = 5,for which Here, the congruence has the only solution x = 6, and we state that 5 is the primitive root of number 7. Last number to test is a = 6,for which It is evident, that 6 is not the primitive root of number 7. Now, all primitive roots of number 7, that are 3 and 5, are determined. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 6. If congruence for prime p and a non multiple to p has solution ,the number b which is the greatest common divisor of numbers and p – 1 is another solution. To proof the theorem lets state the few facts. If d is the greatest common divisor of and p – 1, the numbers are relatively prime. Next, if and r is relatively prime to p, for any there is such that produce Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Indeed, the sequence (*) has no numbers k1 and k2 that simultaneously satisfy congruences If both congruences will be satisfied, the next congruence will be satisfied too (subtraction) But its impossible, as k1 –k2 is not divisible by p and r that are relatively prime to p. Therefore, for each of (p – 1) numbers of sequence (*) is correct congruence for different i, where . Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Among these i there is for which is satisfied. From this fact follows, that if A and B are relatively prime numbers, there is possible determine s and t for which there will be As A and B are relatively prime numbers, setting gives Equivalent equality is which is correct for any m, particularly for m = 1. Now we have equality or Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
From initial statement follows And after division of first congruence by second we get which is the statement of the theorem. The theorem may be expanded on general case. If and are any two solution of congruence where p – prime number and a is not multiple to p, their greatest common divisor is the solution of this congruence. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 7. • Let is the smallest number that satisfies congruence • where p is prime number and a is not multiple to p. Then is devisor of p – 1, and other numbers that satisfies initial congruence are multiple to . • Let is arbitrary solution of the congruence. According theorem 6 the greatest common divisor of numbers and will satisfy this congruence. For this case should be satisfied d a. But is the smallest number that satisfies congruence and inequality is impossible. From this d= a ,i.e. is divisor of any solution of the congruence, including • p – 1 . Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 8. • Let is the solution, that satisfies congruence • (*) • where p is prime number, A is relatively prime to a, and is the smallest number that satisfies congruence • There are (p – 1) / numbers that satisfy first congruence, notably Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Basing on the conditions of the theorem we can write congruences where n is integer number. Multiplying these congruences gives from which we see, that for any n satisfies (*). General equation for x may be written in form (**) In accordance to previous theorems, if number satisfies the congruence, the other numbers that congruent to by modulo p – 1 will satisfy this congruence. In other words, the sequence of numbers obtained from (**) for different n is the sequence of numbers that congruent by modulo p – 1. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Because is divisor of p – 1, in this sequence there will be the numbers that congruent by modulo p – 1 only when different n will be congruent by modulo (p – 1) / . Let there is the congruence or Cancelling we get But all numbers of sequence are congruent by modulo (p – 1) / . This gives that all solutions of (*) will be congruent by modulo p – 1 to any number of sequence Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 9 It states more effective algorithm for determining of the primitive roots. Let – are the prime-divisors of p – 1. Then, the necessary and sufficient condition that q is the primitive root of the prime number p is that no one of congruences of form (*) will be satisfied. Necessity of this condition is evident, because satisfying congruence we get, that it has other solution besides x = p – 1, which is contrary to the definition of a primitive root. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Now lets proof sufficient condition of the theorem. Suppose that in addition to solution x = p – 1 to congruence there is another solution x = , and < p – 1. This x is not of any of powers of q in (*). If it is the least solution, then should be satisfied – If is prime number, then = i and i.e. is solution of one of congruences (*) which contradicts the assumption. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
– If is not prime factor of p – 1, then it may be presented as where iis prime factor of p – 1, and then The assumption that isa solution of the congruence entails implementation of congruence and again we get a contradiction. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: • Determine the primitive roots of number p = 7. • Here we have p – 1 = 6. Prime-divisors of p – 1 are 1 = 2 and 2= 3. System of congruences is of form • Test of a = 2. • 2 is not a primitive root of 7. • Test of a = 3. • 3 is a primitive root of 7. • Test of a = 4. • 4is not a primitive root of 7. • Test of a = 5. • 5is a primitive root of 7. • Test of a = 6. • 6is not a primitive root of 7. Primitive Roots and Their Computation CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 10. • If q is the primitive root of p, the congruence • (*) • where A is not multiple to p, has the only solution. • According the definition of the primitive root for congruence • the smallest satisfying it value is x = p – 1. The congruence (*) can have the only solution, as • or can’t have any solution. Theorem states that solution exist. • Assume that the congruence has no solution. Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Because A is not multiple to p, we have that A(mod p) gives residue from the sequence of numbers of form (*) Let it will be number r, i.e. Then we have the congruence which also has no solution. Because q is relatively prime to p, then numbers can not be divided by p and each of them is congruent to one of numbers (*). In turn, each of p – 1 numbers satisfies one of congruences of form Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
But one of these congruences is the congruence (*) which by assumption has no solution. From this, each of p – 1 numbers should satisfies to one of p – 2 congruences, that leads to statement that one of numbers should satisfy to two congruences. In other words, there will be the congruence that has two solutions. But this impossible, because there was shown, that congruence (*) may have (if have) the only solution. Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Definition. Number J, which is the solution of the congruence is the index of A and is denoted as The primitive root q is referred to as base index. From the last theorem follows, that to find index of any number A by modulo p first should be determined the primitive root, and then should be found solution of the congruence for this primitive root. Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: • Determine indices by modulo 7 of numbers 0, 1, 2, 3, 4, 5, 6. The primitive roots of 7 are 3 and 5. • Lets take the base index q = 3. Values 3x for x=0, 1, 2, 3, 4, 5,6 are: • From these congruences follows: • By the same way we find indices of these numbers for base index q = 5. Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Theorem 11. If are positive integer numbers and indices by modulo p for primitive root q are And if J is index of the product of these numbers for the same modulo p and primitive root q, then index of the product will be the sum of indices of multipliers by modulo p – 1 i.e. (*) Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
According index definition we have Multiplying these congruences gives or Dividing both sides by qJgives As q is the primitive root of p, all solutions of this congruence will be multiple to p – 1. In other words we get This expression may be rewritten in form (*) or in another form as Theory of Indices CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Property of indices makes them similar to logarithms and demonstrates, that multiplication and powering of numbers may be replaced by addition of indices. Anti-index may be applied for transition from index to actual result. Definition: Anti-index of number J is such a that or Denoting anti-index as N(J) gives Applying of Indices For Arithmetic Operations CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: • Determine anti-indices by modulo 7 of numbers 0, 1, 2, 3, 4, 5. • In previous example were computed indices of numbers from 1 to 6. These indices create sequence from 0 to 5. It is evident, that 0 can’t have finite index as no such power of number different of zero that gives 0. • Primitive root 3: • Primitive root 5: Applying of Indices For Arithmetic Operations CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
By the same way may be realized division by modulo. Division of two numbers by modulo gives quotient where k – is the minimal number, that transform in number that is multiple to b. In this case, if then Applying of Indices For Arithmetic Operations CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Example: Determine numerical value of the expression for 1. We first determine indices of variable accepting primitive root 5: 2. Computing index of the result: 3. Determining anti-index of the result: Direct computation gives Applying of Indices For Arithmetic Operations CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Tables of Indices For Prime Moduli CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV
Tables of Indices For Prime Moduli CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV