Chapter 105 Rubik's Cube Matrix(1/2)
Rubik's Cube Matrix, also known as magic square, vertical and horizontal diagram.
It refers to an N-order matrix arranged by N^2 numbers in total, with the same number of rows and columns, and the sums on each row and column and diagonal are equal.
In "The Legend of the Condor Heroes", Guo and Huang were chased by Qiu Qianren to Heilongtan and hid in Yinggu's hut. Yinggu asked a question: The numbers 1 to 9 fill in the table of three rows and three columns, and the sums of each row, each column, and the two diagonal lines were required to be equal. This question stumped Yinggu for more than ten years, and Huang Rong answered it all at once.
4 9 2
3 5 7
8 1 6
This is the simplest third-order plane Rubik's Cube matrix.
The question that Lao Tang asked today is a more difficult fifth-level Rubik's Cube Plane Matrix.
The difficulty of the calculation is, I don’t know how much higher than the third-order Rubik’s Cube matrix.
However, since the Rubik's Cube matrix has been defined by mathematicians, it naturally has a unique set of operational rules.
According to the value of N, it can be divided into three situations.
When N is an odd number, when N is a multiple of 4, when N is another even number!
Lao Tang’s question is to find the 5th-order plane magic cube. Obviously, the calculation rules of N as odd numbers can be applied.
Cheng Nuo silently recalled the filling rules of the plane Rubik's Cube when N is an odd number.
“When N is an odd number
① Place 1 in the middle of the first row;
② From 2 to n×n, each number is stored in sequence according to the following rules:
Walk in 45° direction, like upright
The row stored in each number is 1 less than the row number of the previous number, and the number of columns is 1 less than the number of rows.
③If the range of rows and columns exceeds the range of the matrix, wrap around.
For example, 1 is in the first row, then 2 should be placed in the lowest row, and the number of columns is also reduced by 1;
④If there is a number at the position determined by the above rules, or the previous number is the n column of the first row,
Then put the next number below the previous number." (Note ①)
"So, the correct answer should be..."
Cheng Nuo built a grid model in his mind. Soon, he filled in 25 numbers.
Swish swish swish swish swish swish ~~
In the eyes of the students, Cheng Nuo did not hesitate at all. He took the chalk and walked on the blackboard, and the powder was flying. There was no pause in the middle, and it was done in one go!
When I raised my hands and feet, I revealed my incredible confidence.
"Okay, teacher, I've finished it." Cheng Nuo turned around, threw the chalk head on the podium, and said to Lao Tang with a smile.
"Okay, let me take a look. Did you fill it in it right?" Old Tang looked at the square that had been filled on the blackboard with a curiosity.
15 8 1 24 17
16 14 7 5 23
22 20 13 6 4
3 21 19 12 10
9 2 25 18 11
All are correct!!
The position of 25 numbers is exactly the same as the correct answer.
The sum of every row, column, and diagonal is 65!~
Old Tang looked at Cheng Nuo with a normal expression in surprise. Then, under the expectant gaze of the whole class, he announced, "Class Cheng Nuo's answer... is correct!"
Wow~~
All the students in the class were in an uproar.
Sure enough, this guy Cheng Nuo is still as strong as ever!
It's not comparable, it's not comparable.
Their brain configurations with Cheng Nuo are simply not on the same level.
A top student is an existence that is only worthy of being looked up to by a poor student!
Old Tang looked at Cheng Nuo and said, "Since Cheng Nuo is the first to solve this problem, then my 'special' reward will belong to Cheng Nuo. Cheng Nuo, can you tell you how you solved this problem through?"
"No problem." Cheng Nuo nodded, turned around and pointed to the question, "Actually, this question is very simple."
This question...is very simple?
Well, you are a top student, you have the final say.
The whole class rolled his eyes.
Cheng Nuo shrugged and continued to preach as usual. "Before talking about this question, I will first tell you a model called Rubik's Cube Matrix!"
Why can Cheng Nuo know about the Rubik's Cube Matrix?
Logically speaking, high school will not involve this knowledge.
But who is Cheng Nuo? He is a top student!
A major feature of a top student is that he will never be satisfied with only learning the knowledge in class!
Do you still remember the large number of books about world math problems that Cheng Nuo bought from the bookstore? This Rubik's Cube Matrix was used in the reasoning process of one of the difficult problems. Cheng Nuo wrote it down by the way.
Cheng Nuo stood on the podium and explained all three solutions to the Rubik's Cube Matrix.
"After listening to this theorem, do you think this question is much simpler? First of all, the number in the middle of the first line must be 1 and the position of the number 2..."
The students under the podium were dizzy and unaware of the harshness, but Cheng Nuo spoke on the podium with relish.
"Okay, that's all I want to say, thank you everyone!" After saying that, Cheng Nuo walked off the podium.
Smack sex~~
The whole class applauded subconsciously.
Comrade Lao Tang stood in front of the podium and looked embarrassed after Cheng Nuo walked off the podium.
My sister! I have finished everything I want to say, what do I want to say?!
Originally, Comrade Lao Tang wanted to use this question to introduce the Rubik's Cube matrix and spread the students' thinking before the college entrance examination.
But now...
Uh...well, Cheng Nuo talked about the Rubik's Cube matrix more detailed than me, so I, a teacher, wouldn't be ugly anymore.
"Okay. Students, let's take out the Hengshui real questions I sent last week and let's talk about the test papers." Old Tang coughed awkwardly, and without asking the students whether they understood it, he hurriedly changed the topic.
"Wow, Mu Leng, Cheng Nuo is really amazing. You can do such questions!" Su Xiaoxiao's bright eyes were filled with little stars.
Mu Leng's mouth raised slightly, "This is the...rebellious him!"
…………
"Okay, get out of class is over. Mu Leng, Cheng Nuo, you two come to the office with me."
With the ringtone of the end of get out of class, Lao Tang happened to finish the last question.
Cheng Nuo and Mu Leng looked at each other, and were confused. They didn't know what Lao Tang had to do with him, but they just followed Lao Tang to the office honestly.
When going down the stairs, Cheng Nuo approached Mu Leng and whispered with a little worried tone, "Sister Leng, do you think that Lao Tang discovered that the two of us were in love?"
Mu Leng glanced at Cheng Nuo indifferently and spoke word by word: "You said--what!"
Cheng Nuo shrank his neck and looked embarrassed, "Just, joke."
"But, Sister Leng, do you really no longer consider the matter between us? Look, you are a top student, I am also a top student, a top student, and we are a top student, and we are a match between the two of us. The children born must be top student!" Cheng Nuo said with his fists tightly.
Mu Leng pursed her lips and said ambiguously, "After the college entrance examination, let's talk about this issue."
"Okay, I'll wait for you." Cheng Nuo smiled faintly.
……………………
Note ①: The algorithm for the other two situations of the Rubik's Cube matrix. (The number of words in the main text has reached 2,000 words, which is not the number of words in the water. This is to help everyone learn this question!! Please understand the author's good intentions.)
(2) When N is a multiple of 4
Symmetrical element exchange method is used.
First fill in the matrix in order from top to bottom and from left to right
Then, the numbers on the two diagonal lines in all 4×4 sub-matrixes of the square matrix are exchanged symmetrically about the center of the large square matrix (note that they are the numbers on the diagonal lines of the cogmatrix), that is, a(i,j) and a(n+1-i,n+1-j) are exchanged, and the numbers at all other positions remain unchanged. (Or the diagonal lines remain unchanged, and other positions can be exchanged symmetrically.)
(3) When N is another even number
When n is an even number that is not a 4 multiple (i.e., 4n+2 shape): first decompose the large square matrix into 4 odd (2m+1 order) sub-square matrix.
To be continued...