<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Combinatorial problem</title>
    <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Wed, 10 Jun 2026 17:38:28 GMT</lastBuildDate>
    <pubDate>Wed, 10 Jun 2026 17:38:28 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Combinatorial problem</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Combinatorial problem</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem</link>
    </image>
    <item>
      <title>Solution</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem?ref=Feed:MaplePrimes:Combinatorial problem:Comments#answer144196</link>
      <itunes:summary>&lt;p&gt;&lt;strong&gt;P:=combinat[powerset]({a, b, c, d, e}):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;m:=0:&amp;nbsp; n:=0:&amp;nbsp; k:=0:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for i in P do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for j in P do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if nops(i union j)=5 and nops(i intersect j)=3 then m:=m+1: fi:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if nops(i union j)=5 and nops(i intersect j)=4 then n:=n+1: fi:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if nops(i union j)=5 and nops(i intersect j)=5 then k:=k+1: fi:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;od: od:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;binomial(30, 5)*(m+n*binomial(4, 3)+k*binomial(5, 3))*2^(30-3);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1721414839173120&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;strong&gt;P:=combinat[powerset]({a, b, c, d, e}):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;m:=0:&amp;nbsp; n:=0:&amp;nbsp; k:=0:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for i in P do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;for j in P do&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if nops(i union j)=5 and nops(i intersect j)=3 then m:=m+1: fi:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if nops(i union j)=5 and nops(i intersect j)=4 then n:=n+1: fi:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if nops(i union j)=5 and nops(i intersect j)=5 then k:=k+1: fi:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;od: od:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;binomial(30, 5)*(m+n*binomial(4, 3)+k*binomial(5, 3))*2^(30-3);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1721414839173120&lt;/p&gt;</description>
      <guid>144196</guid>
      <pubDate>Tue, 05 Mar 2013 20:44:44 Z</pubDate>
      <itunes:author>Kitonum</itunes:author>
      <author>Kitonum</author>
    </item>
    <item>
      <title>Manually</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem?ref=Feed:MaplePrimes:Combinatorial problem:Comments#answer144198</link>
      <itunes:summary>&lt;p&gt;Computing manually I get 30!/25!/3!/2!*5^2 = 35626500. This comes from creating the venn diagram of the sets, noting that there must be exactly 3 in the middle region, 25 in C minus A minus B, leaving 2 for the other 5 regions. &amp;nbsp;Those two can be distributed 5^2 ways. &amp;nbsp;The lhs of the product is the number of ways to partition a set of 30 elements in subsets of 25, 3, and 2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: fixed original computation&lt;/p&gt;
&lt;p&gt;Per response from OP, my assumption that A union B union C = S is incorrect. Fortunately, it is easy to handle the more general case, just multiply by the number of ways to partition a set of 25 elements into two sets (the sets being C \ (A union B) and S \ (A union B union C)). That factor is 2^25. &amp;nbsp;So the overall result is&lt;/p&gt;
&lt;p&gt;30!/25!/3!/2!*5^2*2^25 = 1195426971648000&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Computing manually I get 30!/25!/3!/2!*5^2 = 35626500. This comes from creating the venn diagram of the sets, noting that there must be exactly 3 in the middle region, 25 in C minus A minus B, leaving 2 for the other 5 regions. &amp;nbsp;Those two can be distributed 5^2 ways. &amp;nbsp;The lhs of the product is the number of ways to partition a set of 30 elements in subsets of 25, 3, and 2.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: fixed original computation&lt;/p&gt;
&lt;p&gt;Per response from OP, my assumption that A union B union C = S is incorrect. Fortunately, it is easy to handle the more general case, just multiply by the number of ways to partition a set of 25 elements into two sets (the sets being C \ (A union B) and S \ (A union B union C)). That factor is 2^25. &amp;nbsp;So the overall result is&lt;/p&gt;
&lt;p&gt;30!/25!/3!/2!*5^2*2^25 = 1195426971648000&lt;/p&gt;</description>
      <guid>144198</guid>
      <pubDate>Tue, 05 Mar 2013 21:38:03 Z</pubDate>
      <itunes:author>Joe Riel</itunes:author>
      <author>Joe Riel</author>
    </item>
    <item>
      <title>Split cases via |A intersect B| = 3, 4, or 5.</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem?ref=Feed:MaplePrimes:Combinatorial problem:Comments#answer144221</link>
      <itunes:summary>&lt;p&gt;Notation: I'll use juxtaposition to indicate intersection, `+` for union, `-` for minus, with `+` having precedence. |A| is nops(A), and (n C k) is a binomial coefficient.&lt;/p&gt;
