MathDB
magician with 15 hats

Source: IFYM - XI International Festival of Young Mathematicians Sozopol 2022, Theme for 11-12 grade, 4th round p8

November 12, 2022
combinatoricsnumber theory

Problem Statement

A magician wants to demonstrate the following trick to an audience of n16n \ge 16 people. He gives them 1515 hats and after giving instructions to his assistant (which the audience does not hear), leaves the hall. Some 1515 people in the audience put on one of the hats. The assistant tags in front of everyone, one of the hats with a marker and then the person with an unmarked hat takes it off. The magician then returns back to the hall and after surveying the situation, knows who in the audience has taken off his hat. For what nn is this possible?
[hide=original wording]Магьосник иска да покаже следния фокус пред публика от n16n \ge 16 души. Той им дава 1515 шапки и след като даде инструкции на помощника си (които публиката не чува), напуска залата. Някои 1515 души от публиката си слагат по една от шапките. Асистентът маркира пред всички една от шапките с маркер и след това човек с немаркирана шапка си я сваля. След това магьосникът се връща обратно в залата и след оглед на ситуацията познава кой от публиката си е свалил шапката. За кои nn е възможно това?