Here is a magic trick I saw. My question is how the magician and his partner did it.
Given the simple French deck of cards, with $52$ cards. A person from the audience chooses randomly five cards from the deck and gives it to the partner (the partner works with the magician), without showing it to the magician. Then the partner (who sees the five cards) chooses four cards from the five cards, and gives it to the magician one by one (so the order of the four cards matters). From that the magician knows the fifth card.
The partner and the magician can’t communicate during the trick. How did they do it?
I thought that amoung the five cards there will be two with the same sign (Spades,Hearts,Diamonds or Clubs) and one of these two cards will be the fifth, and the other will be the first card to give to the magician...
There is in fact a solution which uses your idea: that some suit will be repeated twice.
Say that among the $13$ ranks within a suit, ordered $A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K$, each rank "beats" the next six ranks, wrapping around when we get to the end. For example, $A$ beats $2,3,4,5,6,7$, and $10$ beats $J, Q, K, A, 2, 3$.
If you have two cards of the same suit, exactly one of them beats the other one. So you should pass, in order:
For the second step, we should order all $52$ cards in the deck somehow; for instance, say that $\clubsuit < \diamondsuit < \heartsuit < \spadesuit$ and $A < 2 < 3 < \dots < Q < K$. Then the order of the last three cards is one of "Low, Middle, High", "Low, High, Middle", and so on through "High, Middle, Low". Just remember some correspondence between these six possibilities and the values $+1, +2, +3, +4, +5, +6$, and add the value you get to the rank of the first card (wrapping around from $K$ to $A$ of the same suit).
For example, say that the correspondence we chose in the second step is
\begin{array}{ccc|c} \text{Low} & \text{Middle} & \text{High} &+1 \\ \text{Low} & \text{High} & \text{Middle} &+2 \\ \text{Middle} & \text{Low} & \text{High} &+3 \\ \text{Middle} & \text{High} & \text{Low} &+4 \\ \text{High} & \text{Low} & \text{Middle} &+5 \\ \text{High} & \text{Middle} & \text{Low} &+6 \end{array}
and you draw the cards $\{4\clubsuit, 5\spadesuit, 5\diamondsuit, A\clubsuit, J\spadesuit\}$.