MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A nasty 2x2 system of equations?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54132] Re: A nasty 2x2 system of equations?
  • From: "Valeri Astanoff" <astanoff at yahoo.fr>
  • Date: Fri, 11 Feb 2005 03:33:56 -0500 (EST)
  • References: <cuf559$glj$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Sometimes, Mathematica needs a little help from a human being...

Here is the way you could do :

In[1]:=
<<Statistics`

In[2]:=
X=BetaDistribution[a1,b1];
Y=BetaDistribution[a2,b2];
Z=BetaDistribution[a3,b3];

In[5]:=
f1=Mean[Z]-c*Mean[X]-(1-c)*Mean[Y];
f2=Variance[Z]-c^2*Variance[X]-(1-c)^2*Variance[Y];

In[7]:=
sa3=First@Solve[f1 == 0,a3]

Out[7]=
{a3 -> ((-a1)*a2*b3 - a2*b1*b3 + a2*b1*b3*c - a1*b2*b3*c)/((-a1)*b2 -
b1*b2 - a2*b1*c + a1*b2*c)}

In[8]:=
n=f2/.sa3//Together//Numerator;

In[9]:=
sb3=First@Solve[n == 0,b3]//Simplify

Out[9]=
{b3 -> (a1^3*b2^2*(-1 + c)^2*(a2 + c + b2*c) - a2*b1^2*(1 + b1)*(-1 +
c)*(b2^2 + a2*(1 + a2)*c^2 + b2*(c + 2*a2*c)) -
     a1^2*b2*(-1 + c)*(2*a2^2*b1*c + b2*(1 + b2)*(1 + 2*b1 - c)*c +
a2*(b1*c*(1 + c) + b2*(1 - c + b1*(3 - 2*c + 3*c^2)))) +
     a1*b1*(b2^2*(1 + b2)*(1 + b1 - c)*c + a2^3*b1*c^2 + a2^2*c*(b1*c +
b2*(2 - 3*c + c^2 + b1*(4 - 4*c + 3*c^2))) +
       a2*b2*(c*(1 - c + b1*(2 - c + c^2)) + b2*(2 - 3*c + 2*c^2 - c^3
+ b1*(3 - 4*c + 4*c^2)))))/
    (a1^3*a2*b2*(-1 + c)^2 + a2*b1^2*(1 + b1)*b2*(-1 + c)^2 +
a1^2*a2*(1 + 3*b1)*b2*(-1 + c)^2 +
     a1*b1*(a2^3*c^2 + b2^2*(1 + b2)*c^2 + a2^2*(1 + 3*b2)*c^2 +
a2*b2*(2 + 3*b1*(-1 + c)^2 - 4*c + (4 + 3*b2)*c^2)))}

In[10]:=
Solve[f1 == 0/.sb3,a3]//Simplify

Out[10]=
{{a3 -> (a2^2*b1^2*(1 + b1)*(-1 + c)^2*(b2 + c + a2*c) - a1^3*b2*(-1 +
c)*(a2^2 + b2*(1 + b2)*c^2 + a2*(c + 2*b2*c)) -
      a1*a2*b1*(-1 + c)*(a2^2*(c + 2*b1*c) + b2*c*(1 + 2*b2 - b2*c +
b1*(1 + 2*b2 + c)) +
        a2*(c + 2*b1*c + b2*(2 - c + c^2 + b1*(3 - 2*c + 3*c^2)))) +
a1^2*(a2^3*b1*c + b2^2*(1 + b2)*(1 + b1 - c)*c^2 +
        a2*b2*c*((-(1 + 2*b2))*(-1 + c) + b1*(2 - c + c^2 + b2*(4 - 4*c
+ 3*c^2))) + a2^2*(b1*c + b2*(1 - c + b1*(3 - 4*c + 4*c^2)))))/
     (a1^3*a2*b2*(-1 + c)^2 + a2*b1^2*(1 + b1)*b2*(-1 + c)^2 +
a1^2*a2*(1 + 3*b1)*b2*(-1 + c)^2 +
      a1*b1*(a2^3*c^2 + b2^2*(1 + b2)*c^2 + a2^2*(1 + 3*b2)*c^2 +
a2*b2*(2 + 3*b1*(-1 + c)^2 - 4*c + (4 + 3*b2)*c^2)))}}


  • Prev by Date: Re: Re: finding package in ExtraPackages`Enhancements`
  • Next by Date: Re: Re: problem with FindRoot
  • Previous by thread: Re: A nasty 2x2 system of equations?
  • Next by thread: Newbie question Re: C# and Mathematica via NETLink