Arithmetic laws for rational numbers vs. real numbers












0














Are there any arithmetic laws that are always true for the set of rational numbers but not always true for the set of real numbers?



This came up because I was doing various exercises in different ways to represent real numbers on a computer (besides the IEEE 754 floating point standard) and accidentally stumbled onto a method that only produces rational numbers. I know that the result of any real number representation will terminate at the length of the data types size and thus the final result of a calculation is always rational, but in most cases the true answer is irrational and then it gets rounded and terminated into being represented as a rational number.



I was curious as to whether this weird property had any benefits that could be taken advantage of.










share|cite|improve this question






















  • "The final result of a calculation is always rational" - only if you use e.g. fixed-point binary arithmetic. Computer algebra systems like Mathematica are capable of using representations that are much more broad: they can manipulate the number $sqrt{2}$ in complete generality.
    – Patrick Stevens
    Nov 26 '18 at 7:59










  • "The equation $x^2=2$ has no solution" is an arithmetic law that is valid in ${mathbb Q}$ but not in ${mathbb R}$. You have to differentiate between numbers as "infinitely precise" mathematical objects (like ${2over7}$ or $pi$) and their (often approximate) representation in a computer.
    – Christian Blatter
    Nov 26 '18 at 8:09


















0














Are there any arithmetic laws that are always true for the set of rational numbers but not always true for the set of real numbers?



This came up because I was doing various exercises in different ways to represent real numbers on a computer (besides the IEEE 754 floating point standard) and accidentally stumbled onto a method that only produces rational numbers. I know that the result of any real number representation will terminate at the length of the data types size and thus the final result of a calculation is always rational, but in most cases the true answer is irrational and then it gets rounded and terminated into being represented as a rational number.



I was curious as to whether this weird property had any benefits that could be taken advantage of.










share|cite|improve this question






















  • "The final result of a calculation is always rational" - only if you use e.g. fixed-point binary arithmetic. Computer algebra systems like Mathematica are capable of using representations that are much more broad: they can manipulate the number $sqrt{2}$ in complete generality.
    – Patrick Stevens
    Nov 26 '18 at 7:59










  • "The equation $x^2=2$ has no solution" is an arithmetic law that is valid in ${mathbb Q}$ but not in ${mathbb R}$. You have to differentiate between numbers as "infinitely precise" mathematical objects (like ${2over7}$ or $pi$) and their (often approximate) representation in a computer.
    – Christian Blatter
    Nov 26 '18 at 8:09
















0












0








0


1





Are there any arithmetic laws that are always true for the set of rational numbers but not always true for the set of real numbers?



This came up because I was doing various exercises in different ways to represent real numbers on a computer (besides the IEEE 754 floating point standard) and accidentally stumbled onto a method that only produces rational numbers. I know that the result of any real number representation will terminate at the length of the data types size and thus the final result of a calculation is always rational, but in most cases the true answer is irrational and then it gets rounded and terminated into being represented as a rational number.



I was curious as to whether this weird property had any benefits that could be taken advantage of.










share|cite|improve this question













Are there any arithmetic laws that are always true for the set of rational numbers but not always true for the set of real numbers?



This came up because I was doing various exercises in different ways to represent real numbers on a computer (besides the IEEE 754 floating point standard) and accidentally stumbled onto a method that only produces rational numbers. I know that the result of any real number representation will terminate at the length of the data types size and thus the final result of a calculation is always rational, but in most cases the true answer is irrational and then it gets rounded and terminated into being represented as a rational number.



I was curious as to whether this weird property had any benefits that could be taken advantage of.







real-numbers irrational-numbers rational-numbers






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Nov 26 '18 at 6:53









Rory O'Hare

143




143












  • "The final result of a calculation is always rational" - only if you use e.g. fixed-point binary arithmetic. Computer algebra systems like Mathematica are capable of using representations that are much more broad: they can manipulate the number $sqrt{2}$ in complete generality.
    – Patrick Stevens
    Nov 26 '18 at 7:59










  • "The equation $x^2=2$ has no solution" is an arithmetic law that is valid in ${mathbb Q}$ but not in ${mathbb R}$. You have to differentiate between numbers as "infinitely precise" mathematical objects (like ${2over7}$ or $pi$) and their (often approximate) representation in a computer.
    – Christian Blatter
    Nov 26 '18 at 8:09




















  • "The final result of a calculation is always rational" - only if you use e.g. fixed-point binary arithmetic. Computer algebra systems like Mathematica are capable of using representations that are much more broad: they can manipulate the number $sqrt{2}$ in complete generality.
    – Patrick Stevens
    Nov 26 '18 at 7:59










  • "The equation $x^2=2$ has no solution" is an arithmetic law that is valid in ${mathbb Q}$ but not in ${mathbb R}$. You have to differentiate between numbers as "infinitely precise" mathematical objects (like ${2over7}$ or $pi$) and their (often approximate) representation in a computer.
    – Christian Blatter
    Nov 26 '18 at 8:09


















