Current location - Training Enrollment Network - Early education courses - Nine-way lock spelling
Nine-way lock spelling
Jiuqu Lock is a traditional folk intellectual toy that spreads in Shanxi Province. It uses nine rings in a string and wins by unraveling them. According to Yang Yinzhu Lu, two intersecting rings were made of jade in the Ming Dynasty. "When two rings intersect, they can be closed, the solution is two and merged into one." Later, copper or iron replaced jade and became toys. It has a history of nearly 2000 years in China. In Zhuo Wenjun's letter to Sima Xiangru, there is a saying that "nine chains are broken from it".

How to untie or splice the nine rings? The first thing to know is its structure. Generally, nine small rings are made of metal wires, and the nine rings are connected and sleeved on strip transverse plates or various frames. The handle of the frame is sword-shaped, wishful-shaped, butterfly-shaped, plum-blossom-shaped and so on, and all rings are connected by copper bars. When playing, the nine rings are all connected to the copper ring according to law, or they are all untied after putting on sleeves.

It takes 256 steps to untie the nine-ring * * *, as long as the next ring is connected, even if it is a step, it is not sliding on the shelf. I hope everyone can solve this problem through independent thinking. The expansion and nesting of nine chains are a pair of inverse processes. This solution is based on the same principle as computer gray code.

The links of the nine-link chain restrict each other, and only the first link can go up and down freely. In order to get down/up the nth ring, two conditions must be met (except the first ring). N- 1 ring on the rack; None of the rings in front of the n- 1 ring are on the shelf. Playing nine chains is to try to meet the above two conditions. In essence, to untie the nine-ring chain, we should start from the back ring, and the front ring should be removed before the back ring can be removed. The front ring should be installed, not really removed.

That is to say, to solve an N-2 chain is to solve an N-2 chain first, then the last chain, then the N-2 chain, and then the N- 1 chain. It takes 65,438+0 steps to solve one chain and 65,438+0 steps to solve the second chain. Therefore, it takes four steps to solve the third chain, seven steps to solve the fourth chain, 65,438+06 steps to solve the fifth chain, 365,438+0 steps to solve the sixth chain, 64 steps to solve the seventh chain, 65,438+027 steps to solve the eighth chain and 27 steps to solve the ninth chain.