Words 223
andinparticularthatp(n, k)=p(n, k;1)+···+ p(n, k; k). This suggests a
way to create a recursion for the sequence {p(n, k)}
n,k
.
Definition 6.33 Let 1 ≤ s ≤ m, 1 ≤ r ≤ k and c
1
,...,c
m−s
∈ [k].Ifthere
exists a bijection between the sets
P (n, k; b
1
,...,b
m
) and P (n − s, k − r; c
1
,...,c
m−s
),
then the set P (n − s, k − r; c
1
,...,c
m−s
) is said to be a reduction of the
set P (n, k; b
1
,...,b
m
). In this case we say that the set P (n, k; b
1
,...,b
m
) is
reducible (otherwise it is irreducible).Anelementb is said to be an (m +1)-
inactive element ((m + 1)-active element) of the set P (n, k; b
1
,...,b
m
) if the
set P (n, k; b
1
,...,b
m
,b) is reducible (irreducible).
Example 6.34 If P (n, k)=AW
1234
[k]
(n), then for 1 ≤ j
1
<j
2
<j
3
≤ k,
the set P (n − 1,j
3
; j
1
,j
2
) is a reduction of the set P (n, k; j
1
,j
2
,j
3
), that is,
j
3
>j
2
is an inactive 3-element of P (n, k; j
1
,j
2
) in this case. Why? Because
for any word of the form w = j
1
j
2
j
3
w
4
···w
n
which avoids 1234,weknow
that j
3
has to be the maximal element in w. Thus, we can uniquely map w to
the word w
= j
1
j
2
w
4
···w
n
∈ [j
3
]
n−1
which also avoids 1234.Thisprocessis
reversible, therefore we have found the desired bijection.
In order to set up the system of recurrence relations, we need to define some
notation.
Definition 6.35 Let I(n, k; b
1
,...,b
m
) denote the set of (m +1)-active ele-
ments of P (n, k; b
1
,...,b
m
),and
¯
I(n, k; b
1
,...,b
m
)=[k] − I(n, k; b
1
,...,b
m
)
the set of (m +1)-inactive elements of P(n, k; b
1
,...,b
m
). In addition, let
R(n, k; b
1
,...,b
m
) be the multi-set
⎧
⎨
⎩
(d, r, c
1
,...,c
m−d
)
(
(
(
(
(
(
P (n − d, k − r; c
1
,...,c
m−d
) is a reduction
of the set P (n, k; b
1
,...,b
m
,j), 1 ≤ d ≤ m,
1 ≤ r ≤ k, j ∈
I(n, k; b
1
,...,b
m
)
⎫
⎬
⎭
.
Note the fact that R(n, k; b
1
,...,b
m
) is a multi-set because reductions of
different sets may lead to the same reduced set, creating multiple entries in
R(n, k; b
1
,...,b
m
).
We start with an overview of the algorithm before describing the step-by-
step procedure. The first step is to determine the set of 1-inactive and 1-active
elements of P (n, k), that is,
I(n, k)andI(n, k), respectively. Using (6.19) and
Definition 6.35 we have
p(n, k)=p(n, k;1)+···+ p(n, k; k)
= |
I(n, k)|·p(n − 1,k)+
j∈I(n,k)
p(n, k; j) (6.20)
© 2010 by Taylor and Francis Group, LLC