Permutations to un-shuffle indistinguishable cards from multiple decks?

36 Views Asked by At

An "out-shuffle" on a deck of size $2n$ is defined by the permutation $O$, where $$O = \begin{pmatrix} 0 & 1 & 2 & \cdots & n-1 && n && n+1 && \cdots && k && \cdots &&2n-1\\ 0 & 2 & 4 & \cdots & 2n-2 && 1 && 3 && \cdots && 2k\pmod{2n-1} && \cdots && 2n-1\end{pmatrix}$$

Observe that if $2^x\equiv 1\pmod{2n-1}$, then after $x$ out-shuffles the deck will be restored to its original position. A popular example of this is using a deck of 52 cards (i.e. $2n=52$), it will take 8 out-shuffles to cycle the deck back to the starting position since $2^8=256\equiv1\pmod{51}$.

Now for my question:

Assume you have a stack of $n$ black tickets and a stack of $n$ white tickets. Note these tickets have no distinct markers, and so the $n$ black tickets are indistinguishable from each other (and similarly for the $n$ white tickets). Now place one deck on top of the other to create a combined deck of size $2n$.

From the above, we know there is a smallest, non-trivial $x$ where $2^x\equiv1\pmod{2n-1}$ such that $x$ out-shuffles restores the deck back to the exact original position. But is there a number $y<x$ such that $y$ out-shuffles will sift the large stack into the 2 distinct black and white smaller stacks?

I think the answer is "no" and that I'd have to use a proof by contradiction.

However maybe it's possible with an "in-shuffle"? An "in-shuffle" on a deck of size $2n$ is defined by the permutation $I$, where:

$$I = \begin{pmatrix} 1 & 2 & \cdots & n && n+1 && n+2 && \cdots && k && \cdots &&2n\\ 2 & 4 & \cdots & 2n && 1 && 3 && \cdots && 2k\pmod{2n+1} && \cdots && 2n-1\end{pmatrix}$$

Similar to the out-shuffle, observe that if $2^z \equiv 1 \pmod{2n+1}$, then after $z$ in-shuffles the deck will be restored to its original position. In the case of the deck of a deck of 52 cards (i.e. $2n=52$), it will take $z=52$ in-shuffles to cycle the deck back to the starting position since $2^{52}\equiv1\pmod{53}$ (by Fermat's Little Theorem).

One difference, however, is that with the in-shuffle, there is an opportunity for the deck to be completely reversed (if $z$ is even, then by symmetry this means that $\dfrac{z}{2}$ in-shuffles reverses the deck). For the ticket stack problem posed, this would satisfy sifting the stack back into 2 distinct black and white stacks using $\frac{z}{2}$ in-shuffles (which is of course fewer than $z$ in-shuffles).

But this is a pretty unique case ($z$ must be even and we must be using in-shuffles).