Decrypt "Source Code"

Olen 2022-03-19 09:01:02

In general, the source code is a good movie with a compact plot and exquisite content that is worthy of scrutiny. However, after reading many film reviews with divergent opinions, I thought that if you want to explain the film technically, you still have to look at it from a programming perspective.

Based on the concept of computer simulation, the execution of the program always exists only on the computer and is separated from the real world. In this film, this computer is Colter's living brain. The result is only the simulation data left in his brain every time, and it has never been actually executed or existed in the real world. Professor Hu's original intention was to write a self-learning algorithm in order to find the person who bombed the bomber. This can be proved by the fact that the experience of the male lead is not repeated every time, and every time the study has been further improved. In detail, when Colter went back for the first time, he didn’t remember anything (just finished the initialization, Shangmu has assigned values.) When he went back for the second time, he remembered that the ticket was placed in his shirt pocket (it can be understood as an iterative algorithm, from the variable A new value is calculated from the original value of, in other words, the original value has an influence on the new value).

In addition to finding bomber, keeping as many people alive as possible is probably a decisive condition for this self-learning algorithm. In the second algorithm learning, Colter saved Christina, and for the Nth time, he saved two people who were motion sickness and Christina. Except for Colter himself, everyone in the car survived the penultimate time. According to Professor Hu's original intention, the self-learning algorithm should stop here, but the program itself is based on the intent to find the best results and can be improved further (this is what Professor Hu and Goodwin did not expect). what is this? Wrongly defined the loop condition as
while((bomber not found)||(the number of people alive is not the largest))
{
self-learning algorithm;
},
but should be defined as
while(bomber not found)
{
self-learning algorithm;
}?
Because of the wrong definition of the termination condition, Colter asked Goodwin to run the program for the last time. This time, including Colter himself, all survived.

Until Colter and Christina kiss were simulations. I think that the extra last 5 minutes ending is the extension of science fiction, and the result of simulation affects and overwrites the real world (the last time the program runs, I think it is the only time parallel space appears in the movie, not as many people say, yes. Each time the program runs, a parallel space is created. For details, see the next paragraph). This can be proved by the email that Goodwin got. The email said, at some point today, you're gonna hear about a failed terrorist attack on a commuter train near Chicago. You and I kept that bomb from going off. At some point today, you're gonna hear about a failed terrorist attack on a commuter train near Chicago. The news of the failed bomb attack on the outskirts of Chicago was that you and I removed the bomb together. At this time, the Source code hasn't started yet, and Goodwin is probably still at a loss after receiving the email. Maybe he doesn't know what's going on.

Regarding parallel space, Colter said in an email to Goodwin, If you're reading this email, then Source Code works even better than you and Dr. Rutledge imagined. He thought you were creating eight minutes of a past event. But you're not. You have created a whole new world. This whole new world is parallel space. As for Colter's statement that there is a Captain Colter that exists somewhere in the source code, he is always ready to save the world. It probably means that once a disaster occurs, then run the source code, Colter will dispatch to create a parallel space, and in turn overwrite the disaster. period of time. (In my blog, there is an explanatory picture, please click: http://blog.sina.com.cn/s/blog_6a6e6fde0100susn.html )

If the whole movie is regarded as a program, define Professor Hu and Goodwin as Global variables, and Colter is defined as a local variable (it is useless outside the scope of the variable), under the condition of while (bomber not found),
through the self-learning algorithm, find the bomber Derek to prevent the explosion. However, the program definition is wrong. This local variable modifies the entire program and also modifies the two global variables of Professor Hu and Goodwin. In the end, this local variable not only found the person who put the bomb, but also turned itself into a dangling pointer, handing in hand with another pointer (Christina), which is in the memory and outside the program. In this way, it is the same kind of sci-fi technique used by i and Robot.

An obvious bug: Since the explosion in the Source code occurred after the first explosion, but before the second bomb, how did Professor Hu believe that it was a serial explosion? So he used the excuse of saving 200 million innocent people as an excuse to tinker with Colter's death again.

A crooked thought: In the film, Colter saw the CAO-N logo on the Goodwin armband and wanted to find out her origins. This film was released in April 2011. If it’s a few months later, when Google releases the search images function, is it much inconvenient to take a photo and drag the image directly into the search bar? Haha.

In conclusion, the main point of this movie is that I hate scientific research and programming. I want my life back. Just like the code farmers every time they run the program near miss (almost succeeded) to persuade themselves that everything is gonna be alright, so do you always stay up all night and test again and again? Just like the code farmers hate the boss, regardless of the life and death of their puppets, is there always an unfinished job? Just like code farmers hate BT professors trying to find funding? Pay attention to Professor Hu's expression that fears that the world will not be messed up. (In other words, why didn't Professor Hu use quantum mechanics to connect Colter to the brain of the Ministry of Defense, let him have a brain cramp, and directly fund the project?) Then, Colter grabbed Derek and said when he called 911. , I'm sick, I'm a sympathetic human being, is this the screenwriter's self-deprecating with a programmer mentality?

By the way, in order to understand this film, I watched it three times in 2 days, thought about it all day, and spent another afternoon writing this so-called craking article. . . It's really sick enough, sympathetic enough...

Personal opinions, welcome all kinds of decoding discussions.

View more about Source Code reviews

Extended Reading

Source Code quotes

  • Colter Stevens: I'm asking you to have the decency to let me try.

  • [first lines]

    Christina Warren: I took your advice. It was good advice, thank you.