"The final result of a calculation is always rational" - only if you use e.g. fixed-point binary arithmetic. Computer algebra systems like Mathematica are capable of using representations that are much more broad: they can manipulate the number $sqrt{2}$ in complete generality.
– Patrick Stevens
Nov 26 '18 at 7:59




"The final result of a calculation is always rational" - only if you use e.g. fixed-point binary arithmetic. Computer algebra systems like Mathematica are capable of using representations that are much more broad: they can manipulate the number $sqrt{2}$ in complete generality.
– Patrick Stevens
Nov 26 '18 at 7:59












"The equation $x^2=2$ has no solution" is an arithmetic law that is valid in ${mathbb Q}$ but not in ${mathbb R}$. You have to differentiate between numbers as "infinitely precise" mathematical objects (like ${2over7}$ or $pi$) and their (often approximate) representation in a computer.
– Christian Blatter
Nov 26 '18 at 8:09






"The equation $x^2=2$ has no solution" is an arithmetic law that is valid in ${mathbb Q}$ but not in ${mathbb R}$. You have to differentiate between numbers as "infinitely precise" mathematical objects (like ${2over7}$ or $pi$) and their (often approximate) representation in a computer.
– Christian Blatter
Nov 26 '18 at 8:09












3 Answers
3






active

oldest

votes


















1














Every rational number can be written as $frac ab $ such that $a,b in Bbb{Z} ,bneq 0$ with $operatorname{gcd}(|a|,|b|)=1$.But it's not true for every real number.






share|cite|improve this answer

















  • 1




    Heh, that was the one I knew but I didn't think to mention it :)
    – Rory O'Hare
    Nov 26 '18 at 7:41








  • 1




    Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
    – fleablood
    Nov 26 '18 at 7:43



















1














Given rational non-zero $p, q$ there are non-zero integers $a,b$ where $ap = bq$. That's trivial but imagine two waves with rational period they will have a least common multiple period where they synch up on a periodic bases. A wave with a rational period and one with on odd period will match when the both start but will never synch up again.



