<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 get a random selection from a specific subArrays of an Array?</title>
    <link>http://www.mapleprimes.com/questions/88761-How-To-Get-A-Random-Selection-From-A</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 12:40:39 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 12:40:39 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, How to get a random selection from a specific subArrays of an Array?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, How to get a random selection from a specific subArrays of an Array?</title>
      <link>http://www.mapleprimes.com/questions/88761-How-To-Get-A-Random-Selection-From-A</link>
    </image>
    <item>
      <title>Some suggestions</title>
      <link>http://www.mapleprimes.com/questions/88761-How-To-Get-A-Random-Selection-From-A?ref=Feed:MaplePrimes:How to get a random selection from a specific subArrays of an Array?:Comments#answer88783</link>
      <itunes:summary>&lt;p&gt;Hi Econometrician,&lt;/p&gt;
&lt;p&gt;First of all, I see that you're assigning into a list, e.g. R1[q] := ... or Options[i] := ... . That's generally a bad idea; lists are immutable data structures in Maple, so if you change an element, Maple generates a completely new list for you with that one element changed and returns that. Because of this inefficiency, assigning into lists of length greater than 100 has been disabled completely, so your program will stop working if the size of your input grows beyond that. If you use an Array or a Vector, you don't have that problem.&lt;/p&gt;
&lt;p&gt;Another option is to keep using lists, but create them as a whole, as it were, instead of element by element. For example, to create &lt;i&gt;R1&lt;/i&gt;, you can either set &lt;i&gt;R1&lt;/i&gt; := &lt;i&gt;Array&lt;/i&gt;(1 .. 15) (or 0..14?) and keep your current program (in which case you will clearly have an Array), or do the initialization in one fell swoop by running&lt;/p&gt;
&lt;pre&gt;
R1 := map(i -&amp;gt; A[i, 1], select(i -&amp;gt; A[i, 2] = 4 or A[i, 2] = 0, [seq(1 .. 90)]));
&lt;/pre&gt;
&lt;p&gt;in which case you will have a list.&lt;/p&gt;
&lt;p&gt;Now for your main question. I'm not entirely sure I understand your explanation or your program - but the first line of your description tells me that you might want to consider using the &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=combinat/randcomb&amp;amp;term=combinat,randcomb"&gt;&lt;i&gt;combinat&lt;/i&gt;[&lt;i&gt;randcomb&lt;/i&gt;] command&lt;/a&gt;, which will give you a random selection of &lt;i&gt;m&lt;/i&gt; entries of a list.&lt;/p&gt;
&lt;p&gt;General tip: if you want to do more than only displaying the card names, it might be useful to just use row number internally instead of the card names, so you could simplify the command for &lt;i&gt;R1&lt;/i&gt; above to just&lt;/p&gt;
&lt;pre&gt;
R1 := select(i -&amp;gt; A[i, 2] = 4 or A[i, 2] = 0, [seq(1 .. 90)]);
&lt;/pre&gt;
&lt;p&gt;and perform the &lt;i&gt;map&lt;/i&gt;(&lt;i&gt;i&lt;/i&gt; -&amp;gt; &lt;i&gt;A&lt;/i&gt;[&lt;i&gt;i&lt;/i&gt;, 1], ...) only upon output. That way, you have easy access to the information in the other 14 columns of your table as well.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Erik Postma&lt;br /&gt;
Maplesoft.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Hi Econometrician,&lt;/p&gt;
&lt;p&gt;First of all, I see that you're assigning into a list, e.g. R1[q] := ... or Options[i] := ... . That's generally a bad idea; lists are immutable data structures in Maple, so if you change an element, Maple generates a completely new list for you with that one element changed and returns that. Because of this inefficiency, assigning into lists of length greater than 100 has been disabled completely, so your program will stop working if the size of your input grows beyond that. If you use an Array or a Vector, you don't have that problem.&lt;/p&gt;
&lt;p&gt;Another option is to keep using lists, but create them as a whole, as it were, instead of element by element. For example, to create &lt;i&gt;R1&lt;/i&gt;, you can either set &lt;i&gt;R1&lt;/i&gt; := &lt;i&gt;Array&lt;/i&gt;(1 .. 15) (or 0..14?) and keep your current program (in which case you will clearly have an Array), or do the initialization in one fell swoop by running&lt;/p&gt;
&lt;pre&gt;
R1 := map(i -&amp;gt; A[i, 1], select(i -&amp;gt; A[i, 2] = 4 or A[i, 2] = 0, [seq(1 .. 90)]));
&lt;/pre&gt;
&lt;p&gt;in which case you will have a list.&lt;/p&gt;
&lt;p&gt;Now for your main question. I'm not entirely sure I understand your explanation or your program - but the first line of your description tells me that you might want to consider using the &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=combinat/randcomb&amp;amp;term=combinat,randcomb"&gt;&lt;i&gt;combinat&lt;/i&gt;[&lt;i&gt;randcomb&lt;/i&gt;] command&lt;/a&gt;, which will give you a random selection of &lt;i&gt;m&lt;/i&gt; entries of a list.&lt;/p&gt;
&lt;p&gt;General tip: if you want to do more than only displaying the card names, it might be useful to just use row number internally instead of the card names, so you could simplify the command for &lt;i&gt;R1&lt;/i&gt; above to just&lt;/p&gt;
&lt;pre&gt;
R1 := select(i -&amp;gt; A[i, 2] = 4 or A[i, 2] = 0, [seq(1 .. 90)]);
&lt;/pre&gt;
&lt;p&gt;and perform the &lt;i&gt;map&lt;/i&gt;(&lt;i&gt;i&lt;/i&gt; -&amp;gt; &lt;i&gt;A&lt;/i&gt;[&lt;i&gt;i&lt;/i&gt;, 1], ...) only upon output. That way, you have easy access to the information in the other 14 columns of your table as well.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;Erik Postma&lt;br /&gt;
Maplesoft.&lt;/p&gt;</description>
      <guid>88783</guid>
      <pubDate>Tue, 01 Jun 2010 19:37:52 Z</pubDate>
      <itunes:author>epostma</itunes:author>
      <author>epostma</author>
    </item>
    <item>
      <title>Select and Remove</title>
      <link>http://www.mapleprimes.com/questions/88761-How-To-Get-A-Random-Selection-From-A?ref=Feed:MaplePrimes:How to get a random selection from a specific subArrays of an Array?:Comments#answer89167</link>
      <itunes:summary>&lt;p&gt;&amp;nbsp;&lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=Statistics/Commands"&gt;?Statistics&lt;/a&gt; package has &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelect"&gt;Select&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelect"&gt;Remove&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectNonNumeric"&gt;SelectNonNumeric&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectNonNumeric"&gt;RemoveNonNumeric&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectInRange"&gt;SelectInRange&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectInRange"&gt;RemoveInRange&lt;/a&gt; commands which can be applied to both Arrays and lists.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;_______________&lt;br&gt; Alec Mihailovs, PhD&lt;br&gt; Maplesoft Member&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&amp;nbsp;&lt;a href="http://www.maplesoft.com/support/help/view.aspx?path=Statistics/Commands"&gt;?Statistics&lt;/a&gt; package has &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelect"&gt;Select&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelect"&gt;Remove&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectNonNumeric"&gt;SelectNonNumeric&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectNonNumeric"&gt;RemoveNonNumeric&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectInRange"&gt;SelectInRange&lt;/a&gt;, &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics%2fSelectInRange"&gt;RemoveInRange&lt;/a&gt; commands which can be applied to both Arrays and lists.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;_______________&lt;br&gt; Alec Mihailovs, PhD&lt;br&gt; Maplesoft Member&lt;/p&gt;</description>
      <guid>89167</guid>
      <pubDate>Mon, 07 Jun 2010 01:20:44 Z</pubDate>
      <itunes:author>Alec Mihailovs</itunes:author>
      <author>Alec Mihailovs</author>
    </item>
    <item>
      <title>helped a lot</title>
      <link>http://www.mapleprimes.com/questions/88761-How-To-Get-A-Random-Selection-From-A?ref=Feed:MaplePrimes:How to get a random selection from a specific subArrays of an Array?:Comments#comment89105</link>
      <itunes:summary>&lt;p&gt;Thanks...&lt;/p&gt;
&lt;p&gt;that helped a lot!&lt;/p&gt;
&lt;p&gt;Though I sticked to using lists, because I saw no way of applying select or remove to an array or Array,&lt;/p&gt;
&lt;p&gt;your suggestion of using the combinat: -randcomb command was indeed very useful to me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Arndt Feddersen&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Thanks...&lt;/p&gt;
&lt;p&gt;that helped a lot!&lt;/p&gt;
&lt;p&gt;Though I sticked to using lists, because I saw no way of applying select or remove to an array or Array,&lt;/p&gt;
&lt;p&gt;your suggestion of using the combinat: -randcomb command was indeed very useful to me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Arndt Feddersen&lt;/p&gt;</description>
      <guid>89105</guid>
      <pubDate>Sat, 05 Jun 2010 17:30:35 Z</pubDate>
      <itunes:author>afeddersen</itunes:author>
      <author>afeddersen</author>
    </item>
  </channel>
</rss>