=== not working properly [closed]












2












$begingroup$


I've been trying to check the identity using wolfram Mathematica and I've found the following



ppo = Plus[Times[Rational[1,6],Power[a,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-3,s],Times[2,Subscript[i,3]]]],Times[Rational[1,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]

ppn = Plus[Times[Rational[-1,6],Power[a,2],Plus[-6,Times[3,s],Times[-2,Subscript[i,3]]],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]]],Times[Rational[1,2],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]


And when I try to compare these two expressions with



ppo === ppn


It returns False



But this is actually an identity
enter image description here



So what's the problem here? Am I getting something wrong?










share|improve this question









$endgroup$



closed as off-topic by m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform Jan 31 at 0:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Simplify[ppn == ppo] gives True. Don't use ===. Your ideas about its semantics are wrong.
    $endgroup$
    – m_goldberg
    Jan 30 at 17:27








  • 4




    $begingroup$
    Expand[ppo] === Expand[ppn] works as well, but the point is that ppo and ppn are not structurally equivalent expressions.
    $endgroup$
    – Jason B.
    Jan 30 at 17:28
















2












$begingroup$


I've been trying to check the identity using wolfram Mathematica and I've found the following



ppo = Plus[Times[Rational[1,6],Power[a,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-3,s],Times[2,Subscript[i,3]]]],Times[Rational[1,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]

ppn = Plus[Times[Rational[-1,6],Power[a,2],Plus[-6,Times[3,s],Times[-2,Subscript[i,3]]],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]]],Times[Rational[1,2],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]


And when I try to compare these two expressions with



ppo === ppn


It returns False



But this is actually an identity
enter image description here



So what's the problem here? Am I getting something wrong?










share|improve this question









$endgroup$



closed as off-topic by m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform Jan 31 at 0:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform

If this question can be reworded to fit the rules in the help center, please edit the question.
















  • $begingroup$
    Simplify[ppn == ppo] gives True. Don't use ===. Your ideas about its semantics are wrong.
    $endgroup$
    – m_goldberg
    Jan 30 at 17:27








  • 4




    $begingroup$
    Expand[ppo] === Expand[ppn] works as well, but the point is that ppo and ppn are not structurally equivalent expressions.
    $endgroup$
    – Jason B.
    Jan 30 at 17:28














2












2








2





$begingroup$


I've been trying to check the identity using wolfram Mathematica and I've found the following



ppo = Plus[Times[Rational[1,6],Power[a,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-3,s],Times[2,Subscript[i,3]]]],Times[Rational[1,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]

ppn = Plus[Times[Rational[-1,6],Power[a,2],Plus[-6,Times[3,s],Times[-2,Subscript[i,3]]],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]]],Times[Rational[1,2],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]


And when I try to compare these two expressions with



ppo === ppn


It returns False



But this is actually an identity
enter image description here



So what's the problem here? Am I getting something wrong?










share|improve this question









$endgroup$




I've been trying to check the identity using wolfram Mathematica and I've found the following



ppo = Plus[Times[Rational[1,6],Power[a,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-3,s],Times[2,Subscript[i,3]]]],Times[Rational[1,2],Plus[1,Subscript[i,3]],Plus[2,Subscript[i,3]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]

ppn = Plus[Times[Rational[-1,6],Power[a,2],Plus[-6,Times[3,s],Times[-2,Subscript[i,3]]],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]]],Times[Rational[1,2],Plus[2,Times[3,Subscript[i,3]],Power[Subscript[i,3],2]],Plus[6,Times[-5,s],Power[s,2],Times[Plus[5,Times[-2,s]],Subscript[i,3]],Power[Subscript[i,3],2]],Power[Superscript[a,0],2]]]


And when I try to compare these two expressions with



ppo === ppn


It returns False



But this is actually an identity
enter image description here



So what's the problem here? Am I getting something wrong?







inequalities operators






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 30 at 17:20









Melik KarapetyanMelik Karapetyan

135




135




closed as off-topic by m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform Jan 31 at 0:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform

If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform Jan 31 at 0:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Anton Antonov, march, MarcoB, AccidentalFourierTransform

If this question can be reworded to fit the rules in the help center, please edit the question.












  • $begingroup$
    Simplify[ppn == ppo] gives True. Don't use ===. Your ideas about its semantics are wrong.
    $endgroup$
    – m_goldberg
    Jan 30 at 17:27








  • 4




    $begingroup$
    Expand[ppo] === Expand[ppn] works as well, but the point is that ppo and ppn are not structurally equivalent expressions.
    $endgroup$
    – Jason B.
    Jan 30 at 17:28


















  • $begingroup$
    Simplify[ppn == ppo] gives True. Don't use ===. Your ideas about its semantics are wrong.
    $endgroup$
    – m_goldberg
    Jan 30 at 17:27








  • 4




    $begingroup$
    Expand[ppo] === Expand[ppn] works as well, but the point is that ppo and ppn are not structurally equivalent expressions.
    $endgroup$
    – Jason B.
    Jan 30 at 17:28
















$begingroup$
Simplify[ppn == ppo] gives True. Don't use ===. Your ideas about its semantics are wrong.
$endgroup$
– m_goldberg
Jan 30 at 17:27






$begingroup$
Simplify[ppn == ppo] gives True. Don't use ===. Your ideas about its semantics are wrong.
$endgroup$
– m_goldberg
Jan 30 at 17:27






4




4




