In this week’s blog post, Mark exercises some math muscles and illustrates why the infamous Shamath riddle from Lone Wolf book 16 is truly unsolvable, and in the process addresses some of the “solution theories” that once circulated on the Internet.  Here’s a hint for those that have studied some linear algebra: it has to do with linear independence. And if you don’t know what linear independence is, buckle your seatbelts because you’re about to find out!

Shamath’s riddle from LW16 was notorious for being unsolvable.  Or was it?  Much speculation flew around online about whether it was possible to solve this riddle.  I’d like to put this issue to rest here using some mathematical analysis that this riddle is, indeed, NOT solvable, and moreover, was apparently made unsolvable by accident.

To begin with, here is the riddle (from LW16 section 189 of unabridged version or section 171 of abridged/US version) as posed by the evil demoness Shamath to 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 underspecified algebraic system, meaning there are more variables than there are 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 of servants (which is open to debate depending on how you interpret the language, as many have pointed out; I’ll return to this point later): there are Loyal Servants (call this “S”), Dwellers of the Abyss (call this “D”), and Lieutenants of the Night (call this “L”).  And the demoness Shamath is asking: what is the value of S?

So we have three variables: S, D, and L.

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 D=2. That’s the simplest equation (and “D=2” certainly counts as an equation!). (Alternatively we could do away with D as a variable entirely and just substitute 2 everywhere that D occurs, in which case we have one fewer variable and one fewer equation, but the result will be the same as I’ll describe below.)

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:

S+D = L

And we have a third equation, which takes a bit more effort to glean from the text of the riddle (as well as some potential difference of opinion in the interpretation of the text, another point which I’ll address momentarily).

After the Lieutenants arrive, the total number present is now S+D+L. However, then the Dwellers depart, giving us S+L remaining. Then half of those remaining also leave, giving us (S+L)/2 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:

(S+L)/2 – 1 = S

So the contents of the riddle are providing us with three equations:
D = 2
S+D = L
(S+L)/2 – 1 = S

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:

(S + L)/2 – 1 = S
Distribute the divide-by-2:
S/2 + L/2 – 1 = S
Subtract S/2 from each side:
L/2 – 1 = S/2
Multiply through by 2:
L – 2 = S
L = S + 2

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:
D = 2
S + D = L
Or, in other words, S + 2 = L.

So in fact, we do not have three linearly independent equations (to use some terminology from linear algebra), and therefore we do not have enough information to solve for all three variables, S, D, and L. We only have two linearly independent equations (the two above), plus three unknowns (S,D,L). Or, doing away with D and substituting it with 2, we have one equation (S+2=L) and two unknowns (S and L), which again is an underspecified system.

Going back to the language/semantics issue, I feel pretty confident in the interpretation of the text I’ve used because the resulting system of equations above is at least internally consistent. That is, there are no contradictions or impossibilities; we never end up with a system of contradictory equations, for example something like L=S+1 and L=S-1 for which there is no possible solution.

Nevertheless, although the riddle is consistent, it is still incomplete (or as mathematicians say, indeterminate). We need one more independent equation in order to solve this algebraic system.  Independent means the new equation adds some new information that is not contained in the other equations.  To me, the riddle reads like the author (presumably Joe Dever) didn’t realize he was giving us the same information twice. Therefore there is nothing contradictory about what’s written, however it is still not enough information to solve the problem. As more evidence that he had something particular in mind, he also had a “correct” answer in mind. That is, he didn’t intentionally make it unsolvable; otherwise, why does section 10 contain the text for having the correct solution?

And because the system is underspecified, in this particular case we can choose any number for L and it will conform to the equations above.  Many people have noted this online: any number works for S… pick a number (any number: 10, 100, 457, 9999, 6 million, etc) for S and plug it into the equations above, and everything will work just fine.  And that is because the space of solutions is still infinitely large because it hasn’t been narrowed down enough by the information in the given equations (this is what an underspecified algebraic system does).

At this point we could try to reinterpret what is meant by “Loyal Servants” (is “Loyal Servants” perhaps really a superset of the various types of minions, etc), but I think doing so is adding complications to try to “bandage up” a flawed problem that was never intended to be a complicated riddle (do you like Occam’s Razor? I do!).

There are many ways the author could have “closed” this system of equations. A third independent equation is all it takes. For instance, he could’ve told us that L=12 (for example if, as someone already proposed, he wanted us to jump to the conclusion that there are 12 Lieutenants of the Night since there are 12 hours in half a day). Then, combining L=12 with the two equations above (D=2 and S+D=L), we immediately see that S=10 (the “intended” solution).

Or, he could’ve made it trickier and given us a more complicated third independent equation, like (L+S)/2 = 5D+1 (insert some riddle text to match this equation however you like), which again when combined with the two equations above would yield S=10 (try it for yourself!). I’m just making up examples. In truth, there is an infinite number of equations that could be provided, and 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. (If you’re curious, you can check for linear independence of a system of equations using a matrix operation called the determinant).

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 a whole lot better.  Check out the new sentence that was added:

‘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):
S = 12 – D

The reason I find this disappointing, besides having to make an assumption about there being 12 months, is that we can immediately solve for S since we already know that D=2.  The rest of the riddle is now made pointless, and Shamath could’ve stopped after her first sentence!  To put this another way, if Shamath were asking us to solve for L we would still need to utilize the third equation, but since she wants to know S, these first two equations are sufficient and we no longer need to solve for nor care about the value of L. If I were to fix the riddle, I would’ve added a new equation along the lines of the one I suggested above, like (L+S)/2 = 5D+1, which incorporates all 3 unknown variables and therefore still requires the use of all 3 equations in order to solve for S.

So, Shamath’s riddle has been “fixed”, at least in the sense that you can solve it now.

Does anyone know the wording of Shamath’s riddle in the Collector’s Edition of LW16?  Because of the short publication run of that book and its resulting rarity, I don’t own it.  Let me know in the comments if you do, and what the state of the riddle is in that edition! Is it the same as the “fixed” version on Project Aon?