![]() |
[QUOTE=jinydu;85897]Mathematica seems to be behaving strangely. I'm getting:
ContinuedFraction[0.3] = {0, 3} ContinuedFraction[3/10] = {0, 3, 3} Even worse: ContinuedFraction[0.2] = {0}[/QUOTE] Use PARI/GP, then. :cool: gp>contfrac(0.3) %104 = [0, 3, 3] gp>contfrac(3/10) %105 = [0, 3, 3] gp>contfrac(0.2) %106 = [0, 5] |
[QUOTE=jinydu;85897]Mathematica seems to be behaving strangely. I'm getting:
ContinuedFraction[0.3] = {0, 3} ContinuedFraction[3/10] = {0, 3, 3} Even worse: ContinuedFraction[0.2] = {0}[/QUOTE] The Mathematica strange behaviour continues by introducing a small error ContinuedFraction[0.2-10^-10] returns {0,5} and ContinuedFraction[0.2+10^-10] returns {0,4,1} This is on version 4.1 |
I'm using Version 4.0.2. Are you saying that this problem is fixed in versions newer than 4.1?
In any case, given that such errors occur, I'm not so sure that I can trust the answer that Mathematica gives for, say: ContinuedFraction[[tex]\pi^3[/tex]] |
[QUOTE=alpertron;85861]Yes, it agrees with the first line I wrote above: 0.3 = [3, 3]. It appears that your notation [0;3,3] is 0+[3,3] (or [3,3])
Continuing with the problem set by the original poster, if the number in question is 0.12345678910111213141516... (which is obviously irrational) we find its continued fraction expansion: [ 8 , 9 , 1 , 149083 , 1 , 1 , 1 , 4 , 1 , 1 , 1 , 3 , 4 , 1 , 1 , 1 , 15 , 4575401113910310764836466282429561185996039397104575\ 5500066200439309026265925631493795320774712865626829\ 1352511788034072479309738318986794132119711326023863\ 081376170, 6 , 4 , 1 , 5 , 1 , 1 , ...] If we convert the continued fraction to standard fractions just before the huge coefficients we get: 10 / 81 60499999499 / 490050000000 The first 189 digits of the last number agrees with the decimal expansion of our irrational number.[/QUOTE]Indeed, the presence of a particularly large term in the CF expansion of a number indicates that it is especially well represented by a rational approximation. There can be practical benefits of observing such things. For instance, it can have cryptographic significance. See the justly famous Blum, Blum & Shub paper for a concrete example. Yes, I am being deliberately obscure in the hope that you'll put just a little effort into tracking down the paper mentioned. The effort brings its own rewards. Paul |
[QUOTE=alpertron;85861]Yes, it agrees with the first line I wrote above: 0.3 = [3, 3]. It appears that your notation [0;3,3] is 0+[3,3] (or [3,3])
Continuing with the problem set by the original poster, if the number in question is 0.12345678910111213141516... (which is obviously irrational) we find its continued fraction expansion: [ 8 , 9 , 1 , 149083 , 1 , 1 , 1 , 4 , 1 , 1 , 1 , 3 , 4 , 1 , 1 , 1 , 15 , 4575401113910310764836466282429561185996039397104575\ 5500066200439309026265925631493795320774712865626829\ 1352511788034072479309738318986794132119711326023863\ 081376170, 6 , 4 , 1 , 5 , 1 , 1 , ...] If we convert the continued fraction to standard fractions just before the huge coefficients we get: 10 / 81 60499999499 / 490050000000 The first 189 digits of the last number agrees with the decimal expansion of our irrational number.[/QUOTE]Simple exercise: predict when the next huge coefficient occurs in the CF expansion of this number. Explain your reasoning. Slightly harder exercise: find the next huge coefficient and see whether its position is in accordance with your prediction. Further exercise: repeat the previous two exercises until you run out of computational resources. Paul |
[QUOTE=xilman;85913]Indeed, the presence of a particularly large term in the CF expansion of a number indicates that it is especially well represented by a rational approximation. There can be practical benefits of observing such things. For instance, it can have cryptographic significance. See the justly famous Blum, Blum & Shub paper for a concrete example. Yes, I am being deliberately obscure in the hope that you'll put just a little effort into tracking down the paper mentioned. The effort brings its own rewards.
Paul[/QUOTE] Indeed. The presence of such a large term early on also strongly suggests that the number is transcendental, because Thue's Theorem limits how quickly the denominators can grow for ALGEBRAIC irrationals. |
[QUOTE=xilman;85913]Indeed, the presence of a particularly large term in the CF expansion of a number indicates that it is especially well represented by a rational approximation. There can be practical benefits of observing such things. For instance, it can have cryptographic significance. See the justly famous Blum, Blum & Shub paper for a concrete example. Yes, I am being deliberately obscure in the hope that you'll put just a little effort into tracking down the paper mentioned. The effort brings its own rewards.
Paul[/QUOTE] Indeed. The presence of such a large term early on also strongly suggests that the number is transcendental, because Thue's Theorem limits how quickly the denominators can grow for ALGEBRAIC irrationals. |
[QUOTE=xilman;85914]Simple exercise: predict when the next huge coefficient occurs in the CF expansion of this number. Explain your reasoning.
Slightly harder exercise: find the next huge coefficient and see whether its position is in accordance with your prediction. Further exercise: repeat the previous two exercises until you run out of computational resources. Paul[/QUOTE] This is a known constant. See: [URL="http://mathworld.wolfram.com/ChampernowneConstant.html"]http://mathworld.wolfram.com/ChampernowneConstant.html[/URL] |
It is clear that this number must have very large coefficients in the continued fraction expansion:
From: [tex]\large \frac{1}{\left(10^n-1\right)^2} = \frac{1}{10^{2n}} + \frac{2}{10^{3n}} + \frac{3}{10^{4n}} + ...[/tex] Now we multiply by a power p of 10 such that the consecutive numbers of n digits are in the same location than the Champernowne constant C. For example when n=2, p=11. Let B be this product. Now the product has 9n(10[sup]n-1[/sup]) - n - 1 digits equals to C starting from the digit G(n) (G(2) = 10, G(3) = 190, G(4) = 2890, ..., G(n) = G(n-1) + 9(n-1)(10[sup]n-2[/sup])). (Notice that G(n) is near (n-1)10[sup]n-1[/sup]). This means that the difference between C and the product is very near a fraction whose denominator is 10[sup]G(n)-1[/sup]. Call it D. Now B - D is extremely near to C, with about n 10[sup]n[/sup] digits correct, while the denominator of D - B is lcm ((10[sup]n[/sup]-1)[sup]2[/sup], 10[sup]G(n)-1[/sup]) which has about (n-1)10[sup]n-1[/sup] digits. This implies a very huge coefficient in the continued fraction expansion of the constant, which are larger when n increases. |
[QUOTE=alpertron;85926]It is clear that this number must have very large coefficients in the continued fraction expansion:[/QUOTE]Thank you! :bow:
i'm always pleased when someone takes seriously my suggestions of worthwhile "exercises", which are sometimes trivial to answer and sometimes turn out to be research problems. Paul |
I would like to repeat the question I asked earlier, lest it be forgotten:
[QUOTE=jinydu;85911]I'm using Version 4.0.2. Are you saying that this problem is fixed in versions newer than 4.1? In any case, given that such errors occur, I'm not so sure that I can trust the answer that Mathematica gives for, say: ContinuedFraction[[tex]\pi^3[/tex]][/QUOTE] |
| All times are UTC. The time now is 22:11. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.