How does Wolfram find the closed form of numbers?

406 Views Asked by At

Introduction

I don't know if this question has already been asked (I didn't find it in the list of questions already asked) and I hope it won't be closed immediately since it's technically a question without context.

I wanted to know the name of the algorithm that is implemented on Wolfram to recognize numbers. In particular, I would need it to be able to obtain the coefficients of certain numbers.

Question

We start from the assumption that a good part of the results that Wolfram gives are absurd and that they contain constants that are not widely used. I wanted to know if there was a "simpler" algorithm that only involves an rational and a certain constant that is chosen a priori.

Example

If I have a number like $$48.816776471217042048816689916025967826926945218597900984114771090$$ and I know nothing about this number, only that it is the result of a polynomial with coefficients in $\mathbb{Q}$, calculated in $x=\pi$

What is the algorithm that tells me that this number is equal to $$3\pi^2+5\pi+\frac{7}{2}$$ ?

(In this case I only consider polynomials with coefficients in $\mathbb{Q}$.)

I used in the example of $\pi$ but I could also use $e$, $\sqrt{5}$, the Catalan constant, $\zeta(3.4)$, $\text{Si}(\sqrt{11})$ etc...

Motivation

Essentially because often I have numerical results of which I know the general form i.e.:

  • The irrational number in question in which the polynomial is calculated
  • The degree of the polynomial

But not the specific coefficients and Wolfram it does not calculate them because perhaps they are made up of numbers that are too high in the numerator or denominator, in case I would like it I would be the one to forcefully implement the algorithm

Application

  • Parameter-dependent integrals (series) in which we see that the result is a polynomial that depends on a parameter
  • Inversion of series (in these cases Wolfram is good at giving the numerical result of the n-th derivatives, but after a while he no longer gives the closed form)
1

There are 1 best solutions below

3
On

I suggest an optimization-based method to solve your example. A simiar method can be used to find rational coefficients when you are intrested in a possibly long list of specific numbers such as $e^i, \pi^i, e^i\pi^j, i,j=1,2,\dots$, etc.

For the given number $B$ in your example, we want to find rational numbers $a_0, a_1, a_2, \dots$ such that

$$a_0+a_1\pi+a_2\pi^2+\dots =B.$$

Then, you can solve the following optimization problem:

$$\min \left|\sum_{i=0}^{N}\pi^ix_i-yB\right| \\ \text{subject to}: x_i \in \{-K, -(K-1),\dots,0,\dots, K-1,K\},i=1,\dots,n,\\y\in \{1,\dots, K-1,K\}.$$

Here, $K$ and $N$ are sufficiently large integers, which can be set based on $B$.

This can be rewritten as the following mixed-integer linear programming (MILP) model:

$$ \min z \\ -z \le \sum_{i=0}^N \pi^ix_i-yB \le z \\ -K \le x_i \le K, i=0,\dots,N \\ y \ge 1 \\ y, x_i \in \mathbb Z, i=0,\dots,N \\ z \in \mathbb {R}_{+}.$$

If the optimal value $z^*=0$, then the desired numbers are

$$a_i=\frac{x^*_i}{y^*}, i=0,\dots, N.$$

If the optimal value $z^*>0$, then we have two cases either there is no closed form in terms of $\pi^i, i=0,\dots, N$, or $K$ and $N$ are not set appropriately.

MILP models can be solved in large scales by commercial optimization solvers such as Cplex. You can also use Pyomo library of Python, Solver Add-in of MS Excel, or other tools.