Work related posts have been moved.

9 November, 2010

My work and computing related posts are now at

If you have come here from a work-related perspective (computing, semweb, bioinformatics, math). Perhaps you could go there right now and not read the gory personal stuff here.

Use the wordpress rss mechanism to follow categories:

Follow Paul Murray on Quora

So, did we win?

5 August, 2015

End of game!

We played the finale. Big, complicated fight with some cool stuff tying it back to previous adventures: some of the mooks exploded into candy (from the haloween plane).

And Brus got to kill Limen, just like he told Dimfuzz he would. “I am going to kill him with this”, he said, “unless I find something bigger”. In the end – he did find something bigger: Shub-Liminel with an Enlarge Person spell. Limen had an Anti-life Shell up, but with a reach of 15′ Brus was able to get him.

Did we win? The ending was just a shade ambiguous. Perhaps the whole thing – Coin included – was all just a big game put up by Limen himself. But, our characters ended the adventure levelled up and with bags of loot. All’s well that ends well.


Well – inquisitor is ok as a class. The specific picks I made to get travel domain made it quite a bit better. There was some rules adjudication needed for some of the teamwork feats, and the Surmount Affliction spell is useless without the rule that it’s the one spell that you can drop even when you are under the effect of one of the conditions it addresses.

It’s a bit monk-y: fighter with kick-butt will saves, so can deal with things that a fighter can’t. But really: can’t heal like a cleric, can’t fight like a fighter, can’t cast like a bard, and the sucky reflex save is crippling. The class would come into its own in urban adventures, I think.

Brus was a hell of a lot of fun as a character, but the class was complicated to play and not good enough at the things that it did do. The main reason Brus was as good as he was was that the DM gave him a weapon with book value completely off the scale.

As always, Brus will be shredded. I levelled him up to 15, just to see how the story ends – spells Ghostbane Dirge, Mass, and Instrument of Agony. Like Fallback Strategy, it sits there waiting to be used for 1 minute a level. Will save, but a free action in combat and the effect (nauseated) is very, very worthwhile. For his feat, I drew on his human heritage and took Defiant Luck.

And with the money from Limen, Shub-Liminel will be upgraded to being Cruel as well as Vicious, because it just has to be done :) .

Bye Brus! It was awesome. For the record, here’s how he looks at level 15:

Brus Reckoner #15
Male half-orc fighter 1/inquisitor of Yog-Sothoth 14 (Pathfinder RPG Advanced Player’s Guide 38)
N Medium humanoid (human, orc)
Init +3; Senses darkvision 60 ft., scent; Perception +12


AC 26, touch 13, flat-footed 26 (+9 armor, +2 deflection, +1 insight, +2 natural, +2 shield)
hp 154 (15 HD; 14d8+1d10+32)
Fort +13, Ref +4, Will +12; -4 penalty vs. odor-related effects
Defensive Abilities stalwart


Speed 40 ft. (30 ft. in armor)
Melee shub liminel +16/+11/+6 (1d8+20/×4 plus 2d6) or
   bite +10 (1d4+6)
Ranged composite shortbow +11/+6/+1 (1d6/×3)
Special Attacks exploit weakness, greater bane (19 rounds/day), judgment 5/day (2 simultaneous)
Domain Spell-Like Abilities (CL 14th; concentration +17)
   At will—dimensional hop (140 feet/day)
Inquisitor Spell-Like Abilities (CL 14th; concentration +17)
   At will—detect alignment, discern lies (14 rounds/day)
Inquisitor Spells Known (CL 14th; concentration +17)
   5th (2/day)—divine pursuitUM, mass ghostbane dirgeAPG (DC 18), unwilling shieldAPG (DC 18)
   4th (4/day)—find quarryUC, judgment lightUC, leashed shacklesUM (DC 17), stoneskin
   3rd (5/day)—coordinated effortAPG, cure serious wounds, deadly juggernautUC, dimensional anchor, festerAPG (DC 16)
   2nd (6/day)—blistering invectiveUC (DC 15), bloodhoundAPG, instrument of agonyUC, remove paralysis, see invisibility, surmount afflictionUM
   1st (6/day)—deadeye’s loreUC, divine favor, expeditious retreat, fallback strategy, lend judgmentUM (DC 14), wrathAPG
   0 (at will)—brandAPG (DC 13), create water, detect magic, guidance, read magic, resistance, virtue
   Domain Travel


