Question: Troubleshooting: Error, cannot determine if this expression is true or false

I am trying to see if I can run a program looking at the tendency of clustering within groups - basically to see if something occurs within sequential members of a group versus not clustering within the group. I simply wanted to see the indexmax expected tendency to sequentially cluster followed by the probability of exceeding that index max. However, I keep getting the error:  "Error, cannot determine if this expression is true or false: Dmax < 0”. Is there any quick fix to this? 

 

restart;

G = unapply((x-y+1)*X/binomial(x, y)+1-(x-y+1)/binomial(x, y), x, y); PSI := G(3, 2)^10*G(4, 2)^4*G(4, 3)^2*G(5, 2)^2*G(5, 4)*G(5, 3)*G(6, 2)^4*G(7, 3)*G(8, 2)*G(9, 2)*G(9, 3)*G(9, 4)*G(10, 2)^2*G(11, 2)*G(11, 3)*G(12, 3)*G(13, 3)*G(15, 2)^2;

evalf(expand(PSI));

for i from 0 to degree(PSI) do D . i = evalf(coeff(PSI, X, i)) end do; Dmax = 0; for i from 0 to degree(PSI) do if D . i > Dmax then index = i; Dmax = D . i end if end do;

 

Error, cannot determine if this expression is true or false: Dmax < 0

 

mean := sum('i*D . i', 'i' = 1 .. degree(PSI));

indexmax := index;

Proba := sum('D . i', 'i' = 20 .. degree(PSI));

Please Wait...