=== not working properly [closed]
$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
So what's the problem here? Am I getting something wrong?
inequalities operators
$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.
add a comment |
$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
So what's the problem here? Am I getting something wrong?
inequalities operators
$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]
givesTrue
. 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 thatppo
andppn
are not structurally equivalent expressions.
$endgroup$
– Jason B.
Jan 30 at 17:28
add a comment |
$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
So what's the problem here? Am I getting something wrong?
inequalities operators
$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
So what's the problem here? Am I getting something wrong?
inequalities operators
inequalities operators
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]
givesTrue
. 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 thatppo
andppn
are not structurally equivalent expressions.
$endgroup$
– Jason B.
Jan 30 at 17:28
add a comment |
$begingroup$
Simplify[ppn == ppo]
givesTrue
. 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 thatppo
andppn
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
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
SameQ
(===
) is working as expected.
See the evaluation trace result:
FullSimplify[ppo === ppn] // Trace
Now see this result:
FullSimplify[ppo] === FullSimplify[ppn]
(* True *)
$endgroup$
add a comment |
$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 *)
$endgroup$
$begingroup$
What do you mean by saying "same structurally"?
$endgroup$
– Melik Karapetyan
Jan 30 at 18:15
3
$begingroup$
Look atx (y + 1) // TreeForm
andx y + x // TreeForm
. Do you see the difference?===
effectively comparesFullForm
, of the expressions, andTreeForm
is just a visualization of that.
$endgroup$
– John Doty
Jan 30 at 18:36
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
SameQ
(===
) is working as expected.
See the evaluation trace result:
FullSimplify[ppo === ppn] // Trace
Now see this result:
FullSimplify[ppo] === FullSimplify[ppn]
(* True *)
$endgroup$
add a comment |
$begingroup$
SameQ
(===
) is working as expected.
See the evaluation trace result:
FullSimplify[ppo === ppn] // Trace
Now see this result:
FullSimplify[ppo] === FullSimplify[ppn]
(* True *)
$endgroup$
add a comment |
$begingroup$
SameQ
(===
) is working as expected.
See the evaluation trace result:
FullSimplify[ppo === ppn] // Trace
Now see this result:
FullSimplify[ppo] === FullSimplify[ppn]
(* True *)
$endgroup$
SameQ
(===
) is working as expected.
See the evaluation trace result:
FullSimplify[ppo === ppn] // Trace
Now see this result:
FullSimplify[ppo] === FullSimplify[ppn]
(* True *)
answered Jan 30 at 17:30
Anton AntonovAnton Antonov
23.5k167114
23.5k167114
add a comment |
add a comment |
$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 *)
$endgroup$
$begingroup$
What do you mean by saying "same structurally"?
$endgroup$
– Melik Karapetyan
Jan 30 at 18:15
3
$begingroup$
Look atx (y + 1) // TreeForm
andx y + x // TreeForm
. Do you see the difference?===
effectively comparesFullForm
, of the expressions, andTreeForm
is just a visualization of that.
$endgroup$
– John Doty
Jan 30 at 18:36
add a comment |
$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 *)
$endgroup$
$begingroup$
What do you mean by saying "same structurally"?
$endgroup$
– Melik Karapetyan
Jan 30 at 18:15
3
$begingroup$
Look atx (y + 1) // TreeForm
andx y + x // TreeForm
. Do you see the difference?===
effectively comparesFullForm
, of the expressions, andTreeForm
is just a visualization of that.
$endgroup$
– John Doty
Jan 30 at 18:36
add a comment |
$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 *)
$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 *)
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 atx (y + 1) // TreeForm
andx y + x // TreeForm
. Do you see the difference?===
effectively comparesFullForm
, of the expressions, andTreeForm
is just a visualization of that.
$endgroup$
– John Doty
Jan 30 at 18:36
add a comment |
$begingroup$
What do you mean by saying "same structurally"?
$endgroup$
– Melik Karapetyan
Jan 30 at 18:15
3
$begingroup$
Look atx (y + 1) // TreeForm
andx y + x // TreeForm
. Do you see the difference?===
effectively comparesFullForm
, of the expressions, andTreeForm
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
add a comment |
$begingroup$
Simplify[ppn == ppo]
givesTrue
. 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 thatppo
andppn
are not structurally equivalent expressions.$endgroup$
– Jason B.
Jan 30 at 17:28