A deck of 2 n cards is numbered 1 , 2 , ⋯ , 2 n from top to bottom. The top n cards are removed, kept in order, and put into another pile A. The remaining cards in the original deck are in pile B. Then, the top card is taken from pile B and placed on the table, then the top card from pile A is placed on top of that, then the new top card on pile B is placed on top of that, and so forth until all cards are exhausted. Define a card position m to be magical if there exists a deck of cards such that the card in position m retains its original position after the process. As an explicit example, 3 and 6 are magical because in a deck of 8 cards, 3 and 6 are still in the 3 r d and 6 t h positions, respectively, counting from the top after the process.
How many integers m < 1 0 0 0 are not magical?
Details and Assumptions
A deck of cards must have an even number of cards by definition.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Do u mean reading from up to bottom for your first statement of the card with number m in the position 2 n − m + 1 ? Sorry, I'm a little confused here...
Log in to reply
Yes. So if you have a deck of size 8 , card 6 will be in position 3 if you read top to bottom. So generally, number of position its in from top to bottom + number of position its in from bottom to top = 2n + 1. Thus, for a card in position / number m , it's in position x + m = 2 n + 1 → x = 2 n − m + 1 from reading bottom to top.
Log in to reply
If 3 and 6 switched positions on you... you inverted the deck. 3 should be in the 3rd and 6 in the 6th. Remer the first cards off the top of A and B end up at the bottom of the new deck.
Given, 1 to 'n' cards are in pile A and 'n+1' to '2n' cards are in pile B.
If you look at pile A , after the process, all cards in pile A get odd positions
card '1' gets 2n-1 position , 2 gets 2n-3 , 3 gets 2n-5 position and so on... IF they are in pile A.
So, for any odd number 'm' there exists an 'n' such that it gets its own position....so all odd numbers are magical.
whereas even numbers can't get their positions if they are in pile A as all cards in pile A get odd positions.
Coming to pile B , after the process, all cards in pile B get even positions..
'2n' card gets 2nd position , '2n-1' gets 4th position , '2n-2' gets 6th position and so on..
or rather,
2nd position goes to card '2n' , 4th position goes '2n-1' , 6th goes to '2n-2' , 8th goes to '2n-3' and so on..
2 ,6 ,10,14,... are all magical as there exists an 'n' such that 2n = 2 ; 2n-2 =6 ; 2n-4 =10 ; .. and so on
But, all positions of multiples of '4' get odd numbered cards... so for any value of n , multiples of '4' can't be magical..
As there are 249 multiples of '4' below 1000 , the answer is 249
Only multiples of 4, cannot be magical for any natural number n
Idk much math. Just figured 2N=(m+2m)-1. 2m for the 2nd m # as the deck has an even number always has to have two magic numbers and it being 2x the first. Using that corilation I found 2 (1)= (1+2 (1))-1 or a Deck of 2 cards. Then I corilated 2 yielding 1,2 with 8 yielding 3,6 and saw a few patterns +6. m+2 and (m+2m)/3 I worked out [14, 5,10.] [20,7,14] and [26,9,18] using the additive with the first formula [2n+6= new 2n=(m+2m)-1] and double checked with the m+2, (m+2m)/3 =Whole number. Since the pattern of +6 for the deck proved true I used that to determine how many decks have a magic number below 1000. Since the decks start at 2
(1000-2)/6 = 166.333 or 166 that gives decks with both numbers under 1000. Since #m is 1/2 2m [as I labeled them for that corilation purpose] m was only half way to 1000 when 2m capped at 166. Thus only 2/3s of the decks were accounted for. So I took (166/2)x3 for 249.
the magical numbers are odd numbers and their doubles ( the odd numbers multiplied by 2 ) . So , we have exactly 500 odd numbers ( magical numbers ) between 0 and 1000 . The rest of the magical numbers are the doubles that are less than 1000 , and the odd numbers that satisfy this condition are those below 500 , and there are 250 odd numbers below 500 ( starting from 1 till 499 ) , which means that there are 500 + 250 = 750 magical numbers . Therefore non-magical numbers = 999 - 750 = 249 .
In the last step , we didn't say ( 1000 - 750 ) because the range doesn't include 1000 :) :D
Consider a m in stack A.
When m is placed, m − 1 cards above it from stack A would have been placed, and m cards from stack B would be placed (B goes first). Thus, m has position 2 n − ( 2 k − 1 ) = 2 n − 2 k + 1 in the stack. Setting it equal to m (since we want card m to have position m ), we find this clearly has solutions for all odd m but no even m. We now know all odd m are magical.
Now we test Stack B. When card number m in stack B is placed, m − n + 1 cards have been placed from each stack (total of 2 m − 2 n + 2 cards). This means that card m occupies position 2 n − ( 2 m − 2 n + 2 ) = 4 n − 2 m − 2 . Setting this equal to m , we have 3 m = 4 n − 2 . Since the RHS is clearly not divisible by four, there is no solution for any m divisible by 4. All other even m have a solution for some n .
We find there are 1000/4 - 1 = 249 positive integers below 1000 divisible by 4.
Problem Loading...
Note Loading...
Set Loading...
Reading from bottom up, the card labeled with the number m is in position 2 n − m + 1 .
If m ≤ n , then, from reading bottom to top, the card will then be in spot 2 m . Thus, 2 n + 1 − m = 2 m → n = 2 3 m − 1 .
If n < m ≤ 2 n , then, from reading bottom to top, the card will then be in spot 2 m − 2 n − 1 . So, n = 4 3 m − 2 .
We require one of these two expressions to be integers. The top means that every odd m has a solution. The bottom means that every m ≡ 2 ( m o d 4 ) has a solution. But there is no solution for multiples of 4 in these cases. There are ⌊ 4 9 9 9 ⌋ = 2 4 9 multiples of 4 less than 1 0 0 0 .