Magic in a Square

N2 numbers are arranged in a square pattern. Select one of the numbers and try answering computer queries. After two attempts, computer will reveal your selected number.

This applet requires Sun's Java VM 2 which your browser may perceive as a popup. Which it is not. If you want to see the applet work, visit Sun's website at, download and install Java VM and enjoy the applet.

What if applet does not run?


|Contact| |Front page| |Contents| |Algebra|

Copyright © 1996-2018 Alexander Bogomolny

Magic in a Square

Simple as the trick is, it was described by [Rouse Ball, p. 325] and referred to by [M. Gardner, p. 3]. Martin Gardner writes: "The success of the trick depends, of course, on the spectator's inability to follow the procedure well enough to guess the operating principle." He then selfishly adds: "Unfortunately, few spectators are that dense."

Every location in the square is determined by its row and column numbers. The column is indicated directly on the first response, after which the columns of the square are swapped with the corresponding rows. Answer to the second query therefore determines the row. To confound the mildly dense spectators, computer, before displaying the numbers, randomly reshuffles them in every column.


  1. M. Gardner, Mathematics Magic and Mystery, Dover, 1956
  2. W. W. Rouse Ball, H. S. M. Coxeter, Mathematical Recreations and Essays, Dover, 1987

Related material

  • An Arithmetic Magic Trick
  • Bachet's Magic Trick
  • Gergonne's Magic Trick
  • Hummer's Mind Reader
  • Magic in Square
  • Math Telepathy
  • Number Guessing Game. All by Computer
  • Barcode Magic
  • Arithmetic magic matrix
  • Calendar Magic: an Interactive Gizmo
  • Two Numbers Guessing Game
  • |Contact| |Front page| |Contents| |Algebra|

    Copyright © 1996-2018 Alexander Bogomolny


    Search by google: