We give a bijection between permutations of
1
,
…
,
2
n
1,\ldots ,2n
and certain pairs of Dyck paths with labels on the down steps. The bijection arises from a game in which two players alternate selecting from a set of
2
n
2n
items: the permutation encodes the players’ preference ordering of the items, and the Dyck paths encode the order in which items are selected under optimal play. We enumerate permutations by certain new statistics, AA inversions and BB inversions, which have natural interpretations in terms of the game. We derive identities such as
\[
∑
p
∏
i
=
1
n
q
h
i
−
1
[
h
i
]
q
=
[
1
]
q
[
3
]
q
⋯
[
2
n
−
1
]
q
\sum _{p} \prod _{i=1}^n q^{h_i -1} [h_i]_q = [1]_q [3]_q \cdots [2n-1]_q
\]
where the sum is over all Dyck paths
p
p
of length
2
n
2n
, and
h
1
,
…
,
h
n
h_1,\ldots ,h_n
are the heights of the down steps of
p
p
.