Solving the Unsolvable Riddle of Shamath

A mathematical analysis and revision of an unsolvable riddle from the Lone Wolf series of gamebooks
Mark Baumann
July 14, 2025
Book 16 of the Lone Wolf series, The Legacy of Vashna, contained a riddle – the riddle of the Demoness Shamath – that was notorious for being unsolvable.
As a member of the Editor’s Guild for the new Definitive Editions, I was involved in fixing Shamath’s riddle. My goal was to make Shamath’s riddle as good as it can be, which in my mind meant making it: (1) solvable, (2) difficult enough that solving it is worthy of defeating a mighty Demoness, (3) not so difficult that readers can’t solve it, and, (4) to achieve this by making minimal changes to the original text. A tall order, perhaps!
In this article, I will describe the riddle and the reasons it was unsolvable. Then I will explain the fixes I proposed that were eventually adopted into the Definitive Edition of Lone Wolf 16 (LW16).
Spoiler Warning! This article will explain the riddle in detail, including its solution. If you haven’t already read The Legacy of Vashna, first go read it and then come back to this article!
The Unsolvable Riddle
Here is the original riddle (from LW16 section 189 of unabridged version or section 171 of abridged/US version) as posed by the evil demoness Shamath to the protagonist Lone Wolf:
“While I am here to do Naar’s bidding, how many loyal servants guard my throne of power?
In addition to the loyal servants, there are two Dwellers of the Abyss.
When the loyal servants and the Dwellers of the Abyss were counted together, their total number was doubled when my Lieutenants of Night arrived.
But when my Lieutenants of Night arrived, the Dwellers of the Abyss had to leave.
Exactly half of the remaining number also departed, for they were beholden to the Dwellers.
From the remainder I picked the loyal servants to guard my throne of power. I chose them all, except for one who was known to me as a traitor. I executed the traitor before I set my loyal servants to guard my throne.
So, mortal, answer my question: while I am here to do Naar’s bidding, how many loyal servants guard my throne of power?”
The problem with Shamath’s riddle is that it’s an underdetermined algebraic system, meaning there are more variables than there are equations.
Counting Variables and Equations
Let’s take a separate count of the number of equations and the number of variables.
As I see it, there are three distinct groups (a fact which was debated heavily in the Project Aon boards): there are Loyal Servants (call this
), Dwellers of the Abyss (call this
), and Lieutenants of the Night (call this
).
So we have three variables:
,
, and
.
And the Demoness Shamath is asking: what is the value of
?
How many equations do we have?
At first it seems we have three equations, but it turns out that we don’t really. Here’s how:
First, we have “there are two Dwellers of the Abyss”. So
. That’s the simplest equation.
We also have that when the Lieutenants of the Night arrive, they are equal in number to the Servants plus the Dwellers, hence doubling the total number present upon their arrival. In algebraic terms, this equation is:
![]()
And we have a third equation, which takes a bit more effort to glean from the text of the riddle.
After the Lieutenants arrive, the total number present is now
. However, then the Dwellers depart, giving us
remaining. Then half of those remaining also leave, giving us
remaining. And finally, Shamath tells us that this number is exactly equal to the number of Loyal Servants after she kills the one remaining traitor. In algebraic terms:
![]()
So the contents of the riddle are providing us with three equations:
![]()
![]()
![]()
So it appears we have three equations and three unknowns. However, the third equation actually contains the same content as the first two equations! Some algebraic manipulation of the third equation reveals:
![]()
Add 1 to both sides:
![]()
Multiply both sides by 2:
![]()
Subtract S from both sides:
![]()
Notice that the form of the equation in that last line clearly has exactly the same content as the first two equations together, which were:
![]()
![]()
Or, in other words,
.
So in fact, we do not have three linearly independent equations, and therefore we do not have enough information to solve for all three variables,
,
, and
. We only have two independent equations (
and
), plus three unknowns (
,
,
). Or, doing away with
and substituting it with
everywhere, we have one equation (
) and two unknowns (
and
), which is still an underdetermined system (we have one more variable than equation).
Note that I’ve just boiled it down to the fact that any solution that satisfies
will solve the riddle. The “expected” solution was
and
. But use
and
and it will still fit Shamath’s text, for example. Or
and
, or
and
, etc. So, in fact, there are an infinite number of solutions.
Initial Attempt to Fix the Riddle
The core issue with the original riddle is that we need to provide one more independent piece of information (giving us three equations and three unknowns) to make it a solvable system of equations.
When Project Aon published LW16 online, they fixed Shamath’s riddle. How? They gave us one new piece of information, just as we needed. Unfortunately, in my opinion, the new information they gave us didn’t make the riddle better. Check out the new sentence that was added at the start of the riddle:
‘My loyal servants are equal in number to the months in a Magnamund year, less the number of my Dwellers of the Abyss.’
So, assuming a Magnamund year has the same number of months as our Gregorian year (which moreover is an unfortunate thing to have to assume):
![]()
The reason I find this disappointing, besides having to make an assumption about there being 12 months, is that we can immediately solve for
since we already know that
. The rest of the riddle is now made pointless, and Shamath could’ve stopped after her first sentence!
I think this makes the riddle too easy and unworthy of the Demoness Shamath. It also renders the rest of the riddle’s text completely unnecessary, begging the question why the text exists at all. The full text of the riddle is really good and should be mandatory reading!
This Project Aon version also appeared in the Collector’s Edition of LW16.
Fixing the Riddle for the Definitive Edition
The fact remains that we need just one more piece of information that is independent from the other information provided in order to “close” the algebraic system.
You can check for linear independence of a system of equations using a matrix operation called the determinant. When fixing the riddle, I generated many matrices and tested each by taking the determinant, in my search for good candidates for new systems of equations. You can see some of these (literal) back-of-the-envelope calculations in the image at the top of this article.
A big challenge in fixing the riddle is making the new piece of information fit as seamlessly as possible with the riddle text as it’s already written. And, we wish to keep the solution to the riddle the same so that the Lone Wolf section containing the answer remains unchanged.
We already know the complete solution to the riddle, which is:
Dwellers of the Abyss = 2
Loyal Servants = 10
Lieutenants of the Night = 12
The goal: We need to provide one more piece of information which is consistent with the above solution and which is independent (doesn’t contain the same information that’s already been provided). And we also wish to make it challenging, but not too challenging. And do so without changing too much of the riddle’s text.
My proposal was to change the third equation so that it now provides information that is independent of the other two equations. In that vein, I proposed changing the third equation from
![]()
to
![]()
Notice these equations are the same except for the right-hand side, meaning Joe Dever’s text can remain mostly unchanged.
So now we have three independent equations that can be solved for the three unknowns:
![]()
![]()
![]()
Mathematical Detail:
To verify that these three equations are independent, you can put the coefficients into a matrix as follows:
| S | D | L |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 1 | -1 |
| ½ | -5 | ½ |
Taking the determinant of this matrix gives -1, which is nonzero, and therefore this matrix is nonsingular. This means the equations are linearly independent.
To make this mathematical change into riddle text is fairly straightforward. You can take this paragraph from the riddle:
“From the remainder I picked the loyal servants to guard my throne of power. I chose them all, except for one who was known to me as a traitor. I executed the traitor before I set my loyal servants to guard my throne.”
And replace it with this paragraph:
“Among the remainder, one was known to me as a traitor. I executed the traitor, and those that were left were equal in number to fivefold the number of Dwellers of the Abyss that I’d started with.”
I think this retains the spirit of the riddle. But it makes it solvable. And it is still difficult, but not excessively so (more on the difficulty in a second).
To help the reader some, I also proposed that we capitalize “loyal servants” to make it clear that that is a distinct group of followers, along the same lines as Dwellers of the Abyss and Lieutenants of the Night.
Solving the New Riddle
I think this new riddle is challenging but not excessively so. Here are the three equations again:
![]()
![]()
![]()
One could solve it like this:
First replace
everywhere with
. That gives:
![]()
![]()
The last equation can be rearranged (after some algebra) to give:
![]()
Then substitute the second equation
in for
above to get:
![]()
Which gives
.
Final Version of the Riddle
I also suggested adding one sentence to the end of the riddle, that says: ‘I sent them all away and ordered only my Loyal Servants to return.’ Here’s why…
Anyone that knew the old riddle can solve the new riddle in one step, since they can take the number of Dwellers of the Abyss (2) and multiply by 5 (since it says the number remaining are fivefold the number of Dwellers of the Abyss) to get the final answer. That’s because the way the original riddle is written, it leads you to the idea that however many ARE LEFT AT THE END will be the answer. The new version makes it so that you don’t necessarily know that the number you have at the end is the solution, but some may assume such and then get it right just by multiplying 2 by 5.
The extra sentence was added to make it so that the reader no longer worries about how many are left, and instead must figure out how many Loyal Servants there were all along.
Admittedly, anyone that’s grappled with the original riddle will be able to take the “5×2 shortcut”. This is a drawback to keeping the text as similar as possible to the original riddle, and moreover with the same solution. But I’m not too worried about that since, after all, anyone that’s read this book before already knows the answer is
, anyway. I’m concerned with new readers having a riddle that is solvable and challenging. What this new version gives you is a system of three unknowns (
,
,
) and three equations that can be solved.
With all that said, the final version of the riddle looks like this:
“While I am here to do Naar’s bidding, how many Loyal Servants guard my throne of power?
In addition to the Loyal Servants, there are two Dwellers of the Abyss.
When the Loyal Servants and the Dwellers of the Abyss were counted together, their total number was doubled when my Lieutenants of Night arrived.
But when my Lieutenants of Night arrived, the Dwellers of the Abyss had to leave.
Exactly half of the remaining number also departed, for they were beholden to the Dwellers.
Among the remainder, one was known to me as a traitor. I executed the traitor, and those that were left were equal in number to fivefold the number of Dwellers of the Abyss that I’d started with.
I sent them all away and ordered only my Loyal Servants to return.
So, mortal, answer my question: while I am here to do Naar’s bidding, how many Loyal Servants guard my throne of power?”
This version of the riddle is solvable, difficult but not too difficult, has the same solution as the original riddle, and retains the spirit of the original riddle by changing a minimal amount of the text.
You can purchase any of the Definitive Editions of the Lone Wolf series here!
