Xiaoming was lying naked in bed, wrapped in the hot summer air.
Suddenly, he woke up from his dream.
This is not the first time. At first, he thought it was natural that summer was coming and the weather was sultry and he couldn't sleep. But these were not problems before. When I was a child, when I couldn't sleep at night, adults at home would sing ghost stories, and then I didn't feel cold. However, even so, with adults at home, I am not afraid to fall asleep.
But now, I am alone in the dormitory. Roommates with girlfriends go to their girlfriends to get a room, some go to work, and some go to the movies. He is the only one. After the power failure, he took a bath in the dark, took a long drink of cold water and hurried to bed. I want to have a good sleep after taking a shower. Just didn't expect that in the silent midnight, he woke up again.
A stream of urine hit him and he got out of bed with a rope. 15 today, the moon looks surprisingly big, and the pale moonlight shines through the empty balcony.
He looked down for his slippers, and bang, something fell on the balcony.
It is a black cat.
The shadow of the cat came in from the balcony and stopped at his feet. I didn't hear the cat meowing or see it leave. It landed on all fours and looked at the corner of the balcony.
Xiaoming doesn't like cats, especially black cats. Sometimes, when I look at a cat, I always feel that it is not a beast, but more like a silent person. Just watching you quietly. He heard that cats like to stare into people's eyes. When a man dies, his eyes lose their luster, and the cat no longer treats him as a man, but as food.
But the cat didn't look over, which is good.
He turned and walked to the independent bathroom by the door. Suddenly, the cat gave a cry. Xiao Ming suddenly turned around and found the cat staring at himself! Glowing eyes are like glass balls, without any life.
Xiao Ming is a little scared. Cats don't eat people and don't bite people for no reason. But in the present environment, Xiao Ming always thinks that the cat in front of him will jump off the balcony, get closer with his eyes open, and then jump up and bite his neck. But what scares him more is whether this cat is just one of them. Another cat is behind him, showing its fangs when looking at the balcony.
"bang! There was a loud noise behind him.
"ah! ! ! 」
"ah! What's your name, classmate? The door behind him was pushed open. Looking back, two aunts stood at the door with flashlights. " You are so scary! Recently, an outsider entered the dormitory to steal things. Remember to lock the door when you sleep at night. 」
Should I say that? Xiao Ming was a little angry, but a little disappointed, and finally he was not so afraid. "Aunt, you scared me to death. Don't knock so hard. 」
"This is not afraid of you can't hear? 」
When he closed the door, Xiao Ming looked back at the balcony again. The cat is missing. It must have been scared away. I hurried to the toilet, locked the door, and trotted back to bed while I was still popular. It's really cowardly to be scared by a cat. He drew the bed curtain and lay heavily on the bed.
"meow"
The cat gave another cry, but did not leave. Xiao Ming is a little angry. This cat is too courageous. I'm afraid I haven't called yet He reached for the bed curtain, ready to give the cat a saliva explosion.
Suddenly, the balcony made a noise, and the cat made a miserable cry. Then, the sound disappeared and the cat left.
However, Xiao Ming got goose bumps. What's that noise on the balcony? Why is there a sound on the balcony?
Speaking of which, why did the cat stare at the corner of the balcony at first?
You should not be afraid of cats. No matter how terrible cats are, they are also small animals. Is there anything on the balcony compared with cats?
None of his roommates are here, so who is on the balcony?
Xiao Ming's hand stretched out on the bed curtain froze, and now even a little noise seems to thunder in his ear. He is worried that if he moves, the curtains of the bed will be opened and people with hair in front of their faces will stand in front of the bed with a kitchen knife.
He lay down slowly with minimal movements. He comforted himself that as long as he was not found, the man would walk away by himself.
After a long time, nothing happened. That man should go.
"ding"
With the sound of the Qing community, the screen of the mobile phone also lit up. It is spam!
The balcony also heard the sound of clothes rubbing. That man is coming! Does the sound of short messages attract him?
Xiao Ming feels that his breathing has stopped. The man's footsteps are getting closer and closer.
Ding! Shit, another one!
The man's footsteps stopped.
Now that man is standing beside Xiaoming's bed. What is he doing? Is it grinning? Or can't see anything, just stand here with a straight face?
Sweat came again, but this time, I didn't feel any heat.
"So, you were scared to pee? 」
"The situation at that time was really terrible! 」
It's ten o'clock in the morning and the sun has risen into the air. In the study room of the library, I took my mobile phone and described the horrible night with the girl sitting in front. "You see, this is the news. 」。
"That's not you scare yourself. The girl sitting opposite is wearing a ball head, her facial features are not prominent, and her face is a little fat, but she looks very attractive as a whole.
"I just told you for nothing. Xiaoying. 」
Last night's experience was a bit scary, but the thief was more scared to death than I was. First, a cat stared at him, and then the terrible bell rang out of nowhere. When he rushed to the door to run, he found that the door wouldn't open, growling and pushing around. I finally pushed the door open, and my aunt outside saw him shouting and screaming, and was subdued by other students who didn't sleep. It is conceivable how terrible it is for a man to be crushed by several naked men.
"You are more than twenty years old, are you afraid of sleeping alone? Do you want your sister to sleep with you tonight? 」
"Hey, you are terrible. Besides, is there any way you can help me delete these messages? " I pointed to her cell phone.
"well. . . There are many methods, depending on which one you want to use. 」
"The simplest kind. The sooner the better. 」
"Change a new card. 」
"It won't come again for a long time. 」
Xiaoying closed her eyes, held her cheek in one hand and knocked on the table in the other. Judging from her childhood experience, she can almost solve the problem by doing this action.
"Can't help you. 」
"Don't ah, you are not a magical Xiaoying, you will help me solve this problem. 」
"What's the use of asking me? I can't write programs. Why not ask the magic Bayes formula? 」
"Bayesian formula? What does Bayesian formula have to do with this? 」
Xiaoying turned to a pen and held her face in the other hand. "In your opinion, why is there a probability? 」。
Although it is not appropriate to say now, Xiaoying in this position does feel a bit like a summer girl. "Probability is not like tossing a coin. Is there a 50% chance to throw heads and tails? There are other versions. 」
"No, I'm not asking about probability. But why is there such a thing as probability? For example, why do you think there is a 50% chance that the coin thrown is positive? 」
"Because after throwing a coin, although it will be unclear at first, the more you throw it, the more times the pros and cons appear, and the closer it is to half of the total, so you will feel that there is a 50% probability. 」
Suddenly, I saw a shallow bad smile on Xiaoying's face. "That's right." Xiaoying stopped the pen in his hand, as if he had caught the flaw, and his eyes were full of confidence. "You said the word" feeling ". 」
"What's going on? 」
She is sitting up. "The probability of rain tomorrow is 30%. . . . What's the difference between these probabilities and what you just said? 」
"It's no different. The numbers are different? 」
"Wrong! 」
After she finished speaking, she quickly crossed an X in my notes.
"It's a bit hard to understand, give some tips? 」
"Hum, is the number. 」
"How many times? 」
"Whether it rains tomorrow or the winning rate of the game, the biggest difference between it and flipping a coin is that it does not repeat. She seems a little excited. It is strange to say that it will rain 30% tomorrow. If you say that the probability of positive and negative coins is 50%, which can be understood as that after throwing 10000 times, 4999 times is heads, then the probability of 50% is obtained by comparing 4999 times with 10000 times. However, there is only one time tomorrow anyway, and no one has ever done repeated experiments between different universes to get the data of "30% rainfall"! 」
The first time I heard about it, my head flashed like lightning. The concept of "probability is obtained through repeated measurements" has naturally been implanted in the brain for more than ten years. And Xiaoying's words made the big tree start to shake a little.
Before she came to her senses, Xiaoying went on to say, "You said yourself that the probability will gradually become 50% only if a large number of coins are tossed. That is to say, when you only vote five or six times at the beginning, the probability of heads and tails is not 50/50, but why is it more correct? According to this, if I vote 65438+ million times again, will the probability become 60%? 」
"This. . . As long as there is information about the uniform material of coins, it will only get closer and closer to 50% under a large number of measurements, and it will not become 60% at all! Although what Xiaoying said is reasonable, the dignity of a man will not stop me.
"ha! This is what I want! Xiaoying's eyes seemed to see the fish biting the hook.
A little behind her head. "What did I say? 」
You mentioned the word "information". 」
"What do you mean? 」
Xiaoying crossed her hands and leaned back with her legs crossed. "It seems that you really don't understand. 」
"I admit that I am stupid. 」
"If I find that the other side of the coin is full of lead, will the probability be 50%? 」
"Of course not! 」
"Why not? Is it still a coin, or is it tossed 10000 times? 」
"Because matter is homogeneous, this information has always existed. . . The information has changed. Xiao Ming suddenly remembered something.
"Yes," Xiaoying snapped her fingers. "Because the information has changed! Not because it is a coin, so it has a 50% probability, but because we have guessed its probability by observing its information! In other words, people create probability! 」
People create probability? This statement is unheard of. Besides changing the electron spin, how can people have the ability to change the probability?
"Well, this is a bit exaggerated. But you see, it is obviously the pros and cons of the 50% probability. After we got the new information that "the other side was injected with lead", the probability changed immediately, and it was no longer 50-50. That is to say-the probability of new information changing. On the other hand, if no new information is found, we always give coins a wrong probability, don't we? Does this mean that we can only determine the positive and negative probability of coins if we get all the information? " Xiaoying paused and said slowly, "But how can humans get all the information? 」
"Wouldn't it be. . . 」
"Yes, before people get all the information, they have given the probability that coins don't belong to them. We impose probability on things. 30% rainfall rate or 60% winning rate is a guess. However, it is not a shot in the dark, but the probability that we think of an event. However, this is not their true probability, because once new information appears, we begin to correct our previous guess. The probability has changed. From this perspective, probability is only imagined by human beings. 」
"But. . . 」
"For example, what is the probability that the next Thai Prime Minister will be Mars? Mars has never run for prime minister before, so it is impossible to arrange repeated experiments in multiple universes. What are his chances of becoming president? 」
"This is not the same point as what we want to discuss. Although it is impossible to get the probability through experiments, there is no need to investigate a large number of people and analyze the political trend of Thailand in the last two years. . . Wait, these things are just ... . . 」
"Yes," Xiaoying snapped her fingers. "These are news! 」
"For example." Xiaoying said, and drew a form in her notebook. "You look at this form. 」
"love rat. . . Xiaoying, what the hell is this? " How much has she experienced?
"Don't pay attention to these." She waved, "here, we can see that the total is 10, there are four honest people, and there are six in love rat. It can be written that the probability p (honest man) =0.4 and p (love rat) =0.6. After that, there are four WeChat accounts in love rat, which is 4/6. In contrast, only 1 honest people have two WeChat accounts, which is 1/4. " Say that finish, she drew a square in the notebook. "This picture is the same as what I just said. 」
"Uh-huh. 」
"Now, there are two micro-signal men walking into the library. Hey, let me ask you, your other number. . . Ah, no, what are the chances that he is love rat? 」
「4/5? No, because there is slag. . . There is only one WeChat in love rat. By the way, did you want to ask something just now? 」
"That's a good idea. Indeed, you can't judge a person by his appearance. 」
You judge a book by its cover, right?
Xiaoying went on to say, "Because he has two WeChat, we only have one WeChat. The picture becomes like this. 」
"It's not over yet, because these two graphs are out of proportion, and their sum is not 1. If it is not 1, there are other possibilities. But we can start normalization. 」
Xiaoying: "Look, simply calculate, 80% of the people who come to these two WeChat accounts are scum men. 」
I said, "What's your opinion on WeChat? 」
Xiaoying: Otherwise, what do you need a micro signal for? 」
I said, "I have my own job. No, how did you know I had two micro signals? 」
Xiaoying: Wow, I was right, love rat. 」
"Don't look at me like a bug." You say that as if I didn't do anything wrong to you? "Ahem, then, but what is this? What does it have to do with Bayesian? 」
"It's not over yet. Wait a minute. " She took the notebook back.
What is endless? Is it my other WeChat or Bayesian algorithm?
"Look here. 」
"Remember the information I told you earlier? 」
"Remember, you said that because of information, the probability has changed. 」
"That's right." She circled 0.6 on the left side of the equation. "Remember I said before, what is the probability of such a person as you? 」
「0.6。 . . 」
Xiaoying: Yes, that's right. This is the probability of judging whether a man is love rat before knowing that you have two micro-signals. Let's call it a priori probability. 」
"Wait a minute, the topic is wrong. I am not scum. 」
"So" she ignored me, simply went on and circled the answers calculated on the right. "This is what we just calculated. Knowing that you have two micro signals is the probability of love rat. 」
"So. . . 」
"Did you find it? 」
"What did you find? 」
She tapped the answer with a pen. "The probability that you are love rat has changed." .
The probability has changed. With the new information, the probability has changed. From the earliest 0.6 to 0.8. Is this the so-called information change probability?
"Change the numbers just now into mathematical writing, and then switch the questions on both sides of the equation. 」
"When I know that you have two micro signals, I can use this formula to calculate the probability that you are love rat. This thing on the left is called posterior probability. 」
Ah, a little too much, Xiaoying.
"Ah, you talk about me for a long time. How do I know if you are love rat? 」
"Listen, is this what people say? Don't interrupt me yet. " She patted me hard on the head. "Now it can only be counted as love rat. If you want to count love rat, change it to this. " Say that finish, she scratched on the book.
"Because love rat and love rat may do different things, I replaced the two micro-signals with the word feature." After a pause, she went on to say, "Besides, this love rat can also be replaced by an ordinary word, such as the word category. 」
After writing these, she smiled. "This is the famous Bayesian formula."
You can look at Xiaoying's formula. 」
"If you speak professionally, you can also write. 」
Ah, I explained it in words, and suddenly I found the formula easy to understand. As Xiaoying said, new changes will take place after the old probability gets new information. However, there are also some problems.
"But isn't this too decisive? Isn't it unfair to kill all good men, such as me, with two WeChat messages?
"Yes, the probability of 0.8 is obviously not enough. Because another 0.2 will be wronged. Then add another one. 」
She moved the chair next to me, less than a punch from me, and wrote in the notebook. When you get closer, you always feel a soft fragrance.
She looked up at me. "This is new information. You should consider how to use it. 」
Information recorded in the book. . . I always feel something is wrong. No, no, no, this is just an illusion, not a fight against me.
Now take a closer look. From this table, we can see that the ratio of scum men to honest people is the same, 0.6 and 0.4 respectively. At the same time, the proportion of many female friends in love rat is 4/6, while the proportion of honest people is 1/4, the same as just now. If you follow the calculation method just now, won't the result be the same? The probability of love rat is still 0.8?
"how about it? 」
She leaned over to me curiously, and her white forehead was in front of my eyes. As long as she goes any further, her lips will touch her nose.
I quickly put my notebook back on the table and pulled away a little. "If we only rely on this information, the result is still the same as just calculated. . . 」
White forehead shrank back, then shook his head. "No, it's not enough." , in her notebook, where she recorded the love rat WeChat form, she clicked, "You have to use them. Why don't you try to draw a picture too?
Ah, by the way, the things calculated before have not been used yet. On the basis of the picture just now, add the new information just obtained.
The new data does not indicate whether men with more female friends have two micro-signals, so in the above picture, both parts are added.
Seeing that I drew a picture, I nodded and asked, "Now I know that this man has two micro signals, and at the same time, he has many female friends. So, what are the chances that he is love rat? 」
"Ah, then remove the part with only one WeChat, and at the same time remove the part with fewer female friends, and then normalize it. 」
Ah, this probability has risen! Although the area on the map is getting smaller and smaller, the probability is actually increasing bit by bit.
"Too good, finished. Did you find it? If there is only one piece of information, it may not be inaccurate, but if there are two characteristics at the same time, there will be less legitimacy. 」
Don't look at me when you say these words.
"If now," she continued, she didn't give me a chance to defend myself. "If I say that I forgot the previous calculation, I can only say that the probability that this person is love rat is 0.8, and at the same time, I will give you Bayesian formula and this table with many female friends, and then you can calculate the probability. 」
"Forget the previous calculation, that is to say, I didn't know he had two micro-signals, but my girlfriend told you that the possibility that this person is love rat is 0.8. Is that what you mean? 」
Xiaoying nodded. "You are very experienced. 」
「。 .。 」
All right, I'll try again. In other words, can we use Bayesian formula directly?
Huh? The calculated results are exactly the same as those just obtained.
"This is no coincidence. It is no coincidence that the posterior probability obtained from the WeChat part becomes the prior probability of the female friend part, and the result obtained is exactly the same as that calculated by us. You can try other examples, but the final result is still the same. 」
I'm a little confused. In this way, when drawing, I first cut with the first piece of information, then cut with the second piece of information, and then normalized it to get the posterior probability.
But in the later calculation, I didn't know the existence of the first piece of information, only knew that the probability was obtained from the first piece of information and regarded it as the prior probability of the second piece of information. In this way, you don't need to know the existence of the first piece of information at all, as long as you know its probability, you can continue to calculate. In this way, after repeated calculations, even if you forget what you have done, as long as you remember the prior probability, there is still a way to recalculate.
"This kind of calculation, a bit like humans. 」
Yes, isn't that what humans think? When you do a problem, you will feel wrong when you see an option. Even if you can't tell the reason, you will feel that the probability of being wrong is very high. Also, when you see someone doing something that annoys you, you will revise your evaluation of him in your mind. Although you forget what he did in the future, your disgust still exists.
"yes. Bayesian formula has such a special ability. It has the ability to learn. From another perspective, isn't the word "experience talk" the best interpretation? Doctors who have been practicing medicine for many years can know the success rate before operation. Soldiers who have been fighting for many years can perceive the existence of the enemy in an instant. This is not a mysterious story. 」
"Ah, I see what you mean. 」
After listening to the Bayesian formula that Xiaoying told me, I finally understood the thing of probability from another angle. Uncertainty, dependence on subjective consciousness, information change probability.
Knowing this, you can complete your spam classifier. In the absence of data, collect a large number of spam messages and normal messages, and make word frequency statistics, such as the probability of a word appearing in spam messages and the probability of a word appearing in normal messages. After that, it was set on Bayesian formula. "She closed the book and put it in the bag. "As for how to divide words, you can look at the hidden Markov model, which may surprise you. 」
After discussing the boring problem, Xiaoying and I packed our schoolbags and walked out of the library. It's already dark outside.
"Oh, no, it's raining." Looking up at the falling rain, Xiaoying sighed.
"You don't have an umbrella, do you? I thought girls were creatures who couldn't live without umbrellas. Or you're not. . . Ah. " Before the words were finished, I got a blow under my ribs.
"It's not raining, run back quickly." She is going to rush into the rain line.
I quickly grabbed her, "run back? The dormitory is so far away from the library, even if you run back, will the books get wet? Wait until the rain stops. 」
"The library is going to close, so what shall we do now? 」
"What else can I do? Let's go and see the rain. 」
So we stood on the steps of the library without saying a word, watching others leave with umbrellas. Standing here and looking down, the umbrella groups under the stairs, like fireworks, rose to the sky, dispersed and disappeared.
「。 .。 」
「。 .。 Xiaoying. . . It was raining like this when we met, right? 」
「。 .。 Hmm. . . At the end of primary school. 」
"None of us brought an umbrella that time, and all the other students left, leaving only the two of us. 」
"I remember when you cried, hahahaha."
"On rainy days, I can't go home alone, so children will cry, right? But you, like a big sister since childhood, are not afraid of anything. However, the face has always been as lovely as a child. Xiao Ming thought about it and didn't say anything.
"Ah, it seems that from then on, I earned a younger brother for nothing. 」
"From then on, just like doomed love, no matter where I go, I will always meet you. Every time you turn your head, you will see her face, as if it were all taken for granted. Just like now.
「。 .。 Why do you say that? 」
"But you are better than me in everything, whether it's high school grades or taking part in various math competitions after going to college, which I can't do. Last time I saw you taking part in a mathematical modeling contest in the library, I didn't even care about eating. I think it's a little difficult for you to catch up. One day, you will do something I can't imagine where I can't reach. 」
「。 .。 」
"But, I like your expression when you win the prize. Look at the way you pursue mathematics, see your eyes shine, see you strike the table excitedly and listen to your stories about mathematics. . . I believe your love for mathematics, and your ideas about mathematics will spread to every corner of the world. 」
「。 .。 」
Xiaoying didn't speak and didn't know how to go on. In her opinion, I am so wordy.
"So you can safely go forward. Chichiwa, I will always support you and cheer for you. . . 」
"You, you, how do you talk so much? Also, how can Qian Qian be so kind? What is your relationship with my Qian Qian? " My fist hit me in the chest.
Gee, the feelings I finally brewed.
When she stopped, we stood at the door again and watched couples pass by.
More memories of the above part. The following part is a bit conflicting)
"Xiao Ming, there is something I want to ask you. . . 」
"Oh, Xiao Ming, you stole a woman behind my back again." A mature woman's voice came from behind, interrupting Xiaoying.
"learning. . . study . . Senior! 」
The man standing behind us has a posture that most girls envy, which is convex, and his long hair exudes the black magic of eating people.
"Who is this, Xiao Ming?" Holding my waist, Xiaoying, who is relatively weak, asked.
"This is my senior drama club. Senior, this is Xiaoying. " Xiaoying glared at me. Did I say something wrong?
"Ah, I just stood here and listened to your conversation for a long time. What a lovely childhood friend. Hehehe. " Senior seductively smile, "when also come to our drama club to play. There are many handsome boys here. 」
"No, I don't need it." Grumpily reply, "I have to go first. Before I left, I was kicked in the calf.
"Ah, here is an umbrella, which can only hold one person. You can borrow it first if you are in a hurry. Xiaoming and I will wait in the back for a while. The senior drew an umbrella from his handbag and wanted to pass it to Xiaoying.
Xiaoying walked into the rain without looking back, leaving the senior's umbrella hanging in the air.
"Senior, what are you doing? You make it sound as if we were lovers. 」
"Ha, ha, ha, more and more like this little girl. Ha ha ha ha "
Single teachers and even elementary school girls will not let go, will they?
"Xiao Ming, the question you asked me last time has been solved. I'll tell you next time you come to the club. 」
"Oh oh, thank you very much, senior. 」
"Once again, well, enjoy the wonderful world of computers all night. 」
"I refuse. 」
Back to the dormitory, after taking a shower, I called Xiaoying and explained the senior's problems to her. Although it sounds like love rat's defense, please believe me anyway.
However, my relationship with Xiaoying seems to need no explanation.
Hanging up the phone, recalling what Xiaoying told me in the library about probability and the derivation and application of Bayesian formula, I can't help but sigh the efforts made by my predecessors. Bayesian probability, ordinary and wonderful. Turning complex laws into mathematical formulas that everyone can use may be one of the charms of mathematics.
I sat back at my desk and looked at the blank draft paper.
"Better, to calculate the probability of senior have a boyfriend. 」