There is a close relationship between the “ha-ha” of humor and the “aha!” of discovery.