Andrea, Carlos and Marcelo spend every weekend at the pool. While Andrea sunbathes, the other two play a game called Bubbles. Andrea studies computer science and tells them she does not see why such a simple game takes them so long.
On Andrea's laptop the two players generate a random integer N and a random permutation of 1,2,…,N.
The players move in turn and Marcelo always starts.
A move is to pick a pair of consecutive elements of the sequence that are out of order and swap the two elements. For the sequence 1,5,3,4,2 a player may swap 5 and 3, or swap 4 and 2, but may not swap 3 and 4, and may not swap 5 and 2. Swapping 5 and 3 turns the sequence into 1,3,5,4,2.
Sooner or later the sequence ends up sorted in increasing order. The player who has no move on their turn loses.
Andrea says with some disdain that a coin flip would settle it just as well. Given the initial sequence, decide who wins.