Counting chambers in restricted Coxeter arrangements

Abstract: Solomon showed that the Poincaré polynomial of a Coxeter group $W$ satisfies a product decomposition depending on the exponents of $W$. This polynomial coincides with the rank-generating function of the poset of regions of the underlying Coxeter arrangement. In this note we determine all instances when the analogous factorization property of the rank-generating function of the poset of regions holds for a restriction of a Coxeter arrangement. It turns out that this is always the case with the exception of some instances in type $E_8$.

\section{Introduction}

Much of the motivation
for the study of arrangements
of hyperplanes comes
from Coxeter arrangements.
They consist of the reflecting hyperplanes
associated with the
reflections of the underlying Coxeter group.
Solomon showed that
the Poincar\'e polynomial $W(t)$
of a Coxeter group $W$ satisfies a product
decomposition depending on the exponents of $W$, see \eqref{eq:solomon}.
This polynomial coincides with the
rank-generating function of the poset of regions of
the underlying Coxeter arrangement, see \S \ref{s:rankgenerating}.
The aim of this note is to
classify all cases when
the analogous factorization property of
the rank-generating function of the poset of
regions holds for an arbitrary restriction of a
Coxeter arrangement.
It turns out that this is always the case
with the exception of some instances in type $E_8$,
see Theorem \ref{thm:main}.

The analogous factorization property for
a localization of a Coxeter arrangement
is an immediate consequence of Solomon's theorem
and a theorem of Steinberg \cite[Thm.~1.5]{steinberg:invariants},
see Remark \ref{rems:thmmain}(iv).

\subsection{The Poincar\'e polynomial of a Coxeter group}
\label{ssec:coxeter}
Let $(W,S)$ be a Coxeter group with a distinguished set of generators, $S$,
see \cite{bourbaki:groupes}. Let $\ell$ be the length function
of $W$ with respect to $S$.
The \emph{Poincar\'e polynomial} $W(t)$ of
the Coxeter group $W$ is the polynomial in $\BBZ[t]$ defined by
\begin{equation}
\label{eq:poncarecoxeter}
W(t) := \sum_{w \in W} t^{\ell(w)}.
\end{equation}

The following factorization of
$W(t)$ is due to Solomon \cite{solomon:chevalley}:
\begin{equation}
\label{eq:solomon}
W(t) = \prod_{i=1}^n(1 + t + \ldots + t^{e_i}),
\end{equation}
where $\{e_1, \ldots, e_n\}$ is the
set of exponents of $W$.
See also Macdonald \cite{macdonald:coxeter}.

\subsection{The rank-generating function of the posets of regions}
\label{s:rankgenerating}

Let $\CA = (\CA,V)$ be a
hyperplane arrangement in the real vector space $V=\BBR^n$.
A \emph{region} of $\CA$ is a connected component of the
complement $V \setminus \cup_{H \in \CA}H$ of $\CA$.
Let $\RR := \RR(\CA)$ be the set of regions of $\CA$.
For $R, R' \in \RR$, we let $\CS(R,R')$ denote the
set of hyperplanes in $\CA$ separating $R$ and $R'$.
Then with respect to a choice of a fixed
base region $B$ in $\RR$, we can partially order
$\RR$ as follows:
\[
R \le R' \quad \text{ if } \quad \CS(B,R) \subseteq \CS(B,R').
\]
Endowed with this partial order, we call $\RR$ the
\emph{poset of regions of $\CA$ (with respect to $B$)} and denote it by
$P(\CA, B)$. This is a ranked poset of finite rank,
where $\rk(R) := |\CS(B,R)|$, for $R$ a region of $\CA$,
\cite[Prop.~1.1]{edelman:regions}.
The \emph{rank-generating function} of $P(\CA, B)$ is
defined to be the following polynomial in
$\BBZ[t]$
\begin{equation*}
\label{eq:rankgen}
\zeta(P(\CA,B), t) := \sum_{R \in \RR}t^{\rk(R)}.
\end{equation*}

\bigskip
Let $W = (W,S)$ be a Coxeter group with associated reflection arrangement
$\CA = \CA(W)$ which consists of the reflecting hyperplanes of
the reflections in $W$ in the real space $V=\BBR^n$, where $|S| = n$.
Note that the Poincar\'e polynomial $W(t)$
associated with $W$
given in \eqref{eq:poncarecoxeter}
coincides with the rank-generating function of the poset of regions of
the underlying reflection arrangement
$\CA(W)$ with respect to $B$ being the dominant Weyl chamber of $W$
in $V$;
see \cite{bjoerneredelmanziegler} or \cite{jambuparis:factored}.

\bigskip

Thanks to work of  Bj\"orner, Edelman, and Ziegler
\cite[Thm.~4.4]{bjoerneredelmanziegler}
(see also Paris \cite{paris:counting}), respectively
Jambu and Paris \cite[Prop.~3.4, Thm.~6.1]{jambuparis:factored},
in case of a real arrangement $\CA$
which is supersolvable (see see \S \ref{ssect:supersolv}),
respectively inductively factored (see \S \ref{ssect:factored}),
there always exists a suitable base region $B$ so that
$\zeta(P(\CA,B), t)$
admits a multiplicative decomposition which
is equivalent to \eqref{eq:solomon}
determined by the exponents of $\CA$,
see Theorem \ref{thm:mult-zeta}.

\subsection{Restricted Coxeter arrangements}
\label{s:restrictedCoxeter}

Let $W$ be a Coxeter group with reflection arrangement
$\CA = \CA(W)$ in $V=\BBR^n$.
We consider the following generalization of the
Poincar\'e polynomial $W(t)$ of $W$.
Let $X$ be in the intersection lattice $L(\CA)$ of $\CA$,
i.e.~$X$ is the subspace in $V$ given by the intersection
of some hyperplanes in $\CA$.
Then we can consider the restricted arrangement
$\CA^X$ which is the induced arrangement in $X$ from $\CA$,
see \S \ref{ssect:arrangements}.
In a case-by-case study,
Orlik and Terao showed in \cite{orlikterao:free} that the restricted
arrangement
$\CA^X$ is always free, so we can speak of the exponents of $\CA^X$,
see \cite[\S 4]{orlikterao:arrangements}.
In case $W$ is a Weyl group, Douglass \cite[Cor.~6.1]{douglass:adjoint}
gave a uniform proof
of this fact by means of an elegant, conceptual Lie theoretic argument.

It follows from the discussion above that in the special instances
when either $\CA^X$ is supersolvable
(which is for instance always the case for $X$ of dimension at most $2$)
or inductively factored, or else if $X$ is just the ambient space $V$
(so that $\CA^V = \CA)$, then
$\zeta(P(\CA^X,B), t)$ is known to factor analogous to
\eqref{eq:solomon} involving the exponents of $\CA^X$.

Fadell and Neuwirth \cite{fadellneuwirth}
showed that the braid arrangement
is fiber type and Brieskorn \cite{brieskorn:tresses}
proved this for the reflection arrangement of the
hyperoctahedral group. This property is equivalent to
being supersolvable, see \cite{terao:modular}.
Therefore, since any restriction of a supersolvable
arrangement is again supersolvable, \cite{stanley:super}, in
case of the symmetric or hyperoctahedral group $W$,
we see that $\CA(W)^X$ is supersolvable for any $X$.
Thus in each of these cases the rank
generating function of the poset of regions of
 $\CA(W)^X$ factors as in \eqref{eq:solomon},
thanks to Theorem \ref{thm:mult-zeta}.

Therefore,
it is natural to study the rank-generating function
of the poset of regions of an arbitrary restriction of a
Coxeter arrangement.
The following gives a complete classification of all instances
when $\zeta(P(\CA^X,B), t)$ factors analogous to
\eqref{eq:solomon}.