$begingroup$
Expand[ppo] === Expand[ppn] works as well, but the point is that ppo and ppn are not structurally equivalent expressions.
$endgroup$
– Jason B.
Jan 30 at 17:28




$begingroup$
Expand[ppo] === Expand[ppn] works as well, but the point is that ppo and ppn are not structurally equivalent expressions.
$endgroup$
– Jason B.
Jan 30 at 17:28










2 Answers
2






active

oldest

votes


















4












$begingroup$

SameQ (===) is working as expected.



See the evaluation trace result:



FullSimplify[ppo === ppn] // Trace


enter image description here



Now see this result:



FullSimplify[ppo] === FullSimplify[ppn]

(* True *)


enter image description here






share|improve this answer









$endgroup$





















    3












    $begingroup$

    ppo and ppn may be mathematically identical, but they are not the same structurally. Thus, === returns False. Use ==, and coax it to do the work with Simplify.



    Simplify[ppo == ppn]
    (* True *)





    share|improve this answer









    $endgroup$













    • $begingroup$
      What do you mean by saying "same structurally"?
      $endgroup$
      – Melik Karapetyan
      Jan 30 at 18:15






    • 3




      $begingroup$
      Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
      $endgroup$
      – John Doty
      Jan 30 at 18:36


















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4












    $begingroup$

    SameQ (===) is working as expected.



    See the evaluation trace result:



    FullSimplify[ppo === ppn] // Trace


    enter image description here



    Now see this result:



    FullSimplify[ppo] === FullSimplify[ppn]

    (* True *)


    enter image description here






    share|improve this answer









    $endgroup$


















      4












      $begingroup$

      SameQ (===) is working as expected.



      See the evaluation trace result:



      FullSimplify[ppo === ppn] // Trace


      enter image description here



      Now see this result:



      FullSimplify[ppo] === FullSimplify[ppn]

      (* True *)


      enter image description here






      share|improve this answer









      $endgroup$
















        4












        4








        4





        $begingroup$

        SameQ (===) is working as expected.



        See the evaluation trace result:



        FullSimplify[ppo === ppn] // Trace


        enter image description here



        Now see this result:



        FullSimplify[ppo] === FullSimplify[ppn]

        (* True *)


        enter image description here






        share|improve this answer









        $endgroup$



        SameQ (===) is working as expected.



        See the evaluation trace result:



        FullSimplify[ppo === ppn] // Trace


        enter image description here



        Now see this result:



        FullSimplify[ppo] === FullSimplify[ppn]

        (* True *)


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 30 at 17:30









        Anton AntonovAnton Antonov

        23.5k167114




        23.5k167114























            3












            $begingroup$

            ppo and ppn may be mathematically identical, but they are not the same structurally. Thus, === returns False. Use ==, and coax it to do the work with Simplify.



            Simplify[ppo == ppn]
            (* True *)





            share|improve this answer









            $endgroup$













            • $begingroup$
              What do you mean by saying "same structurally"?
              $endgroup$
              – Melik Karapetyan
              Jan 30 at 18:15






            • 3




              $begingroup$
              Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
              $endgroup$
              – John Doty
              Jan 30 at 18:36
















            3












            $begingroup$

            ppo and ppn may be mathematically identical, but they are not the same structurally. Thus, === returns False. Use ==, and coax it to do the work with Simplify.



            Simplify[ppo == ppn]
            (* True *)





            share|improve this answer









            $endgroup$













            • $begingroup$
              What do you mean by saying "same structurally"?
              $endgroup$
              – Melik Karapetyan
              Jan 30 at 18:15






            • 3




              $begingroup$
              Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
              $endgroup$
              – John Doty
              Jan 30 at 18:36














            3












            3








            3





            $begingroup$

            ppo and ppn may be mathematically identical, but they are not the same structurally. Thus, === returns False. Use ==, and coax it to do the work with Simplify.



            Simplify[ppo == ppn]
            (* True *)





            share|improve this answer









            $endgroup$



            ppo and ppn may be mathematically identical, but they are not the same structurally. Thus, === returns False. Use ==, and coax it to do the work with Simplify.



            Simplify[ppo == ppn]
            (* True *)






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 30 at 17:30









            John DotyJohn Doty

            6,95811024




            6,95811024












            • $begingroup$
              What do you mean by saying "same structurally"?
              $endgroup$
              – Melik Karapetyan
              Jan 30 at 18:15






            • 3




              $begingroup$
              Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
              $endgroup$
              – John Doty
              Jan 30 at 18:36


















            • $begingroup$
              What do you mean by saying "same structurally"?
              $endgroup$
              – Melik Karapetyan
              Jan 30 at 18:15






            • 3




              $begingroup$
              Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
              $endgroup$
              – John Doty
              Jan 30 at 18:36
















            $begingroup$
            What do you mean by saying "same structurally"?
            $endgroup$
            – Melik Karapetyan
            Jan 30 at 18:15




            $begingroup$
            What do you mean by saying "same structurally"?
            $endgroup$
            – Melik Karapetyan
            Jan 30 at 18:15




            3




            3




            $begingroup$
            Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
            $endgroup$
            – John Doty
            Jan 30 at 18:36




            $begingroup$
            Look at x (y + 1) // TreeForm and x y + x // TreeForm. Do you see the difference? === effectively compares FullForm, of the expressions, and TreeForm is just a visualization of that.
            $endgroup$
            – John Doty
            Jan 30 at 18:36



            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?