Introduction
Continued fractions offer a powerful way to express numbers through nested integer expansions, revealing deep structural patterns within number theory. This calculator performs the expansion of rational numbers into continued fractions, a fundamental process in number theory. It allows for the exploration of the relationship between a ratio and its representation as a sequence of integers. This is particularly useful for identifying the underlying structure of numerical values and finding optimal rational approximations through the study of convergents.
What this calculator does
Processes a numerator and a denominator to generate a continued fraction sequence. It produces a list of partial quotients, a step-by-step calculation process, and a table of convergents. Additional outputs include the decimal equivalent, the expansion type (finite or infinite), the number of terms, error bounds for each convergent, and verification of Legendre's criterion for rational approximations.
Formula used
The expansion follows the iterative algorithm where is the floor of the ratio. The convergents are calculated using recursive relations. Here, represents the nth partial quotient, is the convergent numerator, and is the convergent denominator.
How to use this calculator
1. Enter the numerical value for the Numerator .
2. Enter the numerical value for the Denominator .
3. Select the preferred number of decimal places for the output display.
4. Execute the calculation to view the expansion and convergents.
Example calculation
Scenario: A student is analysing the rational approximation of a specific ratio in a number theory assignment to determine its sequence of convergents.
Inputs: Numerator ; Denominator .
Working:
Step 1: remainder
Step 2: remainder
Step 3: remainder
Step 4: remainder
Result: [2; 1, 4, 3]
Interpretation: The ratio is represented as a finite continued fraction with four partial quotients.
Summary: The expansion terminates, confirming the input is a rational number.
Understanding the result
The continued fraction notation shows the integer components of the fraction. Convergents provide the best rational approximations. Legendre's criterion indicates if a convergent is sufficiently close to the target value such that no other fraction with a smaller denominator is closer.
Assumptions and limitations
The calculator assumes the inputs are real numbers within the range of -1,000,000,000,000 and 1,000,000,000,000. It limits the expansion to 100 terms or 20 convergents. Floating-point precision constraints apply to very small remainders or extremely large denominators.
Common mistakes to avoid
Common errors include attempting to use scientific notation, which is not permitted, or entering a denominator of zero. Users should also ensure they do not exceed 20 decimal places in their inputs, as the system enforces strict validation on decimal length to maintain numerical stability.
Sensitivity and robustness
The calculation is stable for standard rational numbers. However, small variations in the input, particularly in the decimal places, can significantly alter the partial quotients and the length of the expansion. The tool is robust against precision errors by utilizing a small epsilon value during floor operations.
Troubleshooting
If an error message appears regarding "Invalid session", refresh the page to reset the security token. If the expansion is marked as "Infinite/Incomplete", the number of terms reached the internal limit or the precision threshold was triggered before the remainder reached absolute zero.
Frequently asked questions
What does the Max Error Bound represent?
It is the maximum possible difference between the convergent value and the actual decimal equivalent, calculated using the denominator of the next convergent.
Why is scientific notation prohibited?
The system is designed for direct numerical input to ensure precise string handling and validation of decimal places without floating-point conversion errors.
What is Legendre's Criterion?
It is a condition stating that if the absolute error is less than one divided by twice the square of the denominator, the fraction is a convergent of the value.
Where this calculation is used
Continued fractions are utilised in number theory to solve Diophantine equations and to approximate irrational numbers like or the square root of two. In mathematical modelling, they help identify periodic patterns in sequences. Academically, they are used in the study of Euclidean algorithms and the analysis of chaotic systems where rational approximations are required for complex ratios. They also appear in environmental science and population studies when modelling cyclical behaviour with high precision.
Results are based on standard mathematical and statistical methods and may involve rounding or approximation. If precise accuracy is required, please verify results independently. See full disclaimer.