Is Modular Arithmetic Notation Good?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1












When we write
$$a = b, (mathrmmod, n)$$
we mean $a$ and $b$ belong to the same equivalence class. This is a symmetric property, so writing $$a equiv_n b$$ is intuitive. On the other hand, we also treat $(mathrmmod, n)$ like an operator: that is, given some $b$, we write $b, (mathrmmod, n)$ to denote the remainder of $b$ upon division by $n$. In this setting, it is not necessarily true that $a = b, (mathrmmod, n)$, even if $a$ and $b$ belong to the same equivalence class. Disagreements in notation are never good, so my friend writes $lfloor brfloor_n$ to mean the remainder after division by $n$.



There is now a very clear distinction between congruence mod $n$ and the modulo operator. However, this makes me think, what if there is a deep reason why the common notation is good? To me the current conventions seem bad, but there must be reason it is popular. Why do people use the current notation?







share|cite|improve this question















  • 3




    "We" don't treat (mod $n$) as an operator...
    – Lord Shark the Unknown
    Jul 22 at 9:06






  • 2




    There's already an error in your first displayed equation. This should be $$aequiv bpmod n.$$
    – Lord Shark the Unknown
    Jul 22 at 9:07







  • 3




    I agree that $equiv_n$ would've been better. But it's not established, which is a downside.
    – Arthur
    Jul 22 at 9:14






  • 1




    There a spacing difference between $;aequiv bpmod n;$ and $;a=bbmod n$.
    – Bernard
    Jul 22 at 9:16















up vote
0
down vote

favorite
1












When we write
$$a = b, (mathrmmod, n)$$
we mean $a$ and $b$ belong to the same equivalence class. This is a symmetric property, so writing $$a equiv_n b$$ is intuitive. On the other hand, we also treat $(mathrmmod, n)$ like an operator: that is, given some $b$, we write $b, (mathrmmod, n)$ to denote the remainder of $b$ upon division by $n$. In this setting, it is not necessarily true that $a = b, (mathrmmod, n)$, even if $a$ and $b$ belong to the same equivalence class. Disagreements in notation are never good, so my friend writes $lfloor brfloor_n$ to mean the remainder after division by $n$.



There is now a very clear distinction between congruence mod $n$ and the modulo operator. However, this makes me think, what if there is a deep reason why the common notation is good? To me the current conventions seem bad, but there must be reason it is popular. Why do people use the current notation?







share|cite|improve this question















  • 3




    "We" don't treat (mod $n$) as an operator...
    – Lord Shark the Unknown
    Jul 22 at 9:06






  • 2




    There's already an error in your first displayed equation. This should be $$aequiv bpmod n.$$
    – Lord Shark the Unknown
    Jul 22 at 9:07







  • 3




    I agree that $equiv_n$ would've been better. But it's not established, which is a downside.
    – Arthur
    Jul 22 at 9:14






  • 1




    There a spacing difference between $;aequiv bpmod n;$ and $;a=bbmod n$.
    – Bernard
    Jul 22 at 9:16













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





When we write
$$a = b, (mathrmmod, n)$$
we mean $a$ and $b$ belong to the same equivalence class. This is a symmetric property, so writing $$a equiv_n b$$ is intuitive. On the other hand, we also treat $(mathrmmod, n)$ like an operator: that is, given some $b$, we write $b, (mathrmmod, n)$ to denote the remainder of $b$ upon division by $n$. In this setting, it is not necessarily true that $a = b, (mathrmmod, n)$, even if $a$ and $b$ belong to the same equivalence class. Disagreements in notation are never good, so my friend writes $lfloor brfloor_n$ to mean the remainder after division by $n$.



There is now a very clear distinction between congruence mod $n$ and the modulo operator. However, this makes me think, what if there is a deep reason why the common notation is good? To me the current conventions seem bad, but there must be reason it is popular. Why do people use the current notation?







share|cite|improve this question