\begin{theorem}
\label{thm:main}
Let $W$ be a finite, irreducible Coxeter group with
reflection arrangement $\CA = \CA(W)$.
Let $\CA^X$ be the restricted arrangement
associated with $X \in L(\CA)\setminus\{V\}$.
Then there is a suitable choice of a base region $B$ so that
the rank-generating function of the poset of regions of $\CA^X$
satisfies the multiplicative formula
\begin{equation}
\label{eq:poinprod}
\zeta(P(\CA^X,B), t) = \prod_{i=1}^n (1 + t + \ldots + t^{e_i}),
\end{equation}
where $\{e_1, \ldots, e_n\}$ is the
set of exponents of $\CA^X$
if and only if one of the following holds:
\begin{itemize}
\item[(i)] $W$ is not of type $E_8$;
\item[(ii)] $W$ is of type $E_8$ and either the rank of $X$ is at most $3$,
but $\CA^X \not \cong (E_8,A_2A_3)$ and $\CA^X \not \cong (E_8,A_1A_4)$,
or else $\CA^X \cong (E_8,D_4)$.
\end{itemize}
\end{theorem}

We prove Theorem \ref{thm:main} in Section \ref{sec:proof}.
For classical $W$, either $\CA(W)^X$ is supersolvable and
the result follows from Theorem \ref{thm:mult-zeta},
or else $W$ is of type $D$ and
$\CA(W)^X$ belongs to a particular family of arrangements
$\CD_p^k$ for $0 \le k \le p$ studied by Jambu and Terao,
\cite[Ex.~2.6]{jambuterao:free}.
We prove Theorem \ref{thm:main} for the family
$\CD_p^k$ in Lemma \ref{lem:dn}.

For $W$ of exceptional type,
there are $31$ restrictions $\CA(W)^X$ of rank at least $3$
(up to isomorphism)
that need to be considered. These are handled by
computational means, see Remark \ref{rem:exc}.

\begin{remarks}
\label{rems:thmmain}
(i).
In the statement of the theorem and later on
we use the convention to label the $W$-orbit
of $X \in L(\CA)$ by the Dynkin type $T$
of the stabilizer $W_X$ of $X$ in $W$ which
is itself a Coxeter group,
by Steinberg's theorem \cite[Thm.~1.5]{steinberg:invariants}.
So we denote the restriction $\CA^X$ just by the pair
$(W,T)$; see also \cite[App.~C, D]{orlikterao:arrangements}.

(ii).
Among the restrictions $\CA(W)^X$ all
supersolvable and all inductively factored instances are known,
see Theorems \ref{thm:super-restriction} and
\ref{thm:nice-restriction} below.
Thus, by Theorem \ref{thm:mult-zeta}, in each of these cases
$\zeta(P(\CA^X,B), t)$
factors as in \eqref{eq:poinprod}.

(iii).
Hoge checked that the exceptional case
$(E_8,A_2A_3)$ from Theorem \ref{thm:main}
is isomorphic to
the real simplicial arrangement
``$A_4(17)$'' from Gr\"unbaum's list \cite{gruenbaum}.
It was observed by Terao that the latter does
not satisfy the product rule \eqref{eq:poinprod},
\cite[p.~277]{bjoerneredelmanziegler}.
It is rather remarkable that this arrangement
makes an appearance as a restricted Coxeter arrangement.
In contrast, according to Theorem \ref{thm:main},
the rank-generating function of the poset of regions
of $(E_8,A_1^2A_3)$ does factor according to
\eqref{eq:poinprod}. In particular,
these two arrangements are not isomorphic, as
claimed erroneously in \cite[App.~D]{orlikterao:arrangements}.

(iv).
For  $X$ in $L(\CA(W))$ consider
the localization $\CA(W)_X$ of $\CA(W)$ at $X$,
which consists of all members of $\CA(W)$ containing $X$,
see \S \ref{ssect:arrangements}.
Then, since
the stabilizer $W_X$  in $W$ of $X$
is itself a Coxeter group,
by Steinberg's theorem \cite[Thm.~1.5]{steinberg:invariants},
and since $\CA(W)_X = \CA(W_X)$,
by \cite[Cor.~6.28(2)]{orlikterao:arrangements},
it follows from Solomon's factorization \eqref{eq:solomon}
that the rank generating function of the poset of regions of
$\CA(W)_X$
(with respect to the base chamber being the unique chamber of
$\CA(W)_X$ containing the dominant Weyl chamber of $W$) factors
analogous to \eqref{eq:solomon} involving
the exponents of $W_X$.

(v).
In Lie theoretic terms,
for $W$ a Weyl group,
$W(t^2)$ is the Poincar\'e polynomial
of the flag variety of a semisimple
linear algebraic group with Weyl group $W$.
The  formula \eqref{eq:solomon} then gives a well-known
factorization of the Poincar\'e polynomial of the flag variety.

If $W$ is of type $A$ or $B$, then
each restriction $\CA(W)^X$ is
the Coxeter arrangement of the same Dynkin type of
smaller rank,
cf.~\cite[Props.~6.73, 6.77]{orlikterao:arrangements}.
Thus, by the previous paragraph, in these instances,
$\zeta(P(\CA^X,B), t^2)$
is just the Poincar\'e polynomial
of the flag variety of a semisimple
linear algebraic group of the same Dynkin type as $W$ but of smaller rank.

In view of these examples, it is natural to wonder whether in general
there is a suitable projective variety
associated with a fixed semisimple group $G$ with Weyl group $W$
whose Poincar\'e polynomial is related to
the rank-generating function of the poset of
regions for any restriction of $\CA(W)$ in the same manner
as in these special instances above, relating to
and generalizing the flag variety of $G$.
\end{remarks}

For general information about arrangements and Coxeter groups,
we refer the reader to \cite{bourbaki:groupes} and
\cite{orlikterao:arrangements}.

\section{Recollections and Preliminaries}
\label{sect:prelims}

\subsection{Hyperplane arrangements}
\label{ssect:arrangements}
Let $V = \BBR^n$ be an $n$-dimensional real vector space.
A \emph{(real) hyperplane arrangement} $\CA = (\CA, V)$ in $V$
is a finite collection of hyperplanes in $V$ each
containing the origin of $V$.
We denote the empty arrangement in $V$ by $\Phi_n$.

The \emph{lattice} $L(\CA)$ of $\CA$ is the set of subspaces of $V$ of
the form $H_1\cap \ldots \cap H_i$ where $\{ H_1, \ldots, H_i\}$ is a subset
of $\CA$.
For $X \in L(\CA)$, we have two associated arrangements,
firstly
$\CA_X :=\{H \in \CA \mid X \subseteq H\} \subseteq \CA$,
the \emph{localization of $\CA$ at $X$},
and secondly,
the \emph{restriction of $\CA$ to $X$}, $\CA^X = (\CA^X,X)$, where
$\CA^X := \{ X \cap H \mid H \in \CA \setminus \CA_X\}$.
Note that $V$ belongs to $L(\CA)$
as the intersection of the empty
collection of hyperplanes and $\CA^V = \CA$.
The lattice $L(\CA)$ is a partially ordered set by reverse inclusion:
$X \le Y$ provided $Y \subseteq X$ for $X,Y \in L(\CA)$.

Throughout, we only consider arrangements $\CA$
such that $0 \in H$ for each $H$ in $\CA$.
These are called \emph{central}.
In that case the \emph{center}
$T(\CA) := \cap_{H \in \CA} H$ of $\CA$ is the unique
maximal element in $L(\CA)$  with respect
to the partial order.
A \emph{rank} function on $L(\CA)$
is given by $r(X) := \codim_V(X)$.
The \emph{rank} of $\CA$
is defined as $r(\CA) := r(T(\CA))$.

\subsection{Free arrangements}
\label{ssect:free}

Free arrangements play a fundamental role in the
theory of hyperplane arrangements,
see \cite[\S 4]{orlikterao:arrangements} for the definition and
properties of this notion. Crucial for our purpose is the fact that
associated with a free arrangement is a set of important invariants, its
(multi)set of \emph{exponents}, denoted by $\exp \CA$.

