"The Friendship Algorithm" is the thirteenth episode of the second season of the American sitcom The Big Bang Theory. This episode first aired on Monday, January 19, 2009.
At the Caltech cafeteria, Sheldon is going on and on about how deadly tapioca pudding is. Howard interrupts him until Sheldon is about to explodes and they let him finish in a burst of unwanted factoids. Barry Kripke comes over to "congwatuwate Weonard" on anti-proton decay experiment, which had 20,000 data runs without any statistically significant results. Sheldon needs time on the open science grid computer, which Barry Kripke controls, and let his friends have plenty of time on it. Sheldon decides that he should become his friend.
Back at home, Leonard is working on Penny’s computer so that Howard's emails go right into the spam folder. Sheldon is calling Kripke to again try and be friends after many unanswered phone calls. Leonard is his friend because there was a flyer on the bulletin board at the university: "roommate wanted: whistlers need not apply." Leonard demonstrates with a short whistler, which is immediately met with a quick first warning from Sheldon.
Sheldon is undaunted by his quest for figuring out how to make friends so he passes out a questionaire to his friends, 211 questions and an essay. No one takes it seriously. Leonard answered the multiple-choice in a repeating pattern. Howard filled out his essay with a picture of a raccoon with an enlarged scrotum.
Next Sheldon decides to head to a bookstore to find literature on the subject. In the children's section he finds "Stu the Cockatoo is New at the Zoo." He tries to make friends with a little girl who also likes monkeys. He invites her to go with him sometime to see the monkeys, however, Leonard pulls him out before he gets arrested as a pedophile.
Leonard, Raj, and Howard show up with dinner and Sheldon presents his "Friendship Algorithm" based on the Stu the Cockatoo book. Leonard dismisses it, however Howard thinks they should consider in since they might make a fortune selling it at Comic-Con. “Share a meal ----> get a hot beverage----> share time with an interest of Kripke's ----> share a different interest of Kripke's ----> share a different interest of Kripke's ----> share a different interest of Kripke's ----> share a different interest of Kripke's (uh-oh)” Sheldon calls Kripke, but gets stuck in his loop. By Howard adding a loop counter and a direct line to the "Least Objectionable Activity," Sheldon accepts rock climbing. Not bad for a man with only a masters in mechanical engineering.
Sheldon learns about rock climbing over the Internet and has no fear of climbing. He does have fear of falling. He freezes and can’t go up or down so he faints still hanging from his safety line like a giant salami.
Back at the apartment returning from their rock-climbing adventure, they offer Kripke some Chinese food. He needs some dental floss first. Since he can’t deal with any more friends, Sheldon cuts Raj loose even though Penny is not a scientist. Kripke notices that Penny is hot, but changes her name to Roxane. Howard whispers that he is starting to look good no, isn’t he? Sheldon pushes past to discuss getting time in the Open Science Grid Computer, however since as the official schedule is out of his control, Kripke can’t help him even if they are friends. Sheldon who is annoyed at this, allows Raj to be back in his friendship circle since he likes monkeys.
Leonard, Howard, and Raj comment about Sheldon's rock-climbing efforts before the camera reveals that he passed out again.
- Title Reference: The algorithm created by Sheldon that he uses to make friends with Kripke.
- When Leonard drags Sheldon out of the bookstore, he still has a copy of "Stu the Cockatoo is New at 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 is stalking little children. Sheldon was also stopped on checking the Internet for "How do I get 12 years old girls excited" in "The Contractual Obligation Implementation". In "The Hook-up Reverberation" the guys have the idea to chip-in some money to help Stuart to re-open the Comic Book Store, later Raj has the idea to get a van and drive around the neighborhood picking up children.
- The "big-balled raccoon" Howard drew on his Sheldon trivia sheet is a Bake-Danuki.
- The aspect that Sheldon likes monkeys (and also trains) is strongly regarded in this episode as does his future girlfriend Amy though he doesn't complain that everything with her is "monkeys, monkeys, monkeys."
- When Kripke hits on Penny, Howard says to her "Suddenly I'm looking pretty good, huh?", referencing the previous episode, where Penny comments on Howard's interest in her.
- This is the first time that Leonard mentioned that Sheldon does not like whistling (and demonstrates it to show Sheldon's dislike).