When we write
$$a = b, (mathrmmod, n)$$
we mean $a$ and $b$ belong to the same equivalence class. This is a symmetric property, so writing $$a equiv_n b$$ is intuitive. On the other hand, we also treat $(mathrmmod, n)$ like an operator: that is, given some $b$, we write $b, (mathrmmod, n)$ to denote the remainder of $b$ upon division by $n$. In this setting, it is not necessarily true that $a = b, (mathrmmod, n)$, even if $a$ and $b$ belong to the same equivalence class. Disagreements in notation are never good, so my friend writes $lfloor brfloor_n$ to mean the remainder after division by $n$.



There is now a very clear distinction between congruence mod $n$ and the modulo operator. However, this makes me think, what if there is a deep reason why the common notation is good? To me the current conventions seem bad, but there must be reason it is popular. Why do people use the current notation?









share|cite|improve this question










share|cite|improve this question




share|cite|improve this question









asked Jul 22 at 9:05









Harambe

5,75921842




5,75921842







  • 3




    "We" don't treat (mod $n$) as an operator...
    – Lord Shark the Unknown
    Jul 22 at 9:06






  • 2




    There's already an error in your first displayed equation. This should be $$aequiv bpmod n.$$
    – Lord Shark the Unknown
    Jul 22 at 9:07







  • 3




    I agree that $equiv_n$ would've been better. But it's not established, which is a downside.
    – Arthur
    Jul 22 at 9:14






  • 1




    There a spacing difference between $;aequiv bpmod n;$ and $;a=bbmod n$.
    – Bernard
    Jul 22 at 9:16













  • 3




    "We" don't treat (mod $n$) as an operator...
    – Lord Shark the Unknown
    Jul 22 at 9:06






  • 2




    There's already an error in your first displayed equation. This should be $$aequiv bpmod n.$$
    – Lord Shark the Unknown
    Jul 22 at 9:07







  • 3




    I agree that $equiv_n$ would've been better. But it's not established, which is a downside.
    – Arthur
    Jul 22 at 9:14






  • 1




    There a spacing difference between $;aequiv bpmod n;$ and $;a=bbmod n$.
    – Bernard
    Jul 22 at 9:16








3




3




"We" don't treat (mod $n$) as an operator...
– Lord Shark the Unknown
Jul 22 at 9:06




"We" don't treat (mod $n$) as an operator...
– Lord Shark the Unknown
Jul 22 at 9:06




2




2




There's already an error in your first displayed equation. This should be $$aequiv bpmod n.$$
– Lord Shark the Unknown
Jul 22 at 9:07





There's already an error in your first displayed equation. This should be $$aequiv bpmod n.$$
– Lord Shark the Unknown
Jul 22 at 9:07





3




3




I agree that $equiv_n$ would've been better. But it's not established, which is a downside.
– Arthur
Jul 22 at 9:14




I agree that $equiv_n$ would've been better. But it's not established, which is a downside.
– Arthur
Jul 22 at 9:14




1




1




There a spacing difference between $;aequiv bpmod n;$ and $;a=bbmod n$.
– Bernard
Jul 22 at 9:16





There a spacing difference between $;aequiv bpmod n;$ and $;a=bbmod n$.
– Bernard
Jul 22 at 9:16











2 Answers
2






active

oldest

votes

















up vote
4
down vote



accepted










Nobody uses $amod b$ as an operator. That's an exaggeration, but basically that notation is not as popular as you seem to think. It is non-standard and discouraged. Programmers sometimes use it because they're used to the % operator in many programming languages, but I don't think I've ever seen someone write $amod b$ on math.SE without a mathematician telling them that's not really how the notation works.



Sometimes it's useful to have a notation for "the unique $xin 0, ... b-1$ such that $aequiv xmod b$", and in that case writing $amod b$ might not be an unreasonable way of doing it as long as explain the notation beforehand. $lfloor a rfloor_b$ seems reasonable as well. There is no standard notation for this operation.