Str 25, Dex 11, Con 14, Int 8, Wis 16, Cha 7
Base Atk +11; CMB +15; CMD 31
Feats Brutal Grappler, Cornugon Smash, Defiant LuckARG, Divine InterferenceUM, Escape RouteUC, Intimidating Prowess, Judgment SurgeUM, OutflankAPG, Power Attack, Quicken Spell-Like Ability (dimensional hop), Shake It OffUC, Shared JudgmentUC, Swap PlacesAPG
Traits armor expert, brute (orc)
Skills Climb +10, Handle Animal +2, Heal +10, Intimidate +36, Knowledge (arcana) +3, Knowledge (dungeoneering) +3, Knowledge (local) +3, Knowledge (nature) +3, Knowledge (planes) +3, Knowledge (religion) +3, Linguistics +3, Perception +12 (+20 vs. smells), Ride +2, Sense Motive +25, Spellcraft +3, Stealth +3, Survival +25 (+29 to track using scent, You do not have to move at half your speed while tracking.), Swim +9; Racial Modifiers +2 Intimidate, +4 to survival when tracking by scent
Languages Abyssal, Common, Custom Language, Infernal, Orc, Undercommon
SQ agile feet (6/day), monster lore +7, orc blood, solo tactics, stern gaze +7, track +7
Combat Gear potion of cure serious wounds (2), potion of shield of faith +2 (2), snapleaf, wand of cure light wounds; Other Gear +3 breastplate, shub liminel, arrows (20), composite shortbow, dusty rose prism ioun stone, amulet of natural armor +2, bane baldric, belt of giant strength +4, ring of force shield, ring of protection +2, backpack, bedroll, belt pouch, flint and steel, hemp rope (100 ft.), iron spike (2), iron unholy symbol, piton (2), torch (10), waterskin, material components for stoneskin * 3 (worth 250 gp), 137 gp, 7 sp, 4 cp

Special Abilities

+4 to Survival when tracking by Scent +4 to Survival when tracking by Scent.
Agile Feet (6/day) (Su) For 1 rd, you ignore difficult terrain.
Armor Expert -1 Armor check penalty.
Brutal Grappler When you and an ally with this feat have grappled the same creature, you may attempt to damage the opponent on your turn (whether you were the one who first initiated the grapple or were assisting your ally in doing so).
Brute (Orc) Whenever you score a critical threat, you add (but not multiply, in the case of a confirmed critical hit) an amount of damage equal to your weapon’s critical modifier.
Cornugon Smash When you damage an opponent with a Power Attack, you may make an immediate Intimidate check as a free action to attempt to demoralize your opponent.
Darkvision (60 feet) You can see in the dark (black and white vision only).
Defiant Luck (1/day) Reroll a natural 1 on a save, or force a reroll of a critical hit confirmation roll.
Detect Alignment (At will) (Sp) Detect chaos, evil, good, or law at will.
Dimensional Hop (28 5-ft inc/day) (Sp) As a move action, teleport with no AoO to seen destination. Spend an equal distance to carry others.
Discern Lies (14 rounds/day) (Sp) Discern Lies at will
Divine Interference Sacrifice a spell to force an enemy to reroll a successful attack against your ally
Escape Route You do not provoke attacks of opportunity when moving through spaces adjacent to allies
Exploit Weakness (Ex) With a crit, ignore DR, suppress Regen, and take advantage of vulnerability.
Greater Bane (+2 / 4d6, 19 rounds/day) (Su) Make the weapon you are holding a bane weapon.
Inquisitor Domain (Travel) Granted Powers: You are an explorer and find enlightenment in the simple joy of travel, be it by foot or conveyance or magic. Increase your base speed by 10 feet.
Judgment Surge (1/day) Gain improved versions of your judgments
Monster Lore +7 (Ex) +7 to Knowledge checks when identifying the weaknessess of creatures.
Orc Blood Half-orcs count as both humans and orcs for any effect related to race.
Outflank Increase flank bonus by +2 if flanking ally has same feat. If you crit, ally gets an AoO.
Power Attack -3/+6 You can subtract from your attack roll to add to your damage.
Quicken Spell-Like Ability (Dimensional Hop [28 5-ft inc/day] [Sp], 3/day) Spell-like ability is cast as a swift action up to 3/day.
Ring of force shield An iron band, this simple ring generates a shield-sized (and shield-shaped) wall of force that stays with the ring and can be wielded by the wearer as if it were a heavy shield (+2 AC). This special creation has no armor check penalty or arcane spell failure chance since it is weightless and encumbrance-free. It can be activated and deactivated at will as a free action.

