Season 2, episode 13\r\rSheldon displays his friendship algorithm as a flow chart, and tests it.\r\r(this belongs to CBS, not me, Im just enlightening you with Sheldons awesomeness)