Viewers of The Big Bang Theory are familiar with Dr. Sheldon Cooper's famous triple knock. What is the origin and reason for this humorous (and slightly irritating - from the characters perspective) behavior?
In the episode "The Hot Tub Contamination", the origins of this knocking ritual are revealed. When Sheldon was 13 years old, he once came home because they ran out of math to teach him. His mother was at a Bible study. He walked in the house expecting it to be empty and heard a sound from his parents' bedroom. When he opened the door, he saw his father having relations with another woman. It’s why he never opens a door without knocking three times. The first one is traditional, but two and three are for people to get their pants on.
Because Wikia is, well, Wikia, here's a link to a more reliable transcript of the episode: link
While Plexus's answer is absolutely correct, it should be noted that there is a bit of an inconsistency in the show. Sheldon claims that he started using the triple knock after this traumatizing event, but it can be seen in the first few episodes of season 1 that he only uses a normal "one-time knock" on Penny's apartment door. The triple knock first appears in the show a few episodes into season 1.