Note: In order to get the AC bonus from this, it must be equipped and then activated on the in-play tab.

Requirements: Forge Ring, wall of force; Cost 4,250 gp
Scent (Ex) Detect opponents within 15+ feet by sense of smell.
Second Judgment (5/day) (Su) Variable bonuses increase as the combat continues.
Shake It Off Gain +1 to all saving throws per adjacent ally
Shared Judgment Extend a judgment to an adjacent ally instead of enacting a second judgment.
Solo Tactics (Ex) Count Teamwork feats as if your allies had the same ones.
Stalwart (Ex) If you succeed at a Fort or Will save for reduced effect, you take none instead.
Swap Places You can trade places with an ally with this feat during your movement.
Track +7 Add the listed bonus to survival checks made to track.

Hero Lab and the Hero Lab logo are Registered Trademarks of LWD Technology, Inc. Free download at
Pathfinder® and associated marks and logos are trademarks of Paizo Inc.®, and are used under license.

What is a Wall of Force?

19 July, 2015

What actually is a Wall of Force?

Well, the thing to note is that it is an evocation, not a conjuration. Very different.

A conjurer creates matter having certain properties by knotting the aether into a particular “shape”. A spray of something an acidic, a ball of burning stuff. It will exist for a period of time, usually, and then unravel.

Evocation is quite different, and goes back to Plato’s ideal forms.

What is the nature of fire? Well, the nature of fire is to burn. An evoker “evokes” – “manifests”, if you prefer – this inner nature of fire, without recourse to any gross matter on which the burniness subsists, and so creates a spherical region of sheer burniness – burniness in and of itself. (The concussion and sound are consequences of this, rather than being things in themselves.) Thus, a Fireball. Likewise, a Cone of Cold is a cone of sheer freeziness; and a Sound Burst a burst of loudness.

Now, what is the nature of solid matter, qua being solid matter? As the mage Pauli explains, the nature of solid matter is that it excludes other solid matter from the volume it occupies, and exerts force on other solid matter that tries to do so. Why can you not press your hand through a brick wall? Because the brick wall pushes back on your hand, in order to keep it out.

That is what a Wall of Force is – a volume in which is evoked sheer solidity, solidity in and of itself. Such walls need to be thin because they need to displace the air previously occupying the space. Even a Bigby’s Hand (showing my years – we no longer call the spell that, for legal reasons) is only a thin membrane in the approximate shape of a hand. Of course, these ideal forms can only be manifested briefly on Prime – often instantaneously – as Prime is not the place where these forms reside (they normally reside in the same place that fictional objects do). Maintaining an evocation for longer than an instant is always more advanced magic.

Assignment: 200 words. Summarise pp 453-460, “on the nature of fictional objects”.
Additional Credit: explain why a Disintegrate unfailingly dispels a Wall of Force.

He’s our buoy!

18 July, 2015

So, everything has gone to shit, Coin is probably dead, Limen was probably in the holy-of-holies – the tesseract – and has kinda stolen our plan. The dimensional anchor is imbedded in Coin’s portrait, and the rope extends off to … somewhere.

We had a bit of a chat to these kinda godlike dudes, who are Coin’s “children”. Maybe. We were going to want to catch up with Limen at the other end of this rope thing. We could follow that rope (which no doubt let through the Plane of Infinite Rats), or maybe take a shortcut.

We opted for the shortcut. We were waned that it might get a little damp.

Now, there’s a bit of history there. One of the doorways opened out onto a ship, which we sank a while ago and which “now” probably lies on the bottom of an ocean.

Checkov’s Gun was mentioned.

Oh, and we needed to find a wizard who was not very good (at being a wizard), but who was going to help in some unspecified way.

And they gave us a little thingy which would stop time while we all had a full nights rest and levelled up. Nice. And a second one. For later. Because we are going to need it.

In the “morning”, John gives everyone a Water Breathing spell, which will last for a while, ditto a Wind Walk.

