Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Multiplicative inverse - what am I doing wrong?

  • 05-07-2008 10:16PM
    #1
    Closed Accounts Posts: 12,382 ✭✭✭✭


    Hello

    This should be easy, but I am being stupid I think.
    • I have a finite field with 269 fields.
    • I want to find the multiplicative inverse of 98.
    • I multiply 98 by every field in the finite field (modulo 269) until the answer is 1.
    • This gives me 140.
    • (98 * 140) modulo 269 = 1

    Grand.

    However, I thought I could use the multiplicative inverse instead of division? For example, instead of dividing a number by 98 (modulo 269) I could multiply it by 140 (modulo 269). This doesn't seem to be working.

    Am I doing something stupid?

    Any help appreciated.

    Thanks :)

    [One more question if anyone can help! If the numbers I am dealing with are polynomials, can I use the same system as above, except use polynomial multiplication instead of natural number multiplication? Thanks!]


Comments

  • Closed Accounts Posts: 6,081 ✭✭✭LeixlipRed


    To find the inverse of some a (mod n) you use the fact that an inverse exists if and only if the gcd of a and n is one.


  • Closed Accounts Posts: 12,382 ✭✭✭✭AARRRGH


    Hi LeixlipRed

    Would you mind telling me if this looks right to you?

    I want to find the multiplicative inverse of x^4 + 1. The irreducible polynomial I am using is x^8 + x^6 + x^5 + x + 1.

    I have already worked out (using Extended Euclidean Algorithm) that the multiplicative inverse of x^4 + 1 is x^6 + x^4 + x^3 + x^2 + 1.

    So -

    f(x) = x^8 + x^6 + x^5 + x + 1
    a = x^4 + 1
    1/a = x^6 + x^4 + x^3 + x^2 + 1

    This is how I verified I am correct -

    a * 1/a = x^10 + x^8 + x^7 + x^3 + x^2 + 1

    As this is larger than f(x), I divide it by f(x) and keep the remainder -

    (a * 1/a) / f(x) = x^2 remainder 1

    The remainder 1 means the multiplicative inverse of a is x^6 + x^4 + x^3 + x^2 + 1, as a * 1/a = b mod f(x) = 1.

    Does this sound correct?

    Thank you!


Advertisement