# [Maxima] Solving a two equation system yields strange results

Jason Filippou jason.filippou at gmail.com
Wed May 9 17:59:57 CDT 2012

```Thanks for the help. Indeed, even after changing eq1 into eq1 : b (k -
1) = a i ended up with a summation of parameterized terms in terms of
a, and proceeded to do a number of substitutions of a which all appear
to be minimized at 0.2.

This concludes my Maxima - related questions for now, yet I am at a
loss as to what these results mean regarding the statistical nature of
my problem, as I mentioned it a couple of e-mails ago. I find it hard
to believe that one cannot choose the mean of a distribution such that
approximately 98% of its mass is bounded within [0,1]. Perhaps the
fact that the minimization does not fall below the 0.2 indiates that
I'm approaching my problem in the wrong way.

Any pointers, perhaps?

Regards,

Jason

On Thu, May 10, 2012 at 12:48 AM, Stavros Macrakis
<macrakis at alum.mit.edu> wrote:
> As far as I know, 'solve' knows nothing about indexed sums, so Maxima will
>
>    exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02
>
> roughly the way it treats:
>
>    exp(-1/b) / f(b,k) = 0.02
>
> namely, not something that Maxima can do anything useful with....
>
> However, you can work on this problem in the following simple way:
>
> (%i1) eq1: b*(k - 1) = 0.1\$
>
> I will express eq2 as its left-hand-side minus its right-hand-side for
> convenience later.
>
> (%i2) eq2: exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) - 0.02\$
>
> (%i3) solve(eq1,b);
> rat: replaced -0.1 by -1/10 = -0.1
> (%o3) [b=1/(10*k-10)]
> (%i4) subst(%o3,eq2);
> (%o4) %e^(10-10*k)*(sum((10*k-10)^i/i!,i,0,k-1))-0.02
>
> Now we have an expression in one integer variable, so we can just evaluate
> it at the relevant integers....
>
> (%i9) makelist(subst(j,k,%o4),j,1,10);
> (%o9)
> [-0.02,%e^(-10)*(sum(10^i/i!,i,0,1))-0.02,%e^(-20)*(sum(20^i/i!,i,0,2))-0.02,%e^(-30)*(sum(30^i/i!,i,0,3))-0.02,%e^(-40)*(sum(40^i/i!,i,0,4))-0.02,%e^(-50)*(sum(50^i/i!,i,0,5))-0.02,%e^(-60)*(sum(60^i/i!,i,0,6))-0.02,%e^(-70)*(sum(70^i/i!,i,0,7))-0.02,%e^(-80)*(sum(80^i/i!,i,0,8))-0.02,%e^(-90)*(sum(90^i/i!,i,0,9))-0.02]
>
> Now expand the sums and calculate numerical results:
>
> (%i10) %,sum,numer;
> (%o10)
> [-0.02,-.01950060077261267,-.01999954448504944,-0.0199999995338968,-.01999999999949795,-.01999999999999945,-0.02,-0.02,-0.02,-0.02]
>
> It doesn't look as though this is ever near zero, so no solutions.
>
>             -s
>
>
> On Wed, May 9, 2012 at 2:47 PM, Jason Filippou <jason.filippou at gmail.com>
> wrote:
>>
>> Pardon, the second equation (2) should read (as is implied by the
>> output that I typed in):
>>
>> (%i7) exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1) = 0.02;
>>                                  k - 1
>>                                  ====
>>                            - 1/b \       1
>> (%o7)                     %e       >    ----- = 0.02
>>                                  /      i
>>                                  ====  b  i!
>>                                  i = 0
>>
>>
>>
>> Still no luck though.
>>
>> Jason
>>
>> On Wed, May 9, 2012 at 9:46 PM, Jason Filippou <jason.filippou at gmail.com>
>> wrote:
>> > Good afternoon.
>> >
>> > I've been using  Maxima 5.21.1 in a Debian GNU / Linux 2.6.32-5-686
>> > system to solve a particular two equation system that I have to. The
>> > system is as follows:
>> >
>> > (1): b*(k - 1) = 0.1
>> >
>> > (2): exp(-1/b) / sum(i! * b^i, i, 0, k -1) = 0.02
>> >
>> > I've been using solve/2 for this, but I've been returned an empty
>> > solution set. Namely:
>> >
>> > %i9) solve([b * (k - 1) = 0.1, exp(-1/b) / sum(i! * b^i, i, 0, k -1) =
>> > 0.02], [b, k]);
>> >
>> > rat: replaced -0.1 by -1/10 = -0.1
>> >
>> > rat: replaced -0.02 by -1/50 = -0.02
>> > (%o9)                                 []
>> >
>> > Now, normally I would assume that this means that the system doesn't
>> > have a solution, but after substituting beta with its equivalent from
>> > the first equation, i.e 0.1 / (k - 1), I noticed that the evaluation
>> > of the second equation halts after a couple of steps:
>> >
>> > (%i5) solve([exp(-(k - 1) / 0.1) * sum(1/(i! * (0.1 / (k-1))^i), i, 0,
>> > k -1) = 0.02], [k]);
>> >
>> > rat: replaced -0.02 by -1/50 = -0.02
>> >
>> > rat: replaced 0.1 by 1/10 = 0.1
>> >
>> > rat: replaced 10.0 by 10/1 = 10.0
>> >                                %i %pi
>> >                                ------
>> >                                  5
>> >         1 - k                %e
>> > (%o5) [%e      = -----------------------------------,
>> >                             k - 1
>> >                             ====    i        i
>> >                  1/10  1/5  \     10  (k - 1)  1/10
>> >                 2     5    ( >    ------------)
>> >                             /          i!
>> >                             ====
>> >                             i = 0
>> >                        2 %i %pi
>> >                        --------
>> >                           5
>> >  1 - k               %e
>> > %e      = -----------------------------------,
>> >                      k - 1
>> >                      ====    i        i
>> >           1/10  1/5  \     10  (k - 1)  1/10
>> >          2     5    ( >    ------------)
>> >                      /          i!
>> >                      ====
>> >                      i = 0
>> >                        3 %i %pi
>> >                        --------
>> >                           5
>> >  1 - k               %e
>> > %e      = -----------------------------------,
>> >                      k - 1
>> >                      ====    i        i
>> >           1/10  1/5  \     10  (k - 1)  1/10
>> >          2     5    ( >    ------------)
>> >                      /          i!
>> >                      ====
>> >                      i = 0
>> >                        4 %i %pi
>> >                        --------
>> >                           5
>> >  1 - k               %e
>> > %e      = -----------------------------------,
>> >                      k - 1
>> >                      ====    i        i
>> >           1/10  1/5  \     10  (k - 1)  1/10
>> >          2     5    ( >    ------------)
>> >                      /          i!
>> >                      ====
>> >                      i = 0
>> >  1 - k                      1
>> > %e      = - -----------------------------------,
>> >                        k - 1
>> >                        ====    i        i
>> >             1/10  1/5  \     10  (k - 1)  1/10
>> >            2     5    ( >    ------------)
>> >                        /          i!
>> >                        ====
>> >                        i = 0
>> >    5 k - 4 %i %pi - 5
>> >  - ------------------
>> >            5                             1
>> > %e                     = -----------------------------------,
>> >                                     k - 1
>> >                                     ====    i        i
>> >                          1/10  1/5  \     10  (k - 1)  1/10
>> >                         2     5    ( >    ------------)
>> >                                     /          i!
>> >                                     ====
>> >                                     i = 0
>> >    5 k - 3 %i %pi - 5
>> >  - ------------------
>> >            5                             1
>> > %e                     = -----------------------------------,
>> >                                     k - 1
>> >                                     ====    i        i
>> >                          1/10  1/5  \     10  (k - 1)  1/10
>> >                         2     5    ( >    ------------)
>> >                                     /          i!
>> >                                     ====
>> >                                     i = 0
>> >    5 k - 2 %i %pi - 5
>> >  - ------------------
>> >            5                             1
>> > %e                     = -----------------------------------,
>> >                                     k - 1
>> >                                     ====    i        i
>> >                          1/10  1/5  \     10  (k - 1)  1/10
>> >                         2     5    ( >    ------------)
>> >                                     /          i!
>> >                                     ====
>> >                                     i = 0
>> >    5 k - %i %pi - 5
>> >  - ----------------
>> >           5                            1
>> > %e                   = -----------------------------------,
>> >                                   k - 1
>> >                                   ====    i        i
>> >                        1/10  1/5  \     10  (k - 1)  1/10
>> >                       2     5    ( >    ------------)
>> >                                   /          i!
>> >                                   ====
>> >                                   i = 0
>> >  1 - k                    1
>> > %e      = -----------------------------------]
>> >                      k - 1
>> >                      ====    i        i
>> >           1/10  1/5  \     10  (k - 1)  1/10
>> >          2     5    ( >    ------------)
>> >                      /          i!
>> >                      ====
>> >                      i = 0
>> >
>> > And then if I try to "solve" it any further I get no solutions:
>> >
>> > (%i6) solve(%, [k]);
>> > (%o6)                                 []
>> >
>> > What am I doing wrong here?
>> >
>> > Thanks,
>> >
>> > Jason
>> >
>> > --
>> > Jason Filippou
>> > Research Associate
>> > NCSR Demokritos
>> > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/
>> > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/
>> >
>> >
>> > --
>> > Jason Filippou
>> > Research Associate
>> > NCSR Demokritos
>> > NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/
>> > D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/
>>
>>
>>
>> --
>> Jason Filippou
>> Research Associate
>> NCSR Demokritos
>> NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/
>> D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>

--
Jason Filippou
Research Associate
NCSR Demokritos
NCSR Webpage: http://users.iit.demokritos.gr/~jfilip/
D.I.T Webpage: http://cgi.di.uoa.gr/~std06142/