For Apu and Sanjay's brief lines of Indian dialogue, the writers called the Embassy of India in Washington to get them to translate. The Embassy was not "interested or happy" but still did it.
Apu testifies in a courtroom scene in the episode that he is able to recite 40,000 decimal places of the number pi. He correctly notes that the 40,000th digit is the number one. The episode's writers prepared for this scene by asking David H. Bailey of the National Aeronautics and Space Administration (now at Lawrence Berkeley National Laboratory) for the number of the 40,000th decimal place of pi. Bailey sent them back a printout of the first 40,000 digits.
Marge is accused of shoplifting and hires Lionel Hutz, played by Phil Hartman, as her attorney. In the middle of the trial, Lionel gets an urge for whisky, so he calls his AA sponsor, David Crosby of Crosby Stills Nash & Young. When Crosby answers the phone he is looking at the CSNY emblem on an album, which Phil Hartman designed himself in the late-'70s.
Marge's inmate number is 24601. This is also Sideshow Bob's number, itself a reference to Jean Valjean from Les Miserables.
In Lionel Hutz's dream of what the world would be like without lawyers, the writers had wanted to use the song "I'd Like to Teach the World to Sing" which was used in Coca-Cola advertisements, but they could not get the rights to it. Instead, they used a similar instrumental theme.