Mathematical models of recognition and confusion in psychology