4. Let $n \in \mathbf{Z}_{+}$. A volleyball team has $n$ male players and $n$ female players. Initially, each player is assigned to one of the positions numbered $1,2, \cdots, 2 n$, with only positions 1 and $n+1$ being outside the court. During the game, position swaps occur, and each swap involves moving the player in position $i(i=1,2, \cdots, 2 n)$ to position $i+1$, where position $2 n+1$ is the same as position 1. How many different initial allocation methods are there such that, regardless of how many rounds of swapping occur, at least $n-1$ female players are on the court?
4. If position $i(i \in\{1,2, \cdots, n\})$ and $i+n$ are both occupied by female athletes, then after $n+1-i$ rounds of swapping, positions 1 and $n+1$ will both be occupied by female athletes, resulting in two female athletes being off the field. Therefore, there do not exist two female athletes whose position numbers differ by $n$. The positions of all female athletes must exactly take one element from each of the $n$ sets
$$
\{1, n+1\},\{2, n+2\}, \cdots,\{n, 2 n\}
$$
This results in $2^{n}$ ways.
Considering the arrangement of male athletes has $n!$ ways, and the arrangement of female athletes has $n!$ ways, the total number of arrangements that satisfy the condition is $2^{n}(n!)^{2}$.