he had learned while working for the state treasury, including mathematical problems posed by computing land tax, estimating requirements, currency issues, metrology, and so forth. Shen once computed the amount of terrain space required for battle formations in military strategy, and also computed the longest possible military campaign given the limits of human carriers who would bring their own food and food for other soldiers. Shen wrote about the earlier Yi Xing (672–717), a Buddhist monk who applied an early escapement mechanism to a water-powered celestial globe. By using mathematical permutations, Shen described Yi Xing's calculation of possible positions on a go board game. Shen calculated the total number for this using up to five rows and twenty five game pieces, which yielded the number 847,288,609,443. Optics Shen Kuo experimented with the pinhole camera and burning mirror as the ancient Chinese Mohists had done in the 4th century BC, as Mozi of China's Warring States period was perhaps the first to describe the concept of camera obscura, if not his Greek contemporary Aristotle. The Iraqi Muslim scientist Ibn al-Haytham (965–1039) further experimented with camera obscura and was the first to attribute geometrical and quantitative properties to it, but Shen was first to note the relationship of the three separate radiation phenomena: the focal point, burning point, and pinhole. Using a fitting metaphor, Shen compared optical image inversion to an oarlock and waisted drum. Along with focal points, he also noted that the image in a concave mirror is inverted. Shen, who never asserted that he was the first to experiment with camera obscura, hints in his writing that camera obscura was dealt with in the Miscellaneous Morsels from Youyang written by Duan Chengshi (d. 863) during the Tang dynasty (618–907), in regard to the inverted image of a Chinese pagoda by a seashore. Chinese authors from the 12th to 17th centuries would discuss the optical observations made by Shen Kuo but not advance them further, while Leonardo da Vinci (1452–1519) would be the first in Europe to make a similar observation about the focal point and pinhole in camera obscura. Magnetic needle compass Since the time of the engineer and inventor Ma Jun (c. 200–265), the Chinese had used the south-pointing chariot, which did not employ magnetism, as a compass. In 1044 the Collection of the Most Important Military Techniques (; Wujing Zongyao) recorded that fish-shaped objects cut from sheet