Are these expressions not equal? Mathematica output is ambiguous












5












$begingroup$


The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:



Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]


An attempt to simplify indicates the expressions are not equal:



FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]


That gives the following answer:



(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]


enter image description here










share|improve this question









$endgroup$








  • 3




    $begingroup$
    Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.
    $endgroup$
    – Sjoerd Smit
    Mar 22 at 10:29








  • 1




    $begingroup$
    In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.
    $endgroup$
    – Henrik Schumacher
    Mar 22 at 10:41






  • 1




    $begingroup$
    Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify what you know about P, so of course you get a general result.
    $endgroup$
    – J. M. is slightly pensive
    Mar 22 at 11:48
















5












$begingroup$


The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:



Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]


An attempt to simplify indicates the expressions are not equal:



FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]


That gives the following answer:



(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]


enter image description here










share|improve this question









$endgroup$








  • 3




    $begingroup$
    Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.
    $endgroup$
    – Sjoerd Smit
    Mar 22 at 10:29








  • 1




    $begingroup$
    In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.
    $endgroup$
    – Henrik Schumacher
    Mar 22 at 10:41






  • 1




    $begingroup$
    Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify what you know about P, so of course you get a general result.
    $endgroup$
    – J. M. is slightly pensive
    Mar 22 at 11:48














5












5








5





$begingroup$


The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:



Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]


An attempt to simplify indicates the expressions are not equal:



FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]


That gives the following answer:



(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]


enter image description here










share|improve this question









$endgroup$




The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:



Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]


An attempt to simplify indicates the expressions are not equal:



FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]


That gives the following answer:



(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]


enter image description here







plotting simplifying-expressions






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 10:25









user120911user120911

75128




75128








  • 3




    $begingroup$
    Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.
    $endgroup$
    – Sjoerd Smit
    Mar 22 at 10:29








  • 1




    $begingroup$
    In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.
    $endgroup$
    – Henrik Schumacher
    Mar 22 at 10:41






  • 1




    $begingroup$
    Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify what you know about P, so of course you get a general result.
    $endgroup$
    – J. M. is slightly pensive
    Mar 22 at 11:48














  • 3




    $begingroup$
    Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.
    $endgroup$
    – Sjoerd Smit
    Mar 22 at 10:29








  • 1




    $begingroup$
    In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.
    $endgroup$
    – Henrik Schumacher
    Mar 22 at 10:41






  • 1




    $begingroup$
    Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify what you know about P, so of course you get a general result.
    $endgroup$
    – J. M. is slightly pensive
    Mar 22 at 11:48








3




3




$begingroup$
Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.
$endgroup$
– Sjoerd Smit
Mar 22 at 10:29






$begingroup$
Add the option Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.
$endgroup$
– Sjoerd Smit
Mar 22 at 10:29






1




1




$begingroup$
In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.
$endgroup$
– Henrik Schumacher
Mar 22 at 10:41




$begingroup$
In addition to what Sjoerd said: Evaluating FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.
$endgroup$
– Henrik Schumacher
Mar 22 at 10:41




1




1




$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify what you know about P, so of course you get a general result.
$endgroup$
– J. M. is slightly pensive
Mar 22 at 11:48




$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell FullSimplify what you know about P, so of course you get a general result.
$endgroup$
– J. M. is slightly pensive
Mar 22 at 11:48










1 Answer
1






active

oldest

votes


















11












$begingroup$

You can ask Mathematica when this expression is zero, assuming we work on the reals:



Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
(* 0 < P < 1 *)


FullSimplify will confirm that result.



FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)





share|improve this answer









$endgroup$














    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: "387"
    };
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193756%2fare-these-expressions-not-equal-mathematica-output-is-ambiguous%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    11












    $begingroup$

    You can ask Mathematica when this expression is zero, assuming we work on the reals:



    Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
    (* 0 < P < 1 *)


    FullSimplify will confirm that result.



    FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
    (* 0 *)





    share|improve this answer









    $endgroup$


















      11












      $begingroup$

      You can ask Mathematica when this expression is zero, assuming we work on the reals:



      Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
      (* 0 < P < 1 *)


      FullSimplify will confirm that result.



      FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
      (* 0 *)





      share|improve this answer









      $endgroup$
















        11












        11








        11





        $begingroup$

        You can ask Mathematica when this expression is zero, assuming we work on the reals:



        Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
        (* 0 < P < 1 *)


        FullSimplify will confirm that result.



        FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
        (* 0 *)





        share|improve this answer









        $endgroup$



        You can ask Mathematica when this expression is zero, assuming we work on the reals:



        Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
        (* 0 < P < 1 *)


        FullSimplify will confirm that result.



        FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
        (* 0 *)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 22 at 10:29









        SzabolcsSzabolcs

        163k14447944




        163k14447944






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematica 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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193756%2fare-these-expressions-not-equal-mathematica-output-is-ambiguous%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

            Paul Cézanne

            UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

            Angular material date-picker (MatDatepicker) auto completes the date on focus out