\subsection{Supersolvable arrangements}
\label{ssect:supersolv}

We say that $X \in L(\CA)$ is \emph{modular}
provided $X + Y \in L(\CA)$ for every $Y \in L(\CA)$,
\cite[Cor.~2.26]{orlikterao:arrangements}.

\begin{defn}
[{\cite{stanley:super}}]
\label{def:super}
Let $\CA$ be a central arrangement of rank $r$.
We say that $\CA$ is
\emph{supersolvable}
provided there is a maximal chain
\[
V = X_0 < X_0 < \ldots < X_{r-1} < X_r = T(\CA)
\]
 of modular elements $X_i$ in $L(\CA)$,
cf.~\cite[Def.~2.32]{orlikterao:arrangements}.
\end{defn}

\noindent Note that arrangements of rank at most $2$ are always supersolvable,
e.g.~see \cite[Prop.~4.29(iv)]{orlikterao:arrangements} and
supersolvable arrangements are always free, e.g.~see
\cite[Thm.~4.58]{orlikterao:arrangements}.
Also, restrictions of a supersolvable
arrangement are again supersolvable, \cite[Prop.~3.2]{stanley:super}.

\subsection{Nice and inductively factored arrangements}
\label{ssect:factored}

The notion of a \emph{nice} or \emph{factored}
arrangement is due to Terao \cite{terao:factored}.
It generalizes the concept of a supersolvable arrangement, e.g.~see
\cite[Prop.~2.67, Thm.~3.81]{orlikterao:arrangements}.
Terao's main motivation was to give a
general combinatorial framework to
deduce tensor factorizations of the underlying Orlik-Solomon algebra,
see also \cite[\S 3.3]{orlikterao:arrangements}.
We refer to \cite{terao:factored} for the relevant
notions and properties
(cf.~ \cite[\S 2.3]{orlikterao:arrangements}).

There is an  analogue of Terao's
Addition Deletion Theorem for
free arrangements
(\cite[Thm.~4.51]{orlikterao:arrangements})
for the class of
nice arrangements, see \cite[Thm.~3.5]{hogeroehrle:factored}.
In analogy to the case of free arrangements, this motivates
the notion of an
\emph{inductively factored} arrangement,
see \cite{jambuparis:factored}, \cite[Def.~3.8]{hogeroehrle:factored}
for further details on this concept.

The connection with the previous notions is as follows.
Supersolvable arrangements are always inductively factored
(\cite[Prop.~3.11]{hogeroehrle:factored})
and inductively factored arrangements are always free
(\cite[Prop.~2.2]{jambuparis:factored}) so
that we can talk about the exponents of such arrangements.

The following theorem due to Jambu and Paris,
\cite[Prop.~3.4, Thm.~6.1]{jambuparis:factored},
was first shown by Bj\"orner, Edelman and Ziegler
for $\CA$ supersolvable in \cite[Thm.~4.4]{bjoerneredelmanziegler}
(see also Paris \cite{paris:counting}).

\begin{theorem}
\label{thm:mult-zeta}
If $\CA$ is inductively factored, then
there is a suitable choice of a base region $B$ so that
$\zeta(P(\CA,B), t)$ satisfies the multiplicative formula
\begin{equation}
\label{eq:poinprod2}
\zeta(P(\CA,B), t) = \prod_{i=1}^n (1 + t + \ldots + t^{e_i}),
\end{equation}
where $\{e_1, \ldots, e_n\} = \exp \CA$ is the
set of exponents of $\CA$.
\end{theorem}

\subsection{Restricted root systems}
\label{ssect:restrictedroots}
Given a root system for $W$,
associated with a member $X$ from $L(\CA(W))$ we have a
\emph{restricted root system} which consists of the restrictions
of the roots of $W$ to $X$, see \cite[\S 2]{brundangoodwin:grading}.
As in the absolute case, bases of the restricted root system correspond
bijectively to chambers of the arrangement $\CA(W)^X$,
\cite[Cor.~7]{brundangoodwin:grading}.
More specifically, let $\Phi$ be a root system for $W$
and let $\Delta\subset \Phi$
be a set of simple roots.
In view of Remark \ref{rems:thmmain}(i),
choosing $X\in L(\CA(W))$ amounts to specifying the Dynkin type $T$
of the parabolic subgroup $W_X$, so that the pair
$(W,T)$ characterizes $A(W)^X$.
Let $\mathcal{B}_T$ be the set of all subsets of $\Delta$
that generate a root system of Dynkin type $T$.
Fixing an element $\Delta_J\in \mathcal{B}_T$,
the bases for $\Phi$ containing $\Delta_J$ are
in bijective correspondence with
the bases for the restricted root system,
\cite[Thm.~10]{brundangoodwin:grading}.

Furthermore, the set $\mathcal{B}_T$ characterizes a set of
representatives for the action of the \emph{restricted Weyl group}
on the set of chambers of the arrangement $\CA(W)^X$,
\cite[Lem.~11]{brundangoodwin:grading}.
Thus there is a suitable choice of a base region $B$
such that $\zeta(P(\CA(W)^X, B),t)$ factors according to \eqref{eq:poinprod},
if and only if there is
such a choice among regions that arise from elements in $\mathcal{B}_T$.

\section{Proof of Theorem \ref{thm:main}}
\label{sec:proof}

It is well known that
if $W$ is of type $A$ or $B$, then
the Coxeter arrangement $\CA(W)$ is supersolvable and
so is every restriction thereof.
So Theorem \ref{thm:main} follows in this
case from Theorem \ref{thm:mult-zeta}.
Therefore, for $W$ of classical type, we only need to consider
restrictions for $W$ of type $D$.
The restrictions
$\CD_p^k$ for $0 \le k \le p$
of Coxeter arrangements
of type $D$ are given by
the defining polynomial
\[
Q(\CD_p^k) := x_{p-k+1} \cdots x_p \prod_{1 \le i < j \le p}(x_i^2 - x_j^2),
\]
see \cite[Ex.~2.6]{jambuterao:free} (\cite[Cor.~6.86]{orlikterao:arrangements}).

In view of Theorem \ref{thm:mult-zeta}, we next recall
the relevant parts of the classifications of the
supersolvable and inductively factored restrictions of reflection
arrangements from \cite{amendhogeroehrle:super} and
\cite{moellerroehrle:nice}, respectively.
Here we focus on such $X$ in $L(\CA)$ of dimension at least $3$,
as a restriction to a smaller dimensional member of $L(\CA)$
is already supersolvable.

\begin{theorem}
[{\cite[Thm.~1.3]{amendhogeroehrle:super}}]
\label{thm:super-restriction}
Let $W$ be a finite, irreducible Coxeter group
with reflection arrangement
$\CA = \CA(W)$ and let $X \in L(\CA)\setminus\{V\}$
with $\dim X \ge 3$.
Then the restricted arrangement
$\CA^X$ is supersolvable
if and only if
one of the following holds:
\begin{itemize}
\item[(i)] $\CA$ is of type $A$ or of type $B$, or
\item[(ii)]  $W$ is of type $D_n$ for $n \ge 4$ and
$\CA^X \cong \CD^k_p$, where $p = \dim X$ and $p - 1 \leq k \leq p$;
\item[(iii)] $\CA^X$ is $(E_6,A_3)$, $(E_7, D_4)$, $(E_7, A_2^2)$, or $(E_8, A_5)$.
\end{itemize}
\end{theorem}

As noted above, every supersolvable restriction from
Theorem \ref{thm:super-restriction}
is inductively factored.

