<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Moment Generating Functions and Finding E(X), Var(X) and P(4.1&lt;X&lt;4.7)</title>
    <link>http://www.mapleprimes.com/questions/144644-Moment-Generating-Functions-And-Finding-EX-VarX-And-P41</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 20:45:09 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 20:45:09 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Moment Generating Functions and Finding E(X), Var(X) and P(4.1&lt;X&lt;4.7)</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Moment Generating Functions and Finding E(X), Var(X) and P(4.1&lt;X&lt;4.7)</title>
      <link>http://www.mapleprimes.com/questions/144644-Moment-Generating-Functions-And-Finding-EX-VarX-And-P41</link>
    </image>
    <item>
      <title>By Gamma distribution</title>
      <link>http://www.mapleprimes.com/questions/144644-Moment-Generating-Functions-And-Finding-EX-VarX-And-P41?ref=Feed:MaplePrimes:Moment Generating Functions and Finding E(X), Var(X) and P(4.1&lt;X&lt;4.7):Comments#answer144657</link>
      <itunes:summary>&lt;p&gt;Up to &lt;a href="http://en.wikipedia.org/wiki/Moment_generating_function"&gt;http://en.wikipedia.org/wiki/Moment_generating_function&lt;/a&gt; ,&lt;br&gt;this can be done as follows.&lt;br&gt;1. MGF := t -&amp;gt; 1/(1-3*t)); #We will not use the condition t &amp;lt; 1/3.&lt;br&gt;&amp;nbsp;E(X) = eval(diff(MGF(t), t), t = 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 &lt;br&gt;2. Variance(X)= E(X^2)-E(X)^2 =&amp;nbsp; eval(diff(MGF(t), t,t), t = 0) - 3^2;&lt;br&gt;&amp;nbsp;&amp;nbsp; 9&lt;br&gt;3.&amp;nbsp; The function piecewise(t&amp;lt;1/3,1/(1-3*t),undefined) is the MGF of the random variable&lt;br&gt;Gamma(b, c) with b=3, c=1&amp;nbsp; (for example, see &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics/Distributions/Gamma"&gt;http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics/Distributions/Gamma&lt;/a&gt; and&lt;br&gt;&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Gamma_distribution"&gt;http://en.wikipedia.org/wiki/Gamma_distribution&lt;/a&gt; for info).&lt;br&gt;Let us find its CDF&lt;br&gt;&amp;gt; with(Statistics); X := RandomVariable(Gamma(3, 1));&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; _R&lt;br&gt;&amp;gt; CDF(X, t);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; piecewise(t &amp;lt;= 0, 0, 0 &amp;lt; t, -exp(-(1/3)*t)+1)&lt;/p&gt;
&lt;p&gt;and the probability &lt;span class="mainBody document"&gt;P(4.1 &amp;lt; X &amp;lt;4.7)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt; CDF(X, 4.7)-CDF(X, 4.1);&lt;br&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;0.0462155726364304 &lt;br&gt;It should be noticed that the Gil-Pelaez formula&amp;nbsp; &lt;a href="http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29"&gt;http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29&lt;/a&gt;&amp;nbsp; fails in Maple&lt;br&gt;because of slow convergence:&lt;br&gt;&lt;br&gt;&amp;gt;Digits := 10: F[X](4.1) := evalf(1/2-(int(evalc(Im(exp(-(I*4.1)*t)*1/(1-3*exp(-I*t))/t,&lt;br&gt;&amp;nbsp;t = 0 .. infinity, numeric, method = _d01amc))/Pi);&lt;br&gt;&lt;span style="text-decoration: underline;"&gt;Error, (in int) NE_QUAD_NO_CONV:&lt;/span&gt;&lt;br&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; The integral is probably divergent or slowly convergent.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Edit. Bad copy and paste.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Up to &lt;a href="http://en.wikipedia.org/wiki/Moment_generating_function"&gt;http://en.wikipedia.org/wiki/Moment_generating_function&lt;/a&gt; ,&lt;br&gt;this can be done as follows.&lt;br&gt;1. MGF := t -&amp;gt; 1/(1-3*t)); #We will not use the condition t &amp;lt; 1/3.&lt;br&gt;&amp;nbsp;E(X) = eval(diff(MGF(t), t), t = 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 &lt;br&gt;2. Variance(X)= E(X^2)-E(X)^2 =&amp;nbsp; eval(diff(MGF(t), t,t), t = 0) - 3^2;&lt;br&gt;&amp;nbsp;&amp;nbsp; 9&lt;br&gt;3.&amp;nbsp; The function piecewise(t&amp;lt;1/3,1/(1-3*t),undefined) is the MGF of the random variable&lt;br&gt;Gamma(b, c) with b=3, c=1&amp;nbsp; (for example, see &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics/Distributions/Gamma"&gt;http://www.maplesoft.com/support/help/Maple/view.aspx?path=Statistics/Distributions/Gamma&lt;/a&gt; and&lt;br&gt;&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Gamma_distribution"&gt;http://en.wikipedia.org/wiki/Gamma_distribution&lt;/a&gt; for info).&lt;br&gt;Let us find its CDF&lt;br&gt;&amp;gt; with(Statistics); X := RandomVariable(Gamma(3, 1));&lt;br&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; _R&lt;br&gt;&amp;gt; CDF(X, t);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; piecewise(t &amp;lt;= 0, 0, 0 &amp;lt; t, -exp(-(1/3)*t)+1)&lt;/p&gt;
&lt;p&gt;and the probability &lt;span class="mainBody document"&gt;P(4.1 &amp;lt; X &amp;lt;4.7)&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="mainBody document"&gt; CDF(X, 4.7)-CDF(X, 4.1);&lt;br&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;0.0462155726364304 &lt;br&gt;It should be noticed that the Gil-Pelaez formula&amp;nbsp; &lt;a href="http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29"&gt;http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29&lt;/a&gt;&amp;nbsp; fails in Maple&lt;br&gt;because of slow convergence:&lt;br&gt;&lt;br&gt;&amp;gt;Digits := 10: F[X](4.1) := evalf(1/2-(int(evalc(Im(exp(-(I*4.1)*t)*1/(1-3*exp(-I*t))/t,&lt;br&gt;&amp;nbsp;t = 0 .. infinity, numeric, method = _d01amc))/Pi);&lt;br&gt;&lt;span style="text-decoration: underline;"&gt;Error, (in int) NE_QUAD_NO_CONV:&lt;/span&gt;&lt;br&gt;&lt;span style="text-decoration: underline;"&gt;&amp;nbsp; The integral is probably divergent or slowly convergent.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Edit. Bad copy and paste.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <guid>144657</guid>
      <pubDate>Fri, 15 Mar 2013 11:56:11 Z</pubDate>
      <itunes:author>Markiyan Hirnyk</itunes:author>
      <author>Markiyan Hirnyk</author>
    </item>
  </channel>
</rss>