&lt;p&gt;We split cases via |AB|. There are three cases, |AB| = 3, 4, or 5. Regardless of the case, we have a factor of (30 C 5) for the choice of A+B and a factor of 2^25 choices for C - A+B.&lt;/p&gt;
&lt;p&gt;Case |AB| = 5: Thus A=B. There are (5 C 3) = 10 choices for ABC in AB.&lt;/p&gt;
&lt;p&gt;Case |AB| = 4: Either |A|=4 and |B|=5 or vice versa. This dichotomy contributes a factor of 2, and we will consider only the |A|=4 case without loss of generality. There are (5 C 4) choices of A within A+B and (4 C 3) choices of ABC in A. Total factor for this case 2*(5 C 4)*(4 C 3) = 40.&lt;/p&gt;
&lt;p&gt;Case |AB| = 3:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Subcase |A|=3, |B|=5 or vice versa. Factor of 2 for the dichotomy. (5 C 3) choices of A in A+B, and only 1 choice of ABC in A. Total factor: 20&lt;/li&gt;
&lt;li&gt;Subcase |A|=4, |B|=4. (5 C 4) choices of A in A+B, (4 C 3) choices of AB in A, and(3 C 3) choices of ABC in AB, for a total of 20.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grand total: (20+20+40+10)*(30 C 5)*2^25 = 430353709793280 = &lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZoAAAAdCAIAAAAcpj3gAAACT0lEQVR4nO3c243DIBCFYdpyQ5RDORRDM94H4yQMM1y0K8Ww//cWYdC8cMTFjjsBYAvu2wUAwN8gzgBsgjgDsAni7JLC4dwRktoYvdkE4DGIs/M8o3fOOSvOojebADwIcZalcKiZFb0PRhOARyHOMj3OovfRTDoAj0KcZVpmRe+j0QTgcYizrM6sHGbEGbAI4iyTmZVCiEYTgEcizjKRWfdlZ8HH1ggAvqsXZykc3WmcwnFPeHUR846GeqBeX5ErvUC5ntafapXRXIKxOgOW0I6zHDatEEnhuKf69bR4OPp3UEVfNvf6Fmk3UEjjsVYZ1QPKyMQZ8HjNOLvXM3aKpOA/53m1lhMhUbT3+l7dJzd40Wv1tso4yxWgklvEGbCERpxF73zU48EiJ3615GnsXevQeK23JiJNrXemDACrMuMsL4ym4iyFo3hU6WyOJ/tWp/FjRWjjz5QBYFlGnL12eePzvj580j7r1j/11g6uUkrvxsZdQT2SqHe8DAArU+Ps48hqKM6KddQ7JIZyxOgrDNxJmPUSZ8D/oMRZse2b2ZXJmwMtM6zx+rcOY5UMxhmbTWA/VZyJM6zJeV/+mc7coVXvj3jU9yvUQTg7A/4jGWfiRa+RjWChOAWr10XNK8XGq1+5uV+DllOTZQBYU++rgNlljMiczgtfzb5CffU5Xu9UGQDWNB1n1/ItZ0PxQ33f9DM5yhTp9C1/f3w/MFlvrwwAu/hdnIm9qZE4xpsWnb5jV55WB2OJNrFtBrAY/lEDwCaIMwCbIM4AbII4A7CJH9Y/j7xV4yEgAAAAAElFTkSuQmCC" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Edit: Corrections to the above.&lt;/p&gt;
&lt;p&gt;Case |AB| = 4: Either |A|=4 and |B|=5 or vice versa. This dichotomy contributes a factor of 2, and we will consider only the |A|=4 case without loss of generality. There are (5 C 4) choices of A within A+B and (4 C 3) choices of ABC in A. The choice of whether the lone element of B-A is or is not in C contributes a factor of 2. Total factor for this case 2*(5 C 4)*(4 C 3)*2 = 80.&lt;/p&gt;
&lt;p&gt;Case |AB| = 3:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Subcase |A|=3, |B|=5 or vice versa. Factor of 2 for the dichotomy. (5 C 3) choices of A in A+B, and only 1 choice of ABC in A. For each of the 2 elements of B-A, there is a choice of whether it is in C, for a factor of 2^2. Total factor: 2*(5 C 3)*2^2 = 80.&lt;/li&gt;
&lt;li&gt;Subcase |A|=4, |B|=4. (5 C 4) choices of A in A+B, (4 C 3) choices of AB in A, and(3 C 3) choices of ABC in AB. For each of the 2 elements of (A-B)+(B-A), there is the choice of whether it is in C. Total factor: (5 C 4)*(4 C 3)*2^2 = 80.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grand total: (10+80+80+80)*(30 C 5)*2^25 = &lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=e2fbcaf97abc0af8e4553db2d38aec11.gif" alt="250*binomial(30,5)*2^25"&gt; = &lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=bc1996e74d1c4fd6910a5e77b2618ce1.gif" alt="evalf[5](250*binomial(30,5)*2^25)"&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Notation: I'll use juxtaposition to indicate intersection, `+` for union, `-` for minus, with `+` having precedence. |A| is nops(A), and (n C k) is a binomial coefficient.&lt;/p&gt;
&lt;p&gt;We split cases via |AB|. There are three cases, |AB| = 3, 4, or 5. Regardless of the case, we have a factor of (30 C 5) for the choice of A+B and a factor of 2^25 choices for C - A+B.&lt;/p&gt;
&lt;p&gt;Case |AB| = 5: Thus A=B. There are (5 C 3) = 10 choices for ABC in AB.&lt;/p&gt;
&lt;p&gt;Case |AB| = 4: Either |A|=4 and |B|=5 or vice versa. This dichotomy contributes a factor of 2, and we will consider only the |A|=4 case without loss of generality. There are (5 C 4) choices of A within A+B and (4 C 3) choices of ABC in A. Total factor for this case 2*(5 C 4)*(4 C 3) = 40.&lt;/p&gt;
&lt;p&gt;Case |AB| = 3:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Subcase |A|=3, |B|=5 or vice versa. Factor of 2 for the dichotomy. (5 C 3) choices of A in A+B, and only 1 choice of ABC in A. Total factor: 20&lt;/li&gt;
&lt;li&gt;Subcase |A|=4, |B|=4. (5 C 4) choices of A in A+B, (4 C 3) choices of AB in A, and(3 C 3) choices of ABC in AB, for a total of 20.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grand total: (20+20+40+10)*(30 C 5)*2^25 = 430353709793280 = &lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZoAAAAdCAIAAAAcpj3gAAACT0lEQVR4nO3c243DIBCFYdpyQ5RDORRDM94H4yQMM1y0K8Ww//cWYdC8cMTFjjsBYAvu2wUAwN8gzgBsgjgDsAni7JLC4dwRktoYvdkE4DGIs/M8o3fOOSvOojebADwIcZalcKiZFb0PRhOARyHOMj3OovfRTDoAj0KcZVpmRe+j0QTgcYizrM6sHGbEGbAI4iyTmZVCiEYTgEcizjKRWfdlZ8HH1ggAvqsXZykc3WmcwnFPeHUR846GeqBeX5ErvUC5ntafapXRXIKxOgOW0I6zHDatEEnhuKf69bR4OPp3UEVfNvf6Fmk3UEjjsVYZ1QPKyMQZ8HjNOLvXM3aKpOA/53m1lhMhUbT3+l7dJzd40Wv1tso4yxWgklvEGbCERpxF73zU48EiJ3615GnsXevQeK23JiJNrXemDACrMuMsL4ym4iyFo3hU6WyOJ/tWp/FjRWjjz5QBYFlGnL12eePzvj580j7r1j/11g6uUkrvxsZdQT2SqHe8DAArU+Ps48hqKM6KddQ7JIZyxOgrDNxJmPUSZ8D/oMRZse2b2ZXJmwMtM6zx+rcOY5UMxhmbTWA/VZyJM6zJeV/+mc7coVXvj3jU9yvUQTg7A/4jGWfiRa+RjWChOAWr10XNK8XGq1+5uV+DllOTZQBYU++rgNlljMiczgtfzb5CffU5Xu9UGQDWNB1n1/ItZ0PxQ33f9DM5yhTp9C1/f3w/MFlvrwwAu/hdnIm9qZE4xpsWnb5jV55WB2OJNrFtBrAY/lEDwCaIMwCbIM4AbII4A7CJH9Y/j7xV4yEgAAAAAElFTkSuQmCC" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Edit: Corrections to the above.&lt;/p&gt;
&lt;p&gt;Case |AB| = 4: Either |A|=4 and |B|=5 or vice versa. This dichotomy contributes a factor of 2, and we will consider only the |A|=4 case without loss of generality. There are (5 C 4) choices of A within A+B and (4 C 3) choices of ABC in A. The choice of whether the lone element of B-A is or is not in C contributes a factor of 2. Total factor for this case 2*(5 C 4)*(4 C 3)*2 = 80.&lt;/p&gt;
&lt;p&gt;Case |AB| = 3:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Subcase |A|=3, |B|=5 or vice versa. Factor of 2 for the dichotomy. (5 C 3) choices of A in A+B, and only 1 choice of ABC in A. For each of the 2 elements of B-A, there is a choice of whether it is in C, for a factor of 2^2. Total factor: 2*(5 C 3)*2^2 = 80.&lt;/li&gt;
&lt;li&gt;Subcase |A|=4, |B|=4. (5 C 4) choices of A in A+B, (4 C 3) choices of AB in A, and(3 C 3) choices of ABC in AB. For each of the 2 elements of (A-B)+(B-A), there is the choice of whether it is in C. Total factor: (5 C 4)*(4 C 3)*2^2 = 80.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Grand total: (10+80+80+80)*(30 C 5)*2^25 = &lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=e2fbcaf97abc0af8e4553db2d38aec11.gif" alt="250*binomial(30,5)*2^25"&gt; = &lt;img class="math" src="http://www.mapleprimes.com/MapleImage.ashx?f=bc1996e74d1c4fd6910a5e77b2618ce1.gif" alt="evalf[5](250*binomial(30,5)*2^25)"&gt;&lt;/p&gt;</description>
      <guid>144221</guid>
      <pubDate>Wed, 06 Mar 2013 07:41:28 Z</pubDate>
      <itunes:author>Carl Love</itunes:author>
      <author>Carl Love</author>
    </item>
    <item>
      <title>Want for explanation</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem?ref=Feed:MaplePrimes:Combinatorial problem:Comments#comment144197</link>
      <itunes:summary>&lt;p&gt;Can you kindly explain your code? Especially, why is every C&amp;nbsp; counted only one time?&amp;nbsp; I also think that the condition nops(i) &amp;gt;= nops (j) is necessary to get rid of duplications.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Can you kindly explain your code? Especially, why is every C&amp;nbsp; counted only one time?&amp;nbsp; I also think that the condition nops(i) &amp;gt;= nops (j) is necessary to get rid of duplications.&lt;/p&gt;</description>
      <guid>144197</guid>
      <pubDate>Tue, 05 Mar 2013 20:57:59 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>Explanation</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem?ref=Feed:MaplePrimes:Combinatorial problem:Comments#comment144199</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/144191-Combinatorial-Problem#comment144197"&gt;@Markiyan Hirnyk&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let &amp;nbsp;A union B ={a, b, c, d, e} is a subset of &amp;nbsp;S. Then &amp;nbsp;A &amp;nbsp;and &amp;nbsp;B &amp;nbsp;are subsets of &amp;nbsp;{a, b, c, d, e} . &amp;nbsp;From the second condition about the intersection follows that &amp;nbsp;nops(A intersect B)&amp;gt;=3 . Suppose &amp;nbsp;nops(A intersect B)=3 . The number of such pairs &amp;nbsp;A &amp;nbsp;and &amp;nbsp;B &amp;nbsp;is &amp;nbsp;m (see code). Set C, which intersects with (A intersect B) in these 3 elements can be chosen in 2^(30-3) ways &amp;nbsp;and so on.&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/144191-Combinatorial-Problem#comment144197"&gt;@Markiyan Hirnyk&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let &amp;nbsp;A union B ={a, b, c, d, e} is a subset of &amp;nbsp;S. Then &amp;nbsp;A &amp;nbsp;and &amp;nbsp;B &amp;nbsp;are subsets of &amp;nbsp;{a, b, c, d, e} . &amp;nbsp;From the second condition about the intersection follows that &amp;nbsp;nops(A intersect B)&amp;gt;=3 . Suppose &amp;nbsp;nops(A intersect B)=3 . The number of such pairs &amp;nbsp;A &amp;nbsp;and &amp;nbsp;B &amp;nbsp;is &amp;nbsp;m (see code). Set C, which intersects with (A intersect B) in these 3 elements can be chosen in 2^(30-3) ways &amp;nbsp;and so on.&amp;nbsp;&lt;/p&gt;</description>
      <guid>144199</guid>
      <pubDate>Tue, 05 Mar 2013 21:44:58 Z</pubDate>
      <itunes:author>Kitonum</itunes:author>
      <author>Kitonum</author>
    </item>
    <item>
      <title>Possible duplications</title>
      <link>http://www.mapleprimes.com/questions/144191-Combinatorial-Problem?ref=Feed:MaplePrimes:Combinatorial problem:Comments#comment144201</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/144191-Combinatorial-Problem#comment144199"&gt;@Kitonum&lt;/a&gt; Why [A, B,&amp;nbsp; C] is counted only one time? It is not obvious if nops (A intersect B) = 4 or 5.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/144191-Combinatorial-Problem#comment144199"&gt;@Kitonum&lt;/a&gt; Why [A, B,&amp;nbsp; C] is counted only one time? It is not obvious if nops (A intersect B) = 4 or 5.&lt;/p&gt;</description>
      <guid>144201</guid>
      <pubDate>Tue, 05 Mar 2013 21:53:29 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
  </channel>
</rss>