\begin{theorem}
[{\cite[Thms.~1.5, 1.6]{moellerroehrle:nice}}]
\label{thm:nice-restriction}
Let $W$ be a finite, irreducible Coxeter group
with reflection arrangement
$\CA = \CA(W)$ and let $X \in L(\CA)\setminus\{V\}$
with $\dim X \ge 3$.
Then the restricted arrangement
$\CA^X$ is inductively factored
if and only if
one of the following holds:
\begin{itemize}
\item[(i)] $\CA^X$ is supersolvable, or
\item[(ii)] $W$ is of type $D_n$ for $n \ge 4$ and
$\CA^X \cong \CD^{p-2}_p$, where $p = \dim X$;
\item[(iii)]
$\CA^X$ is one of $(E_6, A_1A_2), (E_7, A_4)$, or $(E_7, (A_1A_3)'')$.
\end{itemize}
\end{theorem}

It follows from Theorem \ref{thm:mult-zeta} that in all instances
covered in  Theorem \ref{thm:nice-restriction},
$\zeta(P(\CA,B), t)$ satisfies the factorization property of
\eqref{eq:poinprod2} with respect to a suitable choice of
base region $B$.
In particular, Theorem \ref{thm:main} holds in all these instances.

It is not apparent that the rank-generating function
of the poset of regions of $\CD_p^k$ factors
according to \eqref{eq:poinprod} for $1\leq k \leq p-3$.
For, these arrangements are neither reflection arrangements
nor are they inductively factored, by the results above.
To show that
the factorization property from \eqref{eq:poinprod}
also holds in these instances,
we first parameterize the regions $\RR(\CD_p^k)$ suitably
and then prove a recursive formula for $\zeta(P(\CD_p^k,B),t)$.

\begin{remark}
\label{rem:regionsDlk}
Since the inequalities given by the hyperplanes
do not change within a region,
the set of regions is uniquely determined
by specifying one interior point for each region. Let
$$M_p^k:= \left\{(x_1,\dots,x_p)\in \{\pm 1,\dots,\pm p\}^p
\mid x_1,\dots,x_{p-k}\neq -1,\hspace{0.4em} |x_i| \neq |x_j|
\hspace{0.4em} \forall i\neq j  \right\}.$$
It is easy to verify that each region in
$\RR := \RR(\CD_p^k)$ contains
exactly one element of $M_p^k$.
So this gives a parametrization for the regions in $\RR$.
Without further comment, we frequently identify points in $M_p^k$ with their
respective regions in  $\RR$.
For $x\in M_p^k$, write $R_x\in \RR$ for the unique region containing $x$.
Once a base region $B$ in $\RR$
is chosen so that $\RR$ becomes a ranked poset,
we may write
$$\zeta(P(\CD_p^k,B),t) = \sum\limits_{x\in M_p^k} t^{\rk(R_x)}. $$

Using this notation it is easy to see which regions are
adjacent and which hyperplanes are walls of a given region.
Let $x=(x_1,\dots,x_p)\in M_p^k$.
If $x_j = x_i \pm 1$,
then $\ker(x_i-x_j)$ is a wall of $R_x$
and the corresponding adjacent region
is obtained from $x$ by exchanging
$x_i$ and $x_j$ in $x$. If $x_j = -(x_i\pm 1)$,
then $\ker(x_i+x_j)$ is a wall of $R_x$
and the adjacent region again originates
from $x$ by exchanging
$x_i$ and $x_j$ \emph{but maintaining their respective signs}.
Finally, if $x_i=\pm 1$ and $p-k<i\leq p$, then $\ker(x_i)$
is a wall of $R_x$ and the adjacent region
is obtained by exchanging $x_i$ with $-x_i$.
\end{remark}

For our subsequent results,
we choose $B_p := R_y\in \RR$ for $y=(p,p-1,\dots,1)$
as our base chamber independent of $k$.

\begin{lemma}
\label{lem:dnhilf}
Let $p\geq 3$, $k\in\{0,\dots,p\}$ and $B_p\in \RR$ as above.
For an arbitrary $i\in\{1,\dots,p\}$, we have
\begin{equation}
\label{eq:p}
\sum_{\substack{x\in M_p^k \\ x_i = p }} t^{\rk(R_x)} =
\begin{cases}
t^{i-1} \cdot \zeta(P(\CD_{p-1}^{k  },B_{p-1}),t) &\text{ if } i\leq p-k, \\
t^{i-1} \cdot \zeta(P(\CD_{p-1}^{k-1},B_{p-1}),t) &\text{ if } i > p-k,
\end{cases}\\
\end{equation}
and
\begin{equation}
\label{eq:-p}
\sum\limits_{\substack{x\in M_p^k \\ x_i = -p }} t^{\rk(R_x)} =
\begin{cases}
t^{2p-i-1} \cdot \zeta(P(\CD_{p-1}^{k},B_{p-1}),t)   &\text{ if } i\leq p-k, \\
t^{2p - i} \cdot \zeta(P(\CD_{p-1}^{k-1},B_{p-1}),t) &\text{ if } i > p-k.
\end{cases}
\end{equation}
\end{lemma}

\begin{proof}
Set $N^- := \{x\in M_p^k\mid x_i = -p\}$.
Thanks to Remark \ref{rem:regionsDlk},
no hyperplane involving the coordinate $x_i$
lies between any two regions of $N^-$.
Setting
\[
z = (z_1,\dots,z_i,\dots,z_p) :=
(p-1,p-2, \ldots,p-i+1, -p,p-i-1, \ldots,2, 1)\in N^-,
\]
there are only hyperplanes involving $x_i$ between $B_p$ and $R_z$.
More precisely,  we have
\[
\CS(B_p,R_z)=
\begin{cases}
\{\ker(x_i - x_j)\mid j\leq i\}  \cup \{\ker( x_i \pm x_j )\mid i<j \leq p) \} &\text{ for } i\leq p-k, \\
\{\ker(x_i - x_j)\mid j\leq i\}  \cup \{\ker( x_i \pm x_j )\mid i<j \leq p) \} \cup \{\ker(x_i)\} &\text{ for } i>p-k.
\end{cases}
\]
So if we choose an arbitrary $x\in N^-$, we have
$$\CS(B_p,R_x) = \CS(B_p,R_z) \mathbin{\dot\cup} \CS(R_z,R_x).$$
Consequently, we obtain
\begin{equation}
\label{eq:rk}
\rk(R_x) = |\CS(B_p,R_z)| + |\CS(R_z,R_x)| =
\begin{cases}
t^{2p-i-1} + |\CS(R_z,R_x)|  &\text{ for } i\leq p-k, \\
t^{2p - i} + |\CS(R_z,R_x)|  &\text{ for } i>p-k.
\end{cases}
\end{equation}
Now set
\begin{equation}
\label{eq:A}
\CA :=
\begin{cases}
\CD_{p-1}^{k}   &\text{ if } i\leq p-k, \\
\CD_{p-1}^{k-1} &\text{ if } i > p-k,
\end{cases}
\end{equation}
and identify the set of regions $\RR(\CA)$
of $\CA$ with the corresponding set of
$(p-1)$-tuples as in Remark \ref{rem:regionsDlk}.
Then simply omitting the $i$-th coordinate defines a map
\[
h:N^- \longrightarrow \RR(\CA)
\]
which is bijective, $h(R_z)=B_{p-1}$
and if $\widetilde\rk$ denotes the rank function on $P(\CA,B_{p-1})$,
then we get $|\CS(R_z,R_x)| = \widetilde\rk(h(R_x))$.
Therefore, by \eqref{eq:rk}, \eqref{eq:A}
and the bijectivity of $h$, we get
\begin{align*}
\sum\limits_{\substack{x\in M_p^k \\ x_i = -p }} t^{\rk(R_x)}
&= t^{|\CS(B_p,R_z)|} \sum\limits_{x\in N^-} t^{|\CS(R_z,R_x)|} \\
&= t^{|\CS(B_p,R_z)|} \sum\limits_{x\in N^-} t^{\widetilde\rk(h(R_x))} \\
&= t^{|\CS(B_p,R_z)|} \sum\limits_{x\in \RR(\CA)} t^{\widetilde\rk(R_x)} \\
&= t^{|\CS(B_p,R_z)|} \zeta(P(\CA,B_{p-1}),t) \\
& =
\begin{cases}
t^{2p-i-1} \cdot \zeta(P(\CD_{p-1}^{k},B_{p-1}),t)   &\text{ if } i\leq p-k, \\
t^{2p - i} \cdot \zeta(P(\CD_{p-1}^{k-1},B_{p-1}),t) &\text{ if } i > p-k.
\end{cases}
\end{align*}
So \eqref{eq:p} follows.

