Thursday 8 September 2011

Multiplicative Inverses in Zn - execution of the program

This program will give the multiplicative inverse of a number in Zn. As discussed previously suppose we wish to find the inverse of 3 in Z7. On running the program, the dispay shows A? This is the number whose inverse we require. Enter 3 and press [EXE]. The display then shows B? This is the number n. Enter 7 and press [EXE]. The display then shows AX-C+B-1=>X and the number 5. This indicates that the inverse 5 has been found and this matches what we expect.

We can look at bigger values of n. Consider n=211 which is a prime number. As 211 is prime then any number j>1 chosen from Z211 will be coprime with 211 and so will have a multiplicative inverse. For example, running the program with j=33 and n=211 we find that its inverse is 32 in Z211. This is because 33x32=1056=5x211+1.

What if j and n are not coprime. Running the program with j=8 and n=32 the calculator displays X<B=>Goto 0 and 0. This indicates that no multiplicative inverse has been found and this is to be expected as 8 and 32 have a common factors of 2, 4 and 8 and so are not coprime.

No comments:

Post a Comment