D20 with Advantage

Dungeons & Dragons players spend a lot of time rolling 20-sided polyhedral dice, known as D20s.

In general, they’re looking to roll as high as possible to successfully stab a wyvern, jump a chasm, pick a lock, charm a Duke1, or whatever.

A 'full set' of white polyhedral dice commonly-used by roleplayers - a D4, D6, D8, two D10s, a D12, and a D20 - sit half-submerged in a red liquid.
Submerging your dice set in the blood of a halfling is a sure-fire way to get luckier rolls.

Roll with advantage

Sometimes, a player gets to roll with advantage. In this case, the player rolls two dice, and takes the higher roll. This really boosts their chances of not-getting a low roll. Do you know by how much?

I dreamed about this very question last night. And then, still in my dream, I came up with the answer2. I woke up thinking about it3 and checked my working.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 2 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
3 3 3 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
4 4 4 4 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
5 5 5 5 5 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
6 6 6 6 6 6 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
7 7 7 7 7 7 7 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8 8 8 8 8 8 8 8 8 9 10 11 12 13 14 15 16 17 18 19 20
9 9 9 9 9 9 9 9 9 9 10 11 12 13 14 15 16 17 18 19 20
10 10 10 10 10 10 10 10 10 10 10 11 12 13 14 15 16 17 18 19 20
11 11 11 11 11 11 11 11 11 11 11 11 12 13 14 15 16 17 18 19 20
12 12 12 12 12 12 12 12 12 12 12 12 12 13 14 15 16 17 18 19 20
13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 15 16 17 18 19 20
14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 16 17 18 19 20
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 17 18 19 20
16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 17 18 19 20
17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 18 19 20
18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 19 20
19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
Table illustrating the different permutations of two D20 rolls and the “advantage” result (i.e. the higher of the two).

The chance of getting a “natural 1” result on a D20 is 1 in 20… but when you roll with advantage, that goes down to 1 in 400: a huge improvement! The chance of rolling a 10 or 11 (2 in 20 chance of one or the other) remains the same. And the chance of a “crit” –  20 – goes up from 1 in 20 when rolling a single D20 to 39 in 400 – almost 10% – when rolling with advantage.

You can see that in the table above: the headers along the top and left are the natural rolls, the intersections are the resulting values – the higher of the two.

The nice thing about the table above (which again: was how I visualised the question in my dream!) is it really helps to visualise why these numbers are what they are. The general formula for calculating the chance of a given number when rolling D20 with advantage is ( n2 – (n-1)2 ) / 400. That is, the square of the number you’re looking for, minus the square of the number one less than that, over 400 (the total number of permutations)4.

Why roll two dice when one massive one will do?

Knowing the probability matrix, it’s theoretically possible to construct a “D20 with Advantage” die5. Such a tool would have 400 sides (one 1, three 2s, five 3s… and thirty-nine 20s). Rolling-with-advantage would be a single roll.

'400-sided die' shown on Numberwang.
I don’t think anybody’s ever built a real 400-sided die, but Numberwang! claimed to have one.

This is probably a totally academic exercise. The only conceivable reason I can think of would be if you were implementing a computer system on which generating random numbers was computationally-expensive, but memory was cheap: under this circumstance, you could pre-generate a 400-item array of possible results and randomly select from it.

But if anybody’s got a 3D printer capable of making a large tetrahectogon (yes, that’s what you call a 400-sided polygon – you learned something today!), I’d love to see an “Advantage D20” in the flesh. Or if you’d just like to implement a 3D model for Dice Box that’d be fine too!

Footnotes

1 Or throw a fireball, recall an anecdote, navigate a rainforest, survive a poisoning, sneak past a troll, swim through a magical swamp, hold on to a speeding aurochs, disarm a tripwire, fire a crossbow, mix a potion, appeal to one among a pantheon of gods, beat the inn’s landlord at an arm-wrestling match, seduce a duergar guard, persuade a talking squirrel to spy on some bandits, hold open a heavy door, determine the nature of a curse, follow a trail of blood, find a long-lost tome, win a drinking competition, pickpocket a sleeping ogre, bury a magic sword so deep that nobody will ever find it, pilot a spacefaring rowboat, interpret a forgotten language, notice an imminent ambush, telepathically commune with a distant friend, accurately copy-out an ancient manuscript, perform a religious ritual, find the secret button under the wizard’s desk, survive the blistering cold, entertain a gang of street urchins, push through a force field, resist mind control, and then compose a ballad celebrating your adventure.

2 I don’t know what it says about me as a human being that sometimes I dream in mathematics, but it perhaps shouldn’t be surprising given I’m nerdy enough to have previously recorded instances of dreaming in (a) Perl, and (b) Nethack (terminal mode).

3 When I woke up I also found that I had One Jump from Disney’s Aladdin stuck in my head, but I’m not sure that’s relevant to the discussion of probability; however, it might still be a reasonable indicator of my mental state in general.

4 An alternative formula which is easier to read but harder to explain would be ( 2(n – 1) + 1 ) / 400.

