Li Zhendong glanced at Zhang Yuan and saw him smiling mysteriously at his phone. He was stunned.
Great, he'd found himself a girlfriend.
His inner gossip monger roared to life.
He sneaked another look. Wait, was he doing Super Brain?
Li Zhendong had to pinch the bridge of his nose. "You're really that hardworking?"
"I was bored, so I'm doing some problems for fun. Look at this integral—the solution is so elegant. There are very few integrals that actually have an analytic solution."
For fun...
For fun...
For...
Li Zhendong's forehead twitched, and his breathing grew heavy. Thinking back to college, Zhang Yuan had been just as annoyingly diligent, and Li Zhendong had taken plenty of scoldings from his parents because of it.
"Look at him, then look at yourself!" His father's judgment seemed to ring in his ears.
Li Zhendong couldn't help getting annoyed. After graduating, this guy hadn't toned it down at all; he'd only gotten worse. Solving problems had become his advanced form of entertainment. How could anyone be that amazing?!
"Wait, there's a game my little sister can't beat. It's a puzzle game. You're bored anyway, so give it a try."
A game?
"Let me see."
Seeing the other man's gleeful expression, Zhang Yuan grew a little interested. How hard could a kid's game be?
The little girl brought over a learning tablet. On it was a small program called "Lights Out Game."
The rules were simple: a 4×4 grid of lights was lit up on the board. Each time you pressed a light, it and the lights directly above, below, to the left, and to the right changed states—lit lights went dark, and dark lights lit up.
If you could turn off all the lights through a series of moves, you beat the game.
"This is easy."
Zhang Yuan tapped a few lights at random. They all went dark, and he cleared the level.
The screen switched to a new image: a 5×5 grid of lights, with some of the lights in the middle already turned off.
"It's a little harder."
Zhang Yuan thought it over briefly, tapped a few lights, and cleared the level again. This time, it took him longer.
Clearly, the game would get harder as the grid grew.
"I was thinking..."
The little girl blinked, then said timidly, "If there were a really big grid of lights, and their initial states were random, could there be a mathematical algorithm to solve the problem instead of just tapping at random and trying to get lucky?"
Zhang Yuan scratched his head and smiled. "Your little sister has a real mathematical mind. A general algorithm... Hmm, let me think..."
"Of course she does! She's got half my brains!"
"Big brother, I'm smarter than you!"
"How are you smarter than me?"
Li Zhendong grinned outwardly, and inwardly too.
This problem was hard.
Why was it hard?
Because Li Zhendong had thought about it for a while and couldn't solve it.
So, Brother Zhang, who loved solving problems, take your time. Think until the sky grows dark and day turns to night...
Making his best friend look bad in front of his little sister was so satisfying! It felt great!
"I'm going to take a shower. Take your time with it."
The little girl looked at Zhang Yuan expectantly. There was no way she could solve a problem like this herself.
But as the one who'd come up with the challenge, she was pretty pleased with herself.
Zhang Yuan's response was not what they expected. He looked a little embarrassed. "No need. Don't take your shower yet—I've already solved it."
What?
Solved it?
Li Zhendong's eyes nearly popped out of his head. He rushed out of the bathroom, then sheepishly put his underwear back on.
Zhang Yuan explained calmly, "According to the rules, pressing a switch changes the state of that light and the lights directly above, below, to the left, and to the right. So we can conclude that pressing a switch an odd number of times has the same effect as pressing it once; pressing it an even number of times is equivalent to not pressing it at all, which is zero."
Interesting.
"So if there's a solution, each light needs to be pressed at most once. You either press it or you don't."
"First, let's consider an N×N matrix. This is actually a binary group, and it's isomorphic to a full-rank matrix. Since the matrix is full-rank, there must be a unique solution..."
After hearing just that much, Li Zhendong felt his head was about to explode. Inspiration surged through him like a spring!
Wait.
That really was it...
What a simple problem.
How had I not thought of that?
He shouted in frustration, "How can you use group theory? How would a middle schooler understand group theory? You can't do this to my little sister!"
Even Li Zhendong's mother poked her head out to look. When she saw they weren't up to anything, she shook her head and went back to the kitchen.
"All right, then. Middle schoolers have learned systems of linear equations, right?"
The little girl nodded. Two-variable linear equations were definitely part of the middle school curriculum; they could be solved by elimination or substitution.
Three-variable and four-variable equations were manageable too.
Zhang Yuan continued, "Suppose Aij is the number of times we adjust the light in the ith row and jth column. As I just said, Aij is clearly either 1 or 0."
"Let's use the simplest 2×2 matrix as an example. Let's say a light that's off is 0, and one that's on is 1."
"Suppose the initial state of the matrix is:
[1-0]
[0-0]"
"Then we can write four equations:
A11⊕A12⊕A21=1
A11⊕A12⊕A22=0
A11⊕A21⊕A22=0
A12⊕A21⊕A22=0"
"Solving them gives A21=A11=A12=1, A22=0. So we just need to press A21, A11, and A12 in order. The order doesn't matter."
"...All N×N matrix problems can be solved this way, and there's always a solution. But an N×M problem doesn't necessarily have one. The reason is..."
Li Zhendong wanted to cry. He watched his little sister's gaze fill with admiration, until little stars practically appeared in her eyes!
He knew perfectly well that she probably didn't understand a thing...
But still, girls her age were innocent and naive, with nothing on their minds but studying. They couldn't resist a top student!
It was over. Someone else had stolen his little sister's admiration for her big brother!
His sister asked, "Why does the plus sign have a circle around it?"
"Because this is an operation over a binary field: 1⊕1=0, 1⊕0=1, and 0⊕0=0. In computer science, it's called an exclusive OR operation... If we used ordinary addition, we'd get negative numbers."
"Big Brother Zhang, you know so much!"
"So you have to work a little harder. Otherwise, like your brother, you'll have talent without ever making use of it. Being smart won't help you..."
You little beast, still taking shots at me!
Go die!
"Big Brother Zhang, can you help me with my math competition problems? There are lots I can't do. My brother won't help me."
"Sure... I guess."
My little sister isn't even an adult yet!
Keep your claws off her!
"Ahem!" Li Zhendong coughed loudly as a warning. "I'm going to take a shower. Don't get any funny ideas. My parents are still home."
Huh?
Zhang Yuan scratched his head.
The little girl pursed her lips and rolled her eyes. She was already in middle school and understood plenty of things. Even if she dated someone, her family wouldn't object.
She thought her own brother had to be a little off in the head. Zhang Yuan was much more normal...
Before you continue