In [1]:
%display latex 
In [2]:
load("../specifier.py")

We consider the class $\mathcal T = \mathrm{Av}(2413,31452,41253,531642,41352)$. Its only simple permutation is $3142$, and the non-simple avoided patterns are $31452$,$41253$.

In [3]:
S = Specification([[3,1,4,2]],[[3,1,4,5,2],[4,1,2,5,3]])
In [4]:
S
Out[4]:
In [5]:
C = S.sampler(0.1652) #see below the computation of the radius of convergence
In [6]:
perm = C.run(10)
In [7]:
list_plot(perm,aspect_ratio = 1)
Out[7]:

Sage is not able to solve the system directly. However we can solve for $T_3,T_4$.

In [8]:
#S.solve() #sage cannot solve this
In [9]:
S.solve(part=[3,4])
Out[9]:

We remark directly from the specification the identities $T_1 = T_2 = T_0/(1+T_0)$. We just computed $T_3 = z/(1-z)$. Substituting into the equation of $T_0$ gives a self-contained cubic equation for $T_0$.

In [10]:
equation = -T0 + S.system[0].subs(T1==T0/(1+T0),T2==T0/(1+T0),T3 = z/(1-z))
In [11]:
equation
Out[11]:
In [12]:
poly_T0=(equation*(T0+1)).taylor(T0,0,5)
In [13]:
poly_T0
Out[13]:

We play (not shown here) with Cardano's formulas to deduce that $\rho$ is the only real root of $-4z^9 + 41z^8 - 230z^7 + 507z^6 - 582z^5 + 403z^4 - 186z^3 +58z^2 - 12z + 1$, and that $T_0(\rho) = \frac {-21\rho^5 + 30\rho^4 + 12\rho^3 - 33\rho^2 + 15\rho - 3}{18\rho^5 - 78\rho^4 + 102\rho^3 - 66\rho^2 + 24\rho - 6}$.

In [14]:
poly = (-4*z^9 + 41*z^8 - 230*z^7 + 507*z^6 - 582*z^5 + 403*z^4 - 186*z^3 +58*z^2 - 12*z + 1).polynomial(ZZ)
In [15]:
K.<rho> = NumberField(poly, embedding=AA.polynomial_root(poly,RIF(0,0.2)))
In [16]:
T0rho =(-21*rho^5 + 30*rho^4 + 12*rho^3 - 33*rho^2 + 15*rho - 3)/(18*rho^5 - 78*rho^4 + 102*rho^3 - 66*rho^2 + 24*rho - 6)
In [17]:
T1rho,T2rho = T0rho/(1+T0rho),T0rho/(1+T0rho)
In [18]:
rho.n(),T0rho.n(),T1rho.n(),T2rho.n()
Out[18]:

Let us check that these values verify the equation for $T_0,T_1,T_2$.

In [19]:
(T0rho,T1rho,T2rho)==(rho + T0rho*T1rho + T0rho*T2rho + (rho/(rho-1))^2*T0rho^2,rho + T0rho*T2rho + (rho/(rho-1))^2*T0rho^2,rho + T0rho*T1rho + (rho/(rho-1))^2*T0rho^2)
Out[19]:

Now we compute $\mathbb M^\star(\rho, \mathbf T^\star(\rho))$, using an expression of $\mathbb M^\star$ obtained manually from the specification. We then compute the left and right eigenvectors. Note that the fact that $\mathbb M^\star(\rho, \mathbf T^\star(\rho))$ has eigenvalue $1$ confirms that we are indeed at the singularity.

In [20]:
M = Matrix([[T1rho + T2rho + 2*T0rho*(rho/(1-rho))^2,T0rho,T0rho],[T2rho + 2*T0rho*(rho/(1-rho))^2,0,T0rho],[T1rho + 2*T0rho*(rho/(1-rho))^2,T0rho,0]])
In [21]:
index_one = M.eigenvalues().index(1)
In [22]:
u = (M.left_eigenvectors()[index_one][1][0])
In [23]:
v = (M.right_eigenvectors()[index_one][1][0])

We move on to the computation of $p_+$. The expressions for $E_{i,j,j"}^{\pm}$ were obtained manually from the specification.

In [24]:
nplus = u[0]*v[1]*v[0] + u[2]*v[1]*v[0]
In [25]:
nminus = u[0]*v[2]*v[0] + u[1]*v[2]*v[0] + (rho/(1-rho))^2*(u[0]+u[1]+u[2])*(v[0])^2
In [26]:
pplus = nplus/(nplus+nminus)
In [27]:
pplus
Out[27]:
In [28]:
pplus.n()
Out[28]:
In [29]:
pplus.minpoly()
Out[29]:
In [ ]:
 
In [ ]: