Problem

Source: ELMO Shortlist 2023 C2

Tags: Elmo, combinatorics



Alice is performing a magic trick. She has a standard deck of 52 cards, which she may order beforehand. She invites a volunteer to pick an integer \(0\le n\le 52\), and cuts the deck into a pile with the top \(n\) cards and a pile with the remaining \(52-n\). She then gives both piles to the volunteer, who riffles them together and hands the deck back to her face down. (Thus, in the resulting deck, the cards that were in the deck of size \(n\) appear in order, as do the cards that were in the deck of size \(52-n\).) Alice then flips the cards over one-by-one from the top. Before flipping over each card, she may choose to guess the color of the card she is about to flip over. She stops if she guesses incorrectly. What is the maximum number of correct guesses she can guarantee? Proposed by Espen Slettnes