in reply to Rolling DND Dice.

Laptops are subject to electrical attacks, such as "Magic Missile", so you wouldn't want to take one into battle. And blunt weaponry. And water. And sharp weaponry. And ogres. Ok, ok, laptops have something like Armor Class 20. What are you doing carrying one? That's mighty expensive toy there, you'd be much safer with an abacus.

Back on subject, yes, seriously this time. This is just a coincidence. Example to illustrate a point: It's sort of possible that a lottery number could be 1111111111111111, and that's no more likely than it being any other number. Yet if it was all 1's, someone not well versed in Probability might cry foul. If we used something other than base 10, you wouldn't even notice you had a strange average die roll :)

Really, I'd like to see you prove that number through statistics versus the Monte Carlo or Brute Force method. Much more interesting. Of course, being a lazy programmer with a lot of powerful hardware in front of me (who has pretty much forgetten all of his College Stat class), I'd go for the Monte Carlo or Brute Force method myself :)

Replies are listed 'Best First'.
Re: Rolling DND Dice.
by Abigail-II (Bishop) on Feb 03, 2004 at 15:02 UTC
    Everyone knows that ADnD dice are from a different universe and don't follow the law of probability. I, for instance, own a set of dice that just know when to waste the high rolls, and that roll low when you really don't want a low roll.

    I've had one character that probably has inflicted more damage to party members than to opponents (and not on purpose - my current character on the other hand....). Like the time my dwarf was 20 yards away from a fight between the thief in our party and a nearly dead nasty. So, the dwarf decides to shoot a cross-bolt. Right.... The attack roll (on a d20) was 1, fumble. Roll again, another 1. So I hit the thief. Roll again, this time a 20, so it's going to be a critical hit. Roll for damage: a 10 on a d10. Poor thief, she hadn't lost a single hp in the fight so far, but now she was on death's door step, with an arrow between her shoulder blades.

    But when I fight a lonely kobold, with 1 hp left and no armour, it's garanteed I'll roll a 20.

    Abigail

      Everyone knows that ADnD dice are from a different universe and don't follow the law of probability.
      I'd like to add other experimental evidences: for example, a d100 will tend to give < 5 values during a Rolemaster session, and > 95 values during a Call of Cthulhu session. The same dice. My understanding is that dice know what game you're playing, and its basic rules. They don't merely refuse to follow probability, they follow their evil plans against players :)
Re: Re: Rolling DND Dice.
by Anonymous Monk on Feb 03, 2004 at 16:48 UTC
    perl -MMath::BigFloat -le 'print scalar Math::BigFloat->new(15869)->br +ound(100)->bdiv(1296)' 12.2445987654320987654320987654320987654320987654320987654320987654320 +9876543209876543209876543209877
Monte Carlo Method.
by grendelkhan (Sexton) on Feb 04, 2004 at 03:11 UTC

    I actually used a Monte Carlo method as a first try, before enumerating all possibilities. I made the mistake of making it way too general, but it does in fact make the rolls.

    #!/usr/bin/perl -w use strict; srand; my $iters = $ARGV[0] ? $ARGV[0] : 10; my $sum = 0; my $numdice = 4; my $sides = 6; sub dice ($$) { my ($num,$sides) = @_; my @ret = (); my $min = $sides; for (1..$num) { my $roll = int(($sides)*rand)+1; $min = $roll < $min ? $roll : $min; push @ret, $roll; } # print "rolled [@ret]; min $min\n"; my $sum = 0; foreach (@ret) { $sum += $_ } return $sum - $min; } for (1..$iters) { $sum += dice($numdice,$sides); } # main loop print "average over $iters rolls is ".($sum/$iters)."\n";

    Yeah; that's just kinda pasted in from the quick-n-dirty scratchbox. It gives the right result, which was what I was interested in at the time. Someday my code will start to look nicer, but this will require time. Time, and friends asking me to do weird tasks using Perl.

    I wanted a precise answer, and the friend who asked me to do the computation asked me why I didn't just enumerate all 6**4 possible 4d6 rolls, and go from there. So I did.

Re: Re: Rolling DND Dice.
by mildside (Friar) on Feb 04, 2004 at 03:59 UTC
    This is just a coincidence
    Actually, it's not coincidence. Any fraction when converted to a decimal will become either a finite length or recurring decimal number. For example, 80/81 is 0.98765432098765432098765432... etc.

    I suspect that if you calculated the expected value the analytical way, you would end up with a fraction that was somehow related to 80/81.