#Machine Learning

The Elegance of Approximation: When Cosine Meets Gaussian

Tech Essays Reporter
4 min read

Exploring mathematical approximations of the Gaussian function through trigonometric expressions, revealing unexpected properties of series convergence and error bounds.

The Gaussian function, exp(-x²), stands as one of the most important mathematical functions across scientific disciplines, from probability theory to quantum mechanics. Its bell-shaped curve describes natural phenomena ranging from measurement errors to quantum wave functions. While the Gaussian is fundamental, its exponential nature makes certain analytical operations challenging. This has led mathematicians and scientists to develop various approximations, with trigonometric functions offering particularly elegant alternatives.

The simplest approximation presented in the article is the function (1 + cos(x))/2, which bears a striking resemblance to the Gaussian density. This approximation works because both functions are even, symmetric about the y-axis, and share similar behavior near zero. The cosine function, with its periodic nature, naturally approximates the decay characteristics of the Gaussian within certain ranges.

What makes these approximations particularly interesting is their improvable nature. By raising the base approximation to an appropriate power, we can refine it further. Specifically, ((1 + cos(x))/2)^4 provides a good lower bound to the Gaussian, while ((1 + cos(x))/2)^3.5597 offers a tight upper bound. This ability to systematically improve the approximation demonstrates the flexibility of trigonometric expressions in capturing complex mathematical behavior.

The most recent discovery highlighted in the article introduces a novel refinement: (1 + cos(sin(x) + x))/2. This seemingly minor modification—adding a sin(x) term to the argument of the cosine—dramatically improves the approximation quality. The mathematical reasoning behind this improvement lies in how this modified function matches more terms of the power series expansion of exp(-x²). Specifically, the error term is on the order of x^6/240, meaning the approximation captures the behavior of the Gaussian up to the fifth-order terms in its Taylor expansion.

The remarkable aspect of this improved approximation is its accuracy across a surprisingly wide range. For values of x between -4 and 4, the difference between this approximation and the actual Gaussian function is virtually indistinguishable when plotted. This level of accuracy is particularly impressive given the relative simplicity of the trigonometric expression compared to the exponential nature of the Gaussian.

However, the article rightly points out an apparent contradiction that challenges our understanding of approximation errors. If the error is theoretically on the order of x^6/240, then at x = 4, we would expect an error magnitude of approximately 4^6/240 = 17.07. Yet the actual error computed is only -0.002579—between three and four orders of magnitude smaller than expected.

This discrepancy reveals the subtleties of series convergence and the limitations of applying certain mathematical theorems outside their proper domain. The alternating series theorem, which would typically allow us to bound the truncation error by the first omitted term, doesn't apply here because the absolute values of the terms in the series are not decreasing at x = 4.

The explanation lies in the behavior of power series with infinite radius of convergence. While the terms will eventually decrease in absolute value, they may first increase significantly before doing so. At x = 4, the terms are still growing, meaning we haven't yet reached the point where the alternating series theorem guarantees error bounds.

This mathematical curiosity highlights an important principle in approximation theory: theoretical error bounds and actual observed errors can differ dramatically, especially when dealing with functions that have complex convergence properties. The alternating series theorem provides only an upper bound on truncation error, and while extensions exist that can give lower bounds, these require the terms to have begun decreasing in absolute value—a condition not met in our case at x = 4.

The significance of these approximations extends beyond mathematical curiosity. In computational settings where evaluating exponentials might be expensive, trigonometric approximations can offer computational advantages. Moreover, these approximations provide insight into the deep connections between seemingly disparate mathematical functions.

As we continue to explore the boundaries of mathematical approximation, these examples remind us that even well-established theorems have limitations, and that apparent contradictions often lead to deeper understanding. The interplay between the Gaussian function and trigonometric approximations continues to reveal new insights about the nature of mathematical functions and their representations.

For those interested in exploring these approximations further, the original article mentioned provides additional details on the mathematical derivations and computational experiments. The world of mathematical approximation remains rich with opportunities for discovery, where simple trigonometric expressions can capture the essence of one of mathematics' most important functions.

Comments

Loading comments...