Jack Nicholson's own experience in the hospital, just prior to filming, inspired some of the dialogue and acting for the movie. For example, the mirrored glasses seen in the movie were not originally in the script, but Nicholson, who obtained them while in the hospital, brought them to the set. Director Rob Reiner decided to include them in the film.
Morgan Freeman once said in an interview that Jack Nicholson was on his bucket list, and eventually got the chance of acting with him in this movie.
The clip of Jeopardy! (1984) that Carter is seen watching in the bathtub is not from a real episode of the show; it was filmed specifically for this movie.