The hidden formula behind the jokes on late night shows