S01E12 Krusty Gets Busted
While shopping at the Kwik-E Mart, Homer is caught in the middle of an armed robbery. The suspect is dressed like Krusty the Clown, Bart's television idol. Homer confirms the identity and is arrested, tried and convicted (under the pretense that he was trying to recoup gambling losses). Bart is convinced that he is innocent, with Lisa's help, eventually deduces that someone was trying to frame him. Tying information together from news reports, their own knowledge and logical reasoning, Bart and Lisa expose Krusty's sidekick, Sideshow Bob as the culprit. Bob, it seems, had grown weary of being the butt of Krusty's physical gags and being part of an inane show, and with Krusty out of the way he could reshape the show into his more scholastic vision. Bob is arrested and swears revenge, while Krusty is freed.