\documentclass[12pt]{article}
\usepackage{e-jc}
\specs{P1.39}{24(1)}{2017}


%%%%%%%%%%%%%%%%%%%%%%%
%\usepackage[dvips]{graphicx}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{epic}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{tabularx}
\usepackage{array}
\usepackage{multirow}
\usepackage{longtable}

\usepackage[usenames]{xcolor}
\usepackage{amscd}

% use this command to create hyperlinks (optional and recommended)
\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

% use these commands for typesetting doi and arXiv references in the bibliography
\newcommand{\doi}[1]{\href{http://dx.doi.org/#1}{\texttt{doi:#1}}}
\newcommand{\arxiv}[1]{\href{http://arxiv.org/abs/#1}{\texttt{arXiv:#1}}}



\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{fullpage}
\usepackage{float}

\usepackage{latexsym}
\usepackage{tikz}




\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}

% declare theorem-like environments
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{observation}[theorem]{Observation}
\newtheorem{claim}[theorem]{Claim}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{open}[theorem]{Open Problem}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{question}[theorem]{Question}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{note}[theorem]{Note}

\DeclareMathOperator{\ch}{ch}
\DeclareMathOperator{\Av}{Av}
\DeclareMathOperator{\st}{st}
\DeclareMathOperator{\maj}{maj}
\DeclareMathOperator{\inv}{inv}
\DeclareMathOperator{\chv}{chv}
\DeclareMathOperator{\Des}{Des}
\DeclareMathOperator{\Den}{Den}
\DeclareMathOperator{\barsum}{\overline{sum}}


\newcommand{\ignore}[1]{}
\newcommand{\sgn}{\mbox{sgn}}

\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{\bf Inversion generating functions for\\signed pattern avoiding permutations}
\author{
        Naiomi T. Cameron \\
         \small Department of Mathematical Sciences\\[-0.8ex]
        \small Lewis \& Clark College\\[-0.8ex]
        \small Portland, OR, U.S.A.\\
        \small\tt ncameron@lclark.edu\\
            \and
        Kendra Killpatrick\\
        \small Natural Science Division\\[-0.8ex]
        \small Pepperdine University\\[-0.8ex]
        \small Malibu, CA, U.S.A.\\
        \small\tt Kendra.Killpatrick@pepperdine.edu
}

% \date{\dateline{submission date}{acceptance date}\\
%\small Mathematics Subject Classifications: 05A05, 05A15
% MSC codes available from http://www.ams.org/mathscinet/freeTools.html}

\date{\dateline{Oct 17, 2016}{Feb 10, 2017}{Feb 17, 2017}\\
\small Mathematics Subject Classifications: 05A05, 05A15}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\maketitle

\begin{abstract}
We consider the classical Mahonian statistics on the set $B_n(\Sigma)$ of signed permutations in the hyperoctahedral group $B_n$ which avoid all patterns in $\Sigma$, where $\Sigma$ is a set of patterns of length two.  In 2000, Simion gave the cardinality of $B_n(\Sigma)$ in the cases where $\Sigma$ contains either one or two patterns of length two and showed that $\left|B_n(\Sigma)\right|$ is constant whenever $\left|\Sigma\right|=1$, whereas in most but not all instances where $\left|\Sigma\right|=2$, $\left|B_n(\Sigma)\right|=(n+1)!$.  We answer an open question of Simion by providing bijections from $B_n(\Sigma)$ to $S_{n+1}$ in these cases where $\left|B_n(\Sigma)\right|=(n+1)!$.  In addition, we extend Simion's work by providing a combinatorial proof in the language of signed permutations for the major index on $B_n(21, \bar{2}\bar{1})$ and by giving the major index on $D_n(\Sigma)$ for $\Sigma =\{21, \bar{2}\bar{1}\}$ and $\Sigma=\{12,21\}$.  The main result of this paper is to give the inversion generating functions for $B_n(\Sigma)$ for almost all sets $\Sigma$ with $\left|\Sigma\right|\leq2.$

\bigskip\noindent \textbf{Keywords:} signed permutations, pattern avoiding permutations, inversion statistic, major index, generating function

\end{abstract}


\section{Introduction}\label{background}



The hyperoctahedral group $B_n$ is the set of {\em signed permutations} of $[n]$, that is, words of the form $b = b_1b_2\cdots b_n$ where
each of the symbols $1, 2, \dots, n$ appears, possibly barred. The cardinality of $B_n$ is $n!2^n.$  The group $D_n$ is the subset of $B_n$ containing all signed permutations with an even number of barred elements.  In 1993, Reiner introduced the notion of permutation statistics for signed permutations and Egge and Mansour have studied the notion of pattern avoidance on signed permutations \cite{Eg, Ma, Re}. In the present paper, we combine these notions for a study of permutation statistics on pattern avoiding signed permutations.

Let $b = b_1b_2\cdots b_n\in B_n$ and $\sigma=\sigma_1\sigma_2\cdots\sigma_k\in B_k$.  We say {\bf $b$ avoids the pattern $\sigma$} if there is no subsequence $b^*=b_{i_1}b_{i_2}\cdots b_{i_k}$ of $b$ for which (1) $b_{i_1}b_{i_2}\cdots b_{i_k}$ with all bars removed is order isomorphic to $\sigma$ with all bars removed (that is, $b^*$ matches $\sigma$ order-wise) and (2) $b_{i_j}$ is barred in $b$ if and only if $\sigma_j$ is barred in $\sigma$ (that is, $b^*$ matches $\sigma$ bar-wise).

Given a collection $\Sigma$ of patterns, let $B_n(\Sigma)$ denote the set of all signed permutations in $B_n$ that simultaneously avoid all signed patterns in $\Sigma.$  Simion \cite{Si} studied the case where $\Sigma$ contains one or two signed patterns of length 2.  As in her paper, we let $\beta_n(\Sigma)=\left|B_n(\Sigma)\right|.$

\begin{proposition}[Simion, \cite{Si}]  If $\sigma$ is any signed pattern of length 2, then for each $n$, 
\[
\beta_n(\sigma)=\sum_{k=0}^n{\binom{n}{k}}^2\cdot k!
\]
\end{proposition}  

For patterns of length 2, Simion proved (we made a correction to her proposition):
\begin{proposition}[Simion, \cite{Si}]
\[
\beta_n(12,21)=\beta_n(2\bar{1}, \bar{1}2)=\beta_n(2\bar{1}, 1\bar{2})=\beta_n(12, 1\bar{2})=(n+1)!
\]
\[
n! < \beta_n(12, \bar{2}1) < (n+1)! \text{ for } n \geq 3
\]
\[
\beta_n(21, \bar{2} \bar{1}) = \binom{2n}{n}
\]
\[
\beta_n(1\bar{2},\bar{1}2)=2\sum_{\substack{(a_1,\dots,a_k) \\ a_1+\cdots+a_k=n}}{a_1!a_2!\cdots a_k!}
\]
\label{class1}
\end{proposition}
As Simion indicates in \cite{Si}, it is sufficient to consider these seven pairs of signed patterns as all other pairs are in the orbit of one of these seven under the involutions reversal, barring and complementation.  For $b=b_1\cdots b_n\in B_n$,  complementation means $b_i$ is replaced with the value $n+1 - \vert b_i \vert$, which is barred if an only if $b_i$ is barred, and the absolute value notation means $\left|b_i\right|=\overline{b_i}$ if the symbol $b_i$ is barred and $\left|b_i\right|=b_i$ if $b_i$ is unbarred.  Simion left the open question of finding explicit bijections between the sets of these signed permutations that are counted by $(n+1)!$ and in Section \ref{bijections} of this paper we answer this open question by giving bijections from each class counted by $(n+1)!$ to $S_{n+1}$.  


With respect to the total ordering $1<2<\cdots<n<\bar{n}<\cdots<\bar{2}<\bar{1}$, we say $b\in B_n$ has a {\em descent} at $i$ (less than $n$) when $b_i>b_{i+1}$ and $b$ has a {\em descent} at $n$ when $b_n$ is barred.  The {\em descent set of $b$} is 
$$\Des^B(b)=\{i\in[n]: b\text{ has a descent at } i\}$$ and we define the {\bf major index} of $b$ as
$$\maj^B(b):=\sum_{i\in\Des^B(b)}{i}.$$
With respect to the same total ordering, we say $(b_i,b_j)$ where $i<j$ is an {\em inversion} pair in $b$ iff $b_i>b_j$.  We define the {\bf inversion} statistic of $b$ as $$\inv^B(b):=\#\text{ of inversion pairs in }b.$$ When $\pi\in S_n$, we use $\maj^A(\pi)$ and $\inv^A(\pi)$ to denote the major index and the number of inversion pairs of $\pi$ with respect to the standard total ordering of $1,\dots,n.$  We recall here the celebrated result of MacMahon which gives the equidistribution of major index and inversion statistic over $S_n$ as a $q$-factorial, that is, $$\sum_{\pi\in S_n}{q^{\maj^A(\pi)}}=\sum_{\pi\in S_n}{q^{\inv^A(\pi)}} =(1+q)(1+q+q^2)\cdots (1+q+\cdots +q^{n-1})=:[n]!_q.$$ 
Given a  statistic $f$ on $B_n$, define $$B_n^{f}(\Sigma)(q):=\sum_{b\in B_n(\Sigma)}{q^{f(b)}}$$ Simion studied relations between statistics on type-B noncrossing partitions and restricted signed permutations and gave the following explicit generating function for the type $B_n$ major index statistic on signed permutations in $B_n$ avoiding both $21$ and $\bar{2} \bar{1}$.  

\begin{theorem}[Simion, \cite{Si}]
\[
B_n^{\maj^B}(21,\bar{2}\bar{1})(q)=\sum_{k=0}^n{\binom{n}{k}\left[\begin{array}{c} n \\ k\end{array}\right]_q q^{\binom{k+1}{2}} } \label{maj}
\]
\end{theorem}


In Section \ref{major}, we give the generating function for the major index on signed permutations avoiding the patterns $12$ and $21$, as well as the major index on the type $D_n$ permutations that avoid $\Sigma=\{12,21\}$ and $\Sigma=\{21,\bar{2}\bar{1}\}$.  In Section \ref{inversions}, we give the generating function for the inversion statistic for one of the two classes of type $B_n$ permutations that avoid a single pattern of length two and for all but two of the classes of the type $B_n$ permutations that avoid two such patterns.  


\section{Bijective Proofs}\label{bijections}

In this section, we answer an open question of Simion to give bijections between each of the sets of restricted permutations given by $B_n(12,21)$, $B_n(2\bar{1}, \bar{1}2)$, $B_n(2\bar{1}, 1 \bar{2})$, and $B_n(12, 1\bar{2})$.  Since Simion proved that each of these sets is counted by $(n+1)!$, we will give explicit bijections between each of these sets and $S_{n+1}$.  In Theorem \ref{a_n} we provide a correction to the enumeration of $B_n(1\bar{2},\bar{1}2)$ given in \cite{Si}.



\begin{theorem}
There is a bijection from $B_n(12, 21)$ to $S_{n+1}$.
\end{theorem}

\begin{proof}
Let $\sigma \in B_n(12, 21)$.  Any permutation in $B_n(12, 21)$ has either all elements barred or exactly one element unbarred.  If $\sigma$ has all elements barred, then let $\pi_i = \sigma_i$ (without the bar) and let $\pi_{n+1} = n+1$.  Then $\pi \in S_{n+1}$.  

If $\sigma$ has one element unbarred, say $j$, then let $\pi_j = n+1$, let $\pi_i = \sigma_i$ (without the bar) for $1 \leq i \leq j-1$ and let $\pi_{i+1} = \sigma_i$ (without the bar) for $j \leq i \leq n$.

For the reverse map, let $\pi \in S_{n+1}$ and suppose $\pi_j=n+1$, that is, $j$ is the position of $n+1$.  If $j=n+1$, delete $n+1$ from $\pi$ and place a bar on every remaining element of $\pi$.  If $j<n+1$, delete $n+1$ and place a bar on every remaining element except $\pi_{j+1}$.

\ignore{
place all elements $1$ through $n$ from $\pi$ into $\sigma$ in the same relative order.  If $n+1$ is in position $j$ in $\pi$, then let $j$ be the only unbarred element in $\sigma$.  If $n+1$ is in position $n+1$ in $\pi$, then all elements in $\sigma$ are barred.
}


\end{proof}




\begin{theorem}
There is a bijection between $B_n(\bar{1}2, 2 \bar{1})$ and $S_{n+1}$.
\end{theorem}

\begin{proof}
If $\sigma \in B_n(\bar{1}2,2 \bar{1})$, then the unbarred numbers in $\sigma$ must be less than the barred numbers in $\sigma$ (in absolute value).  So either all numbers in $\sigma$ are barred or the numbers $1$ through $k$ are unbarred and the numbers $k+1$ through $n$ are barred, for $1 \leq k \leq n$.  If the numbers $1$ through $k$ are unbarred, then create $\pi\in S_{n+1}$ by letting $\pi_k= n+1$ and placing the numbers $1,\dots, n$ into $\pi$ in the same relative order as the elements of $\sigma$.  If all numbers in $\sigma$ are barred, then let $\pi_{n+1}=n+1$ and place the numbers 1 through $n$ into $\pi$ in the same relative order as the elements of $\sigma$.  

Now let $\pi\in S_{n+1}.$  For the reverse map, if $\pi_k=n+1$, then place the numbers $1,\dots, k$ and $\overline{k+1},\dots,\bar{n}$ into $\sigma$ in the same relative position as the elements $1,\dots,n$ of $\pi$.  
\end{proof} 










\begin{theorem}  
There is a bijection from $B_n(1 \bar{2},2 \bar{1})$ to $S_{n+1}$.
\end{theorem}

\begin{proof}
If $\sigma \in B_n(1 \bar{2}, 2 \bar{1})$, then $\sigma$ consists of $j$ barred numbers followed by $n-j$ unbarred numbers, for $0 \leq j \leq n$.  To create $\pi \in S_{n+1}$, let $\pi_{j+1}=n+1$ and  $\pi_i=|\sigma_i|$ for $1\leq i \leq j$ and $\pi_{i+1}=\sigma_i$ for $j<i\leq n$.  

For the reverse map, if $\pi_{j+1}=n+1$, then let $\sigma_i = \overline{\pi_i}$ for $1 \leq i \leq j$ and let $\sigma_i = \pi_{i+1}$ for $j < i \leq n$.
\end{proof}
 
\begin{theorem}
 There is a bijection from $B_n(12,{1}\bar{2})$ to $S_{n+1}.$
\end{theorem}

\begin{proof}
If $\sigma\in B_n(12,{1}\bar{2})$ then the unbarred elements of $\sigma$ must followed by numbers smaller in absolute value.  To form $\pi \in S_{n+1}$, first let $\pi_j=i$ whenever $\sigma_j=\bar{i}$.  Now place the remaining $k$ unbarred numbers of $\sigma$ into the rightmost $k$ available positions of $\pi$ (due to the pattern restriction, these numbers will appear in decreasing order).  Place $n+1$ in the last remaining open position.

For the reverse map, suppose $\pi\in S_{n+1}$ and $n+1=\pi_j$.  First, if $\pi_l=i$, then let $\sigma_l=\bar{i}$ for $1 \leq l <j$.  Now suppose $\pi_{n+1}=k_1$.  For each $i<k_1$, if $\pi_l=i$ then let $\sigma_l=\bar{i}.$  Place $k_1$ (unbarred) in the first (from the right) available position in $\sigma$, say position $m_1$.  Suppose $\pi_{m_1}=k_2$.  And now for each $i<k_2$, if $\pi_l=i$ then let $\sigma_l=\bar{i}$.  Place $k_2$ (unbarred) in the first (from the right) available position in $\sigma$, say position $m_2$.  Now iterate this process until $m_i = j$ for some $i$.
\end{proof}






\begin{theorem}
 $$\beta_n(1\bar{2},\bar{1}2) = \ignore{n!+\sum_{j=0}^{n-1}{a_j(n-j)!}=n!+\sum_{j=1}^{n}{j!a_{n-j}}=} 2\sum_{\substack{(a_1,\dots,a_k) \\ a_1+\cdots+a_k=n}}{a_1!a_2!\cdots a_k!}.$$
\label{a_n}
\end{theorem}

\begin{proof}
Each $\sigma\in B_n(1\bar{2},\bar{1}2)$ can be considered as a sequence of blocks of integers which alternate between barred and unbarred.  Each block of integers is preceded by numbers which are larger (in absolute value) and followed by numbers which are smaller (in absolute value), however within each block, the integers may appear in any order.  So given the length of each block, the numbers that must appear in each block are determined.  Hence, $\pi$ is in direct correspondence with a composition of $n$ into some number of parts (blocks), where each part of size $i$ has $i!$ colors.  Since $\sigma$ can start with a barred or unbarred block, we double the count.
 \end{proof}






\section{Major index generating functions on \texorpdfstring{$B_n(\Sigma)$}{Lg} and \texorpdfstring{$D_n(\Sigma)$}{Lg}}\label{major}




Simion proved the following result using a bijection between signed permutations and non-crossing partitions:
\begin{theorem}[Simion, \cite{Si}] $$\displaystyle B_n^{\maj}(21,\bar{2}\bar{1})(q)=\sum_{k=0}^n{\binom{n}{k}\left[\begin{array}{c} n \\ k\end{array}\right]_q q^{\binom{k+1}{2}} }$$\label{maj21bar2bar1}\end{theorem}

Using standard recurrences for the binomial and $q$-binomial coefficients, that is,
$$ \left[\begin{array}{c} n \\ k\end{array}\right]_q= \left[\begin{array}{c} n-1 \\ k\end{array}\right]_q + \left[\begin{array}{c} n-1 \\ k-1\end{array}\right]_q q^{n-k}$$ one can show that Theorem \ref{maj21bar2bar1} equates to:


$$\sum_{k=0}^{n-1}{ \binom{n-1}{k} \left[\begin{array}{c} n-1 \\ k\end{array}\right]_q   q^{\binom{k+1}{2}}  }   +
{ \binom{n-1}{k-1} \left[\begin{array}{c} n-1 \\ k\end{array}\right]_q   q^{\binom{k+1}{2}}  }   $$

$$ { \binom{n-1}{k} \left[\begin{array}{c} n-1 \\ k-1\end{array}\right]_q   q^{\binom{k+1}{2}-k} q^{n}  }   +
{ \binom{n-1}{k-1} \left[\begin{array}{c} n-1 \\ k-1\end{array}\right]_q   q^{\binom{k+1}{2}-k} q^{n} }   $$
We now give a combinatorial interpretation of this recurrence using signed permutations.  It is well-known that the $q$-binomial coefficient satisfies $$\left[\begin{array}{c} n \\ k\end{array}\right]_q q^{\binom{k+1}{2}}=\sum_{\{a_1,\dots,a_k\}}{q^{a_1+\cdots+a_k}}$$ where the sum is over all possible $k$-subsets of $[n]$.  


The first two terms of the recurrence correspond to the set of restricted signed permutation with $k$ descents in which the last position is unbarred.  In this case, either $n$ is barred or $n$ is unbarred.  First, suppose $n$ is unbarred.  To create such a restricted signed permutation, we will first choose $k$ numbers from $\{1,\dots,n-1\}$ that will be barred in $\binom{n-1}{k}$ ways, then we will choose the $k$ positions from $\{1,\dots,n-1\}$ to place the barred numbers.  Since these permutations avoid the patterns $21$ and $\bar{2}\bar{1}$, once we have chosen the numbers and positions for the barred elements, the permutation is uniquely determined and each barred position is a position where a descent occurs.  Hence, the generating function for $\maj^B$ for this set of permutations is $$\sum_{k=0}^n{\binom{n-1}{k} \left[\begin{array}{c} n-1 \\ k\end{array}\right]_q q^{\binom{k+1}{2}}}$$
Under the same conditions, if $n$ is barred, the generating function for $\maj^B$ is
$$\sum_{k=0}^{n-1}{ \binom{n-1}{k-1} \left[\begin{array}{c} n-1 \\ k\end{array}\right]_q   q^{\binom{k+1}{2}}  }$$

The last two terms of the recurrence correspond to the set of restricted signed permutation with $k$ descents in which the last position is barred.  Again, $n$ is either unbarred or barred.  In this case, we choose $k-1$ positions from the set $\{1,\dots,n-1\}$ to place our barred numbers.  Given that the last position corresponds to a descent and we pick up a factor of $q^{n}$ to account for the descent in the last position.

We can extend this result for the major index on signed permutations to the set of permutations in $D_n$ (the signed permutations with an even number of signs) avoiding the set $(21, \bar{2} \bar{1})$.

\begin{corollary}

\begin{eqnarray*}
D_n^{\maj^D}(21,\bar{2}\bar{1})(q) = \sum_{j=0}^{\lfloor \frac{n-1}{2}\rfloor} \binom{n-1}{2j} \left[\begin{array}{c} n-1 \\ 2j \end{array}\right]_q q^{\binom{2j+1}{2}} + \\
\sum_{j=0}^{\lfloor \frac{n-1}{2}\rfloor} \binom{n-1}{2j} \left[\begin{array}{c} n-1 \\ 2j-1 \end{array}\right]_q q^{\binom{2j}{2}} + \\
\sum_{j=0}^{\lfloor \frac{n-1}{2} \rfloor} \binom{n-1}{2j-1} \left[\begin{array}{c} n-1 \\ 2j \end{array}\right]_q q^{\binom{2j+1}{2}}q^n + \\
\sum_{j=0}^{\lfloor \frac{n-1}{2}\rfloor} \binom{n-1}{2j-1} \left[\begin{array}{c} n-1 \\ 2j-1 \end{array}\right]_q q^{\binom{2j}{2}}q^n
\end{eqnarray*}


\end{corollary}

\begin{proof}
The four terms in the generating function correspond to the four cases where the last element is unbarred and $n$ is unbarred, the last element is unbarred and $n$ is barred, the last element is barred and $n$ is unbarred and the last element is barred and $n$ is barred, using the same reasoning as in the proof of the theorem.
\end{proof}


Simion notes in \cite{Si} that G. Andrews asked whether it is possible to derive a $p, q$-analogue in which the other binomial coefficient in Theorem \ref{maj21bar2bar1}
becomes a $p$-binomial coefficient.  We now define a statistic on $B_n$ which allows us to obtain the desired $p,q$-analogue.

\begin{definition}
 For $b=b_1\cdots b_n \in B_n$, let $\displaystyle \barsum(b)$ denote the sum of the barred elements of $b$.  That is,
 $$\barsum(b)=\sum_{i=1}^n{\left|b_i\right|\cdot\chi(b_i\ \text{barred})}$$
\end{definition}

\begin{theorem}
 $$\sum_{b\in B_n(21,\bar{2}\bar{1})}{ p^{\barsum(b)} q^{\maj(b)} }= \sum_{k=0}^n{           \left[\begin{array}{c}n\\k\end{array}\right]_p     \left[\begin{array}{c}n\\k\end{array}\right]_q    p^{\binom{k+1}{2}}q^{\binom{k+1}{2}}  }   $$
\end{theorem}

\begin{proof}
 The proof follows from the combinatorial proof of Theorem \ref{maj21bar2bar1} and the definition of $\barsum(b).$
\end{proof}




We now give the major index generating function on the class of signed permutations avoiding the patterns $12$ and $21$.

\begin{theorem}

\begin{eqnarray*}
 B_n^{\maj^B}(12,21)(q)&=& \left( \sum_{\pi\in S_n}{ q^{\maj^A(\pi)} } \right) q^n + (n-1) \left( \sum_{\pi\in S_n}{ q^{\maj^A(\pi)} } \right) q^n\\
 &+&   \left( \sum_{\pi\in S_n}{ q^{\maj^A(\pi)} } \right)  = (nq^n + 1) [n]!_q 
\end{eqnarray*}
 \end{theorem}

\begin{proof}
 
 A signed permutation that avoids the patterns $12$ and $21$ is either all barred or has one element that is unbarred.  If a permutation has all barred elements, then we can biject it with a permutation in $S_n$ whose elements appear in the same relative order, thus $\maj^B$ on all barred signed permutations is the same as $\maj^A$ on unsigned permutations, except that we pick up a factor of $q^n$ for the descent in the last position.  This accounts for the first term in the sum.

  If the signed permutation $\sigma$ has exactly one unbarred element, first suppose this element is not in the last position.  Then we have $(n-1)$ choices of where the unbarred element appears.  Now we may associate this permutation with a permutation $\pi \in S_n$ so that the unbarred element of $\sigma$ corresponds to the $1$ element of $\pi$ and the remaining elements of $\sigma$ are replaced with the numbers $2,\dots,n$ in relative order according to $\sigma$.  Hence, to get $\maj^B$ on this set, we can compute $\maj^A$ on $S_n$ and multiply by $q^n$, since the last element is barred, giving us the second term in the sum.

If the signed permutation $\sigma$ has exactly one unbarred element and it is in the last position, then we can again associate this permutation with a permutation $\pi \in S_n$ so that the unbarred element of $\sigma$ corresponds to the $1$ element of $\pi$ and the remaining elements of $\sigma$ are replaced with the numbers $2,\dots,n$ in relative order according to $\sigma$.  Hence, to get $\maj^B$ on this set, we can simply compute $\maj^A$ on $S_n$, giving us the final term in the sum.
\end{proof}

\begin{corollary}
If $n$ is even,
\[
 D_n^{\maj^D}(12,21)(q)=q^n \left( \sum_{\pi\in S_n}{ q^{\maj^A(\pi)} } \right)=q^n [n]!_q
\]
and if $n$ is odd,
\[
D_n^{\maj^D}(12,21)(q)= (n-1) \left( \sum_{\pi\in S_n}{ q^{\maj^A(\pi)} } \right) q^n
 +   \left( \sum_{\pi\in S_n}{ q^{\maj^A(\pi)} } \right) =(1+(n-1)q^n)[n]!_q.
\]
 \end{corollary}





\section{Inversion generating functions on \texorpdfstring{$B_n(\Sigma)$}{Lg}}\label{inversions}

 In this section, we give generating functions for the inversion statistic on classes of signed permutations that avoid one or two signed patterns.  The operations of reversal and barring change the inversion statistic in a well-defined way, but complementation does not, so when working with the inversion statistic, there are only two classes of signed permutations that avoid a single pattern of length two to consider, $B_n(12)$ and $B_n(1 \bar{2})$ and we give the inversion generating function for $B_n(12)$.  However, for classes that avoid two signed permutations, there are three additional classes to consider beyond those enumerated in Proposition \ref{class1}.  They are $B_n(12, \bar{2} \bar{1})$, $B_n(12, \bar{1}2)$ and $B_n(12, 2\bar{1})$.  Of the ten classes under consideration for the inversion statistic, we give inversion generating functions for all but $B_n(1\bar{2}, \bar{1}2)$ and $B_n(12, 2\bar{1})$. 

\begin{theorem}
$\displaystyle B_n^{\inv^B}(12)(q) = \sum_{k=0}^n \binom{n}{k} \left[\begin{array}{c} n \\ k\end{array}\right]_q q^{\binom{k}{2}} \left[n-k\right]!_q$
\end{theorem}

\begin{proof}
A permutation in $B_n(12)$ contains $k$ unbarred elements which appear in decreasing order and $n-k$ barred elements which can appear anywhere in the permutation and in any order.  We can choose the $k$ unbarred elements in $\binom{n}{k}$ ways and then choose the $k$ places where these elements will appear in the permutation.  Any unbarred element in position $k$ forms $k-1$ inversions with each of the elements before it in the permutation, thus to determine the inversions created by the unbarred elements we need to sum the positions of the $k$ unbarred elements and subtract $k$.  We can do this in $\left[\begin{array}{c} n \\ k\end{array}\right]_q q^{\binom{k+1}{2}-k}$ ways.  Finally, the barred elements are isomorphic to a permutation in $S_{n-k}$ so we can compute the inversions created between the barred elements by computing $\inv^A$ on the corresponding permutation, which gives $\left[n-k\right]!_q$. 
\end{proof} 

Determining the generating function for the inversion statistic on $B_n(1 \bar{2})$ remains an open problem.  We now give the inversion generating function for classes of signed permutations that avoid two signed patterns of length two.


\begin{theorem}
$\displaystyle B_n^{\inv^B}(12,21)(q)= \ignore{(n+1) \left( \sum_{\pi\in S_n}{ q^{\inv^A(\pi)} } \right)  =} (n+1)[n]!_q $
\end{theorem}

\begin{proof}
 As in Section \ref{major}, a permutation in $B_n(12,21)$ has either all barred elements or only one unbarred element.  If the permutation is all barred, we can associate it with a permutation in $S_n$ whose elements appear in the same relative order, thus we can compute $\inv^B$ as $\left( \sum_{\pi\in S_n}{ q^{\inv^A(\pi)} } \right) $.  If the permutation has exactly one unbarred element, then we have $n$ choices for the element in the unbarred position.  As before, we now associate this permutation with a permutation $\pi \in S_n$ so that the unbarred element of $\sigma$ corresponds to the $1$ element of $\pi$ and the remaining elements of $\sigma$ are replaced with the numbers $2,\dots,n$ in relative order according to $\sigma$.  Hence to compute $\inv^B$ on this set, we can compute $\inv^A$ on $S_n$, giving $n \left( \sum_{\pi\in S_n}{ q^{\inv^A(\pi)} } \right)$.
 \end{proof}



\begin{theorem}
$\displaystyle B_n^{\inv^B}(\bar{1}2, 2 \bar{1})(q) = \ignore{(n+1) \sum_{\pi\in S_n}{ q^{\inv^A(\pi)} }  =} (n+1)[n]!_q$
\end{theorem}

\begin{proof}  Any permutation in $B_n^{\inv^B}( \bar{1} 2, 2 \bar{1})$ has the $k$ largest elements (in absolute value) barred since a barred element can not be preceded or followed by a larger (in absolute value) unbarred element.  This permutation can be associated with a permutation in $S_n$ whose elements appear in the same relative order, thus we can compute inv$^B$ on this permutation as inv$^A$ on the associated permutation.  This gives us $\sum_{k=0}^n \sum_{\pi\in S_n}{ q^{\inv^A(\pi)} } = (n+1) \sum_{\pi\in S_n}{ q^{\inv^A(\pi)} }$.
\end{proof}


\begin{theorem}
$\displaystyle B_n^{\inv^B}(1 \bar{2},2 \bar{1})(q)= \ignore{    \sum_{k=0}^n \binom{n}{k} \left( \sum_{\pi\in S_k}{ q^{\inv^A(\pi)} } \sum_{\sigma \in S_{n-k}}{ q^{\inv^A(\sigma)} } \right) q^{k(n-k)}      }   \sum_{k=0}^n{\binom{n}{k}  [k]!_q [n-k]!_q q^{k(n-k)}} $ 
\end{theorem}

\begin{proof}
Any permutation in $B_n(1 \bar{2}, 2 \bar{1})$ has $k$ barred elements followed by $n-k$ unbarred elements since an unbarred element can not be followed by any barred elements.  The initial $k$ barred elements can be associated with a permutation in $S_k$ whose elements appear in the same relative order, thus we can compute inv$^B$ on this permutation as $\inv^A$ on the associated permutation.  The $n-k$ unbarred elements can similarly be associated with a permutation in $S_{n-k}$ whose elements appear in the same relative order, thus we can compute $\inv^B$ on this permutation as $\inv^A$ on the associated permutation.  Since all of the $k$ barred elements form inversions with all of the $n-k$ unbarred elements, we have an additional $k(n-k)$ inversions, thus we need to multiply by $q^{n(n-k)}$.  Summing from $k=0$ to $k=n$ gives the desired sum.
\end{proof}



%\subsection{ $\displaystyle B_n^{\inv^B}(2\bar{1},\bar{1} 2)(q)$  }

%\subsection{ $\displaystyle B_n^{\inv^B}(12,1 \bar{2} )(q)$  }
\begin{theorem}
$\displaystyle B_n^{\inv^B}(12,1 \bar{2})(q) = q^{n-1}B_{n-1}^{\inv^B}(12, 1\bar{2}) + \sum_{k=0}^{n-1} q^k B_{n-1}^{\inv^B}(12, 1\bar{2})$
\end{theorem}

\begin{proof}
For any $\sigma \in B_n(12,1 \bar{2})$, the 1 element is either unbarred or barred.  If the 1 element is unbarred then it must appear in position $n$, which contributes $n-1$ to the inversion statistic.  The permutation in positions 1 through $n-1$ must then be a permutation (after relabeling) in $B_{n-1}(12, 1\bar{2})$, giving the first term in the recurrence.  If the 1 element is barred, then it can appear in any of the positions 1 through $n$.  If the 1 is barred and in position $k$, it contributes $n-k$ to the inversion statistic and the permutation in the remaining $n-1$ positions must be a permutation (after relabeling) in $B_{n-1}(12, 1\bar{2})$, thus giving the second term in the recurrence.  
\end{proof}










%\subsection{ $\displaystyle B_n^{\inv^B}(12,\bar{2} 1)(q)$  }

\begin{theorem}

$\displaystyle B_n^{\inv^B}(12,\bar{2}1)(q) = \ignore{   \sum_{k=0}^{n-1}{ \binom{n-1}{k} q^{\binom{k+1}{2}}} \sum_{\pi \in S_{n-1-k}}{ q^{\inv^A(\pi)}   } + \sum_{k=1}^n{ q^{n-k} \ignore{\sum_{\pi \in B_{n-1}(12, \bar{2}1)} {q^{\inv^B(\pi)}}  }   B_{n-1}^{\inv^B}(12,\bar{2}1)(q)           }  }
 \sum_{k=0}^{n-1}\left( { \binom{n-1}{k}  [n-1-k]!_q  q^{\binom{k+1}{2}}  }+ q^k B_{n-1}^{\inv^B}(12,\bar{2}1)(q) \right)$




%$\displaystyle B_n^{\inv^B}(12,\bar{2}1) = \sum_{k=0}^{n-1} \binom{n-1}{k} \sum_{\pi \in S_{n-1-k}} q^{inv^A(\pi)} q^{\binom{k}{2}} + \sum_{k=1}^n q^{n-k} \sum_{\pi \in B_{n-1}(12, \bar{2}1)} q^{inv^B(\pi)}$
\end{theorem}

\begin{proof}
For any permutation in $B_n(12,\bar{2}1)$, the 1 element is either unbarred or barred.  If the 1 element is unbarred, then the permutation has $k$ unbarred elements in decreasing order, which can be chosen in $\binom{n-1}{k}$ ways, followed by 1, followed by $n-1-k$ barred elements in any order.  To compute inv$^B$ on this permutation, the first $k$ unbarred elements in decreasing order contribute $(k-1) + (k-2) + \cdots + 2 + 1$ to the inversion statistic, the 1 element forms $k$ inversions with the $k$ elements before it and then we compute inv$^B$ on the remaining $n-1-k$ barred elements by associated them with a permutation in $S_{n-1-k}$ whose elements appear in the same relative order.  This gives the first term in the sum.

If the 1 element is barred, then we can insert it into any of $n$ positions in a permutation $\sigma$ in $B_{n-1}(12,\bar{2}1)$ by first relabeling the elements in $\sigma$ as elements $2$ through $n$ in the same relative order and with the same barring scheme as in $\sigma$.  If $\bar{1}$ is inserted in position $n-k$, it contributes $k$ to the inversion statistic since it creates inversions with every element after it.  Thus we obtain the second term in the sum.
\end{proof} 




\begin{theorem}
$\displaystyle B_n^{\inv^B}(12,\bar{1} \bar{2})(q) = \sum_{k=0}^{n} \binom{n}{k} \left[\begin{array}{c} n \\ k\end{array}\right]_{q} q^{\binom{k}{2}} $
\end{theorem}

\begin{proof}
For $\pi\in B_n(12,\bar{1} \bar{2})$, all of the unbarred numbers are in decreasing order and all of the barred numbers are in increasing order (relative to the total ordering).  An unbarred number in position $k$ is smaller than each of the $k-1$ elements preceding it and a barred number in position $j$ is larger than each of the $j-1$ elements preceding it.  Thus we need only to sum the positions of the unbarred elements and subtract the number of total positions (since each position $k$ contributes $k-1$ to the inversion statistic) to determine the total number of inversions.  We first choose which $k$ numbers will be unbarred in $\binom{n}{k}$ ways, then sum their positions and subtract $k$, which gives $\left[\begin{array}{c} n \\ k\end{array}\right]_{q} q^{\binom{k+1}{2}-k} = \left[\begin{array}{c} n \\ k\end{array}\right]_{q} q^{\binom{k}{2}}$.
\ignore{
For any permutation in this class, all of the unbarred numbers are in decreasing order and all of the barred numbers are in increasing order.  An unbarred number in position $k$ is smaller than each of the $k-1$ elements preceding it and an barred number in position $j$ is larger than each of the $j-1$ elements preceding it.  Thus we need only to sum the positions of the unbarred elements and subtract the number of total positions (since each position $k$ contributes $k-1$ to the inversion statistic) to determine the total number of inversions.  We first choose which $k$ numbers will be unbarred in $\binom{n}{k}$ ways, then sum their positions and subtract $k$, which gives the $\left[\begin{array}{c} n \\ k\end{array}\right]_{q} q^{\binom{k+1}{2}-k}$ term.}
\end{proof}




\begin{theorem}
$ \displaystyle B_n^{\inv^B}(\bar{1} \bar{2}, 21)(q)
\ignore{= \sum_{k=0}^{n} \binom{n}{k} \left[\begin{array}{c} n \\ k\end{array}\right]_{\left(\frac{1}{q}\right)} \left(\frac{1}{q}\right)^{\binom{k+1}{2}} q^{kn} $$
$$ \quad\quad\quad\quad\quad\quad\quad\quad
= \sum_{k=0}^{n} \binom{n}{k} \left[\begin{array}{c} n \\ k\end{array}\right]_{\left(\frac{1}{q}\right)} q^{kn - \binom{k}{2}}$}
= \sum_{k=0}^{n} \binom{n}{k} \left[\begin{array}{c} n \\ k\end{array}\right]_{\left(\frac{1}{q}\right)} q^{k(n - k)}$
\end{theorem}


\begin{proof}  
For $\pi\in B_n(\bar{1} \bar{2},21)$, all unbarred numbers increase, so an unbarred number is either followed by unbarred numbers which are bigger, or by barred numbers which are bigger because of the total ordering.  Thus no unbarred number contributes to the inversion statistic.  Any barred number is either followed by larger (with respect to the total ordering) barred numbers, which don't contribute to the inversion statistic, or by unbarred numbers, each of which contributes to the inversion statistic.  We may choose the $k$ numbers which will be barred in $\binom{n}{k}$ ways.   Given the $k$ positions of the barred numbers, we can determine the number of inversions as follows.  Let $p_i$ denote the position of the $i$th barred number, where $i=1,\dots,k$.  Noting that a barred number in position $p_i$ is followed by $n-p_i$ numbers, some of which may be barred, we first take the sum of the positions of the barred numbers and subtract this amount from $kn$, and we have so far an overcount of the number of inversions.  To correct the overcount, at each position for a barred number, we need to subtract the number of barred numbers that follow.  For each barred number in position $p_i$, there are $k-i$ barred numbers that follow.  Hence, we have $ kn-\sum_{i=1}^k{p_i}-\sum_{i=1}^k{(k-i)}= kn-\sum_{i=1}^k{p_i}+ \binom{k+1}{2}-k^2 = \binom{k+1}{2} - \sum_{i=1}^k{p_i} + kn - k^2$ inversions for a given set of $k$ positions for the barred numbers.  Summing over all possible positions for the barred numbers gives $\left[\begin{array}{c} n \\ k\end{array}\right]_{\left(\frac{1}{q}\right)} q^{kn-k^2}$.
\end{proof}

\ignore{
\begin{proof}
All unbarred numbers in the permutation increase, so an unbarred number is either followed by unbarred numbers which are bigger, or by barred numbers which are bigger because of the total ordering, thus no unbarred number contributes to the inversion statistic.  Any barred number is either followed by smaller barred numbers or by unbarred numbers, each of which contributes to the inversion statistic.  Thus a barred number in position $k$ contributes $n-k$ to the inversion statistic.  
We can first choose the $k$ numbers which will be barred in $\binom{n}{k}$ ways, then place them into $k$ positions, summing those positions and subtracting each position from $n$ in $\left[\begin{array}{c} n \\ k\end{array}\right]_{(\frac{1}{q})} (\frac{1}{q})^{\binom{k+1}{2}} q^{kn}$ ways.
\end{proof}
}





\begin{theorem}
$\displaystyle B_n^{\inv^B}(12,\bar{1} 2)(q) = \ignore{\sum_{k=1}^{n} { \binom{n-1}{n-k}q^{k-1} \sum_{\alpha \in S_{n-k}} q^{\inv^A(\alpha)}  \sum_{\sigma \in B_{k-1}(12, \bar{1}2)} q^{\inv^B(\sigma)}} \\ + \sum_{k=1}^{n} { \binom{n-1}{n-k}q^{n-k} \sum_{\alpha \in S_{n-k}} q^{\inv^A(\alpha)}  \sum_{\sigma \in B_{k-1}(12, \bar{1}2)} q^{\inv^B(\sigma)} } = }  \sum_{k=1}^{n} { \binom{n-1}{n-k}( q^{k-1} +q^{n-k}) [n-k]!_q  B_{k-1}^{\inv^B}(12,\bar{1} 2)(q)}$
\end{theorem}

\begin{proof}
For $\sigma \in B_n(12,\bar{1} 2)$, wherever the $1$ element appears (barred or unbarred), all elements following it must be barred.  If the $1$ is unbarred and in position $k$, it contributes $k-1$ inversions since all the elements preceding it are larger.  The $n-k$ elements following the $1$ can be chosen in $\binom{n-1}{n-k}$ ways and correspond to a permutation in $S_{n-k}$, thus the inversion statistic for these elements can be counted by $\inv^A$.  The $k-1$ remaining elements preceding the $1$ correspond to a permutation in $B_{k-1}(12,\bar{1}2)$.  If the $1$ element is barred, the argument is similar, however the $1$ element contributes $n-k$ inversions rather than $k-1$ inversions.
\end{proof}


\ignore{
\begin{theorem}
$\displaystyle B_n^{\inv^B}(1\bar{2},\bar{2}\bar{1})(q) = \sum_{k=0}^{n-1}{ \binom{n-1}{k} \sum_{\pi \in S_{n-1-k}}{ q^{\inv^A(\pi)} q^{(n-1) + (n-2) + \cdots + (n-k-1)}}  }\\ + 
\sum_{k=1}^n{ q^{n-k} \sum_{\pi \in B_{n-1}(12, \bar{2}1)} {q^{\inv^B(\pi)}} }$
\end{theorem}

\begin{proof}
For any permutation in this set, the $n$ element is either barred or unbarred.  If the $n$ element is barred, then the permutation has $k$ barred elements in increasing order (in absolute value), which can be chosen in $\binom{n-1}{k}$ ways, followed by $\bar{n}$, followed by n-1-k unbarred elements in any order.  To compute inv$^B$ on this permutation, the first $k$ barred elements contribute $(n-1) + (n-2) + \cdots + (n-k)$ to the inversion statistic, the $\bar{n}$ element forms $n-k-1$ inversions with the $n-k-1$ elements after it and then we compute inv$^B$ on the remaining $n-1-k$ unbarred elements by associated them with a permutation in $S_{n-1-k}$ whose elements appear in the same relative order.  This gives the first term in the sum.

If the $n$ element is unbarred, then what?  Grrr\ldots we don't have this case.
\end{proof} 
}









\section{Future Work} 

We have been able to extend Simion's work by providing a recurrence for the major index on $B_n(21, \bar{2}\bar{1})$ and also by giving a recurrence for the major index on $D_n(\Sigma)$ for $\Sigma =\{21, \bar{2}\bar{1}\}$ and $\Sigma=\{12,21\}$.  Our goal is to develop recurrence relations for the major index statistic on $B_n(\Sigma)$ for all sets $\Sigma$ with $\left|\Sigma\right|=2.$  Naturally, we would also like to give the inversion generating functions on $B_n(1 \bar{2})$ as well as the two classes of signed permutations avoiding two patterns of length two that remain open questions at this time.  




\begin{thebibliography}{99}

%\bibitem{BZ} R. Biagioli and J. Zeng, On some analogues of Carlitz's identity for the hyperoctahedral group, [arXiv:math/0909.3961v1], 2009.

\bibitem{Eg} E. Egge, Restricted colored permutations and Chebyshev polynomials, {\em Discrete Mathematics}, 307 (2007), 1792--1800.

%\bibitem{KRR} S. Kitaev, J. Remmel, M. Riehl, On a pattern avoidance condition for the wreath product of cyclic groups with symmetric groups, [arXiv:math/0910.3135], 2009.

\bibitem{Ma} T. Mansour, Pattern avoidance in coloured permutations, {\em Seminaire Lotharingien de Combinatoire} 46 (2001), Article B46g.

\bibitem{Re} V. Reiner, Signed permutation statistics, {\em Europ. J. Combinatorics} 14 (1993), 553--567.

\bibitem{Si} R. Simion, Combinatorial statistics on type-B analogues of noncrossing partitions and restricted permutations, {\em Electronic Journal of Combinatorics} 7(2) (2000), \#R9.

 
 

\end{thebibliography}



\end{document}
