Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Mod function in a claculator

  • 18-05-2004 2:57am
    #1
    Banned (with Prison Access) Posts: 13,018 ✭✭✭✭


    As the title says is there an easier way to find out the mod of a number using a claculator rahter than then a long winded way!?


    Me own claculator is a sharp el-53ILH if its any help at all


Comments

  • Banned (with Prison Access) Posts: 13,018 ✭✭✭✭jank


    anybody

    have a cryptography exam tommorrow and i need it so save time


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    ...

    Let's say for example...

    You have 133
    And you want to find 133 % 8

    Divide 133 by 8 = 16.625

    Which means it goes evenly in 16 times.

    So multiply 16 x 8 and subtract it from 133. Ans: 5

    Simple

    or...

    Back to 16.625.
    Take the non-integer part, i.e. 0.625, and multiply it by 8, which will give you 5.

    The first one is better though, as the second one may not produce an integer due to rounding.


  • Banned (with Prison Access) Posts: 13,018 ✭✭✭✭jank


    yea i know that is a way of doing
    cheers

    but in my exam im going to have to deal with numbers like 2^8
    or so
    eg. 2^7mod11 !

    i know its do able but very long winded:dunno:
    was looking for a short-cut

    thanks anyway though;)


  • Moderators, Social & Fun Moderators Posts: 10,501 Mod ✭✭✭✭ecksor


    Do you know your rules for modulo arithmetic? As in, [a]n + n = [a+b]n and [a]n * n = [a*b]n

    Hard to give you an answer without knowing your course though and your example looks a bit bizarre (well, too small basically). Do you remember drawing cayley tables of groups or anything like that? 2 generates the group like so:

    2->4->8->5->10->9->7->3->6->1

    If you were given 2^270 mod 11 then you'd look for 270 mod 11 which is 270-(11*24) = 6

    So, 2^270 mod 11 = 2^6 mod 11 and according to the cycle above that's 9.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    Originally posted by ecksor
    Do you know your rules for modulo arithmetic? As in, [a]n + n = [a+b]n and [a]n * n = [a*b]n

    Hard to give you an answer without knowing your course though and your example looks a bit bizarre (well, too small basically). Do you remember drawing cayley tables of groups or anything like that? 2 generates the group like so:

    2->4->8->5->10->9->7->3->6->1

    If you were given 2^270 mod 11 then you'd look for 270 mod 11 which is 270-(11*24) = 6

    So, 2^270 mod 11 = 2^6 mod 11 and according to the cycle above that's 9.
    Funny....how did a university give me a Comp Sci degree without ever touching on modulo arithmetic?


  • Advertisement
  • Moderators, Social & Fun Moderators Posts: 10,501 Mod ✭✭✭✭ecksor


    You'd have to have seen it in something like a crypto module I guess or something else that covers group theory or number theory I suppose ...

    Of course, numeric datatypes act like modulo arithmetic too which is where integer overflows and similar bugs come from.

    ecksor, degreeless.


  • Banned (with Prison Access) Posts: 13,018 ✭✭✭✭jank


    Mod is used in RSA public key cryptography.

    P^e mod n =C

    C^d mod n= p


    the prime factors is how one would derive the encryption key from the decryption key ie. get the inverse of it
    and visa versa but the strength of the key lies in the fact that RSA standard keys are 1024 bytes long and finding 2 prime factors of a number like that is impossible (well so ive been told until quantum computers are invented)

    e*d mod (p-1)(q-1) =1
    d=e^-1 mod (p-1)(q-1)


    ^
    |
    |
    me thinks im smart cause i just learned it
    wish me luck tomorrow

    ;)


  • Closed Accounts Posts: 1 ruchika


    how do I find mod of a matrice ??


Advertisement