5 Or a “D20 with Disadvantage”: the table’s basically the inverse of the advantage one – i.e. 1 in 400 chance of a 20 through to 39 in 400 chance of a 1.

× ×

Non-transitive Games

Non-transitive dice

Have you ever come across non-transitive dice? The classic set, that you can get in most magic shops, consists of three different-coloured six-sided dice:

A "Grimes" style set of 3 non-transitive dice. Notice the unusual numbering.
A “Grime’s” style set of 3 non-transitive dice. Notice the unusual numbering.

There are several variants, but a common one, as discussed by James Grime, involves one die with five “3” sides and one “6” side (described as red below), a second die with three “2” sides and three “5” sides (described as green below), and a third die with one “1” side and five “four” sides (described as blue below).

They’re all fair dice, and – like a normal six-sided dice – they all have an average score of 3.5. But they’ve got an interesting property, which you can use for all kinds of magic tricks and gambling games. Typically: the red die will beat the green die, the green die will beat the blue die, and the blue die will beat the red die! (think Rock, Paper, Scissors…)

Red beats Green beats Blue beats Red.
Seemingly paradoxically, the dice will generally beat one another in a circular pattern.

If you want to beat your opponent, have them pick a die first. If they pick green, you take red. If they take red, you take blue. If they take blue, you take green. You now have about a 60% chance of getting the highest roll (normally you’d have about a 33% chance of winning, and a 17% chance of a draw, so a 60% chance is significantly better). To make sure that you’ve got the best odds, play “best of 10” or similar: the more times you play, the less-likely you are to be caught out by an unfortunate unlucky streak.

But if that doesn’t bake your noodle enough, try grabbing two sets of nontransitive dice and try again. Now you’ll see that the pattern reverses: the green pair tends to beat the red pair, the red pair tends to beat the blue pair, and the blue pair tends to beat the green pair! (this makes for a great second act to your efforts to fleece somebody of their money in a gambling game: once they’ve worked out how you keep winning, give them the chance to go “double or nothing”, using two dice, and you’ll even offer to choose first!)

Double Red beats Double Blue beats Double Green beats Double Red
When you pair up the dice, the cycle reverses! While red beats green, double-green beats double-red!

The properties of these dice – and of the more-exotic forms, like Oskar van Deventer’s seven-dice set (suitable for playing a game with three players and beating both of your opponents) and like the polyhedral varieties discussed on Wikipedia – intrigue the game theorist and board games designer in me. Could there be the potential for this mechanic to exist in a board game? I’m thinking something with Risk-like combat (dice ‘knock out’ one another from highest to lowest) but with a “dice acquisition” mechanic (so players perform actions, perhaps in an auction format, to acquire dice of particular colours – each with their own strengths and weaknesses among other dice – to support their “hand” of dice). There’s a discussion going on in /r/tabletopgamedesign

I’ve even written a program (which you’re welcome to download, adapt, and use) to calulate the odds of any combination of any variety of non-transitive dice against one another, or even to help you develop your own non-transitive dice sets.

Penney’s game

A coin being flipped.
Heads or tails? Image courtesy David M. Diaz.

Here’s another non-transitive game for you, but this time: I’ve made it into a real, playable game that you can try out right now. In this game, you and I will each, in turn, predict three consecutive flips of a fair coin – so you might predict “tails, heads, heads”. Then we’ll start flipping a coin, again and again, until one of our sequences comes up. And more often than not, I’ll win.

If you win 10 times (or you lose 20 times, which is more likely!), then I’ll explain how the game works, so you know how I “cheated”. I’ll remind you: the coin flips are fair, and it’s nothing to do with a computer – if we played this game face-to-face, with a real coin, I’d still win. Now go play!

× × ×

Spirit of the Century

A couple of weeks ago, the other Earthlings and I played our very first game of Spirit of the Century. Spirit of the Century is a tabletop roleplaying game based on the FATE system (which in turn draws elements from the FUDGE system, and in particular, the FUDGE dice). Are you following me so far?

Four sets of FUDGE/FATE dice. Each die is labelled with 2 “blank”, 2 “minus” and 2 “plus” sides, and all four are rolled to obtain a result between -4 and +4, on a probability bell-curve trending towards 0. Neat.

Spirit of the Century is set in the “pulp novel” era of the 1920s, in the optimistic period between the two world wars. The player characters play pulp-style heroes: the learned professor, the adventurous archaeologist, the daring pilot, all of those tropes of the era. Science, or – as it should be put – Science! is king, and there’s no telling what fantastic and terrifying secrets are about to be unleashed upon the world. Tell you what… let me just show you the cover for the sourcebook:

Yes; that’s a gorilla flying a biplane away from a stricken zeppelin, fighting a masked hero. Meanwhile, a female mechanic clambers under the fuselage and man wearing a jetpack pulls alongside, guns blazing.

Everything you need to know about the game is right in that picture, right there.

