Mathematics experiment-best fraction approximation (Mathematica implementation)

1. Experiment name : Best fractional approximation

2. Experimental environment : Mathematica 10.3 software

3. Purpose of the experiment : To study how to use fractional approximation to make the best approximation to a given irrational number. "Best" means that the error must be small and the denominator must be small. We first need to set specific and clear criteria for "best", and we also need to find a simple and easy algorithm to find the best approximation of the score.

4. Experiment content:

1. Fractions are the best approximation to irrational numbers

       Take n=50, let the denominator qtake nthe integer values ​​​​from 1 to , and for each denominator q, q*\piround to an integer pas the denominator, so as to obtain the qclosest \alphaapproximation of the fraction with the denominator \frac{p}{q}.

1. The continued fraction expansion of π

2. Continued fraction expansion of real numbers

\frac{17}{47}Continued fractions        will be expanded and verified.

5. Experimental results and result analysis

1. The best approximation of fractions to irrational numbers

Result analysis\alpha : By observing the experimental results, the closest fractional approximation with the denominator q can be obtained \frac{p}{q}.

2. \piThe continued fraction expansion

Result analysis : The results we obtained are already relatively close \pi, but if we continue this process, the approximate values ​​obtained will become closer and closer \pi

3. Continued fraction expansion of real numbers

 

Guess you like

Origin blog.csdn.net/qq_45823589/article/details/132889195