Deleting duplicate equations from a list of equations
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Here is a list of algebraicly identical equations, and I like to delete all the duplicate equations from this list and get only one equation. I tried the following:
Clear[ss];
listEqs =
x + y == x^2 + z,
y + z == x^2 + z,
x + y == z + x^2,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x
;
DeleteDuplicates[listEqs]
I got:
x + y == x^2 + z,
y + z == x^2 + z,
x^2 + z == x + y,
x^2 + z == y + z
Can someone tell me how to reduce the list to only one equation?
EDIT 1
I noticed a misunderstanding of my question. Here is a second list:
listEqs =
y + z == x^2 + z,
a + b == k + g,
x + y == x^2 + z,
b + a == g + k,
x + y == z + x^2,
a + b == g + k,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x;
The code
:
DeleteDuplicatesBy[listEqs, MemberQ@Level[listEqs, -1]]
picks the first element of the list, which is not what I asked. I want the following list to be the output of the code
:
y + z == x^2 + z,
a + b == k + g
Basically, I just want to pick the non-identical equations from the list. The desired equations can be placed in the middle, end or beginning of the list. The position of the equations are not the issue.
list-manipulation
add a comment |Â
up vote
1
down vote
favorite
Here is a list of algebraicly identical equations, and I like to delete all the duplicate equations from this list and get only one equation. I tried the following:
Clear[ss];
listEqs =
x + y == x^2 + z,
y + z == x^2 + z,
x + y == z + x^2,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x
;
DeleteDuplicates[listEqs]
I got:
x + y == x^2 + z,
y + z == x^2 + z,
x^2 + z == x + y,
x^2 + z == y + z
Can someone tell me how to reduce the list to only one equation?
EDIT 1
I noticed a misunderstanding of my question. Here is a second list:
listEqs =
y + z == x^2 + z,
a + b == k + g,
x + y == x^2 + z,
b + a == g + k,
x + y == z + x^2,
a + b == g + k,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x;
The code
:
DeleteDuplicatesBy[listEqs, MemberQ@Level[listEqs, -1]]
picks the first element of the list, which is not what I asked. I want the following list to be the output of the code
:
y + z == x^2 + z,
a + b == k + g
Basically, I just want to pick the non-identical equations from the list. The desired equations can be placed in the middle, end or beginning of the list. The position of the equations are not the issue.
list-manipulation
in what sense arex + y == x^2 + z
andy + z == x^2 + z}
"equivalent"?
â kglr
22 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Here is a list of algebraicly identical equations, and I like to delete all the duplicate equations from this list and get only one equation. I tried the following:
Clear[ss];
listEqs =
x + y == x^2 + z,
y + z == x^2 + z,
x + y == z + x^2,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x
;
DeleteDuplicates[listEqs]
I got:
x + y == x^2 + z,
y + z == x^2 + z,
x^2 + z == x + y,
x^2 + z == y + z
Can someone tell me how to reduce the list to only one equation?
EDIT 1
I noticed a misunderstanding of my question. Here is a second list:
listEqs =
y + z == x^2 + z,
a + b == k + g,
x + y == x^2 + z,
b + a == g + k,
x + y == z + x^2,
a + b == g + k,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x;
The code
:
DeleteDuplicatesBy[listEqs, MemberQ@Level[listEqs, -1]]
picks the first element of the list, which is not what I asked. I want the following list to be the output of the code
:
y + z == x^2 + z,
a + b == k + g
Basically, I just want to pick the non-identical equations from the list. The desired equations can be placed in the middle, end or beginning of the list. The position of the equations are not the issue.
list-manipulation
Here is a list of algebraicly identical equations, and I like to delete all the duplicate equations from this list and get only one equation. I tried the following:
Clear[ss];
listEqs =
x + y == x^2 + z,
y + z == x^2 + z,
x + y == z + x^2,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x
;
DeleteDuplicates[listEqs]
I got:
x + y == x^2 + z,
y + z == x^2 + z,
x^2 + z == x + y,
x^2 + z == y + z
Can someone tell me how to reduce the list to only one equation?
EDIT 1
I noticed a misunderstanding of my question. Here is a second list:
listEqs =
y + z == x^2 + z,
a + b == k + g,
x + y == x^2 + z,
b + a == g + k,
x + y == z + x^2,
a + b == g + k,
y + z == z + x^2,
x^2 + z == x + y,
z + x^2 == x + y,
x^2 + z == y + z,
z + x^2 == y + x;
The code
:
DeleteDuplicatesBy[listEqs, MemberQ@Level[listEqs, -1]]
picks the first element of the list, which is not what I asked. I want the following list to be the output of the code
:
y + z == x^2 + z,
a + b == k + g
Basically, I just want to pick the non-identical equations from the list. The desired equations can be placed in the middle, end or beginning of the list. The position of the equations are not the issue.
list-manipulation
list-manipulation
edited 14 mins ago
asked 1 hour ago
Tugrul Temel
43113
43113
in what sense arex + y == x^2 + z
andy + z == x^2 + z}
"equivalent"?
â kglr
22 mins ago
add a comment |Â
in what sense arex + y == x^2 + z
andy + z == x^2 + z}
"equivalent"?
â kglr
22 mins ago
in what sense are
x + y == x^2 + z
and y + z == x^2 + z}
"equivalent"?â kglr
22 mins ago
in what sense are
x + y == x^2 + z
and y + z == x^2 + z}
"equivalent"?â kglr
22 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Maybe
DeleteDuplicatesBy[listEqs, Reduce] (* or *)
DeleteDuplicatesBy[listEqs, Sort]
x + y == x^2 + z, y + z == x^2 + z
For the longer input list:
DeleteDuplicatesBy[listEqs2, Reduce]
y + z == x^2 + z, a + b == g + k, x + y == x^2 + z
In both cases, I can't see how x + y == x^2 + z
and y + z == x^2 + z
can be "equivalent"`.
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Maybe
DeleteDuplicatesBy[listEqs, Reduce] (* or *)
DeleteDuplicatesBy[listEqs, Sort]
x + y == x^2 + z, y + z == x^2 + z
For the longer input list:
DeleteDuplicatesBy[listEqs2, Reduce]
y + z == x^2 + z, a + b == g + k, x + y == x^2 + z
In both cases, I can't see how x + y == x^2 + z
and y + z == x^2 + z
can be "equivalent"`.
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
add a comment |Â
up vote
1
down vote
accepted
Maybe
DeleteDuplicatesBy[listEqs, Reduce] (* or *)
DeleteDuplicatesBy[listEqs, Sort]
x + y == x^2 + z, y + z == x^2 + z
For the longer input list:
DeleteDuplicatesBy[listEqs2, Reduce]
y + z == x^2 + z, a + b == g + k, x + y == x^2 + z
In both cases, I can't see how x + y == x^2 + z
and y + z == x^2 + z
can be "equivalent"`.
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Maybe
DeleteDuplicatesBy[listEqs, Reduce] (* or *)
DeleteDuplicatesBy[listEqs, Sort]
x + y == x^2 + z, y + z == x^2 + z
For the longer input list:
DeleteDuplicatesBy[listEqs2, Reduce]
y + z == x^2 + z, a + b == g + k, x + y == x^2 + z
In both cases, I can't see how x + y == x^2 + z
and y + z == x^2 + z
can be "equivalent"`.
Maybe
DeleteDuplicatesBy[listEqs, Reduce] (* or *)
DeleteDuplicatesBy[listEqs, Sort]
x + y == x^2 + z, y + z == x^2 + z
For the longer input list:
DeleteDuplicatesBy[listEqs2, Reduce]
y + z == x^2 + z, a + b == g + k, x + y == x^2 + z
In both cases, I can't see how x + y == x^2 + z
and y + z == x^2 + z
can be "equivalent"`.
answered 12 mins ago
kglr
166k8188390
166k8188390
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
add a comment |Â
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
It is a typo. Sorry for confusion, but your answer is the right one and it works for me. Thank you very much.
â Tugrul Temel
7 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f184309%2fdeleting-duplicate-equations-from-a-list-of-equations%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
in what sense are
x + y == x^2 + z
andy + z == x^2 + z}
"equivalent"?â kglr
22 mins ago