<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Maple and trinomial distributions</title>
    <link>http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sun, 14 Jun 2026 02:33:10 GMT</lastBuildDate>
    <pubDate>Sun, 14 Jun 2026 02:33:10 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Maple and trinomial distributions</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Maple and trinomial distributions</title>
      <link>http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions</link>
    </image>
    <item>
      <title>Partial case of multinomial</title>
      <link>http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions?ref=Feed:MaplePrimes:Maple and trinomial distributions:Comments#answer144347</link>
      <itunes:summary>&lt;p&gt;A similar question was asked and answered here:&lt;br&gt;&lt;a href="http://www.mapleprimes.com/questions/126141-Multinomial-Distribution-In-Maple"&gt;http://www.mapleprimes.com/questions/126141-Multinomial-Distribution-In-Maple&lt;/a&gt;.&lt;br&gt;A trinomial distribution can be created as a procedure&lt;br&gt;&lt;br&gt;&amp;gt;Multinomial:=proc (n, k, x, p) &lt;br&gt;&amp;nbsp;if nops(x) = k and nops(p) = k and sum(p[j], j = 1 .. k) = 1 and 0 &amp;lt; min(p) and sum(x[j], j = 1 .. k) = n&lt;br&gt;&amp;nbsp;&amp;nbsp; then factorial(n)*mul(p[j]^x[j], j = 1 .. k)/mul(factorial(x[j]), j = 1 .. k) &lt;br&gt;&amp;nbsp;&amp;nbsp; else 0 &lt;br&gt;&amp;nbsp;end if &lt;br&gt;end proc;&lt;br&gt;In your case n=3, k=3, p=[1/6, 1/2, 1/3], and x=[x1,x2,x3], where xj, j=1..3, are integers.&lt;br&gt;For example,&lt;br&gt;&amp;gt; Multinomial(3, 3, [1, 2, 0], [1/6, 1/2, 1/3]);&lt;br&gt;&amp;nbsp; 1/8&lt;br&gt;The values of the trinomial distribution are vectors. The mean of each component&lt;br&gt;can be found in such a way. The command&lt;br&gt;&amp;gt; add(add(add(x2*Multinomial(3, 3, [x1, x2, x3], [1/6, 1/2, 1/3]), x1 = 0 .. 3), x2 = 0 .. 3), x3 = 0 .. 3);&lt;br&gt;&amp;nbsp;3/2&lt;br&gt;produces the one for the second component.&lt;br&gt;The command &lt;br&gt;&amp;gt;add(add(add(x2^2*Multinomial(3, 3, [x1, x2, x3], [1/6, 1/2, 1/3]), x1 = 0 .. 3), x2 = 0 .. 3), x3 = 0 .. 3)-&lt;br&gt;add(add(add(x2*Multinomial(3, 3, [x1, x2, x3], [1/6, 1/2, 1/3]), x1 = 0 .. 3), x2 = 0 .. 3), x3 = 0 .. 3)^2;&lt;br&gt;3/4&lt;br&gt;produces its variance.&lt;br&gt;In order to define the two random trinomial distributions X and Y and to calculate Cov(X,Y),&amp;nbsp; their joint probability distribution (PS. as a seven&lt;span style="text-decoration: line-through;"&gt;four&lt;/span&gt;-dimensional Array)&amp;nbsp; should be given .&lt;/p&gt;
