ArticleslgStudy

computer science

Siamese method

Siamese method is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Siamese method rather than just read about it. In short: The Siamese method, or De la Loubère method, is a simple method to construct any size of n-odd magic squares (i.e. number squares in which the sums of all rows, columns and diagonals are identical). The method was brought to France in 1688 by the French mathematician and diplomat Simon de la Loubère, as he was returning from his 1687 embassy to the kingdom of Siam.

Siamese method — main illustration
Siamese method — illustration

Key takeaways

  • Siamese method belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Siamese method to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Siamese method from memory before moving on to harder problems.

Reference excerpt

The Siamese method, or De la Loubère method, is a simple method to construct any size of n-odd magic squares (i.e. number squares in which the sums of all rows, columns and diagonals are identical). The method was brought to France in 1688 by the French mathematician and diplomat Simon de la Loubère, as he was returning from his 1687 embassy to the kingdom of Siam. The Siamese method makes the creation of magic squares straightforward.

Publication

De la Loubère published his findings in his book A new historical relation of the kingdom of Siam (Du Royaume de Siam, 1693), under the chapter entitled The problem of the magical square according to the Indians. Although the method is generally qualified as "Siamese", which refers to de la Loubère's travel to the country of Siam, de la Loubère himself learnt it from a Frenchman named M.Vincent (a doctor, who had first travelled to Persia and then to Siam, and was returning to France with the de la Loubère embassy), who himself had learnt it in the city of Surat in India:

"Mr. Vincent, whom I have so often mentioned in my Relations, seeing me one day in the ship, during our return, studiously to range the Magical Squares after the method of Bachet, informed me that the Indians of Suratte ranged them with much more facility, and taught me their method for the unequal squares only, having, he said, forgot that of the equal"

The method The method was surprising in its effectiveness and simplicity:

"I hope that it will not be unacceptable that I give the rules and the demonstration of this method, which is surprising for its extreme facility to execute a thing, which has appeared difficult to our Mathematicians" First, an arithmetic progression has to be chosen (such as the simple progression 1,2,3,4,5,6,7,8,9 for a square with three rows and columns (the Lo Shu square)). Then, starting from the central box of the first row with the number 1 (or the first number of any arithmetic progression), the fundamental movement for filling the boxes is diagonally up and right (↗), one step at a time. When a move would leave the square, it is wrapped around to the last row or first column, respectively. If a filled box is encountered, one moves vertically down one box (↓) instead, then continuing as before.

Order-3 magic squares

Order-5 magic squares

Other sizes Any n-odd square ("odd-order square") can be thus built into a magic square. The Siamese method does not work however for n-even squares ("even-order squares", such as 2 rows/ 2 columns, 4 rows/ 4 columns etc...).

Other values Any sequence of numbers can be used, provided they form an arithmetic progression (i.e. the difference of any two successive members of the sequence is a constant). Also, any starting number is possible. For example the following sequence can be used to form an order 3 magic square according to the Siamese method (9 boxes): 5, 10, 15, 20, 25, 30, 35, 40, 45 (the magic sum gives 75, for all rows, columns and diagonals). The magic sum in these cases will be the sum of the arithmetic progression used divided by the order of the magic square.

Other starting points It is possible not to start the arithmetic progression from the middle of the top row, but then only the row and column sums will be identical and result in a magic sum, whereas the diagonal sums will differ. The result will thus not be a true magic square:

Rotations and reflections Numerous other magic squares can be deduced from the above by simple rotations and reflections.

Variations A slightly more complicated variation of this method exists in which the first number is placed in the box just above the center box. The fundamental movement for filling the boxes remains up and right (↗), one step at a time. However, if a filled box is encountered, one moves vertically up two boxes instead, then continuing as before.

Numerous variants can be obtained by simple rotations and reflections. The next square is equivalent to the above (a simple reflexion): the first number is placed in the box just below the center box. The fundamental movement for filling the boxes then becomes diagonally down and right (↘), one step at a time. If a filled box is encountered, one moves vertically down two boxes instead, then continuing as before.

These variations, although not quite as simple as the basic Siamese method, are equivalent to the methods developed by earlier Arab and European scholars, such as Manuel Moschopoulos (1315), Johann Faulhaber (1580–1635) and Claude Gaspard Bachet de Méziriac (1581–1638), and allowed to create magic squares similar to theirs.

See also Conway's LUX method for magic squares Strachey method for magic squares

Notes and references

Illustrations

Siamese method: A simple example of the Siamese method. Starting with "1", boxes are filled diagonally up and right (↗). When a move would leave the square, it is wrapped around to the last row or first column, respectively. If a filled box is encountered, one moves vertically down one box (↓) instead, then continuing as before.
A simple example of the Siamese method. Starting with "1", boxes are filled diagonally up and right (↗). When a move would leave the square, it is wrapped around to the last row or first column, respectively. If a filled box is encountered, one moves vertically down one box (↓) instead, then continuing as before.
Siamese method: A description of the Siamese method in Simon de la Loubère's 1693 A new historical relation of the kingdom of Siam.
A description of the Siamese method in Simon de la Loubère's 1693 A new historical relation of the kingdom of Siam.

Worked examples

Example 1 — a first encounter with Siamese method

Start with the simplest possible case. Write down what Siamese method claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Siamese method before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Siamese method ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Siamese method

In research
Siamese method appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Siamese method in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Siamese method is common in secondary-school and first-year university syllabi. It links to neighbouring topics Magic squares, Search algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Siamese method outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Siamese method” →

How to study Siamese method in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Siamese method means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Siamese method out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Siamese method in simple terms?

The Siamese method, or De la Loubère method, is a simple method to construct any size of n-odd magic squares (i.e. number squares in which the sums of all rows, columns and diagonals are identical). The method was brought to France in 1688 by the French mathematician and diplomat Simon de la Loubèr…

Why does Siamese method matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Siamese method?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Siamese method.

Tags

  • Magic squares
  • Search algorithms

Keep exploring