Re: matrices, dot products and convergents of continued fractions
- To: mathgroup at smc.vnet.net
- Subject: [mg23406] Re: [mg23402] matrices, dot products and convergents of continued fractions
- From: "Richard Finley" <rfinley at medicine.umsmed.edu>
- Date: Sat, 6 May 2000 19:14:14 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Matt, Perhaps I am just not understanding what you are trying to do, but your definition of contfrac1 always gives an integer result so your definition of aak will always give an error if b>0 (since it exceeds the depth of the atomic result). Perhaps you could explain what you actually want them to compute. regards, RF >>> "Matthew Herman" <henayni at hotmail.com> 05/06/00 12:26AM >>> hi, It is known that you can compute convergents of continued fractions using matrices and dot products. I am having a problem, maybe you guys could help. aak2[x_, y_] := Table[aak[x, b, y], {b, 1, y}] aak[x_, b_, y_] := {{1, contfrac1[x, y][[b]]}, {1, 1}} contfrac1[a_,b_]:= If[IntegerQ[Numerator[a]] && IntegerQ[Denominator[a]], ContinuedFraction[a][[1]],ContinuedFraction[a,b][[1]]] I want to take Dot[aak[x,b,y]], but there are 2 braces on the outside that prevent me from doing this. Anyone have an idea on how to workaround that? Matt ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com