Next let $N^+:=\{x\in M_p^k\mid x_i = p\}$ and set
\[
z = (z_1,\dots,z_i,\dots,z_p) :=
(p-1,p-2, \ldots,p-i+1,p,p-i-1, \ldots,2, 1)\in N^+.
\]
Then $\CS(B_p,R_z)=\{\ker(x_i - x_j) \mid 1\leq j < i\}$ has cardinality $i-1$. The proof of this case is similar to the one above,
and is left to the reader.
So \eqref{eq:-p} follows.
\end{proof}

The next technical lemma is needed in the proof of Lemma \ref{lem:dn}.
For ease of notation, we set
\[
F(e_1,\dots,e_m) := \prod_{i=1}^{m} (1+t+\dots+t^{e_i}) \in \BBZ[t]
\]
for any $m\geq 1$ and integers $e_1,\dots,e_m \geq 1$.
In particular, $F(e) = 1+t+\dots+t^e$.
Also note that for $j>0$, we have
\begin{equation}
\label{eq:F}
F(j-1)(1+t^j) = F(2j-1).
\end{equation}

\begin{lemma}
\label{lem:delta}
Let $p\geq 3$ and $0\leq k\leq p$. Define
\[
\Delta_p^k :=
\sum_{i=1}^{p-k} (t^{i-1}+t^{2p-i-1}) F(p+k-2)
+ \sum_{i=p-k+1}^{p} (t^{i-1}+t^{2p-i}) F(p+k-3).
\]
Then
\[
\Delta_p^k
= F(p+k-1,2p-3).
\]
\end{lemma}

\begin{proof}
We argue by induction on $k$. First let $k=0$. Then, using \eqref{eq:F}, we have
\begin{align*}
\Delta_p^0 &= \sum_{i=1}^{p} (t^{i-1}+t^{2p-i-1}) F(p-2) \\
&= (1+\dots+t^{p-1})F(p-2) + (t^{p-1}+\dots+t^{2p-2}) F(p-2) \\
&= F(p-1,p-2) + t^{p-1}F(p-1,p-2) \\
&= F(p-1,p-2)\left(1+t^{p-1}\right) \\
&= F(p-1,2p-3).
\end{align*}
Now let $k>0$ and assume that the statement is true for $k'<k$. Then using
the inductive hypothesis, we get
\begin{align*}
\Delta_p^k &= \Delta_p^{k-1} + t^{p+k-2}\sum_{i=1}^{p-k}\left(t^{i-1}+t^{2p-i-1}\right)
+ t^{p+k-3}\sum_{i=p-k+1}^{p}\left(t^{i-1}+t^{2p-i}\right) \\
&\hspace{1em} - F(p+k-3)\left(t^{p-k}+t^{p+k-2}\right)
+ F(p+k-4)\left(t^{p-k}+t^{p+k-1}\right) \\
&= F(2p-3,p+k-2)+(t^{p+k-2}+\dots+t^{2p-3}+t^{2p+2k-3}+\dots+t^{3p+k-4}) \\
&\hspace{1em} + (t^{2p-3}+\dots+t^{2p+k-4}+t^{2p+k-3}+\dots+t^{2p+2k-4}) - (t^{2p-3}+t^{p+k-2}) \\
&= F(2p-3,p+k-2) + t^{p+k-1}(1+\dots+t^{2p-3}) \\
&= F(2p-3)(F(p+k-2)+t^{p+k-1}) \\
& = F(2p-3,p+k-1),
\end{align*}
as claimed.
\end{proof}

Finally, armed with Lemmas \ref{lem:dnhilf} and \ref{lem:delta}, we are able to
prove the desired result for the arrangements $\CD_p^k$.

\begin{lemma}
\label{lem:dn}
The rank-generating function
of the poset of regions of $\CD_p^k$ factors according to
\eqref{eq:poinprod} for all $1 \le k \le p-3$ and $p \ge 4$.
\end{lemma}

\begin{proof}
We argue by induction on $n=p+k$. For $n=3$, the result holds vacuously.
So let $1 \le k \le p-3$ and $p \ge 4$ and assume that for all $p'$, $k'$,
with $1 \le k' \le p'-3$, $p' \ge 4$ and $n > p'+k'$,
the arrangement $\CD_{p'}^{k'}$ satisfies \eqref{eq:poinprod}.
Note that
\begin{equation}
\label{eq:expD}
\exp(\CD_p^k) = \exp(\CD_{p-1}^{p-1}) \cup \{p+k-1\},
\end{equation}
see \cite[Ex.~2.6]{jambuterao:free}.
Then the inductive hypothesis together
with Lemmas \ref{lem:dnhilf} and \ref{lem:delta}
and \eqref{eq:expD} imply
\begin{align*}
&\zeta(P(\CD_p^k,B_p),t)
=\sum_{x\in M_p^k} t^{\rk(R_x)}
=\sum_{i=1}^{p} \sum_{\substack{x\in M_p^k \\ x_i = \pm p}} t^{\rk(R_x)} \\
&=\sum_{i=1}^{p-k} (t^{i-1}+t^{2p-i-1}) \zeta(P(\CD_{p-1}^{k},B_{p-1}),t)
+ \sum_{i=p-k+1}^{p} (t^{i-1}+t^{2p-i}) \zeta(P(\CD_{p-1}^{k-1},B_{p-1}),t) \\
&= \sum_{i=1}^{p-k} (t^{i-1}+t^{2p-i-1}) F\left(\exp(\CD_{p-1}^{k}) \right)
+ \sum_{i=p-k+1}^{p} (t^{i-1}+t^{2p-i}) F\left( \exp(\CD_{p-1}^{k-1}) \right) \\
&= F\left(\exp(\CD_{p-2}^{p-2})\right) \left( \sum_{i=1}^{p-k} (t^{i-1}+t^{2p-i-1}) F(p+k-2)
+ \sum_{i=p-k+1}^{p} (t^{i-1}+t^{2p-i}) F(p+k-3) \right) \\
&= F\left(\exp(\CD_{p-2}^{p-2})\right)  \Delta_p^k  \\
& = F\left(\exp(\CD_{p-2}^{p-2})\right) F(2p-3,p+k-1) \\
&= F\left(\exp(\CD_{p}^{k})\right).
\end{align*}
This completes the proof of the lemma.
\end{proof}

\begin{remark}
\label{rem:exc}
In view of Theorems \ref{thm:mult-zeta},
\ref{thm:super-restriction} and
\ref{thm:nice-restriction},
Lemma \ref{lem:dn} settles all the remaining
classical instances of Theorem \ref{thm:main}.
It follows from
Theorems \ref{thm:super-restriction} and
\ref{thm:nice-restriction}
that there are $31$ instances for $W$ of exceptional type to
be checked (here we take the isomorphisms of rank $3$
restrictions $\CA(W)^X$ into account,
cf.~\cite[App.~D]{orlikterao:arrangements}).
We have verified that
$\zeta(P(\CA(W)^X,B), t)$ satisfies
the factorization property \eqref{eq:poinprod}
precisely in all the instances when $W$ is of exceptional type, as
specified in Theorem \ref{thm:main}.
In the listed exceptions, $\zeta(P(\CA(W)^X,B), t)$ does not factor
according to this rule with respect to any choice of base region.
This was checked using the computer algebra package \Sage, \cite{sage}.

