I don't understand why this card trick works! So My math professor did a card trick with me where he gave me a set of normal 52 cards and let me shuffle them however I like, he even said that i can arrange them however I would like. Next, he asked me to think of any random number from 1-10 inclusive, and to keep it to myself. lets say i chose 7. He then asks me to slowly drop 7 cards, going one after the other, when i reach the 7th card, i observe its value and continue adding cards over the pile with its value. so if the 7th card was 6, I would add 6 more then observe the 6th card and so on. You repeat this process smoothly and continuously so he doesn't know where i am with the counting. Also, jack counts as 4 (j,a,c,k), queen as 5, king as 4, and the joker as 5.
The trick: I kept doing this and then midway while i was counting in my head he started counting out loud the numbers i was in! so lets say i got 7, then 6, then jack, then 9, he started counting with me 1,2,3!
I've tried thinking about this but it just seems crazy! he reassured me that it involves math only and no cheap tricks, but the way i look at it it seems so random, i could've arranged the cards in any way and chosen any number from 1-10!
I don't want full explanations on this, i just want a hint to start thinking about this, I think that the fact there is an extra 8 4s and 6 5s has to do with something but i am not sure how??
 A: The magician can determine sets $S\subseteq\{1,2,\ldots,52\}$ with the property that he knows that one of your stopping points must be $\in S$.
Initially, he knows that $\{1,2,\ldots,10\}$ is such a set.
Let $S=\{x_1,\ldots, x_k\}$ with $x_1<x_2<\ldots <x_k$. 
Once you display the card at position $x_1$, the magician knows its value $w$ and thus can replace $S$ with $(S\setminus\{x_1\})\cup\{x_1+w\}$. This new set may be as large as the fromer one, but it may also happen to be smaller by one element.
For example, the initial $\{1,\ldots,10\}$ may turn into $\{2,\ldots,11\}$ only if the first card is a 10; in all other cases we immediately improve to $\{2,\ldots,10\}$.
As soon as the set reaches cardinality $1$, he knows one of the cards you landed at and from then on can count synchronously with you.
Is it guaranteed that this process will in deed produce a singleton before the deck is used up?
Not necessarily if the deck is carefully arranged:
Assume we have the following cards at certain positions:
A 9 at position 9, a 10 at position 10, a 10 at position 18, a 9 at position 20, a 9 at position 28, a 10 at position 29, a 9 at position 37, a 10 at position 39, an 8 at position 45, a 7 at position 46. With such a deck, the counting sequences starting with 9 and 10 will remain different until the end.
