Program

Visão de Conjunto O Viajante do Riacho dos Sonhos 2850 words 2026-08-04 04:54:09

During computer class, the teacher was guiding us through exercises in Excel and Python. The storage cubbies in the computer lab were filled with books the teacher had brought himself, mostly concerning mathematics and programming; he said we could read them once we had mastered the proficiency exam material.

This book, *Math Girls*, seemed quite interesting... wait, what is this, a math study guide disguised as a light novel? Then again, aren't I living the same life as the protagonist, studying alongside a beautiful genius girl? Seen in that light, the content of the novel suddenly didn't seem so far-fetched.

I finished the sets of practice problems from the question bank. Glancing over the shoulder of the student at desk 12, I noticed Ling Quan was still at her computer, but she wasn't doing the exercises. On her screen were operation boxes and command lines I didn't quite understand. From time to time, she would tap the keyboard, then pause to contemplate. This had been the case for several consecutive computer classes.

It was another Wednesday club period. I took out my homework.

"Hey, wait, I have something interesting here," Ling Quan whispered with a mysterious wink, then pulled me into the adjacent study room.

She plugged her USB drive into the classroom computer and clicked on a file.

"This is a small program that iterates a function and plots the results," she said, showcasing it with pride.

"Ah, I’ve seen this formula... in that book about complexity."

"This is the carrying capacity of the n-th generation. R is the result of the birth rate minus the death rate, which is the natural growth rate. The book ran some simulations, showing that even a simple unimodal nonlinear function like this can possess complex properties, such as sensitivity to initial conditions..."

"Yes, yes. Even though I’ve already seen others' research, it’s still fun to do it yourself! Now, go ahead and specify a value for R."

"...Two?"

"That converges to a value of 0.5. How about something larger?"

"Three."

She modified a number in the formula and pressed the shortcut key to run it. A string of numbers appeared at the bottom of the screen—the value of x after each iteration. After 50 cycles, x began to hover between approximately 0.63 and 0.69. On the right side of the screen was a graph of the oscillating line. She changed the starting x to 0.9, and it still wandered near those same two values.

A bit larger, and it became a four-period oscillation, then eight, and finally, around 3.569946, it entered the onset of chaos.

Ling Quan changed R to 4. "Now, specify an initial value for x."

"0.314?"

Ling Quan plotted the graph based on that, then changed x to 0.315.

After ten iterations, the two lines had absolutely no resemblance to each other. Sensitive dependence on initial conditions.

She opened another file. "Here, I’ve set all initial x values to 0.5, and R starts from 2.5 and goes up to 4 with a step of 0.005... For each R, I iterate 250 times, discard the first 100, and the remaining ones are effectively in an oscillating state. This way, I can plot the oscillating values for every R..."

The string of numbers at the bottom of the screen scrolled frantically—from a single value to oscillations between several, and finally to something nearly random. Three or five minutes later, the familiar bifurcation diagram appeared on the right.

I was deeply shaken. "So beautiful, so amazing..." These words echoed loudly in my mind. But in the end, I said, "It looks like a butterfly."

"It does look a bit like one, doesn't it?" Ling Quan stepped back, squinted her eyes, and nodded.

Back in the classroom, I started on the physics worksheet handed out that morning.

"Sensitive dependence on initial conditions..." I muttered to myself, distracted as I worked.

"What did you say?"

"Nothing, just feels a bit like life, I suppose."

"After all, it is a nonlinear system."

I stared blankly at the balls, blocks, and inclined planes on the worksheet. In such Newtonian systems, every process is repeatable and reversible. But our lives are not like that; they are filled with irreversible choices and nonlinear chaos. Every beginning leads to a different path and a different outcome.

A different life... is it? However, I have no regrets about anything I have encountered so far. Joy, pain, confusion—let me experience them all and add them to the new iterations to continue running, like a butterfly beating its wings in flight.

"Hey, let me ask you all a question," during the long break, Ye Zihan, as usual, began stretching his neck toward the students in front, behind, and to his sides, venting the desire to speak that had been suppressed for an entire class.

"Spit it out." It seemed we would be surrounded by this chatterbox for the rest of the break.

"You know about self-driving cars, right? Now, assume you are the designer of a self-driving car, writing the code for its AI."

Xu Ning, who sat in front of Ye Zihan, turned his chair around with some interest. Xu Ning usually didn't talk much (which was why he sat next to Ye Heng), and he looked a bit dull, but he had an unusual obsession with mathematics and artificial intelligence. "I know a little—radar and object recognition..." he whispered, rubbing the corner of his shirt, trying to join the discussion.

"No, no, no, not that kind of practical application problem. It’s more of a thought experiment—now, assume two vehicles suddenly appear in the high-speed lane. One is a motorcycle with one person, and the other is a bus full of people. The brakes fail, and you must hit one—which one do you choose?"

"What is this? The Trolley Problem?" I smiled bitterly, put down my pen, and scratched my head. "The motorcycle side, I guess."

Ling Quan also nodded.

"What is the reason? A convincing reason?"

"Wait..." Xu Ning asked, sounding as if he were defending the AI. "When humans drive and encounter this, they just hit whatever they hit; no one holds them accountable for why they made that choice... Why are we suddenly so harsh on an AI's choice?"

"Because in such an emergency, humans don't have time to think and rely only on instinct. But an AI can rationally analyze various actions and their consequences. In that case, you have to give a reason when making a choice."

"Because that way, the maximum number of people survive, and then..." Ling Quan explained.

"And to a certain extent, one could consider this choice to maximize the total happiness value, right?" I finished the second half of the sentence for her.

"I see, *wakarimasu*," Ye Zihan nodded with his habitual mischievous grin.

"Then, let's change the situation slightly: the car is speeding on a cliffside when suddenly, a bus full of people appears in front on the left, and on the right is a sheer drop. The brakes fail, and you must steer toward one side—do you steer to the left, knocking the bus off the cliff (while the car owner might survive due to safety measures), or do you steer to the right, sacrificing the owner to save the others?"

"To the right," Ling Quan answered without hesitation.

"Then—assume you bought a self-driving car and you are the owner?" Ye Zihan’s smile gradually became... brazen.

"Would you still let the car make the choice that 'maximizes the number of survivors'? In other words, do you want a car that saves the most lives, or a car that protects the owner at all costs? Most people would choose the latter—so is your reasoning still valid?" Just like someone watching everyone fall into a trap, he happily crossed his legs.

"I would choose the car that kills the owner to save more people," Ling Quan still answered without hesitation.

"Eh—really? Interesting. Why?" Ye Zihan put away his smile and leaned in, curious.

"Because... why should one think they are more important than others? Why add a greater weight to oneself in the equation?" she said in a flat tone, answering her own question.

"Is it... ah, it's instinct, I guess." Ye Zihan leaned back in his chair and stretched.

"Exactly. It is instinct. But when self-driving cars really become a reality, I will still stick to my choice." Ling Quan shook her head and continued writing her autonomous logic.

I pondered for a moment and felt that I probably still belonged to the "most people" category. But at least I understood one more thing: Ling Quan still held to her calculated morality and would accept all the results derived from it.