2000 AIME I Problem 15
Problem 15 of 15HarderCombinatoricsProblem-Solving Techniques
A stack of cards is labelled with the integers from to with different integers on different cards. The cards in the stack are not in numerical order. The top card is removed from the stack and placed on the table, and the next card is moved to the bottom of the stack. The new top card is removed from the stack and placed on the table, to the right of the card already there, and the next card in the stack is moved to the bottom of the stack. The process — placing the top card to the right of the cards already on the table and moving the next card in the stack to the bottom of the stack — is repeated until all cards are on the table. It is found that, reading from left to right, the labels on the cards are now in ascending order: In the original stack of cards, how many cards were above the card labelled
Your answer
Integer from 0 to 999
Show solution
Solution
Number the original positions (top) through (bottom) and put them in a queue. Each step removes the front position (which receives the next label ) and sends the new front to the back. So the card labelled is the next-to-last card removed, and we must find which original position survives that long.
The first pass removes the odd positions (labels through ) and, since it ends by sending to the back, the next pass again starts by removing the front of the queue Successive passes therefore remove (the positions ), then then then (the positions ). That last pass ran through an odd number () of cards, so the alternation shifts: the surviving multiples of now sit in the queue as
Continuing the same removal pattern from that queue, the next rounds remove then then then then and the final two cards removed are and So label goes to the card at original position which had cards above it.
Tagged: permutations · process simulation · pattern recognition