We used the \Sage-package
\emph{HyperplaneArrangements} which provides
methods to compute
$\zeta(P(\CA, B), t))$ for given $\CA$ and $B$.
More specifically, the algorithm is initiated
with a list containing the vector space $V$ as a polytope and
for each hyperplane in $\CA$ splits each polytope in the
current list into two polytopes,
defined by a positive resp.~negative inequality,
while discarding all empty solutions. This results in a list of chambers
implemented as polytopes.
After specifying a base region $B$
the algorithm checks for each region $R$
and each hyperplane $H$ whether $H$ separates $B$ from $R$.

In addition, we used the results from \cite[\S 2]{brundangoodwin:grading}, as
detailed in Section \ref{ssect:restrictedroots}
to greatly reduce the number of chambers that have to be tested.
This method worked for all exceptional restrictions other than
$(E_8,A_1)$, as the latter is simply too big for \Sage\  to compute
all its chambers at once.
For this case we instead used the
bijective correspondences recalled in
\ref{ssect:restrictedroots} to compute
the chambers directly from the elements of
the Weyl group $W(E_8)$.
By ordering the group elements by length using
a depth-first search algorithm implemented
in the \Sage-package \emph{ReflectionGroup}, we were able to compute
the chambers of the restricted arrangement ordered by rank,
so we could conclude that the rank-generating polynomial
of the poset of regions for the restriction
$\CA^X = (E_8,A_1)$ does not factor
according to \eqref{eq:poinprod}
after computing only a small portion of the entire polynomial
$\zeta(P(\CA^X, B), t))$.
\end{remark}

\bigskip
{\bf Acknowledgments}:
We are grateful to T.~Hoge for checking that
 the simplicial arrangement
``$A_4(17)$'' from Gr\"unbaum's list
coincides with the restriction $(E_8,A_2 A_3)$.
We would also like to thank C.~Stump for
helpful discussions concerning computations in \Sage.

The research of this work was supported by
DFG-grant RO 1072/16-1.

\bibliographystyle{amsalpha}

\newcommand{\etalchar}[1]{$^{#1}$}
\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}
\providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }
\providecommand{\MRhref}[2]{%
  \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2} }
