Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Friday, 9 January 2015

A d20 Dice Pool Table

This is just me noodling on something I was curious about - what would a d20 table for dice pool results look like?

Dice pools have some nice properties. Chief among them is the lack of swinginess - the number of successes (e.g. the number of d6 that turn up 4+) you roll tends to cluster in the middle, so the wildly extreme results don't come up quite so often.

In Burning Wheel, for example, you might be rolling four dice for your sword skill, with any that turn up 4+ counted as successes. Four dice could generate as much as 4 successes, but there's only a 1 in 16 chance of that - rolling 2 successes is more likely by far.

One of the things you can do with this is use the result as a measure of how awesome you did: the margin of success or failure is a number that's also not too swingy. Bad shit can happen, but it will be rarer than near misses.

If, however, you don't like the aesthetics of rolling 4D6 every time you swing your weapon, or you have a nostalgia-induced allergic reaction to attacking monsters without a d20 in your hand, you've been shut out of this particular statistical bliss. Until now! Aren't you lucky?  (At least, as long as you don't mind tables.)

# Dice
d20
1
2
3
4
5
6
7
8
9
10
1
0
0
0
0
0
1
1
1
2
2
2
0
0
0
1
1
1
2
2
2
3
3
0
0
0
1
1
2
2
2
3
3
4
0
0
1
1
1
2
2
3
3
4
5
0
0
1
1
2
2
3
3
3
4
6
0
1
1
1
2
2
3
3
4
4
7
0
1
1
2
2
2
3
3
4
4
8
0
1
1
2
2
3
3
4
4
5
9
0
1
1
2
2
3
3
4
4
5
10
0
1
1
2
2
3
3
4
4
5
11
1
1
2
2
3
3
4
4
5
5
12
1
1
2
2
3
3
4
4
5
5
13
1
1
2
2
3
3
4
4
5
5
14
1
1
2
2
3
4
4
5
5
6
15
1
1
2
3
3
4
4
5
5
6
16
1
2
2
3
3
4
4
5
6
6
17
1
2
2
3
4
4
5
5
6
6
18
1
2
3
3
4
4
5
6
6
7
19
1
2
3
3
4
5
5
6
7
7
20
1
2
3
4
5
5
6
7
7
8

This table converts d20 rolls into an appropriate number of successes on a dice pool from 1-10 dice. If you want to roll 5 dice, just grab your d20 and roll - 17?  4 successes.

To make this table, I worked out the probabilities for n successes for m dice, and then rounded to the nearest 5% (representing 1/20th of a d20 roll) to see how many times on the d20 n should show up. I hand-tweaked a couple of entries where the total wasn't 20.

One could use this as a basis for an opposed combat system - Fighters roll d20, treating their level as the # of dice, while monsters use their hit dice. For every point the winner wins by, they do their damage.  (So a 6th level fighter duels a 2HD orc, rolling 14 to the orc's 8. The fighter's result is 4, the orc's is 1, for a difference of 3. The fighter comes out unharmed, and the orc takes d8 x 3 hp damage from the fighter's sword.)

It could work similar for saving throws - a fire trap activates with a target of 4. Everyone rolls a reflexes save (maybe that's half-level for everyone but the thief), taking 5 points of damage for the margin of failure.

Or whatever. :)

Thursday, 21 March 2013

Finding Prime Numbers with Leaping Frogs


Imagine a pond that contains a long line of lily pads, each labelled with a number, starting with '2', '3', and so on.

A scary stork enters the pond, looking for frogs!  Each turn, the stork will move to a new lily pad, starting with lily pad 2.

When the stork reaches a lily pad, it looks for frogs:
  • If the lily pad has no frogs on it, the stork finds one in the water. Take a new frog token and write the lily pad's number on its back. Put it on the lily pad with the stork.
  • If the lily pad already has frogs on it, the stork won't look in the water, so this lily pad does not get a frog of its own.
The stork then shouts, "Boo!"  This scares the frogs, who jump away. All the frogs jump forward a number of lily pads equal to the number written on their backs.  Frog #2, for example, will make the first leap from lily pad #2 to lily pad #4, and then later to lily pad #6. (It's okay for frogs to share lily pads.)

Stop after however many turns you like.  When you're done, the numbered frogs represent all the prime numbers that you found (at least from numbers 2 to whatever lily pad you stopped at).

When a stork first reaches a lily pad, all the frogs there are the prime factors of that number.  For example, when the stork reaches lily pad #20, the stork will find frogs 2 and 5 there.  (20 = 2 x 2 x5.)  Lily pad 19, however, is empty when the stork arrives arrives: the newly minted frog 19 indicates that 19 is a prime number, and there are no other prime factors (other than 1).

To summarize:
  1. Move the stork forward one lily pad (on the first turn, place it on lily pad 2).
  2. If the lily pad has no frogs on it when the stork gets there, make a new frog with the lily pad's number.
  3. All the frogs on the stork's lily pad jump forward a number of pads equal to their number.