The Friendship Algorithm

The Friendship Algorithm is the thirteenth episode of Season 2 and the thirtieth overall.

Summary
Socially awkward, Sheldon develops a scientific procedure (the titular "Friendship Algorithm") for making friends. He needs to use an open science grid computer that is in Barry Kripke's office, but Leonard tells Sheldon that only Barry's friends can use it. After repeated rebuffs from Kripke, Sheldon finds a children's book in the bookstore (where he is hurried out by Leonard who finds him innocently chatting to a little girl in view of a security camera) about how to make friends. He designs a flowchart for accomplishing this task. 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. Barry then tells Sheldon there is a sign-up sheet for the computer and Barry has no control over it. Sheldon then dismisses Barry as his friend and goes back to his other four friends: Leonard, Howard, Raj, and Penny.

Title reference: The algorithm created by Sheldon that he uses to make friends.

Video
Video:The Friendship Algorithm

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