返回题库

AIME 2000 I · 第 15 题

AIME 2000 I — Problem 15

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

A stack of 20002000 cards is labelled with the integers from 11 to 2000,2000, 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: 1,2,3,,1999,2000.1,2,3,\ldots,1999,2000. In the original stack of cards, how many cards were above the card labeled 19991999?

解析

Solution 1

We try to work backwards from when there are 2 cards left, since this is when the 1999 card is laid onto the table. When there are 2 cards left, the 1999 card is on the top of the deck. In order for this to occur, it must be 2nd on the deck when there are 4 cards remaining, and this means it must be the 4th card when there are 8 cards remaining. This pattern continues until it is the 512th card on the deck when there are 1024 cards remaining. Since there are over 1000 cards remaining, some cards have not even made one trip through yet, 2(10241000)=482(1024 - 1000) = 48, to be exact. Once these cards go through, 1999 will be the 51248=464th512 - 48 = 464^\text{th} card on the deck. Since every other card was removed during the first round, it goes to show that 1999 was in position 464×2=928464 \times 2 = 928, meaning that there were 927\boxed{927} cards are above the one labeled 19991999.

Solution 2

To simplify matters, we want a power of 22. Hence, we will add 4848 'fake' cards which we must discard in our actual count. Using similar logic as Solution 1, we find that 1999 has position 10241024 in a 20482048 card stack, where the fake cards towards the front.

Let the fake cards have positions 1,3,5,,951, 3, 5, \cdots, 95. Then, we know that the real cards filling the gaps between the fake cards must be the cards such that they go to their correct starting positions in the 20002000 card case, where all of them are below 19991999. From this, we know that the cards from positions 11 to 9696 alternate in fake-real-fake-real, where we have the correct order of cards once the first 9696 have moved and we can start putting real cards on the table. Hence, 19991999 is in position 102496=9281024 - 96 = 928, so 927\boxed{927} cards are above it. - Spacesam

Solution 3 (Recursion on number of cards below 1999)

We work backwards. To reverse the process, we must move the bottom card to the top, and add a new number to the top. Let dnd_n equal the number of cards below 1999 after nn process reversals. Reversing one process, our deck only has 20002000, so we reverse again to obtain 1999,20001999, 2000. So, d2=1d_2 = 1. When dn1>0d_{n-1} > 0, after a process reversal, the bottom card is moved to the top (it goes above 19991999), so we subtract by one to account for this (the addition of the new card doesn't matter since it goes above 19991999), giving us dn=dn11d_n = d_{n-1} - 1. So, d3=0d_3 = 0. Then, when dn1=0d_{n-1} = 0, after a process reversal, 19991999 moves to the top and one more card is added above 19991999. Since at dnd_{n}, nn cards have been added, there must be n2n - 2 cards below 19991999. So, d4=2d_4 = 2. Then, consider all dn1=0d_{n-1} = 0. Then, dn=n2d_n = n-2 as previously stated. After n2n-2 process reversals, we go back to d2n2=n2(n2)=0d_{2n - 2} = n - 2 - (n - 2) = 0. Then, d2n1=2n3d_{2n-1} = 2n - 3. Next, we can simply calculate 241=72 \cdot 4 - 1 = 7, 271=132 \cdot 7 - 1 = 13, and so on (which is a very simple bash, as 20002000 is a small number. If you don't want to do this, define sequence an=2an11a_n = 2a_{n-1} - 1, and solve for the closed form, which is very easy). Consequently, we derive d1537=15372=1535d_{1537} = 1537 - 2 = 1535. 20001537=4632000 - 1537 = 463 steps remain. So, d2000=d1537463=1072d_{2000} = d_{1537} - 463 = 1072. Finally, there are 200011072=9272000 - 1 - 1072 = \boxed{\textbf{927}} numbers above 19991999.

~CrazyVideoGamez

Solution 4 (Recursion)

Consider the general problem: with a stack of nn cards such that they will be laid out 1,2,3,...,n1, 2, 3, ..., n from left to right, how many cards are above the card labeled n1n-1?

Let ana_n be the answer to the above problem.

As a base case, consider n=2n=2. Clearly, the stack, from top to bottom, must be (1,2)(1, 2), so a2=0a_2=0.

