Welcome to the magic show. First the magician is blindfolded. Now the assistant asks 4 members of the audience to write 4 distinct numbers between 1 and 9 (inclusive) on the back of 4 cards. The numbers are shown to the assistant and the audience. Now the audience is asked to hide one of the cards. The blindfold is taken off the magician. The assistant gives them the remaining 3 cards in some specific order. After some deliberation, the magician names the number on the missing 4th card. They are correct and the audience is stunned! The audience asks the magician to repeat the trick with a different set of 4 numbers (between 1 and 9). They do it again!
How did the magician and their assistant perform the magic trick?
Notes:
- The magician knows that all numbers are distinct and are between 1 and 9, inclusive.
- There are no tricks like hidden cameras, or extra communication between the magician and the assistant - this is a pure puzzle in logic / mathematics.