Ask your own question, for FREE!
Mathematics 9 Online
OpenStudy (anonymous):

Program for Bhaskara:

OpenStudy (anonymous):

The error message i am getting is: Error, (in Brounker) cannot determine if this expression is true or false: abs(a[200]/b[200]-5^(1/2)) < tol

OpenStudy (anonymous):

isn't this the math forum :D

OpenStudy (anonymous):

Brounker:=proc(n,m,tol) local a,b,i; a[1]:=1; b[1]:=1; for i from 1 to m-1 do a[i+1]:=a[i]+b[i]*n; b[i+1]:=a[i]+b[i]; if abs(a[m]/b[m]-sqrt(n))<tol then return a[m]/b[m]; end if; end do; return "Bb FAIL" end proc;

OpenStudy (anonymous):

its the tolerence (tol)limit i am getting trouble with

OpenStudy (experimentx):

huh? isn't this conway problem?

OpenStudy (anonymous):

na, this is a different one

OpenStudy (experimentx):

what is your algorithm? i can't read that ...

OpenStudy (anonymous):

for i from 1 to m-1 do a[i+1]:=a[i]+b[i]*n; b[i+1]:=a[i]+b[i];

OpenStudy (anonymous):

its suppose to give an approximation of sqrt(n)

OpenStudy (experimentx):

Man ... i always use Newton's Rhapson's method for approximating ... can you give me some link

OpenStudy (anonymous):

hold on

OpenStudy (anonymous):

you know what i think the problem might just be asking me to output the error, meaing the abs value of the final iterate -the sqrt(n) I think i got it, sorry was wasting your time

OpenStudy (experimentx):

do you necessarily need to use recursion?

OpenStudy (experimentx):

try this squareroot := proc (Q, n) option remember; description `What the hell`; if n = 1 then return (1+Q)/(1+1) else return (squareroot(Q, n-1)+Q)/(squareroot(Q, n-1)+1) end if end proc squareroot(2, 12)

OpenStudy (experimentx):

squareroot := proc (Q, n) option remember; description `I don't understand coding in Maple`; if n = 1 then return 1/2+(1/2)*Q else return (squareroot(Q, n-1)+Q)/(squareroot(Q, n-1)+1) end if end proc

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!