DEV Community

Cover image for The Square Root Solution: Heron's Method in a Nutshell
Sakthi LK
Sakthi LK

Posted on

The Square Root Solution: Heron's Method in a Nutshell

Introduction

Unlock the power of Heron's method and simplify your square root calculations. This ancient technique offers a simple and accurate solution for finding square roots. From its historical roots to its modern-day applications, Heron's method is a game-changer in the field of mathematics and computer science. Learn more about it now!

Heron's method is an ancient mathematical technique that is used to approximate the square root of a number. Heron's method is also known as the Babylonian method. The method involves making an initial estimate of the square root, and then repeatedly averaging the estimate with the quotient of the number and the estimate to get a better approximation. The process is repeated until the desired level of accuracy is achieved.

This method can be used to find the square root of any number, regardless of its size. It is an efficient and simple way to find the square root and it has been widely used in the past and continues to be used today.

The History of Heron's Method

Heron's method is believed to have originated in ancient Mesopotamia, specifically in the city of Babylon, around 4th century BCE. The method was first described by the Greek mathematician Heron of Alexandria in his work "Metrica" that is a collection of geometric problems. But the method was used long before Heron wrote about it. The method was passed down through the centuries and was later used by the ancient Egyptians and the ancient Chinese.

The method was rediscovered in Europe during the Renaissance and became popular among mathematicians of the time, who used it to calculate square roots with greater accuracy. Heron's method was widely used until the 16th century, when it was eventually replaced by more accurate methods such as the Newton-Raphson method. However, Heron's method still has its uses today, particularly in situations where a high degree of accuracy is not necessary, or in situations where computational resources are limited.

The Principle of Heron's Method

Heron's method is an iterative method that is used to approximate the square root of a number.

The method works by making an initial estimate of the square root, and then repeatedly averaging the estimate with the quotient of the number and the estimate to get a better approximation.
The process is repeated until the desired level of accuracy is achieved.

Heron's Method: Square Root Formula

ca2+c2a \sqrt{c}≈\frac{a^2+c}{2a}

Example: Square Root of 3
3a2+32a \sqrt{3}\approx\frac{a^{2}+3}{2a}

Iteration - 1
Let's begin with a = 1 and use the approximated square root values as a.
312+32(1)    42=2 \sqrt{3}\approx\frac{1^{2}+3}{2(1)} \implies\frac{4}{2} = 2

Iteration - 2
a = 2
322+32(2)    74=1.75 \sqrt{3}\approx\frac{2^{2}+3}{2(2)} \implies \frac{7}{4} = 1.75

Iteration - 3
a = 1.75
31.752+32(1.75)    6.06253.5=1.7321428571 \sqrt{3}\approx\frac{1.75^{2}+3}{2(1.75)} \implies \frac{6.0625}{3.5} = 1.7321428571

Iteration - 4
a = 1.7321428571
3(1.7321428571)2+32(1.7321428571)    6.000318883.4642857142=1.7320508108 \sqrt{3}\approx\frac{(1.7321428571)^{2}+3}{2(1.7321428571)} \implies \frac{6.00031888}{3.4642857142} = 1.7320508108

Iteration - 5
a = 1.7320508108
3(1.7320508108)2+32(1.7320508108)    6.00000001123.4641016216=1.7320508076 \sqrt{3}\approx\frac{(1.7320508108)^{2}+3}{2(1.7320508108)} \implies \frac{6.0000000112}{3.4641016216} = 1.7320508076

The value of Square Root of 3 using Heron's Method is 1.7320508076, which accurate for about 9 decimal places. If the iteration goes on for another loop, the result will be more accurate and so on.

Comparison of Heron's method with other square root approximation methods

Heron's method can be more accurate and faster than other methods, such as the Newton-Raphson method or the bisection method, for certain inputs. One of the key advantages of Heron's method is that it uses only simple arithmetic operations, making it easy to implement and suitable for use in situations where computational resources are limited. However, it has a slow rate of convergence and is not always the best choice for very large or very small numbers.