&lt;p&gt;Edit. Multinomial(n,k,x,p) replaced by Multinomial.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;A similar question was asked and answered here:&lt;br&gt;&lt;a href="http://www.mapleprimes.com/questions/126141-Multinomial-Distribution-In-Maple"&gt;http://www.mapleprimes.com/questions/126141-Multinomial-Distribution-In-Maple&lt;/a&gt;.&lt;br&gt;A trinomial distribution can be created as a procedure&lt;br&gt;&lt;br&gt;&amp;gt;Multinomial:=proc (n, k, x, p) &lt;br&gt;&amp;nbsp;if nops(x) = k and nops(p) = k and sum(p[j], j = 1 .. k) = 1 and 0 &amp;lt; min(p) and sum(x[j], j = 1 .. k) = n&lt;br&gt;&amp;nbsp;&amp;nbsp; then factorial(n)*mul(p[j]^x[j], j = 1 .. k)/mul(factorial(x[j]), j = 1 .. k) &lt;br&gt;&amp;nbsp;&amp;nbsp; else 0 &lt;br&gt;&amp;nbsp;end if &lt;br&gt;end proc;&lt;br&gt;In your case n=3, k=3, p=[1/6, 1/2, 1/3], and x=[x1,x2,x3], where xj, j=1..3, are integers.&lt;br&gt;For example,&lt;br&gt;&amp;gt; Multinomial(3, 3, [1, 2, 0], [1/6, 1/2, 1/3]);&lt;br&gt;&amp;nbsp; 1/8&lt;br&gt;The values of the trinomial distribution are vectors. The mean of each component&lt;br&gt;can be found in such a way. The command&lt;br&gt;&amp;gt; add(add(add(x2*Multinomial(3, 3, [x1, x2, x3], [1/6, 1/2, 1/3]), x1 = 0 .. 3), x2 = 0 .. 3), x3 = 0 .. 3);&lt;br&gt;&amp;nbsp;3/2&lt;br&gt;produces the one for the second component.&lt;br&gt;The command &lt;br&gt;&amp;gt;add(add(add(x2^2*Multinomial(3, 3, [x1, x2, x3], [1/6, 1/2, 1/3]), x1 = 0 .. 3), x2 = 0 .. 3), x3 = 0 .. 3)-&lt;br&gt;add(add(add(x2*Multinomial(3, 3, [x1, x2, x3], [1/6, 1/2, 1/3]), x1 = 0 .. 3), x2 = 0 .. 3), x3 = 0 .. 3)^2;&lt;br&gt;3/4&lt;br&gt;produces its variance.&lt;br&gt;In order to define the two random trinomial distributions X and Y and to calculate Cov(X,Y),&amp;nbsp; their joint probability distribution (PS. as a seven&lt;span style="text-decoration: line-through;"&gt;four&lt;/span&gt;-dimensional Array)&amp;nbsp; should be given .&lt;/p&gt;
&lt;p&gt;Edit. Multinomial(n,k,x,p) replaced by Multinomial.&lt;/p&gt;</description>
      <guid>144347</guid>
      <pubDate>Fri, 08 Mar 2013 11:15:26 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
    <item>
      <title>Not working</title>
      <link>http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions?ref=Feed:MaplePrimes:Maple and trinomial distributions:Comments#comment144381</link>
      <itunes:summary>&lt;p&gt;This answer isn't working. I am getting unable to match errors with no help on this error available when I click through Maple. Are there any other suggestions available?&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;This answer isn't working. I am getting unable to match errors with no help on this error available when I click through Maple. Are there any other suggestions available?&lt;/p&gt;</description>
      <guid>144381</guid>
      <pubDate>Sat, 09 Mar 2013 04:29:35 Z</pubDate>
      <itunes:author>knovick</itunes:author>
      <author>knovick</author>
    </item>
    <item>
      <title>Working</title>
      <link>http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions?ref=Feed:MaplePrimes:Maple and trinomial distributions:Comments#comment144436</link>
      <itunes:summary>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions#comment144381"&gt;@knovick&lt;/a&gt; See &lt;a href="/view.aspx?sf=144436/455735/trinomial.mw"&gt;trinomial.mw&lt;/a&gt; and &lt;a href="/view.aspx?sf=144436/455735/screen10.03.13.docx"&gt;screen10.03.13.docx&lt;/a&gt; . I am waiting for your feedback.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;&lt;a href="http://www.mapleprimes.com/questions/144334-Maple-And-Trinomial-Distributions#comment144381"&gt;@knovick&lt;/a&gt; See &lt;a href="/view.aspx?sf=144436/455735/trinomial.mw"&gt;trinomial.mw&lt;/a&gt; and &lt;a href="/view.aspx?sf=144436/455735/screen10.03.13.docx"&gt;screen10.03.13.docx&lt;/a&gt; . I am waiting for your feedback.&lt;/p&gt;</description>
      <guid>144436</guid>
      <pubDate>Sun, 10 Mar 2013 10:53:19 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
  </channel>
</rss>