<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, how to compare whether two lists are equal</title>
    <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 19:22:30 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 19:22:30 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, how to compare whether two lists are equal</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, how to compare whether two lists are equal</title>
      <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal</link>
    </image>
    <item>
      <title>immutable</title>
      <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal?ref=Feed:MaplePrimes:how to compare whether two lists are equal:Comments#answer44569</link>
      <itunes:summary>Lists and polynomials are immutable in Maple (changing them makes an entirely new object) so you can just use = to test.  For example:
&lt;code&gt;
A := [x^2+x+1,x-1];
B := [x^2+x+1,x-1];
evalb(A=B);
&lt;/code&gt;</itunes:summary>
      <description>Lists and polynomials are immutable in Maple (changing them makes an entirely new object) so you can just use = to test.  For example:
&lt;code&gt;
A := [x^2+x+1,x-1];
B := [x^2+x+1,x-1];
evalb(A=B);
&lt;/code&gt;</description>
      <guid>44569</guid>
      <pubDate>Wed, 24 Feb 2010 06:21:40 Z</pubDate>
      <itunes:author>roman_pearce</itunes:author>
      <author>roman_pearce</author>
    </item>
    <item>
      <title>thanks.
Another question:
if</title>
      <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal?ref=Feed:MaplePrimes:how to compare whether two lists are equal:Comments#answer44571</link>
      <itunes:summary>thanks.

Another question:
if they are different,  can I see the differences?

A:=[x^2+x+1,x-1];
B:=[x^2+x+1];

how can I compute A-B?

Thanks
Gepo</itunes:summary>
      <description>thanks.

Another question:
if they are different,  can I see the differences?

A:=[x^2+x+1,x-1];
B:=[x^2+x+1];

how can I compute A-B?

Thanks
Gepo</description>
      <guid>44571</guid>
      <pubDate>Wed, 24 Feb 2010 06:49:51 Z</pubDate>
      <itunes:author>gepo</itunes:author>
      <author>gepo</author>
    </item>
    <item>
      <title>define difference of lists</title>
      <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal?ref=Feed:MaplePrimes:how to compare whether two lists are equal:Comments#answer44573</link>
      <itunes:summary>&lt;p&gt;You need to define what you mean by the difference of two lists. Giving the expected output for the following may suffice,&lt;/p&gt;
&lt;pre&gt;
listdiff( [1,2,2,3,3], [2,1] );

&lt;/pre&gt;
&lt;pre&gt;
Possible answers are 
 1. error (lists must be the same size)
 2. [-1,1,2,3,3] (difference of corresponding elements, augmented with zero)
 3. [2,3,3] (multiset difference)
 4. [3,3]   (erasure?)
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;You need to define what you mean by the difference of two lists. Giving the expected output for the following may suffice,&lt;/p&gt;
&lt;pre&gt;
listdiff( [1,2,2,3,3], [2,1] );

&lt;/pre&gt;
&lt;pre&gt;
Possible answers are 
 1. error (lists must be the same size)
 2. [-1,1,2,3,3] (difference of corresponding elements, augmented with zero)
 3. [2,3,3] (multiset difference)
 4. [3,3]   (erasure?)
&lt;/pre&gt;</description>
      <guid>44573</guid>
      <pubDate>Wed, 24 Feb 2010 10:01:57 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>not entirely true</title>
      <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal?ref=Feed:MaplePrimes:how to compare whether two lists are equal:Comments#comment44570</link>
      <itunes:summary>&lt;p&gt;As stated, that is not accurate.&lt;/p&gt;
&lt;p&gt;We may have reason to suspect that the OP is considering exact rational coefficients for the polynomials due to some earlier posts. But evalb may not be adequate for testing polynomials with coefficients in the float domain.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; A := [a^2+b+1,a-1.00]:
&amp;gt; B := [a^2+b+1,a-1.0]:

&amp;gt; evalb(A=B);
                                     false
 
&amp;gt; verify(A,B,list('polynom'(float(10),{a,b})));
                                     true
&lt;/pre&gt;
&lt;p&gt;With floats in the picture, it's up to the individual to decide what is accepted as &amp;quot;equal&amp;quot;.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; evalb(1.0=1.00);
                                     true
 
&amp;gt; evalb(a-1.0=a-1.00);
                                     false
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;As stated, that is not accurate.&lt;/p&gt;
&lt;p&gt;We may have reason to suspect that the OP is considering exact rational coefficients for the polynomials due to some earlier posts. But evalb may not be adequate for testing polynomials with coefficients in the float domain.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; A := [a^2+b+1,a-1.00]:
&amp;gt; B := [a^2+b+1,a-1.0]:

&amp;gt; evalb(A=B);
                                     false
 
&amp;gt; verify(A,B,list('polynom'(float(10),{a,b})));
                                     true
&lt;/pre&gt;
&lt;p&gt;With floats in the picture, it's up to the individual to decide what is accepted as &amp;quot;equal&amp;quot;.&lt;/p&gt;
&lt;pre&gt;
&amp;gt; evalb(1.0=1.00);
                                     true
 
&amp;gt; evalb(a-1.0=a-1.00);
                                     false
&lt;/pre&gt;</description>
      <guid>44570</guid>
      <pubDate>Wed, 24 Feb 2010 06:40:52 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>difference of lists</title>
      <link>http://www.mapleprimes.com/questions/35645-How-To-Compare-Whether-Two-Lists-Are-Equal?ref=Feed:MaplePrimes:how to compare whether two lists are equal:Comments#comment44572</link>
      <itunes:summary>&lt;p&gt;If the lists have the same length, you can simply subtract: &lt;/p&gt;
&lt;pre&gt;
&amp;gt; A-B;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;If not, you can use&lt;/p&gt;
&lt;pre&gt;
&amp;gt; zip(`-`, A, B, 0);&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;which will pad the shorter one with 0's.&amp;nbsp; &lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;If the lists have the same length, you can simply subtract: &lt;/p&gt;
&lt;pre&gt;
&amp;gt; A-B;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;If not, you can use&lt;/p&gt;
&lt;pre&gt;
&amp;gt; zip(`-`, A, B, 0);&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/pre&gt;
&lt;p&gt;which will pad the shorter one with 0's.&amp;nbsp; &lt;/p&gt;</description>
      <guid>44572</guid>
      <pubDate>Wed, 24 Feb 2010 08:59:40 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
  </channel>
</rss>