The character generation mechanism is different from most RPGs; even other fluffy, anti-min/max-ey ones. All player characters (for reasons relevant to the mythos) were born on 1st January 1901, so the first part of character creation is explaining what they did during their childhood. The second part is about explaining what they did during the Great War. During each of these (and every subsequent step), the character will gain two “aspects”, which they’ll later use for or against their feats in a way not-too-dissimilar from the PDQ System (which may be familiar to those of you who’ve played Ninja Burger 2nd Edition).

The third chapter of character generation involves telling your character’s own story – their first adventure – in the style of a pulp novel. The back of the character sheet will actually end up with a “blurb” on it, summarising the plot of their novel. Then things get complicated. In the fourth and fifth chapters, each character will co-star in the novels of randomly-selected other player characters. This can involve a little bit of re-writing, as stories are bent in order to fit around the ideas of the players, but it serves an important purpose: it gives groups of player characters a collaborative backstory. “Remember the time that we fought off Professor Mechk’s evil robot army?”

Johnny Sparks is a character of my creation.

That’s exactly what Johnny Sparks did in “Johnny Sparks and the Robot Army”. When Professor Mechk released his evil robot army on the streets of New York City, Johnny Sparks – government-sponsored whizkid – knew he had to act. With his old friend Jack Brewood (and Jack’s network of black market contacts), he acquired the parts to build a weapon powered by lightning itself. Then, alongside Mafia child and expert pugilist Michael Leone, he fought his way up the Empire State Building to Mechk’s control centre. While Michael duelled with Mechk, Johnny channeled the powers of the heavens into the gigantic robot brainwave transmitter at the top of the tower, sending it into overload. As the tower-top base melted down and exploded, Michael and Johnny abseiled rapidly down the side to safety.

And so they have a history, you see! And some “aspects” for it: Johnny got “Master of Storms” from his lightning-based research and “With thanks to Jack” for his friend’s support. Meanwhile Jack got “On Johnny’s wavelength” to represent the fact that he’s one of the few people who can follow Johnny’s strange and aspie-ish thought patterns.

Beer, crisps, and roleplaying. What more does an Earthling need?

In our first play session, Michael Leone (Paul), Jack Brewood (JTA), and Anna Midnight (Ruth) found themselves in a race to rescue aviator Charles Lindbergh from the evil Captain Hookshot and his blimp-riding pirates. Hookshot hoped to use the kidnap of Lindbergh as leverage to get his hands on some of Thomas Edison‘s secret research, which he hoped would allow him to gain a stranglehold on the world’s aluminium supply, which was only just beginning to be produced in meaningful quantities. So began an epic boat (and seaplane) chase across the Atlantic to mysterious Barnett Island, a fight through the pirates’ slave camp and bauxite mines, a Mexican-stand-off aboard a zeppelin full of explosives, and a high-speed escape from an erupting volcanic island.

Highlights included:

  • Jack’s afraid of flying, so while the others arrived for the first scenes of the adventure by seaplane, Jack trundled well behind in a cruiser. As a result, he completely missed the kidnapping.
  • When Hookshot was first kidnapping Edison, his attempt was foiled when Ana threw a cutlass at him, severing the grapple he had tied to the scientist.
  • Michael’s a badass at barehand combat. When he wasn’t flinging wild dogs into trees, he was generally found crushing the skulls of pirates into one another.
  • Spirit of the Century encourages a particular mechanism for “player-generated content”. This was exemplified wonderfully by Jack’s observation that he “read once that there was a tribal whaling camp on an island near here, called Ingleshtat.” He paid a FATE point and made an Academics roll, but because I wouldn’t tell him the target of the roll he only knew that he’d “done well”, and not that he’d “done well enough.” He and the other player characters weren’t sure that his knowledge was accurate until they reached the island (and thankfully found that he was right). Similarly, the motivation for the kidnapping wasn’t about aluminium until one of the players speculated that it might be.
  • Ana Midnight’s spectacularly failed attempt at stealth, as she crept via a creaky door into a building full of armed guards. Also, Jack’s fabulous rescue attempt, as he dived and rolled into the building, firing his pistol as he went, while Michael climbed up the zeppelin’s boarding tower, leading to…
  • The tense (and, surprisingly, combat-free… barely!) stand-off and negotiation aboard Hookshot’s zeppelin, towards the end of the story.

There’s a lot of potential for a lot of fun in this game, and we’ll be sure to play it again sometime soon.

× × × ×

The Infinity Machine

I read a great article this morning: The Infinity Machine, by Simon Tatham. It looks at the possibility of a hypothetical computer that is capable of processing at infinite speeds. However, unlike many other hypothetical infinity devices, it doesn’t look at the theoretical implications of the project, but the practical ones (if you had a hotel with an infinite number of rooms, what colour would the towels be?). For example, it looks at what instructions the instruction set would need to contain, and how language extensions to, for example, C, might be implemented to take advantage of the processor’s power. It examines the implications of such a system on cryptography, and proposes an alternative cryptographic system that this computer would be able to provide to make up for the fact that it’s existance will have broken all existing cryptographic systems except one-time pads.

It’s probably not interesting if you’re not some variety of geek, but I enjoyed it. The chap also wrote a great article on how be built a pair of dice that never roll a 7.