Next, let's think about how we can construct a stack of n+1n+1 cards from a stack of nn cards. First, let us renumber the current stack of nn by adding 11 to the label of each of the cards. Then we must add a card labeled "11" somewhere in the new deck.

Working backwards, we find that we must move the bottom card to the top, then add "11" to the top of the deck. This is because after one move, the number "11" will be laid out and the top card will be moved to the bottom, so the deck becomes the same as what we had before, but with everything renumbered correctly such that 2,3,4,...2, 3, 4, ... will then be laid out in order.

Therefore, if ann1a_n \ne n-1 (meaning the card n1n-1 is not at the bottom of the deck and so it won't be moved to the top), then an+1=an+2a_{n+1} = a_n + 2, since a card from the bottom is moved to be above the n1n-1 card, and the new card "11" is added to the top. If an=n1a_n = n-1 (meaning the card n1n-1 is the bottom card), then an+1=1a_{n+1}=1 because the n1n-1 card will move to the top and the card "11" will be added on top of it.

With these recursions and the base case we found earlier, we calculate a2000=927a_{2000} = \boxed{927}. To calculate this by hand, a helpful trick is finding that if an=1a_n=1, then a2n1=1a_{2n-1}=1 as well. Once we find a1537=1a_{1537}=1, the answer is just 1+(20001537)21+(2000-1537)\cdot2. - Frestho

Solution 5 (very bashy)

Let us treat each run through the deck as a separate "round". For example, in round one, you would go through all of the 20002000 cards initially in the deck once, in round two, you would go through all 10001000 cards initially in the deck once, so on and so forth. For each round, let us record what the initial and final actions are (rr for moving the card to the right, bb for moving the card to the bottom), the number of cards moved to the right, the number of cards left, and what the position of the cards moved to the right were in the original 20002000 card deck (as n=a+ckn = a + ck where nn is the position, cc is the spacing of the cards moved, aa is an integer such that the correct first card is moved, and kk is an integer greater than or equal to 11 which represents which card out of all the cards moved to the right you are finding the position of). Then,

Round 1: rr to bb, 10001000 to right, 10001000 left in deck, n=1+2kn = -1 + 2k,

Round 2: rr to bb, 500500 to right, 500500 left in deck, n=2+4kn = -2 + 4k,

Round 3: rr to bb, 250250 to right, 250250 left in deck, n=4+8kn = -4 + 8k,

Round 4: rr to bb, 125125 to right, 125125 left in deck, n=8+16kn = -8 + 16k.

Let us treat the remaining deck of 125125 cards as a totally independent deck, note that the positions of card in this deck are n=16kn = 16k. Also note that the first action of a new round is never the same action as the last action of the previous round because actions alternate. Also note that for every new round, the spacing between cards moved doubles, and that the cards remaining in the beginning of a new round have position n=a+c/2+ckn = a + c/2 + ck for the values a,ca, c of the previous round. Also note that if there are an odd number of cards in an initial deck, the first and last actions are the same. Then,

Round 5: rr to rr, 6363 to right, 6262 left in deck, n=1+2kn = -1 + 2k,

Round 6: bb to rr, 3131 to right, 3131 left in deck, n=4kn = 4k, because n=2kn = 2k positioned cards are left at the beginning of this round and the first card is sent to the bottom, only every second card is sent to the right, and because spacing doubles every round,

Round 7: bb to bb, 1515 to right, 1616 left in deck, n=2+8kn = -2 + 8k, because n=2+4kn = 2 + 4k positioned cards are left at the beginning and only every second card is sent to the right, and because spacing doubles every round,

Round 8: rr to bb, 88 to right, 88 left in deck, n=14+16kn = -14 + 16k, by similar reasoning, since the cards n=2+8kn = 2 + 8k are left and spacing doubles every round, from here on things get real easy,

Round 9: rr to bb, 44 to right, 44 left in deck, n=22+32kn = -22 + 32k,

Round 10: rr to bb, 22 to right, 22 left in deck, n=38+64kn = -38 + 64k,

Round 11: rr to bb, 11 to right, 11 left in deck, n=58n = 58, since 58=38+64/2+6458 = -38 + 64/2 + 64.

This card must be labeled 1999 since it is second to last. Then, since it is the 58th58th in the deck of 125125, it must be the 588=928th58 * 8 = 928th card in the original deck, and because we've been numbering from the top of the deck to the bottom (also because AIME answers are 000-999), there were 9281=927928 - 1 = \boxed{927} cards above it in the deck - Romulus and minimaxweii

Solution 6 (Bashing with Modular Arithmetic)

Similar to Solution 5, we treat each run-through of the deck from the lowest-indexed card to the highest-indexed card as a separate round. Notice that after each round, approximately half the deck will remain, with the other half having been cast aside to the right in sorted order. Then, we can model each round as if we are running a "Sieve" through the deck with powers of 2s, filtering out the cards to put to the right and the cards to be pushed to the bottom.

At the beginning, when all 20002000 cards are still in the deck, notice that the first run-through of the deck consists of removing all the cards such that their index I1(mod2)I\equiv 1\pmod{2}, while we leave behind all the cards such that their index I2(mod2)I\equiv 2\pmod{2}. (Since the cards are not 00-indexed, using 22 instead of 0(mod2)0\pmod{2} is simpler to keep track of the cards. This will appear again later.) The remaining 10001000 cards, then, will all share the attribute that their index numbers are even. To split this further for round 2, we look more specifically at each index, categorizing them further as I2(mod4)I\equiv 2\pmod 4 or I4(mod4)I\equiv 4\pmod 4 in that order (The card with the smaller remainder will always be the card on the top of the new deck). Then, in Round 2, we will remove all the cards with index values that leave a remainder of 22 when divided by 44, while leaving the multiples of 44 behind. Notice that each time, in each new deck, we are removing all the cards with an odd position in that specific deck, and leaving behind all the cards with an even position in that specific deck.

This process will continue until we reach Round 5, where the number of cards that remain (125125) is no longer a multiple of 2. Therefore, when we remove all the cards with indices I16(mod32)I\equiv 16\pmod{32} and leave behind all the cards with indices I32(mod32)I\equiv 32\pmod{32}, the last card in the deck will be removed instead of being placed to the bottom, with 12563=62125-63=62 cards remaining. Because of this, when Round 6 begins, we cannot follow our normal procedure, since the top card of the Round 6 deck would have been moved to the bottom! Therefore, when we are using our sieve with I32(mod64)I\equiv 32\pmod{64} and I64(mod64)I\equiv 64\pmod{64}, the order at which the remainders are presented have flipped, so all the cards with indices that are multiples of 64 will be removed, while all the cards with indices that are 32 more than a multiple of 64 will remain. The 6262 cards from Round 6 will be reduced to 3131, and the last card in the deck will be removed just like in Round 5, which means Round 7 will be affected the same way. Of the choices of I32(mod128)I\equiv 32\pmod{128} and I32+64=96(mod128)I\equiv 32+64=96\pmod{128}, we will remove the latter, leaving behind the cards with indices that are 32 more than a multiple of 128. However, since 31 is an odd number, the last card of the deck will NOT be removed, which means our sieving process will return to normal after Round 7, with 3115=1631-15=16 cards remaining. Since 1616 is a perfect power of 22, we will not need to worry about this scenario again in the following rounds.

Round 8: I32(mod256)I\equiv 32\pmod{256} removed; I32+128=160(mod256)I\equiv 32+128=160\pmod{256} remains; 168=816-8=8 cards left.

Round 9: I160(mod512)I\equiv 160\pmod{512} removed; I160+256=416(mod512)I\equiv 160+256=416\pmod{512} remains; 84=48-4=4 cards left.

Round 10: I416(mod1024)I\equiv 416\pmod{1024} removed; I416+512=928(mod1024)I\equiv 416+512=928\pmod{1024} remains; 42=24-2=2 cards left.

Round 11: I928(mod2048)I\equiv 928\pmod{2048} removed; I928+1024=1952(mod2048)I\equiv 928+1024=1952\pmod{2048} remains; 21=12-1=1 card left.

Round 12: The last card in position 19521952 is sorted into place (This is card #20002000!).

It is obvious that the single card put into place in Round 11 is the second-to-last card in the deck, which is our target #19991999. Then, its position in the original deck leaves a remainder of 928928 when divided by 20562056. It is easy to see that 928928 is the only index that satisfies this, so there will be 9281=927928-1=\boxed{927} cards above card #19991999.

~chz3369