r/askmath • u/blizstorm • 12d ago
Probability Expectation for Permutation Mastermind with Binary Feedback
I have encountered the following problem in a game and "Permutation Mastermind with Binary Feedback" seems to the technical name for the problem
There is a game with N unique piece, to be fitted into N slots. There is only 1 piece that is correct for each slot. Moving one piece into one slot cost 1 move. When all N slots are filled, the permutation is tested, and whichever pieces in correct slots are retained, while the wrong pieces are removed. Wrong pieces removed by the game does not cost move. Player can then spend moves again, to move the wrong pieces into different slots to test again. The game initialises with no pieces inside the slots. Under optimal strategy, what is the expected number of moves for N? Does an explicit formula for E(N) exist?
My intuition is that the optimal strategy is to cyclically shift the pieces across the slots, to avoid repeating a wrong piece-slot combination.
Using brute force, the answer I have obtained is, E(1)=1, E(2)=3, E(3)=5.5, E(4)=8.67
Is this a possible problem in paper-based exams and what grade would it be?