Modern Variations and Improvements to Heron's method

There are several modern variations and improvements to Heron's method that have been proposed in recent years.

One such variation is the Aitken's delta-squared method, which is used to accelerate the convergence of Heron's method. This method involves using the difference between consecutive approximations to estimate the next approximation, which can significantly improve the rate of convergence.

Another variation is the use of continued fractions, which are a way of representing real numbers using a sequence of fractions. By expressing the square root as a continued fraction and using Heron's method to approximate each term in the sequence, it is possible to achieve high levels of accuracy.

A variation that uses the arithmetic-geometric mean (AGM) algorithm which is faster than Heron's method, AGM algorithm is based on the AGM of two positive numbers, and the square root of a number can be expressed in terms of this AGM.

Another method that is used to improve the accuracy of Heron's method is the use of high-precision arithmetic, such as multiprecision arithmetic. This allows for more accurate approximations to be computed, even for very large or very small numbers.

In general, Heron's method is still a very popular method for approximating square roots, due to its simplicity and ease of implementation, but there are more advanced and efficient methods available for high-precision computation.

Applications of Heron's Method in Mathematics and Science

In mathematics, Heron's method is used to calculate the square roots of numbers, which are used in many mathematical operations such as in trigonometry, geometry and algebra. It is also used in solving non-linear equations, for example, in solving the quadratic equations.

In science, Heron's method is used in many areas such as in physics, chemistry, and engineering. It is used to solve problems related to mechanics, thermodynamics, quantum mechanics, and many other areas. It is used to calculate the square root of complex numbers which are used in solving differential equations. It is also used in numerical analysis, statistics, computer science and other fields.

Applications of Heron's Method in Computer Science and Engineering

In computer science, Heron's method is used to calculate square roots in many applications such as in numerical analysis, computer graphics, and machine learning. It is used in numerical analysis to calculate square roots of large numbers, and also used in computer graphics to calculate the distance between two points in space. It is also used in machine learning, where the square root is used to calculate the variance of a data set.

Heron's method has also been improved and adapted over time with variations like the Aitken's delta-squared method which increases the efficiency of Heron's method, which is useful in fields like computer science, where computational resources can be limited.

In summary, Heron's method is an important tool in engineering and computer science, and its applications are diverse and wide-ranging. Its simplicity and ease of implementation make it suitable for use in many different fields, and its efficiency has been improved over time with variations like Aitken's delta-squared method.

Real-world examples of Heron's Method

  • In construction, Heron's method is used to calculate the square root of the area of a square, which is required to calculate the volume of a cylindrical tank.

  • In agriculture, Heron's method is used to calculate the square root of the area of a field, which is required to calculate the amount of fertilizer needed to cover the field.

  • In finance, Heron's method is used to calculate the square root of the present value of an investment, which is used to calculate the future value of the investment.

  • In weather forecasting, Heron's method is used to calculate the square root of the atmospheric pressure, which is used to calculate the wind speed.

Conclusion

Heron's method is simple and easy to implement, it uses only simple arithmetic operations. This method is used in many areas of mathematics and science, including trigonometry, geometry, algebra, physics, chemistry, engineering, and numerical analysis.

Modern variations and improvements to Heron's method have been proposed in recent years, such as Aitken's delta-squared method and AGM algorithm which are used to accelerate the convergence of Heron's method.

Heron's method has many real-world applications, including in construction, agriculture, finance, weather forecasting, engineering, and computer science. The best method will depend on the specific requirements of the application, including the desired level of accuracy, computational resources, and memory constraints.

Final Thoughts

In conclusion, Heron's method remains a valuable tool in mathematics and science today, its simplicity and ease of implementation make it accessible to a wide range of users, and its efficiency has been improved over time with variations. It's important to note that the best method will depend on the specific requirements of the application, including the desired level of accuracy, computational resources, and memory constraints.

Top comments (0)