MathGroup Archive 1999

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

Search the Archive

need help.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19086] need help.
  • From: "Ayad Soufiane" <ayad_s at hotmail.com>
  • Date: Thu, 5 Aug 1999 01:35:07 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

I wrote this program for Mathematica 3.0 the logic seems to be correct, the 
output is not,
do you have any idea about what is the problem ?
The same program was run under a Windows machine using the new symbole 
\[Sum]\ of Mathematica 3, the output was different, it was giving a correct 
result without any problem,
the thing is I need powerful unix machine to run this program, and the 
windows machine that I have is not fit for the job.

Regards,
Ayad Soufiane

---------------
Listing of the Program
---------------

Print[StringForm["  App. Num.  "]];
Print[StringForm["========================================================"]];
For[ Split1=3, Split1 <5, Split1++,
g=2;
Beta1=1;
nmax=Split1*(g-1);
lng[x_]=Log[x]/Log[g];
Pr[i_]=lng[1+1/i];
c[Split1_]=lng[Split1+1];
Start[Split1_]=g^(c[Split1]);
End1[Split1_]=g^(c[Split1]+1)-1;
TableSize[Split1_]=End1[Split1]-Start[Split1]+1;
LoadFactor[N1_,Split1_]=N1/TableSize[Split1];
Ro[i_,N1_]=1/N1;
P[N1_,i_,j_]=Binomial[N1,j]*Pr[i]^(j)*(1-Pr[i])^(N1-j);
Alpha1[i_,j_,k_,N1_]=If[i-1>=j-1,If[N1-1>=k-1,If[N1-i>=k-j,Binomial[i-1,j-1]*Binomial[N1-i,k-j]/Binomial[N1-1,k-1],0],0],0];
Gamma1[k_,j_,N1_]=If[k>=j,Sum[Alpha1[i,j,k,N1]*Ro[i,N1],{i,j,N1}],0];
q[N1_,h_,Split1_]=Sum[Pr[Ba]*Gamma1[j,h,N1]*P[N1,Ba,j],{Ba,Start[Split1],End1[Split1]},{j,1,N1}];
S[N1_,Split1_]=Sum[h*q[N1,h,Split1],{h,1,N1}]/Sum[Pr[i]*P[N1,i,j],{i,Start[Split1],End1[Split1]},{j,1,N1}];
Print[StringForm[" "]];
Print[StringForm[" "]];
Print[StringForm[" "]];
Print[StringForm["-----------------------------------------------"]];
Print[StringForm["*                                             *"]];
Print[StringForm["*                  Num. App.                  *"]];
Print[StringForm["*                                             *"]];
Print[StringForm["-----------------------------------------------"]];
Print[StringForm[" "]];
Print[StringForm[" "]];
Print[StringForm["Growth Factor   g        :  "],g];
Print[StringForm["Beta                     :  "],Beta1];
Print[StringForm["Split Number             :  "],Split1];
Print[StringForm["Start File               :  "],N[Start[Split1]]];
Print[StringForm["End File                 :  "],N[End1[Split1]]];
Print[StringForm["Table Size               :  "],N[TableSize[Split1]]];
Print[StringForm["Load Factor      Alpha   :  
"],N[LoadFactor[nmax,Split1]]];
Print[StringForm["Average Search Cost S("],N[nmax],StringForm[") :
"],N[S[nmax,Split1]]];
]


----------
Out-Put
----------

Mathematica 3.0 for HP-UX PA-RISC
Copyright 1988-97 Wolfram Research, Inc.
-- Motif graphics initialized --

In[1]:= App. Num.

In[2]:=
In[2]:= ========================================================

In[3]:=
In[3]:=
$MaxExtraPrecision::meprec:
   In increasing internal precision while attempting to evaluate
                1 + Log[4]/Log[2]
    Floor[-4 + 2                 ], the limit $MaxExtraPrecision = 50.
     was reached. Increasing the value of $MaxExtraPrecision may help 
resolve
     the uncertainty.

$MaxExtraPrecision::meprec:
   In increasing internal precision while attempting to evaluate
                1 + Log[4]/Log[2]
    Floor[-4 + 2                 ], the limit $MaxExtraPrecision = 50.
     was reached. Increasing the value of $MaxExtraPrecision may help 
resolve
     the uncertainty.

$MaxExtraPrecision::meprec:
   In increasing internal precision while attempting to evaluate
                1 + Log[4]/Log[2]
    Floor[-4 + 2                 ], the limit $MaxExtraPrecision = 50.
     was reached. Increasing the value of $MaxExtraPrecision may help 
resolve
     the uncertainty.

General::stop: Further output of $MaxExtraPrecision::meprec
     will be suppressed during this calculation.



-----------------------------------------------
*                                             *
*                  Num. App.                  *
*                                             *
-----------------------------------------------


Growth Factor   g        :  2
Beta                     :  1
Split Number             :  3
Start File               :  4.
End File                 :  7.
Table Size               :  4.
Load Factor      Alpha   :  0.75

                                 1
Power::infy: Infinite expression - encountered.
                                 0

Infinity::indet:
   Indeterminate expression
                                                           1
                                                   Log[1 + -]
                                                           i  3
     0 ComplexInfinity (Log[2] + <<1>>) <<1>> (1 - ----------)
                                                     Log[2]
     ---------------------------------------------------------- encountered.
                                        1  2         1
            Pi Log[2] (Log[2] - Log[1 + -])  Log[1 + -]
                                        i            i
Average Search Cost S(3.) : Indeterminate



-----------------------------------------------
*                                             *
*                  Num. App.                  *
*                                             *
-----------------------------------------------


Growth Factor   g        :  2
Beta                     :  1
Split Number             :  4
Start File               :  5.
End File                 :  9.
Table Size               :  5.
Load Factor      Alpha   :  0.8

                                 1
Power::infy: Infinite expression - encountered.
                                 0

Infinity::indet:
   Indeterminate expression
                                                           1
                                                   Log[1 + -]
                                                           i  4
     0 ComplexInfinity (Log[2] + <<1>>) <<1>> (1 - ----------)
                                                     Log[2]
     ---------------------------------------------------------- encountered.
                                        1  2         1
            Pi Log[2] (Log[2] - Log[1 + -])  Log[1 + -]
                                        i            i
Average Search Cost S(4.) : Indeterminate

In[4]:=
In[4]:=


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


  • Prev by Date: Re: Clippling of polygons within a defined region
  • Next by Date: Re: Packed Arrays in version 4
  • Previous by thread: Re: Wheel mouse under X.
  • Next by thread: (long) Re: need help.