First door. Opened out into a sewer. There were all these skeletons that had had the flesh sucked off them, but it was ok because they were fully dead. Nice.

Our key/compass pointed “thataway” to the next door, so we went thataway. Tied up in the middle of the fetor was some dude calling for help. “Please help!”, he yelled, “He’s coming back!”. A brief interrogation during which Brus for the first time ever used his “Detect Lies” class ability determined that he was lying his ass off. We ignored him and went for the door. Oh, and I think Picklick shot him a bit just to see what would happen, because even though Morgs was not at the table that’s just how he rolls.

Anyway. As soon as we got close the dude, of course, attacked and a couple more emerged out of the scenery (it was a sewer – lot’s of scenery). We managed to get them down without too much trouble, because it turns out they were flesh-suckers. Every sucked cooked flesh off a chicken bone? Well, they did that. Faugh has taken 3 points of Charisma drain, which – well – doesn’t really do much to him. I think Will took some as well, which does affect him. But, he’s rocking about 20 normally, so he’s ok for the moment.

There was a ping from a pile of scenery, and we uncovered a Ring of Water Walking. We gave it to Faugh, on account of he is a gnome and occasionally gets in over his head.

Next door. Wood panelled rooms which smelled awesome with beeswax. Brus drops a Bloodhound spell every day, so was relived to be out of the sewer. Following our compass, we found a wooden shield that had been pierced through with a very odd foot-and-a-half long shortspear, made of a weird material, kinda chitinous and aww shit: is that a bee stinger?

You bet your booty it was.

Anyway. We found this nice room with a boiling kettle, some tea making gear, and no wizard. We opened a door and looked down a corridor to see a dude in a wizard’s hat bolting towards us, pursued by a swarm of unhappy bees. We admit the wizard, slam the door shut, and Picklick proceeds to wedge the door.


Them is some big-ass bees. The wizard mentions that he seems to have upset them. Then there’s a knock on the other door. We reason that bees usually don’t knock, so we let the guy in. Wizard looks like he’s seen a ghost.

Guy says “I’m sorry!” and splits open, and a swarm of bees emerge. Then the other swarm breaks through the wedged door.

Fight fight. Will (or Bottom) gets stung, takes Dex damage. We hightail it to the next door, dragging the wizard along.

But there are two doors! One goes to the bottom of the ocean, and one goes – well, somewhere else. We opt for waterworld. But first, a plan is needed. We rope ourselves together – a good start. We will close the other doors, open the portal door and wait for the inrushing water to equalise pressure. Cool. But we have two problems – we have dudes in armour, and we have a wizard who did not get this morning’s Water Breathing.

For the Wizard, we decide to stuff him into a Bag of Holding. He won’t be in there too long, so will probably not suffocate. Rather than try to convince him to to this, Picklick saps him and we stuff his uncoscious body into the bag. We actually have two, but one of them has a few corpses in it (it’s a long story) so we put him in the other one.

Now, our first thought was to use Wind Walk. But after a moment we recall that that spell doesn’t really work well underwater.

But remember that ring of Water Walking? That we gave Faugh?

If the spell is cast underwater (or while the subjects are partially or wholly submerged in whatever liquid they are in), the subjects are borne toward the surface at 60 feet per round until they can stand on it.

We decide that Faugh is our buoy. Problem solved!

So we secure our loos items (ioun stones, in particular) and open the door.

Well Brus, who opened the door, takes damage, people are washed back, there’s pummelling and cold damage and John drops a Resist Energy (cold), Mass. Much damage. The other doors in the room strain to control the pressure, and John’s invisible Fairy Dragon puts up a Wall of Force It won’t last long.

We get through the door and underwater, and far enough away from the portal to not be sucked back in once the WoF goes down. It’s cold, but we are warmed by the thought of what is going to happen to those fucking bees.

Faugh pops us to the top, cork-like. There is a fortuitous boat just nearby, the crew a little startled by people bobbing to the surface of the sea out of absolutely nowhere, and possibly also by the sight of a deep gnome calmly walking on the water like it ain’t no thing.

Aboard the boat, we let our wizard out of the bag. He’s a little bluish, but not too bad. He is also wet, having made the mistake of opening the bag for a moment.

And here we are. Alive, but still racing the clock.

I do math

13 July, 2015

Well, maybe not really complicated math. Or maths, depending on where you come from.

