=== not working properly [closed]
Clash Royale CLAN TAG#URR8PPP
$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
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
$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
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
$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
$begingroup$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
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.8k167114
23.8k167114
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
$begingroup$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
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
$begingroup$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
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
7,11811024
7,11811024
$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$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
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$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
$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
$begingroup$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
$begingroup$
Wow, thank you a lot.
$endgroup$
– Melik Karapetyan
Feb 9 at 23:38
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