Talk:Continued fraction: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Related tasks: moebius function)
Line 11: Line 11:
== Related tasks ==
== Related tasks ==


===Thiele interpolation===
One might be [[Thiele's interpolation formula]]. —[[User:Sonia|Sonia]] 21:59, 27 February 2012 (UTC)
One might be [[Thiele's interpolation formula]]. —[[User:Sonia|Sonia]] 21:59, 27 February 2012 (UTC)


:When the structure of the solution: a CF object; generators for aN and bN; and translation from the exact CF object to a real number, is established then we can tackle the Thiele task properly. Note that the cf representation for: arcsin is http://www4b.wolframalpha.com/input/?i=continued%20fraction%20arcsin%28x%29&lk=2; arccos is http://www.wolframalpha.com/input/?i=arcos%28z%29+continued+fraction+representations; and arctan is http://www4b.wolframalpha.com/input/?i=continued%20fraction%20arctan%28x%29&lk=2.
:When the structure of the solution: a CF object; generators for aN and bN; and translation from the exact CF object to a real number, is established then we can tackle the Thiele task properly. Note that the cf representation for: arcsin is http://www4b.wolframalpha.com/input/?i=continued%20fraction%20arcsin%28x%29&lk=2; arccos is http://www.wolframalpha.com/input/?i=arcos%28z%29+continued+fraction+representations; and arctan is http://www4b.wolframalpha.com/input/?i=continued%20fraction%20arctan%28x%29&lk=2.

===Moebius function===

I recently read an interesting paper about nested datasets and continued fractions. One of the useful thing that can be done in this regard is to turn a continued fraction into a Moebius function:

http://www.sigmod.org/sigmod/record/issues/0506/p47-article-tropashko.pdf

:<math>a_0 + \cfrac{b_1}{a_1 + \cfrac{b_2}{a_2 + \cfrac{b_3}{a_3 + x}}} = \frac{A_3+B_3x}{C_3+D_3x}</math>

The purpose would be to compute <math>A_n</math>, <math>D_n</math>, <math>C_n</math> and <math>D_n</math> for any n.--[[User:Grondilu|Grondilu]] 00:55, 16 October 2012 (UTC)


== creating a continued fraction ==
== creating a continued fraction ==

Revision as of 00:55, 16 October 2012

Task name

Should the task name be Generalized continued fractions? Both Mathworld and Wikipedia note that these is more properly called generalized continued fractions and that the term continued fraction is most often used for simple continued fractions. —Sonia 21:41, 27 February 2012 (UTC)

In principal Continued Fractions are generalized in the sense that they work for all numbers. In computer terms it is often required to handle Integers, Rationals, Reals, and Complex Numbers seperately. For this task it is sufficent for cf to work with Integers. A solution which switches between Integer and Floating Point will not be able to generate the exact solution that for instance the Python and Haskell solutions do. Having to implement cf for all types of number would make the task more time consuming and detract from the structure of the solution: a CF object; generators for aN and bN; and translation from the exact CF object to a real number.--Nigel Galloway 16:11, 29 February 2012 (UTC)

Subscript convention

Both Mathworld and Wikipedia use a subscript convention different that what is used in the task description. It might be best to match their convention. —Sonia 21:43, 27 February 2012 (UTC)

Related tasks

Thiele interpolation

One might be Thiele's interpolation formula. —Sonia 21:59, 27 February 2012 (UTC)

When the structure of the solution: a CF object; generators for aN and bN; and translation from the exact CF object to a real number, is established then we can tackle the Thiele task properly. Note that the cf representation for: arcsin is http://www4b.wolframalpha.com/input/?i=continued%20fraction%20arcsin%28x%29&lk=2; arccos is http://www.wolframalpha.com/input/?i=arcos%28z%29+continued+fraction+representations; and arctan is http://www4b.wolframalpha.com/input/?i=continued%20fraction%20arctan%28x%29&lk=2.

Moebius function

I recently read an interesting paper about nested datasets and continued fractions. One of the useful thing that can be done in this regard is to turn a continued fraction into a Moebius function:

http://www.sigmod.org/sigmod/record/issues/0506/p47-article-tropashko.pdf

The purpose would be to compute , , and for any n.--Grondilu 00:55, 16 October 2012 (UTC)

creating a continued fraction

This would be a good tie-in to another (as yet, unmentioned) Rosetta Code task: generate a continued fraction. -- Gerard Schildberger 20:29, 24 March 2012 (UTC)

expressing as a true fraction

By the way, it doesn't take that much to add some code to the subroutine to return the result at a true fraction, i.e.:
cff(0 3 1 1 1 2)
would return
8/29
(that is, the four characters "8/29".
cff(9 2 2)
would return 47/5

This necessiitated (for the REXX subroutine) in writing a subroutine to handle arithmetic [+ - * ^ ÷ // %] functions
on/for true fractions (including whole numbers and improper fractions, including negative fractions),
which would also be a good task for Rosetta Code. -- Gerard Schildberger 21:03, 24 March 2012 (UTC)

Gold Credit for pi and The Harmonic Series

REXX has already claimed all the extra credits for this task, however for those implementations which can accept a fractional a_series a Gold Credit has been found for demonstrating the relationship between pi and The Harmonic Series:

This was published in American Mathmatical Monthly, December 2008 by Dr. Tom Picket, an associate Professor in the Physics Faculty of The University of Southern Indiana.--Nigel Galloway 12:49, 12 September 2012 (UTC)