In mathematics, a triple is an n-tuple with n being 3. A triple is a sequence of three elements. It is not a set of three elements, as the ordering of the elements matters, and an element can be present more than once in the same triple. Derived from this abstract meaning it is used in several other contexts.
A triple is a joke consisting of three statements (also known as comedy threes). The first two statements are similar, usually "straight lines", and establish a pattern which the third statement does not follow. For example:
John was a quiet gentleman who liked to work in the garden, read literary works, and devour kittens.
Obviously, the third violent activity does not follow the first two benign ones. This may be found humorous. Other examples include lists, of names for example, where the third is in contrast with the previous two.
"It's one thing to see death coming at the hands of your own creation. Oedipus and his father. Baron Frankenstein and his monster. William Henry Gates and Windows '09." -- David Brin, Kiln People
"Can I get you something to drink? Refill your eggnog? Drive you out to the middle of nowhere and leave you for dead?"
The NBC show 30 Rock employs this technique on occasion. An example is when Tracey Jordan says:
"I’m sorry, Liz Lemon. This is who I am. You can’t ask a bird not to fly. You can’t ask a fish not to swim. You can’t ask a tiger not to turn back into a Chinese dude at midnight."
There are endless variations. Good ones can have a joke within a joke, such as this exchange from All in the Family where the subject of cities with the same names has come up:
In RDF a triple is a subject-predicate-object expression.
Triples in sport
A hat-trick is associated with succeeding at anything three times in one match or game or in consecutive attempts. For example in soccer or in ice hockey scoring three goals in one game.