\providecommand{\href}[2]{#2}

Combinatorics (math.CO); Group Theory (math.GR)


What is the Perfect Shuffle?

Abstract: When shuffling a deck of cards, one probably wants to make sure it is thoroughly shuffled. A way to do this is by sifting through the cards to ensure that no adjacent cards are the same number, because surely this is a poorly shuffled deck. Unfortunately, human intuition for probability tends to lead us astray. For a standard 52-card deck of playing cards, the event is actually extremely likely. This report will attempt to elucidate how to answer this surprisingly difficult combinatorial question directly using rook polynomials.

\section{Introduction}
We will say that a shuffle of a standard 52-card deck is a \emph{perfect shuffle} if any pair of adjacent cards in the deck have a different value from one another.

\begin{figure}[h!]
\centering
\includegraphics[scale=.08]{imperfect_example.jpg}
\caption{An imperfect shuffle}
\label{fig:universe}
\end{figure}

Formally, we can see this as a permutation on 52 elements where the first four elements are of a first color, the second four elements are of a second color, and on until the last four elements are of the thirteenth color.
Answering this problem was looked at in a 2013 IJPAM article by Yutaka Nishiyama \citep{nishiyama13}.
Unfortunately, the perspective he took to analyze the problem became very computationally intensive for decks with 52 cards, so he used Monte Carlo methods to approximate the answer for the 52-card deck\citep{nishiyama13}.
The only other places I have found the exact answer to this question is on a swedish forum from 2009 \citep{swedish} and a french blog from 2014 \citep{french}.
As far as I can tell, the two who answered these questions computed the answer with brute force using more efficient code and more resources than Nishiyama's attempt.
Here, we address the problem using Ira Gessel's 1988 generalization of rook polynomials to achieve a solution which is much less computationally restrictive \citep{gessel88}.

\section{Introduction to Rook Polynomials}
Rook polynomials were developed studying the number of ways to place rooks on a chessboard.
Our study will fairly closely follow a combination of Gessels' work in \citep{gessel88} and \citep{gessel13}.
For a given size of chessboard, the rook polynomial counts the number of ways to place differing amounts of non-attacking rooks on that chessboard.
Let $n \in \mathbb{N}$ and let $[n]$ denote $\{1,...,n\}$.
We consider our chessboard to be $[n] \times [n]$.  Let a \emph{board}, B, be a subset of the chessboard $B \subseteq [n] \times [n]$.
For this board, we define the rook number $r_k(B)$ to be the number of ways to put $k$ rooks onto this board such that none of them are `attacking' the other (none are in the same row or column).  We will take $B' = \{(2,2), (3,2), (3,3)\}$ for our illustrative examples:

\begin{figure}[h!]
\centering
\includegraphics[scale=.23]{rook_number.png}
\caption{We see: $r_0(B') = 1$, $r_1(B') = 3$, and $r_2(B') = 1$.}
\label{fig:rooks}
\end{figure}

Let $S_n$ denote the set of permutations of $[n]$.
We can associate each $\pi \in S_n$ to another subset of our chessboard.
We do this with the set $\{ (i,\pi(i)) : i \in [n] \}$.
We can now see how many `hits' each permutation has with a given board.
Formally, we can define a `hit function'
\[ h_B : S_n \rightarrow \mathbb{N}_0 = {0,1,2,...}\]
\[ h_B(\pi) := | \{ (i,\pi(i)) : i \in [n] \} \cap B | \]
The associated hit numbers count how many of the $n!$ permutations hit that many times.
\[ h_k(B) := | \{ \pi \in S_n : h_B(\pi) = k \} | \hspace{17pt} \textrm{for} \hspace{3pt} k \in \mathbb{N}_0\]

\begin{figure}[h!]
\centering
\includegraphics[scale=.42]{permutations_to_hit_numbers.png}
\caption{We see: $h_0(B') = 1$, $h_1(B') = 4$, $h_2(B') = 1$.}
\label{fig:hits}
\end{figure}

\newpage

We will now see the identity which relates the rook numbers and the hit numbers by considering arrangements of rooks as partial permutations of $[n]$.
\[ \mathlarger{{\sum_i}} h_i(B) \binom{i}{j} = r_j(B)\cdot(n-j)! \hspace{17pt} \forall j\in \mathbb{N}_0 \]
\begin{proof}
This equality will be achieved by double counting the number of pairs $(\pi, H)$ where $\pi$ is a permutation and $H$ is a j-subset of the set of $\pi$'s hits ($\{ (i,\pi(i)) : i \in [n] \} \cap B$)

The left-hand side picks $\pi$ first.
Call i the number of hits of $\pi$, $i=h_B(\pi)$, and then take all $\binom{i}{j}$ subsets of the i hits which have size j.
Since there are $h_i(B)$ permutations which have hit number i and contribute $\binom{i}{j}$ pairs to our sum, we have ${\sum_i} h_i(B) \binom{i}{j}$ pairs in total.

\begin{figure}[h!]
\centering
\includegraphics[scale=.36]{lhs.png}
\caption{We first pick $\pi = e$ and then choose the $\binom{2}{1}$ different subsets (of size 1) of its 2 hits.}
\label{fig:LHS}
\end{figure}

The right-hand side picks H first.
We know that there are $r_j(B)$ subsets of the board which have size j.
For each of these, we can then extend them to a permutation by filling the empty rows and columns in (n-j)! ways.

\begin{figure}[h!]
\centering
\includegraphics[scale=.36]{rhs.png}
\caption{We first pick $H=\{(2,2)\}$ and extend to the $(3-1)!$ different permutations}
\label{fig:RHS}
\end{figure}

\end{proof}

\subsection{Defining the Rook Polynomial}

Given this identity for all j, we can multiply each of these identities by $t^j$, yielding:
\[ \mathlarger{{\sum_i}} h_i(B) \binom{i}{j} t^j = r_j(B)\cdot(n-j)!\cdot t^j \hspace{17pt} \forall j\in\mathbb{N}_0\]
Summing over j yields
\[ \mathlarger{{\sum_i}} h_i(B) \mathlarger{{\sum_j}} \binom{i}{j} t^j = \mathlarger{{\sum_j}} r_j(B)\cdot(n-j)!\cdot t^j \]
\[ \mathlarger{{\sum_i}} h_i(B) (1+t)^i = \mathlarger{{\sum_j}} r_j(B)\cdot(n-j)!\cdot t^j\]
Plugging in $t=-1$ yields
\[ h_0(B)  = \mathlarger{{\sum_j}} (-1)^j\cdot r_j(B)\cdot(n-j)! \]

This number $h_0(B)$ counts how many permutations totally avoid our subset B.
This is the critical identity which fuels the study of rook polynomials, but this identity can equally be derived through the principle of inclusion and exclusion.

Regardless, corresponding to this equation, let us define the rook polynomial:
\[ r_B(x) := \mathlarger{{\sum_k}} (-1)^k\cdot r_k(B)\cdot x^{n-k} \]
Let $\phi$ be a linear functional on polynomials in x with the effect:
\[ \phi(x^k) = k! \]
Thus, $h_0(B) = \phi(r_B(x))$ which may seem a little convoluted at first, but it results in the following fantastic property:

$r_{B_1}(x) * r_{B_2}(x) = r_{B_1\oplus B_2}(x).\hspace{17pt}$ where $B_1\oplus B_2$ is the direct sum of two boards as depicted below.

\begin{figure}[h!]
\centering
\includegraphics[scale=.36]{composition.png}
\caption{Direct sum of two boards}
\label{fig:comp}
\end{figure}

\subsection{Implications of the Product Formula}
Take $l_n(x)$ to be for the complete board
$l_n(x) = r_{[n]\times[n]}(x)$.
We need to count the number of ways to put k rooks on the nxn board.
The first rook has $n^2$ places to go, the second will then have $(n-1)^2$ places, then $(n-2)^2$, etc.  Since we picked these with respect to order, we need to divide by the $k!$ different orders to get the number of ways and then:
\[
\frac{(n)^2\cdot(n-1)^2\cdot ... \cdot(n-(k-1))^2 }{k!} = k! \cdot \frac{((n)\cdot(n-1)\cdot ... \cdot(n-(k-1)))^2}{(k!)^2} = k! \cdot\binom{n}{k}^2
\]
So, $l_n(x) = \sum_{k=0}^n (-1)^k \binom{n}{k}^2 k! x^{n-k}$.  This allows to write the solution for the number of `generalized derrangements.'

The number of permutations of $n = n_1 + ... + n_r$ objects where $n_i$ objects have the color i such that i and $\pi(i)$ have different colors is:
\[
\phi\bigg{(}\mathlarger{\prod_{i=1}^r} l_{n_i}(x) \bigg{)}
\]
This fact simply follows from our product of boards identity by using the full boards $[n_i]\times[n_i]$ and full rook polynomials $l_{n_i}(x)$.
(The case of derrangements is $n_i = 1$ for all $i\in[r]$.)
This result was proved by Evens and Gillis in 1976, without using the connection to rook theory.

\begin{figure}[h!]
\centering
\includegraphics[scale=.33]{gen_derr.png}
\caption{An example of a generalized derrangement with $n_1=3,n_2=4,n_3=4$}
\label{fig:der}
\end{figure}

\section{Generalized Rook Polynomials}
To generalize this rook polynomial beyond permutations of $[n]$ and the conditions $\pi(i) = j$, we can use Ira Gessel's \citep{gessel88} definition of a generalized rook polynomial.

Let us have sets $T_0,T_1,T_2,...$ which have cardinalities $M_0,M_1,M_2,...$ .
For each $n\in\mathbb{N}_0$ we will additionally have a ``set of conditions'' $C_n$ which satisfy $C_0 \subseteq C_1 \subseteq C_2 \subseteq ...$.
To each condition $c\in C_n$ we will have a set $T_n^c \subseteq T_n$ which are the elements of $T_n$ which satisfy the condition.
For a set of multiple conditions $A\subseteq C_n$ we will say the set satisfying all of these properties is $T_n^A = \cap_{a\in A} T_n^a$.

The following property is what we need to stay in the rook polynomial structure:
If $A\subseteq C_n$, one of the following occurs:
\vspace{-5mm}
\begin{itemize}
  \item $T_m^A = \emptyset$ for all $m\geq n$. ``A is incompatible''
  \item There is a $\rho(A)\in\mathbb{N}_0$ such that for every $m\geq n$ there is a bijection $T_m^A\rightarrow T_{m-\rho(A)}$
\end{itemize}

Another technical condition we need is that our sequence $(M_n)\in\mathbb{N}_0$ does not satisfy any linear homogeneous recurrence equation.
This condition is needed so that $\rho(A)$ will be uniquely determined when it exists.

For a set of conditions in $C_n$, take $B\subseteq C_n$.
This means $B\subseteq C_m$ for all $m\geq n$.
We want to count the elements of $T_m$ for $m\geq n$ which satisfy \textit{none} of the conditions in B.
We will denote this set $T_m/B$.
By inclusion-exclusion, we have that
\[ T_m/B = \sum_{\substack{A\subseteq B \\ compatible}} (-1)^{|A|}\cdot M_{m-\rho(A)}    \]
Correspondingly, we will finally define our ``generalized rook polynomial'' to be:
\[ r_B(x) = \sum_{\substack{A\subseteq B \\ compatible}} (-1)^{|A|}\cdot x^{n-\rho(A)}    \]

If we define $\phi(x^n) = |T_n| = M_n$, then for all $m\geq n$, $\hspace{17pt} |T_m/B| = \phi( r_B(x) \cdot x^{m-n} )$.
Because of our linear recurrence restriction on $(M_n)$, this equation is actually able to uniquely determine $r_B(x)$.

This new definition still has the property that the product of the polynomials for two disjoint `boards' are equal to the the polynomial of their disjoint attachment.
This will again be useful to us.

\subsection{Connection to the Original Rook Polynomial}

We will first tie this more general definition back to our original setting.
First, our sets $T_n$ were the sets of permutations of $[n]$, so $T_n = S_n$ for all $n\in\mathbb{N}_0$, hence $M_n =n!$ for all $n\in\mathbb{N}_0$.
The conditions are slightly more tricky.
These conditions are associated to the `boards' which were subsets of $[n] \times [n]$ and prescribed which spots on the board the permutations were not allowed to `hit.'
So, $C_n = \{ ``\pi(i) = j''$ for $(i,j)\in [n]\times[n] \}$ and a set of conditions in $C_n$ $B\subseteq C_n$ is the same as a board $B\subseteq [n]\times [n]$

We can now check if our original setting indeed satisfies the property of compatibility claimed to be essential.
Let $A \subseteq C_n$.
Suppose there is a distinct pair $(i,j),(i',j')\in A$ with $i=i'$ or $j=j'$, then $T_m^a = \emptyset$ and A is incompatible, because there is no permutation which sends one element to two different values and there is no permutation which sends two elements to the same value.
Otherwise, there is a pretty simple bijection by seeing that each condition in A fixes exactly one input and output of our permutation.
Each time we fix an element of our permutation of n elements, we are left with a permutation of (n-1) elements.
This is the bijection $S_m^A \rightarrow S_{m-|A|}$ for all A which are compatible.
This means that $\rho(A) = |A|$.

Now we can see that our definitions now align because the compatible subsets of size k correspond exactly to placements of non-attacking rooks onto the board:
\[ \mathlarger{{\sum_k}} (-1)^k\cdot r_k(B)\cdot x^{n-k} = r_B(x) = \sum_{\substack{A\subseteq B \\ compatible}} (-1)^{|A|}\cdot x^{n-\rho(A)}    \]

\subsection{Linear Permutations}

In this setting, we will also take $T_n = S_n$ and $M_n = n!$, but our conditions will be very different.
Our elementary conditions will be ``i is immediately followed by j'' where we see a permutation as the one-line notation.
Equivalently, this condition is ``for some k, $\pi(k) = i$ and $\pi(k+1) = j$.''
So our set of conditions are $C_n = \{$``i is immediately followed by j'' $: i\neq j\in [n] \} $ and $C_0\subseteq C_1\subseteq C_2\subseteq ...$ is $\{\}\subseteq \{\}\subseteq \{$``1 follows 2'', ``2 follows 1'' $\}\subseteq ... $

We will now show that the compatibility property holds.
Let $A\subseteq C_n$
Similar to before, if we have two distinct conditions $(i,j),(i',j')\in A$ with $i=i'$ or $j=j'$, then A must be incompatible because $i=i'$ can't be immediately followed by two different numbers $j,j'$ or $j=j'$ can't be immediately preceded by two different numbers $i,i'$.
Otherwise, the bijection to a permutation of a smaller number of elements comes by viewing each adjacent pair i,j as a single element.
Each time we group two elements of our permutation of n elements, we are left with a permutation of (n-1) elements (where one element consists of two).
For larger strings of pairs i,j,k,l,... which are all adjacent we can see these r elements all as one element or we can individually put together pairs of elements.
Regardless, we ultimately see that we have a bijection $S_m^A \rightarrow S_{m-|A|}$ for all A which are compatible.
This means that $\rho(A) = |A|$.

\subsection{Product Formula Application}

We will again take the full set of conditions in order to yield a useful formula.
Take $l_n^*(x) = r_{C_n}(x)$ where $C_n$ is defined as above.

We only need to look at compatible subsets, so we only need to pick elements in different rows and columns if we see $C_n$ as the chessboard without the diagonal.
We will now choose a compatible set of conditions of size k.
The first condition we choose has $n^2-n = n(n-1)$ places to go, the second will then have $(n-1)^2-(n-1) = (n-1)(n-2)$ places, then $(n-2)(n-3)$, etc.
Since we picked these in a particular order, we need to divide by the $k!$ to correctly count the number of subsets of size k.

\[
\frac{1}{k!}\cdot(n)(n-1)\cdot(n-1)(n-2)\cdot ... \cdot(n-(k-1))(n-k) = k! \cdot \frac{(n)\cdot ... \cdot(n-(k-1))}{k!} \cdot \frac{(n-1)\cdot ... \cdot(n-(k))}{k!}\]
\[
= k! \cdot\binom{n}{k}\cdot\binom{n-1}{k}
\]

So, $l_n^*(x) = \sum_{k=0}^n (-1)^k \binom{n}{k}\cdot\binom{n-1}{k} k! x^{n-k}$.
This allows to write the solution for the number of a specific type of linear permutation.

The number of linear arrangements of $n = n_1 + ... + n_r$ objects where $n_i$ are of color i, such that every adjacent object has a different colors is:
\[
\phi\bigg{(}\mathlarger{\prod_{i=1}^r} l_{n_i}^*(x) \bigg{)}
\]

This work on generalized rook polynomials has many more applications.
There are weighted sums instead of simple counting and the polynomials are used on other sets than just permutations.
If you are interested in this style of combinatorics, I highly encourage you to check out Gessel's paper \citep{gessel88}.
If you are not so interested, however, you are in luck because the linear permutation case is the solution to our original problem.

\section{Solution}
Our original problem asked about a set of 52 objects/ cards.
We asked that our permutation had no adjacent object of the same value.
We can see that we have 13 different values which we can now see as colors to see that we have 13 colors each with 4 associated objects/ cards.
So, we can take $r = 13$ and $n_i = 4$ for each $i \in [r]$.
We first want to calculate
\[
\mathlarger{\prod_{i=1}^r} l_{n_i}^*(x) = (l_4^*(x))^{13}
\]
\begin{multline}
(l_4^*(x))^{13} = \\
-876488338465357824 x^{13} + 17091522600074477568 x^{14} - 159520877600695123968 x^{15} \\
+ 949054268820802240512 x^{16} - 4044281535242623254528 x^{17} + 13151570567369808936960 x^{18} \\
  - 33954920849889627734016 x^{19} + 71502295779064701517824 x^{20} - 125212657768448227540992 x^{21} \\
 + 185006084370341623234560 x^{22} - 233228682051017005596672 x^{23} + 253073982060156904538112 x^{24} \\
- 238025750670961148952576 x^{25} + 195147037097635696607232 x^{26} - 140102373840493649854464 x^{27} \\
+ 88405409991914856382464 x^{28} - 49175456453520166748160 x^{29} + 24169421980306186960896 x^{30} \\
- 10514786687648809353216 x^{31} + 4054104097647470051328 x^{32} - 1386375667685767249920 x^{33} \\
+ 420612294417061773312 x^{34} - 113190888701156917248 x^{35} + 27000049659200077824 x^{36} \\
- 5701677221962874880 x^{37} + 1063971192922619904 x^{38} - 175008802134196224 x^{39} \\
+ 25291193280417792 x^{40} - 3197671558907904 x^{41} + 351835440473088 x^{42} \\
- 33462483664896 x^{43} + 2727515172096 x^{44} - 188444475648 x^{45} \\
+ 10878057216 x^{46} - 514605312 x^{47} + 19420128 x^{48} \\
- 561912 x^{49} + 11700 x^{50} - 156 x^{51} + x^{52} \\
\end{multline}

So,
\[ \phi(\hspace{1pt} (l_4^*(x))^{13} ) =\]\[ 3,668,033,946,384,704,437,729,512,814,619,767,610,579,526,911,188,666,362,431,432,294,400 \]
Hence, the probability of a perfect shuffle is:
\[ \frac{\phi(\hspace{1pt} (l_4^*(x))^{13} ) }{52!} =
\frac{672,058,204,939,482,014,438,623,912,695,190,927,357}{14,778,213,400,262,135,041,705,388,361,938,994,140,625} \approx 0.045476282331.\]
This means the chance of two adjacent cards being the same value is about $95.45\%$.
Interestingly, in the above probability, the numerator is prime and the denominator is $3^{5}\cdot 5^{10}\cdot 7^7\cdot 11^3\cdot 13^3\cdot 17^3\cdot 19^2\cdot 23^2\cdot29\cdot31\cdot37\cdot41\cdot43\cdot47$ which is always $p^{\lfloor{\frac{51}{p}}\rfloor}$ except for the lower prime factors of 2,3 which points to some small degree of symmetry in the space of ``perfect shuffles''.

\section{Conclusion}
The chance of a perfect shuffle is $\approx            4.5476282331\%$ and the chance of not is $\approx 95.4523717669\%$.
This easy to formulate question had a surprisingly sophisticated but rather elegant solution.
There are some questions which are obvious future directions of this problem.
The first is to consider how our probability changes when we consider the first and last cards of the deck to be `adjacent' to one another so that our deck of cards becomes a cyclic object.
The second is to consider instead of only $h_0(B)$ for our situation where we count the number of permutations satisfying none of the properties, we instead count each number which satisfy k of the properties (corresponding to $h_k(B)$.)
This will then give a distribution over the $52!$ permutations which count how many pairs of adjacent cards have the same value for a given shuffle.
Additionally, both of these questions can be asked simultaneously to give a distribution over the cyclic shuffles.
Hopefully this exposition was sufficient to understand the proof behind the coveted `probability of a perfect shuffle' and hopefully these future questions find their own answers as well.

\setstretch{0.8}
\bibliographystyle{plain}

What is the Perfect Shuffle?