share|cite|improve this answer






























    up vote
    1
    down vote













    I've also wondered what the simplest notation would be. Some alternative notation uses $mod(a,n)$. So then we can write the same identity multiple ways: beginalign ab : (mod : n) &= (a : (mod : n))(b : (mod : n)) : (mod : n) \ mod(ab,n) &= mod(mod(a,n)mod(b,n),n)\
    ab &equiv_n mod(a,n)mod(b,n) endalign
    Using $mod(a,n)$ requires one to remember which comes first (the $a$ or the $n$). Alternative notation might use $mod_n(a)$ as a replacement for $mod(a,n)$. So we would have a fourth way to express the same identity:
    $$ ab equiv_n mod_n(a)mod_n(b)$$
    This consistently keeps $n$ as a subscript.




    Anyone who wants to use notation $equiv_n$ or $mod_n(a)$ can simply define them in one line at the start of their work.






    share|cite|improve this answer























    • I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
      – Michael
      Jul 23 at 23:53










    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2859227%2fis-modular-arithmetic-notation-good%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    Nobody uses $amod b$ as an operator. That's an exaggeration, but basically that notation is not as popular as you seem to think. It is non-standard and discouraged. Programmers sometimes use it because they're used to the % operator in many programming languages, but I don't think I've ever seen someone write $amod b$ on math.SE without a mathematician telling them that's not really how the notation works.



    Sometimes it's useful to have a notation for "the unique $xin 0, ... b-1$ such that $aequiv xmod b$", and in that case writing $amod b$ might not be an unreasonable way of doing it as long as explain the notation beforehand. $lfloor a rfloor_b$ seems reasonable as well. There is no standard notation for this operation.






    share|cite|improve this answer



























      up vote
      4
      down vote



      accepted










      Nobody uses $amod b$ as an operator. That's an exaggeration, but basically that notation is not as popular as you seem to think. It is non-standard and discouraged. Programmers sometimes use it because they're used to the % operator in many programming languages, but I don't think I've ever seen someone write $amod b$ on math.SE without a mathematician telling them that's not really how the notation works.



      Sometimes it's useful to have a notation for "the unique $xin 0, ... b-1$ such that $aequiv xmod b$", and in that case writing $amod b$ might not be an unreasonable way of doing it as long as explain the notation beforehand. $lfloor a rfloor_b$ seems reasonable as well. There is no standard notation for this operation.






      share|cite|improve this answer

























        up vote
        4
        down vote



        accepted







        up vote
        4
        down vote



        accepted






        Nobody uses $amod b$ as an operator. That's an exaggeration, but basically that notation is not as popular as you seem to think. It is non-standard and discouraged. Programmers sometimes use it because they're used to the % operator in many programming languages, but I don't think I've ever seen someone write $amod b$ on math.SE without a mathematician telling them that's not really how the notation works.



        Sometimes it's useful to have a notation for "the unique $xin 0, ... b-1$ such that $aequiv xmod b$", and in that case writing $amod b$ might not be an unreasonable way of doing it as long as explain the notation beforehand. $lfloor a rfloor_b$ seems reasonable as well. There is no standard notation for this operation.






        share|cite|improve this answer















        Nobody uses $amod b$ as an operator. That's an exaggeration, but basically that notation is not as popular as you seem to think. It is non-standard and discouraged. Programmers sometimes use it because they're used to the % operator in many programming languages, but I don't think I've ever seen someone write $amod b$ on math.SE without a mathematician telling them that's not really how the notation works.



        Sometimes it's useful to have a notation for "the unique $xin 0, ... b-1$ such that $aequiv xmod b$", and in that case writing $amod b$ might not be an unreasonable way of doing it as long as explain the notation beforehand. $lfloor a rfloor_b$ seems reasonable as well. There is no standard notation for this operation.







        share|cite|improve this answer















        share|cite|improve this answer



        share|cite|improve this answer








        edited Jul 22 at 12:43


























        answered Jul 22 at 11:35









        Jack M

        17k33473




        17k33473




















            up vote
            1
            down vote













            I've also wondered what the simplest notation would be. Some alternative notation uses $mod(a,n)$. So then we can write the same identity multiple ways: beginalign ab : (mod : n) &= (a : (mod : n))(b : (mod : n)) : (mod : n) \ mod(ab,n) &= mod(mod(a,n)mod(b,n),n)\
            ab &equiv_n mod(a,n)mod(b,n) endalign
            Using $mod(a,n)$ requires one to remember which comes first (the $a$ or the $n$). Alternative notation might use $mod_n(a)$ as a replacement for $mod(a,n)$. So we would have a fourth way to express the same identity:
            $$ ab equiv_n mod_n(a)mod_n(b)$$
            This consistently keeps $n$ as a subscript.




            Anyone who wants to use notation $equiv_n$ or $mod_n(a)$ can simply define them in one line at the start of their work.






            share|cite|improve this answer























            • I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
              – Michael
              Jul 23 at 23:53














            up vote
            1
            down vote













            I've also wondered what the simplest notation would be. Some alternative notation uses $mod(a,n)$. So then we can write the same identity multiple ways: beginalign ab : (mod : n) &= (a : (mod : n))(b : (mod : n)) : (mod : n) \ mod(ab,n) &= mod(mod(a,n)mod(b,n),n)\
            ab &equiv_n mod(a,n)mod(b,n) endalign
            Using $mod(a,n)$ requires one to remember which comes first (the $a$ or the $n$). Alternative notation might use $mod_n(a)$ as a replacement for $mod(a,n)$. So we would have a fourth way to express the same identity:
            $$ ab equiv_n mod_n(a)mod_n(b)$$
            This consistently keeps $n$ as a subscript.




            Anyone who wants to use notation $equiv_n$ or $mod_n(a)$ can simply define them in one line at the start of their work.






            share|cite|improve this answer























            • I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
              – Michael
              Jul 23 at 23:53












            up vote
            1
            down vote










            up vote
            1
            down vote









            I've also wondered what the simplest notation would be. Some alternative notation uses $mod(a,n)$. So then we can write the same identity multiple ways: beginalign ab : (mod : n) &= (a : (mod : n))(b : (mod : n)) : (mod : n) \ mod(ab,n) &= mod(mod(a,n)mod(b,n),n)\
            ab &equiv_n mod(a,n)mod(b,n) endalign
            Using $mod(a,n)$ requires one to remember which comes first (the $a$ or the $n$). Alternative notation might use $mod_n(a)$ as a replacement for $mod(a,n)$. So we would have a fourth way to express the same identity:
            $$ ab equiv_n mod_n(a)mod_n(b)$$
            This consistently keeps $n$ as a subscript.




            Anyone who wants to use notation $equiv_n$ or $mod_n(a)$ can simply define them in one line at the start of their work.






            share|cite|improve this answer















            I've also wondered what the simplest notation would be. Some alternative notation uses $mod(a,n)$. So then we can write the same identity multiple ways: beginalign ab : (mod : n) &= (a : (mod : n))(b : (mod : n)) : (mod : n) \ mod(ab,n) &= mod(mod(a,n)mod(b,n),n)\
            ab &equiv_n mod(a,n)mod(b,n) endalign
            Using $mod(a,n)$ requires one to remember which comes first (the $a$ or the $n$). Alternative notation might use $mod_n(a)$ as a replacement for $mod(a,n)$. So we would have a fourth way to express the same identity:
            $$ ab equiv_n mod_n(a)mod_n(b)$$
            This consistently keeps $n$ as a subscript.




            Anyone who wants to use notation $equiv_n$ or $mod_n(a)$ can simply define them in one line at the start of their work.







            share|cite|improve this answer















            share|cite|improve this answer



            share|cite|improve this answer








            edited Jul 22 at 11:10


























            answered Jul 22 at 10:58









            Michael

            12.2k11325




            12.2k11325











            • I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
              – Michael
              Jul 23 at 23:53
















            • I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
              – Michael
              Jul 23 at 23:53















            I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
            – Michael
            Jul 23 at 23:53




            I'm not sure how to interpret the meaning of the 4.5 sentences in the above comment.
            – Michael
            Jul 23 at 23:53












             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2859227%2fis-modular-arithmetic-notation-good%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What is the equation of a 3D cone with generalised tilt?

            Color the edges and diagonals of a regular polygon

            Relationship between determinant of matrix and determinant of adjoint?