Approximations rationnelles / Fractions continues

Please enter a valid decimal

Exemple rapide :

)

Error:

Description de l'algorithme :

Number of Terms Expanded
Terms
x = a₀ + 1/(a₁ + 1/(a₂ + 1/(a₃ + ...)))
Number of Continued Fractions
  • Count
  • Calculation Time
  • Expansion Type
  • Finite
  • Truncated
  • Calculation Complete!
    Enter a number and click "Start Calculation"
    n/qnCollapse
    • p-1 = 1, q-1 = 0
    • p0 = a₀, q0 = 1
    • Recurrence Formula: pn = an·pn-1 + pn-2
    • Recurrence Formula: qn = an·qn-1 + qn-2
    • Continued fractions provide the best rational approximation of the original number
    3. Best Rational Approximations:
    • Given a real number x and an upper bound Q for the denominator, find a fraction p/q (q ≤ Q) that minimizes |x - p/q|
    • The convergents of a continued fraction provide all the best rational approximations
    • If p/q is a convergent of x, then for all q' < q, we have |x - p/q| < |x - p'/q'|
    4. Continued Fractions of Special Numbers:
    • The Golden Ratio φ:[1; 1, 1, 1, 1, ...] (all ones, slowest convergence)
    • √2:[1; 2, 2, 2, 2, ...] (periodic continued fraction)
    • e:[2; 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, ...] (patterned)
    • π:[3; 7, 15, 1, 292, 1, ...] (no obvious pattern)

    Algorithm Complexity:

    • Time Complexity:O(n), where n is the number of terms expanded
    • Space Complexity:O(n), requires storing all coefficients and convergents
    • Numerical Stability:Using high-precision floating-point or big integers avoids precision loss

    Cas d'utilisation :

    • Numerical Computation:Approximate complex irrational numbers with simple fractions (e.g., π ≈ 22/7, 355/113)
    • Music Theory:Interval consonance related to the simplicity of continued fraction expansions
    • Astronomy:Rational approximations for calculating planetary orbital periods
    • Number Theory:Diophantine approximations and solutions to Pell's equation
    • Computer Graphics:Bresenham's line algorithm and more