Cut the knot: learn to enjoy mathematics
A math books store at a unique math study site. Learn to enjoy mathematics.
Terms of use
Privacy Policy

More Mathematics
CTK Exchange

Games to Relax
Guest book
Recommend this site

Sites for teachers
Sites for parents

Manifesto: what CTK is about Buying a book is a commitment to learning Things you can find on CTK Email to Cut The Knot Recommend this page

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.

<hr> <h3> 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. </h3> <hr>


Copyright © 1996-2008 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

Copyright © 1996-2008 Alexander Bogomolny