From Puzzles to Programming

Puzzles and Programming

Babylonian Mathematics

Clay tablets survived from period 1800-1600 BC in Babylon reveal beautiful examples of mathematics skills during that period.

The  Pythagorian triplets

Babylonians knew pythagorian numbers and relation 1000 years before pythagoras a2 + b2 = c2.

Example of such triplets (a, b, c) are: (3, 4 and 5), (5, 12, 13),…The babylonian left a tablet of 15 pythagorian triplets. One of the large triplet numbers set they left is: a = 12709, b = 13500, and c = 18541. How did they reach such numbers is not known but one explanation is as follows:

First they believed that all numbers are rational i.e. a = a1/a2, b = b1/b2, and c = c1/c2.

Then they thought that C should be larger than A. Now, consider C to be sum of 2 positive integers p and q. C = p+q and A as difference of p and q. A = p-q. It follows that

B2 = C2 – A2 = 4pq. Now, 4pq will be a square only if p and q are squares. Let p = P2, and q = Q2­,

then B = 2PQ, A = P2 - Q2, and C = P2 + Q2.

From this formula, you can derive (A, B, C) triplets such that

B2 = C2 – A2.

Examples of such triplets: let P = 5, Q = 1 then A = 24, B = 10, and C = 26.

Let P = 8, and Q = 7, then A = 64- 49 = 15, B = 112, and C = 113.