Current location - Training Enrollment Network - Mathematics courses - Principle of Han Xin's point soldier algorithm
Principle of Han Xin's point soldier algorithm
Han Xin ordered the more soldiers, the better. There was a general named Han Xin in the Han Dynasty in China. Every time he assembles troops, he only asks his men to count off in order of L ~ 3, 1 ~ 5 and 1 ~ 7, and then reports the remainder of each team's count, so that he knows how many people have arrived.

1, his ingenious algorithm, people call it "Ghost Valley Calculation", "Partition Calculation", or "Han Xin Points Soldiers", and foreigners call it "Chinese Remainder Theorem".

2. Cheng Dawei, a mathematician in Ming Dynasty, summed up this algorithm with poems. Han Xin ordered soldiers and Han Xin ordered soldiers, also known as Chinese remainder theorem. According to legend, Emperor Gaozu Liu Bang asked General Han Xin how many soldiers he commanded.

3. Han Xin replied that every three people have more than 1 person, five people have more than 2 people, seven people have more than 4 people, and 13 people have more than 6 people ... Liu Bang was at a loss.

Let's consider the following questions first: Suppose the number of soldiers is less than 10,000, how many soldiers are there? Let's find the least common multiple 9945 of 5,9, 13 and 17.

Expand knowledge-Han Xin

1, Han Xin (? -Former 196), a native of Huaiyin (now Huaiyin District, Huai 'an City, Jiangsu Province), a founding hero and strategist in the Western Han Dynasty, one of three outstanding heroes of early han dynasty, a representative figure of China's military thought "seeking war", and Mao Kun praised him as a "soldier fairy" in the Ming Dynasty.

2. Han Xin was born a commoner, and his family was poor in his early years. He was once supported by others and cheated and humiliated. After the peasant uprising broke out at the end of Qin Dynasty, Han Xin took refuge in Xiang Liang first, and then in Liu Bang, but they were not reused.

3. When Liu Bang entered Hanzhong, Han Xin escaped and was recovered by Xiao He overnight and recommended to Liu Bang. Liu Bang worshipped Han Xin as a general and competed with Xiang Yu for the world. In the first year of Han Dynasty (206 BC), Han Xin offered a plan to pacify Sanqin.

4. During the Chu-Han War, Han Xin swept Wei, Zhao, Dai, Yan and Qi with his outstanding military ability and supported Liu Bang several times. In the battle of Puban, Han Xin took Anyi, the capital of Wei; In the battle of Jingxing, Han Xin defeated Zhao in the last battle; In the battle of Weishui, Han Xin flooded the Qi-Chu allied forces and killed Long Qie, the general of Chu.

5. In the Battle of Gaixia, Han Xin deployed five armies to lure the enemy and defeated Xiang Yu's army. In the fifth year of Emperor Gaozu (the first 202 years), Xiang Yu, the overlord of Chu, was desperate and committed suicide in Wujiang River. Han envelope Chu Wang is a credit.

6. In the sixth year of Emperor Gaozu (20 1 ago), Liu Bang began to cut off the half surname Wang. Han Xin was demoted to Huaiyin Hou. In the 11th year of Emperor Gaozu (BC 196), Han Xin was accused of participating in the rebellion in Chen Yi. Lv Hou and Xiao He conspired to kill him in Changle Palace, and he was executed by three clans.

7. Han Xin was a first-rate strategist in Qin and Han Dynasties. He not only commanded many major military operations with brilliant results, but also had profound military literacy, leaving behind three military works, Han Xin.

8. It is one of the "Thirteen Great Art of War" recorded in Hanshu, which is tied with military strategists such as Sun Wu, Sun Bin, Shang Yang and Wu Qi. Not only that, Han Xin also worked with Sean to sort out the military books spread to the early years of the Western Han Dynasty.