It’s like this. I recently discovered 3d printing. Yay! My thinginverse page is here. Saw a thing by a dude doing a loxodromic lampshade and I am like “man, I am all over that shit like stink on vomit!”

So I decided to do a better one. Mainly because what I really want to do is a quasifuchsian curlicue lampshade.

So. I need to write a 3-d bilinear transform that moves the xy plane onto the unit sphere.

Any bilinear transform can be done using two sphere inversions, which are easy-peasy.

So, what pair of sphere inversions do the thingy that I want?

Well, we need more invariants. I want the unit circle to be constant. I want all points on the xy plane to be moved to the unit sphere. I want the z<0 half-plane to be moved to the exterior of the sphere.

Now, for some math(s).

I think it’s pretty obvious that the two inversion spheres will be centered on the xy=0 axis. This means that I only have four numbers to figure out. In fact, I can just work with one slice of the space and just do it as a 2-d operation, which makes visualising it muuuch easier.

Three points is enough to fully specify a mobius transform, and I have three points here:
[1,0,0]->[1,0,0]; [0,0,0]->[0,0,1]; ∞->[0,0,-1].

But I don’t want to do this as a mobius transform … although it would be a hell of a lot easier if I did. No! I will stick to the original plan. A pair of sphere inversions. Because you can do arbitrary stuff with it, that’s why.

So, what two inversions accomplish my little plan?

lets call our spheres (circles) Γ1=[0,0,c1]*r1 and Γ2=[0,0,c2]*r2. I invert the point *first* in Γ2 and *then* in Γ1. IOW, p’ = Γ1(Γ2(p)) .

To do a cirlce inversion, you move the center of the circle to the origin, scale the radius to 1, invert, and then move things back again. Inversion is a matter of dividing the coordinates by the square of the distance, which is easy to get

the halfway point is [ x/r, (z-c)/r].
the distance squared of that halfway point is (x/r)^2 + ((z-c)/r)^2 , which is (x^2+(z-c)^2)/r^2

so invertiing we get
[ x/r / ((x^2+(z-c)^2)/r^2), ((z-c)/r)/((x^2+(z-c)^2)/r^2)]

[ x / ((x^2+(z-c)^2)/r), ((z-c))/((x^2+(z-c)^2)/r)]

[ rx / (x^2+(z-c)^2), (r(z-c))/(x^2+(z-c)^2)]
and then move everything back

[ r^2 x / (x^2+(z-c)^2), (r^2 (z-c))/(x^2+(z-c)^2) + c]

so the effect of Γ2 is

[ r2^2 x / (x^2+(z-c2)^2), (r2^2 (z-c2))/(x^2+(z-c2)^2) + c2]

and the effect of Γ1 Γ2 is

ooh-kay. Let’s just do that common term first

K = ({r2^2 x / (x^2+(z-c2)^2)}^2+({(r2^2 (z-c2))/(x^2+(z-c2)^2) + c2}-c1)^2)

giving us

[ r1^2 x / K, (r1^2 (z-c1))/K + c1]

Now, the only way (sorta) this can map the point at infinity to [0,-1] is if K is infinite for [∞,0] and c1 = -1.

So that’s one of our constants sorted. Yay! Let’s substitute it in:

K = ({r2^2 x / (x^2+(z-c2)^2)}^2+({(r2^2 (z-c2))/(x^2+(z-c2)^2) + c2}+1)^2)

Γ1 Γ2 [x, z] = [ r1^2 x / K, (r1^2 (z+1))/K – 1]

Now, what’s going to make K infinite for [∞,0] ? Well, (x^2+(z-c2)^2) needs to be zero. That ain’t going to happen. But that x^2 term in the bottom means that … have we got an infinite radius for one of the circles?? That’s … possible. In fact, inverting the

got it.

If you invert the xy plane through a with radius 2 that is tangent to the origin, this moves the xy plane onto a unit circle centered at .5. Problem is, it’s inverted because it has only been throug one reflection. So invert it through [0,0,-2],r=2, and then reflect the z coordinate at -.25 (or just reflect z and subtract 1). The problem with *that* is that you can’t express it as a pair of sphere inversions if you paramterise it the way I have been doing.

But you know what? Screw it. I only want one specific job done, so I’ll do that.

Thanks guys!

Spartacus – analysis complete

8 July, 2015

