STATUS: Draft
import numpy as np
import sympy as sp
import pickle
from IPython.display import HTML
import ipywidgets as widgets
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
mpl.rcParams['legend.fontsize'] = 10
import pandas as pd
import itertools
# function to print latex
def renderListToLatex(e):
latex_rendering = []
for i in range(len(e)):
latex_rendering.append("$$" + sp.latex(e[i]) + "$$<br/>")
return(HTML("".join(latex_rendering[0:])))
Create needed variables.
c_0, c_1, c_2, c_3, x, t, a_0, a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, a_9, x_1, x_2, s_1, s_2 = sp.symbols('c_0, c_1, c_2, c_3, x, t, a_0, a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, a_9, x_1, x_2, s_1, s_2')
Let g1 through g5 be objects created in Solving Polynomial Equations (4).
with open('./SharedOutputs/SPE3.pickle', 'rb') as input:
importedFromSPE3 = pickle.load(input)
with open('./SharedOutputs/SPE4.pickle', 'rb') as input:
importedFromSPE4 = pickle.load(input)
g1 = importedFromSPE3['generalCubicSolutions']
g2 = importedFromSPE3['solutionOfGeneralCubicInTermsOfx']
g3 = importedFromSPE4['matrixOfCoefficients']
g4 = importedFromSPE4['matrixOfCoeffiencientsAsDecomposedPrimes']
g5 = importedFromSPE4['matrixOfTerms']
Introduction
Goal: continue to find pattern in these numbers and create a formula that accounts for the numbers.
Recall that the index degree of a term $c_1^m c_2^m c_3^m $ be the sum of the products of the indices and the degrees of each of the consituent variables and the claim is that this is constant in each of the values. It appears then that the index degree is always twice the usual degree (when indices are ignored
Subsitute $c_0$ for t into the original solution for x.
t, c_0 = sp.symbols('t, c_0')
g6 = g2.subs(t, c_0 )
g6 = g6.subs(a_0, 0)
g6
Expand g6.
g7 = sp.expand(g6)
g7
Collect in terms of $c_3$
g7.rhs.collect(c_3)
Recall the Catalan function that prints out components to consider the relationship of components to indices.
def CreateCatalanNumber(n):
print("####### Summary: ########### \n(", n, "x 2)!", "/ ((", n, "+ 1)! * ", n, "!):")
return (sp.factorial(2 * n)) / (sp.factorial(n + 1) * sp.factorial(n))
CreateCatalanNumber(5)
####### Summary: ########### ( 5 x 2)! / (( 5 + 1)! * 5 !):
There appears to be a similiar pattern.
Conjecture 1
Example:
$$\frac{180 c_{0}^{7} c_{2}^{2} c_{3}^{2}}{c_{1}^{11}} \equiv \frac{10!}{2!2!7!} $$
g8 = sp.Poly(g7)
Note terms of polynomial in $x, c_1, c_0, c_2$ and $c_3$
g8.terms()
[((1, 0, 0, 0, 0), 1), ((0, 13, 7, 6, 0), 132), ((0, 12, 7, 4, 1), -330), ((0, 11, 7, 2, 2), 180), ((0, 11, 6, 5, 0), 42), ((0, 10, 7, 0, 3), -12), ((0, 10, 6, 3, 1), -84), ((0, 9, 6, 1, 2), 28), ((0, 9, 5, 4, 0), 14), ((0, 8, 5, 2, 1), -21), ((0, 7, 5, 0, 2), 3), ((0, 7, 4, 3, 0), 5), ((0, 6, 4, 1, 1), -5), ((0, 5, 3, 2, 0), 2), ((0, 4, 3, 0, 1), -1), ((0, 3, 2, 1, 0), 1), ((0, 1, 1, 0, 0), 1)]
Create function to implement conjecture function and verify that the coefficients can be obtained via the above conjecture:
def solutionInTermsOfCoefficientsOfGeneralCubic(g):
a = sp.factorial(g[1] - 1)
b = sp.factorial(g[2])
c = sp.factorial(g[3])
d = sp.factorial(g[4])
return(a / (b * c * d))
[solutionInTermsOfCoefficientsOfGeneralCubic(list(g8.terms()[i][0])) for i in range(1, len(g8.terms()))]
[132, 330, 180, 42, 12, 84, 28, 14, 21, 3, 5, 5, 2, 1, 1, 1]
# Write data that will be used again
data = {'cubicSolutionsAsPolynomial': g8,
}
f = open('./SharedOutputs/SPE5.pickle', 'wb')
pickle.dump(data, f)
f.close()
Summary
This conjecture holds for these solutions. Given a general cubic polynomial, $c_0 + c_1x + c_2x^2 + c_3x^3 = 0$, it posssible get solve for x in terms of the given $c_0, c_1, c2$ and $c_3$