The Friendship Algorithm

"The Friendship Algorithm" is the thirteenth episode of the second season of the  sitcom The Big Bang Theory. This episode first aired on January 19, 2009.

Summary
Sheldon wants access to a university computer which Kripke controls, so Sheldon decides to become friends with his adversary. He even invents an for making friends.

Extended Plot
Socially awkward, Sheldon develops a scientific procedure (the titular "Friendship Algorithm") for making friends. He needs to use an  that is in Kripke's office, but Leonard tells Sheldon that only Kripke's friends can use it. After repeated rebuffs from Kripke, Sheldon goes to a bookstore to research making friends. He finds a children's book on the subject and tries to make friends with a little girl whom he finds that he has things in common with. After inviting her to the zoo, he is hurried out by Leonard who notes that he is in direct view of a and might be picked up for. Sheldon then designs a for making friends. Sheldon follows his algorithm and gets stuck in a loop asking Kripke hobby after hobby. Howard helps him out adding a loop and counter making him choose the least objectionable hobby. He goes rock climbing with Kripke, but faints halfway up when he sees how far he has come. Sheldon invites him over to his apartment, much to the disgust of everyone else. Raj is informed he is being replaced by Kripke as five friends would be too many to handle. Kripke then tells Sheldon that there is a sign-up sheet for the computer and he has no control over it. Sheldon then dismisses Kripke as his friend and goes back to his other four friends: Leonard, Howard, Raj, and Penny.

Quotes
Penny: What about Howard and Raj, how did Sheldon become friends with them?

Leonard: I don't know...how do carbon atoms form a benzene ring? Proximity and valence electrons.

Penny: Well yeah sure, when you put it that way.

Critics
"Those writers love Sheldon. He is the reason this show is on the map in many ways. At present he is also the reason it will never become more than it." - The TV Critic's Review

Trivia

 * It should be noted that when Leonard drags Sheldon out of the bookstore, he still has a copy of "Stu The Cockatoo Is New To The Zoo" in his hand. It is unknown whether he went back and paid for it or not.
 * Sheldon innocently tries to make a friend; however, Leonard takes him out of the store before someone thinks he's stalking little children.

Video
Video:The Friendship Algorithm