Well, I have found the optimal strategy for Spartacus combat, assuming a simple back-and-forth. The result is … surprising. Surprising enough that I’m wondering “how much better is the optimal strategy to the suboptimal?’

Source is on github.


8 July, 2015

Ok. The algorithm appears to be generating correct numbers. A couple of bugs, all of them important.

I asked it to compute how to behave in a 1/1 vs. 2/2 battle. This is the smallest situation where one of the parties needs to make a choice: if the 1/1 player manages to make one hit on the 2/2 player, should that player take it off attack or off defence?

Output looks like this:

Calculate state for [A:1/1 vs. D:2/2 (6)] and [A:2/2 vs. D:1/1 (6)]
  Calculate state for [A:2/1 vs. D:1/1 (5)] and [A:1/1 vs. D:2/1 (5)]
    Calculate state for [A:1/1 vs. D:1/1 (4)] and [A:1/1 vs. D:1/1 (4)]
    [A:1/1 vs. D:1/1 (4)] D: winprob 36.8
   [A:1/1 vs. D:2/1 (5)], 1 hits. Take 1 off attack, go to state [A:1/1 vs. D:1/1 (4)] invert for attack winprob: 63.1
  [A:2/1 vs. D:1/1 (5)] D: winprob 5.1
  [A:1/1 vs. D:2/1 (5)] D: winprob 81.6
  Calculate state for [A:1/2 vs. D:1/1 (5)] and [A:1/1 vs. D:1/2 (5)]
   [A:1/1 vs. D:1/2 (5)], 1 hits. Take 1 off defence, go to state [A:1/1 vs. D:1/1 (4)] invert for attack winprob: 63.1
  [A:1/2 vs. D:1/1 (5)] D: winprob 9.6
  [A:1/1 vs. D:1/2 (5)] D: winprob 83.4
 [A:1/1 vs. D:2/2 (6)], 1 hits. Take 1 off defence, go to state [A:1/1 vs. D:2/1 (5)] invert for attack winprob: 94.8
 [A:1/1 vs. D:2/2 (6)], 2 hits. Take 1 off attack, 1 off defence, go to state [A:1/1 vs. D:1/1 (4)] invert for attack winprob: 63.1
[A:1/1 vs. D:2/2 (6)] D: winprob 98.3
[A:2/2 vs. D:1/1 (6)] D: winprob 0.4

The important line is this one: [A:1/1 vs. D:2/2 (6)], 1 hits. Take 1 off defence, go to state [A:1/1 vs. D:2/1 (5)] invert for attack winprob: 94.8.

If attacker is 1/1, and defender is 2/2, and the attacker scores 1 hit, then the defender should take it off defence. If they do, then they will be in the situation of being 2/1 vs 1/1, which has a 94.8% win probability. Looking at the output, if the defender were to take it of attack then next turn they be in 1/2 vs 1/1, which only has a 90.4% win probability.

Looking at this data, you might ejaculate “This is bullshit! The win probability for 1/1 vs 1/1 is 36.8%! It should be 50/50!” But you would be wrong. You see, that number is the win probability for the player currently defending. Certainly, their chance of losing is the same as the attackers chance of losing if no hits are scored, but there’s only at 21 in 36 chanceof that.

This applies to any situation and it brings us to our first useful result – it is a good idea to close and attack. In fact, it’s a very good idea. Even if you are weaker than your opponent, you are better off attacking and hoping that that first hit will knock them down some. If it does, great; and if it doesn’t, you are no worse off than you would be if they caught and hit you first.

So the ‘pre’ stage of the battle – moving your pieces around the board – matters, which means mobility matters. Absolutely you want to corner your opponent in such a way that you can get them on your next turn, but they cannot get you on their next turn. I am not sure if the shape of the board means there is a winning strategy for doing this, or if it’s always possible for the players to circle around each other, trying to get that first hit.

Another point of interest is that this strategy is the best strategy if the opponent also follows the best strategy. But what if they don’t? What if there’s a silly mistake that almost everyone makes when they play? Well, your best strategy is to take advantage of that quirk, which means that this strategy is not as good as that one. But I don’t think that your opponent tending to make a particular mistake is going to make this strategy worse than it is if they play perfectly.

But I could be wrong about that.

