Here is a half of a magic trick to impress your friends. Take the Ace to Seven of hearts and order them numerically in a pile with Ace at the bottom and Seven at the top. Do the same with the Ace to Seven of spades. Put the pile of spades on top of the pile of hearts. Flip the \(14\)-card deck so the cards are now face down.
Make a cut anywhere. Deal out \(7\) cards from the top into a pile, so that you now have two piles of equal size again. Let us refer to the motion of taking the top card of a pile and putting it to the bottom as making a swap. Making two swaps means doing the motion twice, NOT taking the top two cards at the same time.
Your friend chooses two nonnegative numbers that add up to \(6\), for example \(4\) and \(2\). Make \(4\) swaps on the first pile and \(2\) swaps on the second pile. Remove the top card of each pile, so that we now have two piles of six cards.
Your friend now chooses two nonnegative numbers that add up to five and repeat the same procedure. We will continue doing this, but at each turn, the total number of swaps decreases by one. Eventually, we should have one card remaining in each pile. It turns out to be a matching pair.
How does the trick work?