From Puzzles to Programming

Puzzles and Programming

History & Introduction

Puzzle is any problem that challenges the mind, stimulates thinking for potential solutions and provides a rewarding experience upon solving it. Many games—such as solitaire, chess, and checkers—include numerous puzzles. Other common game-puzzles include crossword puzzles, which appear daily in nearly every newspaper around the world, jigsaw puzzles, and the mechanical puzzle Rubik's Cube.

Puzzles are reflection of the human tendency toward curiosity and may be as old as language. The earliest puzzles in history dates to the 2nd millennium BC in the Middle East. The oldest written riddle is inscribed on a tablet that dates to Babylonian (Iraq) times (beginning about 2000 BC). The earliest known physical puzzle is the huge labyrinth constructed by Pharaoh Amenemhet III in the vicinity of Lake Moeris, Egypt. It dates to the 19th century BC and was described by ancient Greek historian Herodotus in his 5th-century-BC writings. Mathematical puzzles are believed to have originated with the development of arithmetic in Egypt and Babylonia during the 3rd and 2nd millennia BC.

During the period from the 5th century to 15th century there was interest in mathematical puzzles, as well as puzzle-vessels (jugs or mugs with hidden tubes) and mazes. A text of 56 mathematical puzzles, Propositiones ad Acuendos Juvenes (Problems to Sharpen the Young), was written by 9th-century English scholar Alcuin. In the same century Muhammad ibn Musá ibn Shakir, of Baghdad (Iraq), described 100 pneumatic and mechanically operated puzzle-vessels and trick-vessels in Kitab al-hiyal (The Book of Ingenious Devices, translated in 1979).

During the last half of the 19th century, many types of puzzles were designed by Sam Loyd, from the United States, and Henry Dudeney, from Great Britain, each of whom is considered the greatest puzzle inventor of his respective country.

Puzzles can be grouped into three broad classes: riddles and word puzzles, mathematical and logic puzzles, and physical and mechanical puzzles. In this part of this website, I presented mainly logical and mathematical puzzles sometimes intermingled with computer algorithms. Also, I had picked some visual illusion cases and tried to explain the reasoning behind such illusions. At the end (though puzzle subject, like mathematics and human thinking, is an almost infinite one), digital logic (the basis for most computer calculations) is mentioned briefly and this topic will be elaborated in more details (e.g. digital adders) as the site grows on.  

Many recreational puzzles have led to important developments in mathematics and logic study including digital logic. As an example, topology and graph theory have their origins in the analysis of a popular puzzle by the great Swiss mathematician Leonhard Euler. The puzzle is to find a path over the seven bridges of Königsberg, Germany, without traveling over the same bridge twice. We will go further into this puzzle as we progress more in the site.

Some of the first number puzzles were included in an important ancient Egyptian mathematical document composed about 1650 BC and known as the Rhind Papyrus. Magic squares, another early form of number puzzle, originated in China before the end of the 1st century. A magic square puzzle forms a square array of numbers so that the rows, columns, and major diagonals all have equal sums.

In 1924 Henry Dudeney published a popular number puzzle of the type known as a cryptarithm, in which letters are replaced with numbers. Dudeney's puzzle reads: SEND + MORE = MONEY. Cryptarithms are solved by deducing numerical values from the mathematical relationships indicated by the letter arrangements. The only solution to Dudeney's problem: 9567 + 1085 = 10,652.

Geometric puzzles were studied by Greek mathematician Archimedes in the 3rd century BC. The Loculus of Archimedes is a dissection puzzle in which a square is cut into 14 pieces that are to be reassembled (a type of put-together puzzle) to form silhouettes of people, animals, or objects. In 1902 Dudeney published another type of geometric puzzle: Cut an equilateral (equal-sided) triangle into four pieces that can be reassembled into a square. Some geometric puzzles or cases will be presented in detail through the site.

Logic puzzles are puzzles that require deductive reasoning with little or no numerical calculation. Logic puzzles and paradoxes were part of the study of logic in the 4th century BC by Greek philosophers, including Aristotle. Zeno of Elea wrote famous paradoxes that attempted to prove that apparently obvious sensory experiences, such as the perception of motion, are in fact impossible. In the 19th century Lewis Carroll popularized several logic puzzles in storybooks such as “A Tangled Tale” (1880). Many paradoxes presented here are lot of fun once you solve them.

Enjoy this site.