[QUIZ] Dice Roller (#61)

Man, *and* I flipped the sign on that -4. *shakes head sadly*

One more shot.

Min: (5*1-4)*(1)+3 = 1*1+3 = 4
Max: (5*5-4)*(16/4)+3 = 21*4+3 = 87

···

On Jan 7, 2006, at 9:55 AM, Gavin Kistner wrote:

On Jan 7, 2006, at 5:03 AM, Christian Neukirchen wrote:

"Matthew D Moss" <matthew.moss.coder@gmail.com> writes:

Parse tree for: (5d5-4)d(16/d4)+3

So what are the maximum and minimum values of this?

Max: (5*5+4)*(16/4)+3 = 29*4+3 = 119

I'm agree with you on that top line, but I'm not sure how you got to the second line from there.
I think you meant:

([1,21])d([1,4])+3 = ...

which results in:

[1,84]+3
[4,87]

···

On Jan 7, 2006, at 9:58 AM, Reinder Verlinde wrote:

([1,21])d(16/[1,4])+3 = (c/[x,y] = [c/y,c/x] if x and y > 0)

([1,21])d([4,16])+3 = ([a,b]d[c,d] = [a*c,b*d] if a,b,c, and d > 0)

As pointed out by others, the result should actually by [4,339]. The
error above is in the second to last step. [a,b]d[c,d] != [a*c,b*d],
it should be [a,b]d[c,d] = [a,b*d]. The minimum effective value on a
die roll is always one, regardless of the number of sides (ie. whether
using a c-sided die or d-sided die). The minimum number of rolls being
a, the minimum roll total would then be a*1 = a. So we have:

  [1,21]d[4,16]+3 =
  [1,21*16]+3 =
  [1+3,336+3] =
  [4,339]

Jacob Fugal

···

On 1/7/06, Reinder Verlinde <reinder@verlinde.invalid> wrote:

Notation: [x,y] is any distribution with minimum x and maximum y. I then
get:

(5d5-4)d(16/d4)+3 = (adb = [a,a*b], so 5d5 = [5,25])

([5,25]-4)d(16/d4)+3 = ([x,y] - c = [x-c,y-c])

([1,21])d(16/d4)+3 = (adb = [a,a*b], so d4 = 1d4 = [1,4])

([1,21])d(16/[1,4])+3 = (c/[x,y] = [c/y,c/x] if x and y > 0)

([1,21])d([4,16])+3 = ([a,b]d[c,d] = [a*c,b*d] if a,b,c, and d > 0)

[4,336]+3 = ([x,y] + c = [x+c,y+c])

[7,339]

Ah, yeah, you're right. It's been too long.

Actually, I believe 3rd Edition and up did away with the extra percentile roll altogether.

James Edward Gray II

···

On Jan 6, 2006, at 2:29 PM, Austin Ziegler wrote:

On 06/01/06, James Edward Gray II <james@grayproductions.net> wrote:

On Jan 6, 2006, at 2:21 PM, J. Ryan Sobol wrote:

I guess that must be a D&D inside half-joke because I'm totally
confused.

18 was the best stat a starting character could have. If you got
one, they let you roll d% and put it after the slash (the higher the
better). 00 == 100. So characters with 18/00 had some damn lucky
die rolls. :slight_smile:

In most versions of D&D/AD&D, this was also limited to Strength attributes only.

This may have changed recently. :wink:

No wonder I don't play D&D. I don't think I am smart enough.

What does 0 -> 10 mean. Does it mean a dice can have the
values 0,1,2,3...10?

If so, why is a 0 never possible?

And why does d10 have 0 -> 10 while a d6 has 1 -> 6?

Jim

···

On Jan 6, 2006, at 6:17 PM, Jacob Fugal wrote:

On 1/6/06, James Edward Gray II <james@grayproductions.net> wrote:

On Jan 6, 2006, at 5:35 PM, Jim Freeze wrote:

What do you need to roll to get a 0 and 100?

A zero on the tens dice is 10. On the one's dice, it's zero. 00 is
100.

Clarification: presented in short, long and practical. :slight_smile:

Short clarification:

Actually, when rolled together, both dice are zero-based. The
double-nought is the only special combination of 00 -> 100. When
rolled singly, a d10 has 0 -> 10. Rolling a 0 is never possible.

Egad, I have been extra dumb today, haven't I? I'm very sorry to keep leading everyone astray. Jacob has it right here, not me.

James Edward Gray II

···

On Jan 6, 2006, at 6:17 PM, Jacob Fugal wrote:

On 1/6/06, James Edward Gray II <james@grayproductions.net> wrote:

On Jan 6, 2006, at 5:35 PM, Jim Freeze wrote:

What do you need to roll to get a 0 and 100?

A zero on the tens dice is 10. On the one's dice, it's zero. 00 is
100.

Clarification: presented in short, long and practical. :slight_smile:

Short clarification:

Actually, when rolled together, both dice are zero-based. The
double-nought is the only special combination of 00 -> 100. When
rolled singly, a d10 has 0 -> 10. Rolling a 0 is never possible.

Wimps! REAL gamers roll 100 sided dice (aka Zoccihedron)

-- Matt
Nothing great was ever accomplished without _passion_

···

On Sat, 7 Jan 2006, Pierre Barbier de Reuille wrote:

Not in that case ! Very simple : you have 100 possible values, ranging
from 1 to 100 ... each value correspond to a single dice configuration
(it you rool 2 and 5 you get 25 and you have no other way to get 25).
Thus the probability of each value is 1/100 ... and all values are
equiprobable !

Gavin Kistner <gavin@refinery.com> writes:

···

On Jan 7, 2006, at 9:55 AM, Gavin Kistner wrote:

On Jan 7, 2006, at 5:03 AM, Christian Neukirchen wrote:

"Matthew D Moss" <matthew.moss.coder@gmail.com> writes:

Parse tree for: (5d5-4)d(16/d4)+3

So what are the maximum and minimum values of this?

Max: (5*5+4)*(16/4)+3 = 29*4+3 = 119

Man, *and* I flipped the sign on that -4. *shakes head sadly*

One more shot.

Min: (5*1-4)*(1)+3 = 1*1+3 = 4
Max: (5*5-4)*(16/4)+3 = 21*4+3 = 87

I claim 4 and 339.

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

Min: (5*1-4)*(1)+3 = 1*1+3 = 4
Max: (5*5-4)*(16/4)+3 = 21*4+3 = 87

For max, should be (16/1) not (16/4), no?

···

From: "Gavin Kistner" <gavin@refinery.com>

Gavin Kistner wrote:

([1,21])d(16/[1,4])+3 = (c/[x,y] = [c/y,c/x] if x and y > 0)

([1,21])d([4,16])+3 = ([a,b]d[c,d] = [a*c,b*d] if a,b,c, and d
> 0)

I'm agree with you on that top line, but I'm not sure how you got to
the second line from there.
I think you meant:

([1,21])d([1,4])+3 = ...

which results in:

[1,84]+3
[4,87]

d(16/[1,4]) must be [16/4,16/1] => [4,16]

[1,21] d [4,16] must be [1*4, 16*21] => [4, 336]

I would like to introduce distribution. Using one normal dice we have an
even distribution
  distr("d6") = [0,1,1,1,1,1,1] Sum=6

Using two normal dices we have the following distribution
  distr("2d6")=[0,0,1,2,3,4,5,6,5,4,3,2,1] Sum=36 (min:max) =
(2:12)

P("2d6",12) = 1/36 = 2.8%

I have a question regarding the distribution for "(d2)d6".
In words, I'm first throwing a coin, to decide how many times I will
throw a the dice.

[1,2] d [1,2,3,4,5,6]

My guess:

  distr("d6") = [0,1,1,1,1,1,1] Sum=6
  distr("2d6") = [0,0,1,2,3,4,5,6,5,4,3,2,1] Sum=36

Probability merge
distr("d6") [0,6,6,6,6, 6, 6] Sum=36
distr("2d6") [0,0,1,2,3, 4, 5,6,5,4,3,2,1] Sum=36

distr("(d2)d6") [0,6,7,8,9,10,11,6,5,4,3,2,1] Sum=72

The probability of having one point is P("(d2)d6",1) = 6/72 = 8.3%

Can somebody agree or disagree on this?

Christer

···

On Jan 7, 2006, at 9:58 AM, Reinder Verlinde wrote:

--
Posted via http://www.ruby-forum.com/\.

d10 has size 0..9, generally because of size (the print on them is
typically only large enough to have one decimal digit). 0 is rarely a
useful number in gaming, so it is treated as a 10 result. Therefore
rand(10) + 1 is sufficient to represent d10. When used as d100, you'll
get the values 00 .. 99, but again, 00 is not a useful value so it is
treated as 100. So rand(100) + 1 is sufficient to represent d100.

-austin

···

On 06/01/06, Jim Freeze <jim@freeze.org> wrote:

No wonder I don't play D&D. I don't think I am smart enough.

What does 0 -> 10 mean. Does it mean a dice can have the
values 0,1,2,3...10?

If so, why is a 0 never possible?

And why does d10 have 0 -> 10 while a d6 has 1 -> 6?

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

What do you need to roll to get a 0 and 100?

A zero on the tens dice is 10. On the one's dice, it's zero. 00 is
100.

Clarification: presented in short, long and practical. :slight_smile:

Short clarification:

Actually, when rolled together, both dice are zero-based. The
double-nought is the only special combination of 00 -> 100. When
rolled singly, a d10 has 0 -> 10. Rolling a 0 is never possible.

No wonder I don't play D&D. I don't think I am smart enough.

It's really my fault. I keep leading you astray.

What does 0 -> 10 mean. Does it mean a dice can have the
values 0,1,2,3...10?

On a ten sided die are printed the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. I have no idea why it's zero based. In most rolls for most games though, 0 is considered 10.

1d10 will be a number between 1 and 10 for this quiz.

When two tens are rolled together for d100, the first is taken as the tens digit (0-9) and the second as the ones digit (0-9). The special case is that 00 is considered 100.

Honestly though, I won't think less of you if you generate a random number between 1 and 100. :slight_smile:

James Edward Gray II

···

On Jan 6, 2006, at 6:35 PM, Jim Freeze wrote:

On Jan 6, 2006, at 6:17 PM, Jacob Fugal wrote:

On 1/6/06, James Edward Gray II <james@grayproductions.net> wrote:

On Jan 6, 2006, at 5:35 PM, Jim Freeze wrote:

If so, why is a 0 never possible?
And why does d10 have 0 -> 10 while a d6 has 1 -> 6?

For the purposes of this quiz, I propose that dice are 1-based. Which
means a d6 has six sides numbered 1, 2, 3, 4, 5 and 6 (ie, 1->6). A
d10 should be 1->10, not 0->10.

There is a bunch of discussion above talking about d10 variants, but
for simplicity, a N-sided die generates values from 1 to N inclusive.
That is, rand(N)+1.

You're all too damned smart. :slight_smile:

Brilliant!

···

On Jan 7, 2006, at 11:36 AM, Bill Kelly wrote:

From: "Gavin Kistner" <gavin@refinery.com>

Min: (5*1-4)*(1)+3 = 1*1+3 = 4
Max: (5*5-4)*(16/4)+3 = 21*4+3 = 87

For max, should be (16/1) not (16/4), no?

Both (4, 87) and (4, 339) are correct depending on your definition of 'max'. You get the former if you assume maximum rolls for each die, and the latter if you want the maximum possible result of the expression.

In any case, the extremal results aren't particularly useful from a testing point of view, as different distributions can have the same extremal points, and you could potentially erroneously pass an incorrect case. For example: 2d2d6

left-associative:
(2d2)d6 -> 4d6 -> 24 max

right-associative (oops!):
2d(2d6) -> 2d12 -> 24 max

But the distributions are different in each case (the latter result could include 2 and 3, for instance).

matthew smillie.

···

On Jan 7, 2006, at 18:32, Christian Neukirchen wrote:

Gavin Kistner <gavin@refinery.com> writes:

On Jan 7, 2006, at 9:55 AM, Gavin Kistner wrote:

On Jan 7, 2006, at 5:03 AM, Christian Neukirchen wrote:

"Matthew D Moss" <matthew.moss.coder@gmail.com> writes:

Parse tree for: (5d5-4)d(16/d4)+3

So what are the maximum and minimum values of this?

Max: (5*5+4)*(16/4)+3 = 29*4+3 = 119

Man, *and* I flipped the sign on that -4. *shakes head sadly*

One more shot.

Min: (5*1-4)*(1)+3 = 1*1+3 = 4
Max: (5*5-4)*(16/4)+3 = 21*4+3 = 87

I claim 4 and 339.

Off the top of my head, that seems right.

···

On 1/7/06, Christer Nilsson <janchrister.nilsson@gmail.com> wrote:

I have a question regarding the distribution for "(d2)d6".
In words, I'm first throwing a coin, to decide how many times I will
throw a the dice.

[1,2] d [1,2,3,4,5,6]

My guess:

  distr("d6") = [0,1,1,1,1,1,1] Sum=6
  distr("2d6") = [0,0,1,2,3,4,5,6,5,4,3,2,1] Sum=36

Probability merge
distr("d6") [0,6,6,6,6, 6, 6] Sum=36
distr("2d6") [0,0,1,2,3, 4, 5,6,5,4,3,2,1] Sum=36

distr("(d2)d6") [0,6,7,8,9,10,11,6,5,4,3,2,1] Sum=72

The probability of having one point is P("(d2)d6",1) = 6/72 = 8.3%

Can somebody agree or disagree on this?

> Actually, when rolled together, both dice are zero-based. The
> double-nought is the only special combination of 00 -> 100. When
> rolled singly, a d10 has 0 -> 10. Rolling a 0 is never possible.

No wonder I don't play D&D. I don't think I am smart enough.

Heh, I wouldn't say that. But I will admit that most of my attraction
to the game is the mental challenge of managing (and taking advantage
of) the complex rule system. Call me munchkin. Shrug.

What does 0 -> 10 mean. Does it mean a dice can have the
values 0,1,2,3...10?

No, that was a typo on my part. Should have been 0 -> 9 (e.g. rand(10)).

If so, why is a 0 never possible?

Zero is possible, but is interpreted as a 10. So the effective range
is 1 -> 19 (rand(10) + 1). In this respect, the outcome of a d10
follows the same rules of the outcome from a d6, d8 or d20 (rand(N) +
1). The presentation on the dice is the only difference. As noted by
Austin, this is primarily due to space limitations, but also for
convenience when using two d10 to simulate a d100.

Jacob Fugal

···

On 1/6/06, Jim Freeze <jim@freeze.org> wrote:

> On 1/6/06, James Edward Gray II <james@grayproductions.net> wrote:

[snip involved dice discussion]

Honestly though, I won't think less of you if you generate a random number between 1 and 100. :slight_smile:

Phew :smiley:

···

On Sat, 07 Jan 2006 01:44:26 -0000, James Edward Gray II <james@grayproductions.net> wrote:

--
Ross Bamford - rosco@roscopeco.remove.co.uk

Thank you all for pitching in your explanation of dice rollers to non-D&D players like my self. However, there's a considerable amount of noise for this post (already) and I'm not 100% confident I could parse the dice syntax in English let alone ruby. Would it be possible to summarize this discussion and post it as an addendum at http://www.rubyquiz.com/quiz61.html ?

~ ryan ~

Ok, I must fix this previous apology to Jim Freeze. 0 -> 10 was *not*
a typo. He just misinterpreted my notation. And seeing as I followed
his misinterpretation before second glance, it's perfectly justified.
In the paragraph above the -> represented "is interpreted as". So when
rolling two ten sided dice for a d100, double-nought ('00') is
interpreted as 100. When rolling a single d10, 0 is interpreted as 10.

Jacob Fugal

···

On 1/6/06, Jacob Fugal <lukfugl@gmail.com> wrote:

Actually, when rolled together, both dice are zero-based. The
double-nought is the only special combination of 00 -> 100. When
rolled singly, a d10 has 0 -> 10. Rolling a 0 is never possible.

On 1/6/06, Jim Freeze <jim@freeze.org> wrote:

What does 0 -> 10 mean. Does it mean a dice can have the
values 0,1,2,3...10?

On 1/9/06, Jacob Fugal <lukfugl@gmail.com> wrote:

No, that was a typo on my part. Should have been 0 -> 9 (e.g. rand(10)).