Wednesday, 4 November 2026

On The Swords of Truth



'The Swords of Truth' trick is an ingenious and intriguing little mathemagic trick based on the work of magician and computer programmer Alex Elmsley, notable for his mathematical card tricks, and for publishing on the mathematics of playing card shuffling. The trick has been described by Michael Stevens (@Vsauce) and Professor Hannah Fry (@fryrsquared) in their 'The Rest is Science' podcast as 'one of the most deceptively tricky logic puzzles of the last century... [a] this seemingly innocent riddle [that has] fascinated mathematicians, programmers and puzzle-solvers for decades'.

Specifically, the 'Swords of Truth' trick — designed by Dave Janelle with a wonderful wooden keychain version manufactured and sold by Creative Crafthouse — utilises a binary grouping logic Alex Elmsley applied to a card trick using 16 cards. Elmsley originally published this routine in the September 1958 issue of the magic journal 'Ibidem (Issue 14)', under the title  'Mathematics and Mentliasm', which can also be viewed in Stephen Minch's 1991 'Collected works of Alex Elmsley, Volume 1', pp378-380.

For a maths teacher, 'The Swords of Truth' is a potent conceit that piques students' interest and that — when used carefully of course (see 'When Magic Fails in Mathematics,' by Junaid Mubeen, for example) — levers and encourages strong, mathematically mature thinking. After playing the trick out on/with students, it is demystified carefully, and collectively, before students use their newfound knowledge and understanding creatively in devising a different trick, based on the same principles. (Downloads of the 'swords' can be accessed here, in pdf, png and ppt.)


The Trick

  • Ask someone to secretly choose any one of the 'swords'.
  • Ask them to secretly choose any one of the numbers on that 'sword'.
  • Ask them to read aloud the shapes surrounding the numbers on that 'sword' in order, but they must lie about the shape surrounding their chosen number, i.e., if a circle surrounds their chose number they must read it as a square, and vice-versa. For example, if they chose number 12 on the 5th sword, they will say 'Circle Circle Square Circle* Square Circle', lying about the square surrounding the number 12 and saying it was a circle. 


The Reveal

    • Convert the shapes into binary numbers, where 'circle' is zero and 'square' is one. 
    • Split the six digits you now have into two groups of three.
    • Convert the first set of three from binary to decimal to give you the first digit of their chosen number.
    • Convert the second set of three from binary to decimal to give you the second digit of their chosen number.

     

    The How / Why?

    • The number 1 in binary (1)2 = (1 x 2⁰) = (1 x 1) = (1)10 → Hence in any group of 3 shapes, should number 1 be the chosen digit, the sequence of shapes will be 001, i.e., Circle Circle Square.
    • The number 2 in binary (10)2 = (1 x 2¹) + (0 x 2⁰) = (1 x 2) + (0 x 1) = (2)10 → Hence in any group of 3 shapes, should number 2 be the chosen digit, the sequence of shapes will be 010, i.e., Circle Square Circle.
    • The number 3 in binary (11)2 = (1 x 2¹) + (1 x 2⁰) = (1 x 2) + (1 x 1) = (3)10 → Hence in any group of 3 shapes, should number 3 be the chosen digit, the sequence of shapes will be 011 , i.e., Circle Square Square.
    • The number 4 in binary (100)2 = (1 x 2²) + (0 x 2¹) + (0 x 2⁰) = (1 x 4) + (0 x 2) + (0 x 1) = (4)10 → Hence in any group of 3 shapes, should number 4 be the chosen digit, the sequence of shapes will be 100, i.e., Square Circle Circle.
    • The number 5 in binary (101)2 = (1 x 2²) + (0 x 2¹) + (1 x 2⁰) = (1 x 4) + (0 x 2) + (1 x 1) = (5)10 → Hence in any group of 3 shapes, should number 5 be the chosen digit, the sequence of shapes will be 101, i.e., Square Circle Square.
    • The number 6 in binary (110)2 = (1 x 2²) + (1 x 2¹) + (0 x 2⁰) = (1 x 4) + (1 x 2) + (0 x 1) = (6)10 → Hence in any group of 3 shapes, should number 6 be the chosen digit, the sequence of shapes will be 110, i.e., Square Square Circle.
    • The number 7 in binary (111)2 = (1 x 2²) + (1 x 2¹) + (1 x 2⁰) = (1 x 4) + (1 x 2) + (1 x 1) = (7)10 → Hence in any group of 3 shapes, should number 6 be the chosen digit, the sequence of shapes will be 111, i.e., Square Square Square.


    Examples

    For example, if the number 12 is chosen on the 5th sword: 

      • Circle Circle Square Circle* Square Circle  →  (001)2 | (010)2
      • (001)2 = (1 x 2⁰) + (0 x 2¹) + (0 x 2²) = 1 + 0 + 0 = (1)10 → So the first digit is 1.
      • (010)2 = (0 x 2⁰) + (2 x 2¹) + (0 x 2²) = 0 + 2 + 0 = (2)10 → So the second digit is 2.
      • Hence their chosen number is 12.

      For example, if the number 54 is chosen on the 4th sword: 

      • Square Circle Square Square Circle* Circle → (101)2 | (100)2
      • (101)2 = (1 x 2⁰) + (0 x 2¹) + (1 x 2²) = 1 + 0 + 4 = (5)10 → So the first digit is 5.
      • (100)2 = (0 x 2⁰) + (0 x 2¹) + (1 x 2²) = 0 + 0 + 4 = (4)10 → So the second digit is 4.
      • Hence their chosen number is 54.

      For example, if the number 2 is chosen on the 1st sword: 

      • Circle Circle* Circle Circle Square Circle → (000)2 | (010)2
      • (000)2 = (0 x 2⁰) + (0 x 2¹) + (0 x 2²) = 0 + 0 + 0 = (0)10 → So the first digit is 0.
      • (010)2 = (0 x 2⁰) + (1 x 2¹) + (0 x 2²) = 0 + 2 + 0 = (2)10 → So the second digit is 2.
      • Hence their chosen number is 2.

       

      More Discussion and Explanation

      Michael Stevens (@Vsauce) and Professor Hannah Fry (@fryrsquared) play with the wonderful wooden 'Swords of Truth' keychain produced by Creative Crafthouse in their 'The Rest is Science' podcast 'The Magic Trick that Fools Everyone'. They give the binary code explanation and move onto discuss error correcting codes.


      Possible Teaching Approaches

      Thinking through some possible starting questions for students to consider (or to consider with students), before moving on perhaps with students creating their own 'Swords of Truth' trick. You may also want to follow with 'On The 'Mystery Calculator' Trick', another and more well-known mind reading mathemagic trick that utilises binary grouping.
      • What do you notice about the numbers on each 'sword'?
      • Can we have a number larger than 76 on any of the swords?
      • What would be the largest possible number if we had fewer or more 'swords'?
      • Would we need more 'swords' if we wanted there to be higher numbers?  
      • Are there any constraints to the numbers we place on the cards?
      • How did the puzzle designer make the 'lie' work?
      • Would a similar trick in another base, maybe base-3, be more magical?
      • How high can we count in binary on our fingers? (Watch this Ted-Ed video from James Tanton.)