The unexpected hanging paradox from an AI viewpoint