The magic trick
Source: Proposed by Nikolai Beluhov, Bulgaria, and Palmer Mebane, USA
November 11, 2020
permutationcombinatorics
Problem Statement
An illusionist and his assistant are about to perform the following magic trick.Let be a positive integer. A spectator is given balls numbered . Unseen by the illusionist, the spectator arranges the balls into a sequence as he sees fit. The assistant studies the sequence, chooses some block of consecutive balls, and covers them under her scarf. Then the illusionist looks at the newly obscured sequence and guesses the precise order of the balls he does not see.Devise a strategy for the illusionist and the assistant to follow so that the trick always works.(The strategy needs to be constructed explicitly. For instance, it should be possible to implement the strategy, as described by the solver, in the form of a computer program that takes and the obscured sequence as input and then runs in time polynomial in . A mere proof that an appropriate strategy exists does not qualify as a complete solution.)