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:])))
Aim: Investigate properties of matrix of values created from the function $C$ which is a generating function for a solution for a general cubic polynomial
Method: Examine the rows and columns of the coeffiecient matrix generated from $C$ using OEIS
Observe: the definition from Solving Polynomials (7) that defines a solution to a general cubic equation.
$$C(m_2, m_3) \equiv(-1)^{m_3 + 1} \frac{(2 m_{2} + 3 m_{3})!}{(1 + m_{2} + 2 m_{3})!m_2!m_3!} \frac{c_0^{1 + m_{2} + 2 m_{3}} c_2^{m_2} c_3^{m_3} }{c_1^{2 m_{2} + 3 m_{3} + 1}}$$Let $C$ be a function implementation that returns a solution to a general cubic equation.
def C(m2, m3, returnCoefficientsOnly = False, returnCoefficientsOnlyWithoutSigns = False):
c_0, c_1, c_2, c_3 = sp.symbols('c_0, c_1, c_2, c_3')
s1 = (-1)**(m3 + 1)
s2 = sp.factorial(2 * m2 + 3 * m3)
s3 = sp.factorial(1 + m2 + 2 * m3) * sp.factorial(m2) * sp.factorial(m3)
s4 = c_0**(1 + m2 + 2 * m3) * c_2**m2 *c_3**m3
s5 = c_1**(2 * m2 + 3 * m3 + 1)
if returnCoefficientsOnly:
s6 = s1 * (s2 / s3)
elif returnCoefficientsOnlyWithoutSigns:
s6 = (s2 / s3)
else:
s6 = s1 * (s2 / s3) * (s4 / s5)
return(s6)
Let $P1$ be a matrix generated from $C$
P1 = np.arange(8)
P2 = np.array([[C(j, i) for i in P1] for j in P1])
P3 = sp.Matrix(P2)
P3
Observe: Many different interacting patterns here, with interelationships between $c_0, c_1, c_2$ and $c_3$. Not simply horizontal and vertical patterns, but diagonal patterns, patterns specific to different variables etc.)
Let $P4$ be a matrix generated from $C$, returning only coefficients without signs.
P4 = np.array([[C(j, i, returnCoefficientsOnlyWithoutSigns=True) for i in P1] for j in P1])
P5 = sp.Matrix(P4)
P5
Observe: important to consider problem for many different angles (columns, rows, diagonals etc). Consult Online Encyclopedia of Integer Sequences to explore this.
Let $P6$ be the first column in $P5$
P6 = list(P5[:,0])
P6
[1, 1, 2, 5, 14, 42, 132, 429]
Observe: This is sequence A000108 in OEIS, the Catalan Numbers, generated with the following formula
$$ C(n) = \frac{(2n)!}{n!(n + 1)!)} $$Observe: Euler originally studied this sequence in terms of properties of polygons
Let $P6$ be the second column in $P5$
P6 = list(P5[:,1])
P6
[1, 5, 21, 84, 330, 1287, 5005, 19448]
Observe: This is sequence A002054 in OEIS and is a binomial coeffient function, generated with the following formula:
$$C(2n +1, n - 1)$$Let $P7$ be the third column in $P5$
P7 = list(P5[:,2])
P7
[3, 28, 180, 990, 5005, 24024, 111384, 503880]
Observe: This is sequence A074922 in OEIS. It is the number of ways of arranging n chords on a circle (handshakes between 2n people across a table) with exactly 2 simple intersections.
Observe: This is similiar to the interpretation of Catalan in the context of Euler's work with Catalan numbers
Let $P8$ be the third column in $P5$
P8 = list(P5[:,3])
P8
[12, 165, 1430, 10010, 61880, 352716, 1899240, 9806280]
Observe: No match in OEIS
Observe: Unlikely to be more matches of columns
Let $P9$ be the first row in $P5$
P9 = list(P5[0, :])
P9
[1, 1, 3, 12, 55, 273, 1428, 7752]
Observe: This is sequence A001764 in OEIS, generated with the following formula:
$$a(n) = binomial \frac{(3n,n)}{(2n+1)}$$Observe: this formula enumerates ternary trees and also noncrossing trees.
Observe: Catalan numbers connected to binary trees so there may be a relationship here.
Let $P10$ be the second row in $P5$
P10 = list(P5[1, :])
P10
[1, 5, 28, 165, 1001, 6188, 38760, 245157]
Observe: This is sequence A025174 in OEIS. It is also binomial generated with the following formula:
$$a(n) = binomial(3n-1, n-1) $$Let $P11$ be the third row in $P5$
P11 = list(P5[2, :])
P11
[2, 21, 180, 1430, 10920, 81396, 596904, 4326300]
Observe: No match in OEIS
Observe: Unlikely to be more matches of rows
Observe: Also possible to search diagonals
Let $P12$ be the first diagonal in $P5$
P12 = list(P5.diagonal(0))
P12
[1, 5, 180, 10010, 678300, 51482970, 4206302100, 361913666400]
Observe: No match in OEIS
Observe cross diagnonals:
1
1,1
2,5,3
5, 21, 28, 12 </br>
Proposed Definition: The alternating sums across cross diagonals in a matrix of cubic polyseries array are equal to 0
Conclusion
There is structure here that seems to be some kind of extension to the Catalan numbers but more investigation is needed. Observe that all coefficients appear to be natural numbers and this may be related to the Catalan numbers.