mcarvalho

140 Reputation

2 Badges

2 years, 197 days
Content Developer @ Maplesoft | Math/Teaching BMath from UWaterloo

MaplePrimes Activity


These are Posts that have been published by mcarvalho

Today is Pi approximation day (22/7) and I will use that as an excuse to share my new favourite expression for Pi:

 

And this isn't even an approximation! Recently, continuous mathematics has found its own equivalent to the digital hardware NAND gate. In his paper “All elementary functions from a single binary operator”, Andrzej Odrzywołek demonstrated that a single functional primitive can generate the entire standard continuous spectrum of operations. In other words, every single button on a scientific calculator, from addition and subtraction to sines, cosines, and logarithms, can be built using just this one function.

This Maple Worksheet explores how the 'Exp-Minus-Log' ("EML") operator, when paired solely with the constant 1, can be systematically nested to construct basic arithmetic, constants, and complex transcendental functions within Maple.

In essence, he discovered that the binary operator EML, along with the constant 1, forms a basis for the set of standard scientific-calculator operations.

This means that functions like sin(x)cos(x) and operations like a-b or a^b can be creating by composing EML with itself in clever ways. Some constants and functions are trivial to represent, such as EML(1,1) = e or EML(x, 1) = exp(x), others however, are not...

With a quick one-command tweak, you can get Maple to use the property of the extended reals that

And then with a simple argument about standard branches, you can construct the natural logarithm for real numbers, which immediately leads the constant zero:

 

You can then expand the tools in your toolbox by creating subtraction with EML, ln(x), and exp(x)

Which then expands the toolbox further by allowing for the construction unary minus from the constant 0 (since -x = 0 - x), and then addition (since a+b=a-(-b))

Since we've constructed addition, subtraction, zero and one, we can technically construct every integer! It would not be very pleasant, and by no means optimal... but you could! Here's 7 for example:

The next step to building all the standard functions is multiplication and inversion. And these use the classic trick by using the fact that x=exp(ln(x)) can help simplify:

These are compositions of exp, addition, ln, and unary minus (all functions constructed previously), which means they can be made with only EML:

 

It's at this point that I will leave the derivation of division (a/b) and exponentiation (a^b) as exercises for the reader, so I can skip to something a little more complex...

To go beyond the basic operators, you'll need to step into the complex domain by constructing the imaginary constant i. To do this, take ln(-1) = -i*Pi (by using the standard branch) and combine it with Euler's formula

And once again the expression on the left-hand side is made up of operations that were all previously defined, so you can compose EML to get a new constant:

And finally, it's possible to break down the expression for Pi from the start, since it's the product i*ln(-1)

 

By successfully extracting the mathematical constants i and Pi, I think this demonstrates the complete constructive capability of the EML operator in the complex domain. While the resulting syntax trees become exponentially deep and unoptimized for human readability, they prove that continuous operations do not require a massive, distinct toolbox. Future applications of this uniform binary structure could dramatically simplify symbolic regression and machine learning optimization models. 
Ultimately, the EML operator reveals the remarkable truth that the vast complexity of scientific mathematics can be distilled down to a single, beautiful building block.


Isn't math awesome?

To celebrate this day of mathematics, I want to share my favourite equation involving Pi, the Bailey–Borwein–Plouffe (BBP) formula:

This is my favourite for a number of reasons. Firstly, Simon Plouffe and the late Peter Borwein (two of the authors that this formula is named after) are Canadian! While I personally have nothing to do with this formula, the fact that fellow Canadians contributed to such an elegant equation is something that I like to brag about.

Secondly, I find it fascinating how Plouffe first discovered this formula using a computer program. It can often be debated whether mathematics is discovered or invented, but there’s no doubt here since Plouffe found this formula by doing an extensive search with the PSLQ integer relation algorithm (interfaced with Maple). This is an example of how, with ingenuity and creativity, one can effectively use algorithms and programs as powerful tools to obtain mathematical results.

And finally (most importantly), with some clever rearranging, it can be used to compute arbitrary digits of Pi!

Digit 2024 is 8
Digit 31415 is 5
Digit 123456 is 4
Digit 314159 is also 4
Digit 355556 is… F?

That last digit might look strange… and that’s because they’re all in hexadecimal (base-16, where A-F represent 10-15). As it turns out, this type of formula only exists for Pi in bases that are powers of 2. Nevertheless, with the help of a Maple script and an implementation of the BBP formula by Carl Love, you can check out this Learn document to calculate some arbitrary digits of Pi in base-16 and learn a little bit about how it works.

After further developments, this formula led to project PiHex, a combined effort to calculate as many digits of Pi in binary as possible; it turns out that the quadrillionth bit of Pi is zero! This also led to a class of BBP-type formulas that can calculate the digits of other constants like (log2)*(π^2) and (log2)^5.

Part of what makes this formula so interesting is human curiosity: it’s fun to know these random digits. Another part is what makes mathematics so beautiful: you never know what discoveries this might lead to in the future. Now if you’ll excuse me, I have a slice of lemon meringue pie with my name on it 😋

 

References
BBP Formula (Wikipedia)
A Compendium of BBP-Type Formulas
The BBP Algorithm for Pi

Page 1 of 1