So now that I can generate the data, I can do some theorem testing on it. My first question is: if you take multiple hits, is your best strategy always the same as if you were to take these multiple hits one at a time? I think it’s likely that it is, but not certain. I this is the case, then I can make life much simpler by only being interested in the “you take one hit” set of strategies.

The main problem is presenting the algorithm. What I need is a simple set of rules saying what to do in any possible situation. That is: the thing that the rules tell you do do should be the same as what (according to this) you actually should do.



6 July, 2015

Ok. I have four numbers. We are discussing this from the POV of the defender because the question we are asking is “if I take 2 hits, which die should I take them off”?

chanceOfThisToInv is the probability that in the current situation, the attacker will score zero hits on me.

chanceOfInvToThis is the probability that in the reverse of this situation (I scored no hits so now it’s the attacker’s go) I will score zero hits in return on my attacker.

chanceOfThisToWinGivenNotLoop is the probability that *if* I do not score no hits, then I will go on to win. To calculate it, we work out for each possible number of hits what our best move is, and then for that move take the inverse of the possibility of winning (because that’s the situation our attcker will then be in), and multiply it by the probability of scoring that number of hits.

We then divide the total by the total chance of not scoring no hits.

chanceOfInvToLoseGivenNotLoop is calculated correspondingly.

Now, what’s my win probability?

To figure that out, I will have to sumultaneously figure out winProb and invLoseProb, I think, because they depend on one another.

First, let’s shrink the size of those variable names

ti = this to inv
it = inv to this
rw = raw win pobability, ignoring the loop
ril = raw invers lose probability, ignoring the loop.

wp = win probaibility
ilp = inverse lose probability

wp = (1-ti) rw + ti ilp
ilp = (1-it) ril + it wp

Ahh crapsicks. I hate these. Actually, no I dont, it’s just been a while since I did one.

wp = (1-ti) rw + ti [ (1-it) ril + it wp ] 
wp = (1-ti) rw + ti (1-it) ril + ti it wp
wp -  ti it wp = (1-ti) rw + ti (1-it) ril
wp  = [ (1-ti) rw + ti (1-it) ril ] / (1 - ti it)

ilp = (1-it) ril + it [ (1-ti) rw + ti ilp ]
ilp = (1-it) ril + it (1-ti) rw + it ti ilp 
ilp - it ti ilp  = (1-it) ril + it (1-ti) rw
ilp = [ (1-it) ril + it (1-ti) rw ] / ( 1 - it ti) 


wp  = [ (1-ti) rw + ti (1-it) ril ] / (1 - ti it)
ilp = [ (1-it) ril + it (1-ti) rw ] / ( 1 - it ti) 

Hmm, some common terms there. Rearranging:

wp  = [ ti (1-it) ril +    (1-ti) rw ] / (1 - it ti)
ilp = [    (1-it) ril + it (1-ti) rw ] / ( 1 - it ti) 

Damn! Look at all those multiplications of ril by (1-it)! Recall that we divided by 1-it to get to where we are. Maybe we can just use what we already have? I’ll call them ‘simple win’ and ‘simple inverse lose’

wp  = [ ti sil +    sw ] /  (1 - it ti)
ilp = [    sil + it sw ] / ( 1 - it ti) 

Weird! Can it really be that simple?

On a 1, I lose; on a 2-3, I win; on a 4-0 I pass the dice to you. .1, .2, .7
On a 1-5, you lose. On a 6, you win. On a 7-0, you pass the dice to me. .5, .1, .4

wp  = [ .7 .5 +    .2 ] /  (1 - .28) = .55 / .72 = .763
ilp = [    .5 + .4 .2 ] / ( 1 - .28) = .58 / .72 = .806

The numbers are different because they are in the form of expressing my chance of winning given who is currently holding the dice.

Now, let’s describe the game from the inverse POV.

On a 1-5, I lose. On a 6, I win. On a 7-0, I pass the dice to yoy. .5, .1, .4
On a 1, You lose; on a 2-3, You win; on a 4-0 you pass the dice to me. .1, .2, .7

wp  = [ .4 .1 +    .1 ] /  (1 - .28) = .14 / .72 = 
ilp = [    .1 + .7 .1 ] / ( 1 - .28) = .17 / .72 =

And you can see that .14+.58 is .72 and .17+.55 is also .72.

I feel good. That’s how I’ll calculate it.


Get every new post delivered to your Inbox.

Join 45 other followers