Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Assume that

w[n_] :=Expand[Sum[Binomial[n - k - 1, k]*(-1)^k*A^(n - 2*k - 1), {k, 0, n - 1}]]
f[y_, z_]:=PolynomialRemainder[(w[z] - 1)*(w[y] - 1), (w[i] - 1), A]
h[{y_, z_}] :=Quiet[N[FindRoot[Abs[f[y, z]] - w[i] + 1 == 0, {A, 10000000}]]]
For[i = 153, i < 210, i++,Print[{i}, Max[ParallelMap[h, Subsets[Range[i + 1, 210], {2}]]]]]

According to above code, there are lots of roots.

But, when I try to find them with NSolve, there is no root. Why?

share|improve this question
    
Actually it gives and a lot of them! One question why you have chosen 10000000 as the initial value? For that initial value it seems that the method is diverging ... –  Spawn1701D Apr 10 '13 at 22:45
    
@Spawn1701D,Because i want to find the greatest root for all cases. and i guess only where the root? Why does it give? When i try to solve with NSolve, i could not have any solutions. –  MATIRMAK Apr 10 '13 at 22:47
    
Try just one step, take i = 153 construct the subset Subsets[Range[i + 1, 210], {2}]and take the first pair. if you run h you will get {A -> 5.16816*10^6} substitute this value on Abs[f[y, z]] - w[i] + 1 == 0 and you will get a huge number, in other word for that initial value the method diverges. –  Spawn1701D Apr 10 '13 at 22:51
add comment

1 Answer

Try this for h:

h[{y_, z_}] :=Quiet[NSolve[Abs[f[y, z]] - w[i] + 1 == 0, A,Reals]]

Also Max won't work try instead this

For[i = 153, i < 210, i++,
    Print[{i}, ParallelMap[Sort[h[#]][[-1]]&, Subsets[Range[i + 1, 210], {2}]]]]]

or alternatively,

For[i = 153, i < 210, i++,
    Print[{i}, ParallelMap[{A->Max[h[#][[All,All,2]]]}&, Subsets[Range[i + 1, 210], {2}]]]]]

(using Sort is faster)

share|improve this answer
    
Thank you for your attention. –  MATIRMAK Apr 11 '13 at 10:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.