((my) mod n ) congruent to n-1

Discussion in 'Physics & Math' started by smslca, Jan 29, 2012.

  1. smslca Registered Senior Member

    Messages:
    53
    If given a 'n' value and m = floor ( squareroot(n) )
    then is there any way to find the value of 'y' , such that

    ((m*y) mod n) is congruent to (n-1)
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. CptBork Valued Senior Member

    Messages:
    6,465
    Nope. Take n=6, for example.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. smslca Registered Senior Member

    Messages:
    53
    so , i took other examples like , 15,20,35,42,..
    and i observed that , if m is one of the divisors of n, then we wont get the solution.

    So , what about the values for which , m is not a divisor of n?
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. CptBork Valued Senior Member

    Messages:
    6,465
    Still doesn't work. Consider n=38, for example. However, if m and n are have no common prime factors, then you can always do it by first finding the modular inverse of m and then multiplying it by n-1.
     
  8. smslca Registered Senior Member

    Messages:
    53
    Thanks . This may be useful. I have to know what the modular inverse is. and how exactly could i compute y.
     
  9. CptBork Valued Senior Member

    Messages:
    6,465
    As is often the case, Wikipedia comes to the rescue: http://en.wikipedia.org/wiki/Modular_multiplicative_inverse#Computation

    I recommend using the extended Euclidean algorithm as the easier method for application and understanding. What you want to do is find a number \(x\) such that \(mx\equiv 1\quad\left(\mathrm{mod}\ n\right)\), then you just take \(y=x\left(n-1\right)\) (or preferably its smallest modular equivalent). Again, this is only guaranteed to work if m and n have no common prime factors (also known as "relatively prime"). This kind of methodology is generally one of the first things you learn in modular arithmetic, try checking out an introductory abstract algebra or number theory text for more details.
     
  10. arfa brane call me arf Valued Senior Member

    Messages:
    7,832
    A modular inverse is found from the multiplication table. Any two numbers whose product is congruent to 1 (mod n) are inverses in Z[sub]n[/sub].

    For instance, 2 and 3 are inverses mod 5, 2x3 = 1 -> 2 = 3[sup]-1[/sup] (working in Z[sub]5[/sub]).
     
  11. Brett Nortje Amateur stripper Registered Senior Member

    Messages:
    28
    If I am not mistaken, if you want to know the segmented inverse of angles in the Euclidean algorithm, then you need to take the angle of the outverse and reverse it by three hundred and sixty degree totals into segments, as you know what the outversed angles are - you can see them.

    You can calcualte the inverse by taking the 360 degrees and finding the pressure threshold of your materials, and then calculating the [pressure] minus the [pressure threshold] and hoping it is negative. Then you calculate the amount of pressure put onto it by taking the [stress resistance levels] of the material and then subtracting that of the stress put onto it. Then you divide the value by the inverse of ninety degrees it stands at.

    If it comes back a negative number then it will not hold, and needs to be adjusted.
     
  12. CptBork Valued Senior Member

    Messages:
    6,465
    It looks like the LHC must have opened a gateway to Bizarro World. Quick, shut it down!
     
  13. RJBeery Natural Philosopher Valued Senior Member

    Messages:
    4,222
    Is there something wrong with making sure that (m mod n) is congruent to (n-1) first? Then y = (n-1)/m...unless I'm caffeine deficient
     

Share This Page