After the top card is fixed, precisely three of the remaining fifty-one cards have the same rank. Thus a fresh uniformly shuffled deck has matching probability
In each independent round, the algorithm repeats with probability and stops with probability . A match always stops. Summing the probabilities over the possible number of repeated rounds gives
For the stopping probability per round is at least , so termination is almost sure.
Permutation of the thirteen rank labels preserves both the uniform shuffle and the stopping rule. The two marginal distributions are consequently uniform:
To establish independence, it is necessary to check the joint probability distribution, not just these marginals. For a specified rank , the fresh-shuffle diagonal probability is . For different specified ranks , it is . Reweight by the acceptance probability and sum over repeated rounds to obtain
The diagonal must equal for independence, forcing and therefore
At this value the off-diagonal expression is also , proving sufficiency for every ordered pair. This is an example of match-biased reshuffling preserves uniform rank marginals: state-dependent rejection sampling changes dependence even though both individual rank distributions remain uniform.