Defeating the Dragon with the Utmost Dispatch:
Solutions to Some Variants of Lueker’s Dilemma
Norman Jacobson
a
7/20/2019
Lueker’s Dilemma
b
in a Nutshell
A rogue is to fight a dragon that has a known number of health points. The rules of combat
require the rogue and dragon to take turns attacking each other until one of them is
defeated. The rogue has two weapons. Each has a given chance (which may be the same or
different for each weapon) to hit the dragon. If a weapon hits, it delivers a fixed amount of
damage (which again may be the same or different for each weapon), reducing the dragon's
health points by that amount. The dilemma: Which weapon should the rogue use to defeat
the dragon — to bring its health points to 0 or lower — as quickly as possible?
Lueker formulated this Dilemma some years ago, when considering how to best play Rogue,
an early “dungeon-crawl” computer game [2].
c
Summary of Results
We present a linear-time algorithm that determines an optimal solution to the Dilemma
where the rogue is allowed to switch weapons just before a turn; it applies both when the
rogue can switch and attack in the same turn and when the rogue must wait a turn or more
before attacking again. We also present constant-time solutions for various special cases of
the weapons’ properties and a constant-time solution for when switching weapons is not
allowed. We show that finding a new optimal solution each time the dragon’s remaining
health points change is not necessary to achieve the quickest defeat of the dragon; an
optimal solution derived before the contest begins can be relied upon to remain optimal
throughout the contest. We also give a constant-time algorithm for finding a close-to-
optimal solution when the dragon’s number of health points is unknown.
Lueker’s Dilemma More Fully
A rogue is to fight a dragon in single combat. The dragon has h health points; it is defeated
when h drops to 0 or below, an event signaled by the dragon exhibiting an obvious sign that
it cannot continue the contest (e.g., it is too weak to take its turn, or is unconscious or dead).
a
Sr. Lecturer (ret.), Dept. of Computer Science, University of California, Irvine. jacobson@uci.edu.
©2018 Norman Jacobson. All Rights Reserved.
b
Lueker’s Dilemma is named after its originator, George S. Lueker, Professor Emeritus, Dept. of Computer
Science, University of California, Irvine.
c
I first learned of the Dilemma from a handout of challenge problems Lueker prepared for students in his
analysis of algorithms course.