(I dunno. That's obvious if you think about it, but it still manages to surprise me. And there's that joke in "Futurama" and the "Channel $sqrt{2}$ News"--- It's funny if you think about it.... At least I think it is funny if you think about it....)



You talk of "using to advantage" and I think the must useful thing would be this sort of period modulo generation that can't happen with irrational values.






share|cite|improve this answer





















  • Do you have "odd period" where you meant "irrational period"?
    – badjohn
    Nov 26 '18 at 7:58



















1














One of my favourites: floating-point addition is not associative or linear. This very slight failure of linearity turns out to be enough, if stacked as the last layer of a neural network, to allow the network to be trained to do nontrivial work.






share|cite|improve this answer





















    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    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%2f3013955%2farithmetic-laws-for-rational-numbers-vs-real-numbers%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Every rational number can be written as $frac ab $ such that $a,b in Bbb{Z} ,bneq 0$ with $operatorname{gcd}(|a|,|b|)=1$.But it's not true for every real number.






    share|cite|improve this answer

















    • 1




      Heh, that was the one I knew but I didn't think to mention it :)
      – Rory O'Hare
      Nov 26 '18 at 7:41








    • 1




      Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
      – fleablood
      Nov 26 '18 at 7:43
















    1














    Every rational number can be written as $frac ab $ such that $a,b in Bbb{Z} ,bneq 0$ with $operatorname{gcd}(|a|,|b|)=1$.But it's not true for every real number.






    share|cite|improve this answer

















    • 1




      Heh, that was the one I knew but I didn't think to mention it :)
      – Rory O'Hare
      Nov 26 '18 at 7:41








    • 1




      Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
      – fleablood
      Nov 26 '18 at 7:43














    1












    1








    1






    Every rational number can be written as $frac ab $ such that $a,b in Bbb{Z} ,bneq 0$ with $operatorname{gcd}(|a|,|b|)=1$.But it's not true for every real number.






    share|cite|improve this answer












    Every rational number can be written as $frac ab $ such that $a,b in Bbb{Z} ,bneq 0$ with $operatorname{gcd}(|a|,|b|)=1$.But it's not true for every real number.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Nov 26 '18 at 7:28









    Thomas Shelby

    1,657216




    1,657216








    • 1




      Heh, that was the one I knew but I didn't think to mention it :)
      – Rory O'Hare
      Nov 26 '18 at 7:41








    • 1




      Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
      – fleablood
      Nov 26 '18 at 7:43














    • 1




      Heh, that was the one I knew but I didn't think to mention it :)
      – Rory O'Hare
      Nov 26 '18 at 7:41








    • 1




      Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
      – fleablood
      Nov 26 '18 at 7:43








    1




    1




    Heh, that was the one I knew but I didn't think to mention it :)
    – Rory O'Hare
    Nov 26 '18 at 7:41






    Heh, that was the one I knew but I didn't think to mention it :)
    – Rory O'Hare
    Nov 26 '18 at 7:41






    1




    1




    Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
    – fleablood
    Nov 26 '18 at 7:43




    Also the product/sum/difference/quotient of two rationals is rational. Of a rational and an irrational is always irrational. But if two irrationals... nothing can be determined.
    – fleablood
    Nov 26 '18 at 7:43











    1














    Given rational non-zero $p, q$ there are non-zero integers $a,b$ where $ap = bq$. That's trivial but imagine two waves with rational period they will have a least common multiple period where they synch up on a periodic bases. A wave with a rational period and one with on odd period will match when the both start but will never synch up again.



    (I dunno. That's obvious if you think about it, but it still manages to surprise me. And there's that joke in "Futurama" and the "Channel $sqrt{2}$ News"--- It's funny if you think about it.... At least I think it is funny if you think about it....)



    You talk of "using to advantage" and I think the must useful thing would be this sort of period modulo generation that can't happen with irrational values.






    share|cite|improve this answer





















    • Do you have "odd period" where you meant "irrational period"?
      – badjohn
      Nov 26 '18 at 7:58
















    1














    Given rational non-zero $p, q$ there are non-zero integers $a,b$ where $ap = bq$. That's trivial but imagine two waves with rational period they will have a least common multiple period where they synch up on a periodic bases. A wave with a rational period and one with on odd period will match when the both start but will never synch up again.



    (I dunno. That's obvious if you think about it, but it still manages to surprise me. And there's that joke in "Futurama" and the "Channel $sqrt{2}$ News"--- It's funny if you think about it.... At least I think it is funny if you think about it....)



    You talk of "using to advantage" and I think the must useful thing would be this sort of period modulo generation that can't happen with irrational values.






    share|cite|improve this answer





















    • Do you have "odd period" where you meant "irrational period"?
      – badjohn
      Nov 26 '18 at 7:58














    1












    1








    1






    Given rational non-zero $p, q$ there are non-zero integers $a,b$ where $ap = bq$. That's trivial but imagine two waves with rational period they will have a least common multiple period where they synch up on a periodic bases. A wave with a rational period and one with on odd period will match when the both start but will never synch up again.



    (I dunno. That's obvious if you think about it, but it still manages to surprise me. And there's that joke in "Futurama" and the "Channel $sqrt{2}$ News"--- It's funny if you think about it.... At least I think it is funny if you think about it....)



    You talk of "using to advantage" and I think the must useful thing would be this sort of period modulo generation that can't happen with irrational values.






    share|cite|improve this answer












    Given rational non-zero $p, q$ there are non-zero integers $a,b$ where $ap = bq$. That's trivial but imagine two waves with rational period they will have a least common multiple period where they synch up on a periodic bases. A wave with a rational period and one with on odd period will match when the both start but will never synch up again.



    (I dunno. That's obvious if you think about it, but it still manages to surprise me. And there's that joke in "Futurama" and the "Channel $sqrt{2}$ News"--- It's funny if you think about it.... At least I think it is funny if you think about it....)



    You talk of "using to advantage" and I think the must useful thing would be this sort of period modulo generation that can't happen with irrational values.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Nov 26 '18 at 7:55









    fleablood

    68.3k22685




    68.3k22685












    • Do you have "odd period" where you meant "irrational period"?
      – badjohn
      Nov 26 '18 at 7:58


















    • Do you have "odd period" where you meant "irrational period"?
      – badjohn
      Nov 26 '18 at 7:58
















    Do you have "odd period" where you meant "irrational period"?
    – badjohn
    Nov 26 '18 at 7:58




    Do you have "odd period" where you meant "irrational period"?
    – badjohn
    Nov 26 '18 at 7:58











    1














    One of my favourites: floating-point addition is not associative or linear. This very slight failure of linearity turns out to be enough, if stacked as the last layer of a neural network, to allow the network to be trained to do nontrivial work.






    share|cite|improve this answer


























      1














      One of my favourites: floating-point addition is not associative or linear. This very slight failure of linearity turns out to be enough, if stacked as the last layer of a neural network, to allow the network to be trained to do nontrivial work.






      share|cite|improve this answer
























        1












        1








        1






        One of my favourites: floating-point addition is not associative or linear. This very slight failure of linearity turns out to be enough, if stacked as the last layer of a neural network, to allow the network to be trained to do nontrivial work.






        share|cite|improve this answer












        One of my favourites: floating-point addition is not associative or linear. This very slight failure of linearity turns out to be enough, if stacked as the last layer of a neural network, to allow the network to be trained to do nontrivial work.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Nov 26 '18 at 8:02









        Patrick Stevens

        28.5k52874




        28.5k52874






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3013955%2farithmetic-laws-for-rational-numbers-vs-real-numbers%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Plaza Victoria

            In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

            How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...