The Forge Forums Read-only Archives
The live Forge Forums
|
Articles
|
Reviews
Welcome,
Guest
. Please
login
or
register
.
March 05, 2014, 08:56:46 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forum changes:
Editing of posts has been turned off until further notice.
Search:
Advanced search
275647
Posts in
27717
Topics by
4283
Members Latest Member:
-
otto
Most online today:
56
- most online ever:
429
(November 03, 2007, 04:35:43 AM)
The Forge Archives
Archive
RPG Theory
Exploding dice: Help with calculating averages
Pages:
1
[
2
]
« previous
next »
Author
Topic: Exploding dice: Help with calculating averages (Read 1622 times)
jpegbert
Member
Posts: 8
Exploding dice: Help with calculating averages
«
Reply #15 on:
January 27, 2004, 08:16:55 PM »
My method for mapping 0 to 1 to a die roll was the following:
multiply the randomly generated number by 10^X where X = the number of digits on the die size (so for d4, d6 and d8, X=1 ; for d10 and d12 X=2). Then I integer divide the result by 1 to truncate the remaining decimal and add 1 to the result. Then I test to see if the resulting integer value is less than or equal to N, where N is the number of sides on the die. Can you see anything inherently wrong with this method that might give skewed results? My programming skills were always half-baked at best.
I'll try the histogram tomorrow. My results for the d10 and the d12 make me particularly suspicious of my results. Thanks for all of the time spent, Harlequin.
Logged
Harlequin
Member
Posts: 284
Exploding dice: Help with calculating averages
«
Reply #16 on:
January 27, 2004, 08:58:11 PM »
Hmm. Certainly I can suggest a better method. Throwing away all but the lowest 10% of the random number range, then looking for a truly random distribution within that bloc, does strike me as dubious. If there are any flaws in the randomizer, you'd be almost guaranteed to find them. :)
Try this, very simple, procedure rather than wasting your time on histograms:
A) Multiply random result by N, the die size.
B) Add 0.5 to the result.
C) Round off to the nearest integer.
If the program is handling floats properly and the random range is the normal one (includes zero, does not include one, does include 0.9999), then this should work.
You could also use
A) Multiply by N
B) Round up, to
next highest
integer
C) If zero, value becomes N
...but I find the first method to be simpler to code, in most cases. Darn that includes-zero random number standard. (Interesting to envision a d8 with that physical property... one in a million or so rolls, what would have been an eight becomes a zero. Puzzled gamer inspects die, finds the other seven sides correct. Rolls it again, the eight is back, for a million or so more rolls.)
Try that, and see if your results come closer to the algebraic solution.
- Eric
PS: No problem. My inner math geek likes to play. You can pay me back by making Ken Burnside happy and convincing someone to buy Attack Vector. I get no money, but happy Ken is fun to watch and I'd consider myself well thanked.
Logged
cthulahoops
Member
Posts: 45
Exploding dice: Help with calculating averages
«
Reply #17 on:
January 28, 2004, 02:25:53 AM »
Hi,
I thought it might be helpful to see if I can generate the algebraic results numerically. I can.
explode.c
produces the appropriate results.
Adam.
Logged
http://www.redbrick.dcu.ie/~cthulhu/
Jack Aidley
Member
Posts: 488
Exploding dice: Help with calculating averages
«
Reply #18 on:
January 28, 2004, 02:37:00 AM »
With most random number generators the high bits give a more random result than the low bits. The rand function in most languages is pretty poor anyway, so it will tend to produce bad results for stuff like this.
Harelquin's method above is the best to use if you must.
Logged
- Jack Aidley,
Great Ork Gods
, Iron Game Chef (Fantasy):
Chanter
Jack Aidley
Member
Posts: 488
Exploding dice: Help with calculating averages
«
Reply #19 on:
January 29, 2004, 07:44:59 AM »
Thinking about it, I think calculating the average of an exploding die is going to be singular useless. More useful is working out how likely you are to hit certain target numbers.
It turns out to pretty easy to figure your odds of hitting a given target number n:
Let x be the number sides on your dice.
Let d be the interger value of n/x (i.e 5 for n = 33 and x = 6)
Let r be the remainder of the above sum.
( ^ here means to the power of)
Then:
if r = 0 p(n) = 1/x^d
if r != 0 p(n) = (x - r + 1)/( x^(d+1) )
Hope those equasions aren't too unclear.
Logged
- Jack Aidley,
Great Ork Gods
, Iron Game Chef (Fantasy):
Chanter
Pages:
1
[
2
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Welcome to the Archives
-----------------------------
=> Welcome to the Archives
-----------------------------
General Forge Forums
-----------------------------
=> First Thoughts
=> Playtesting
=> Endeavor
=> Actual Play
=> Publishing
=> Connections
=> Conventions
=> Site Discussion
-----------------------------
Archive
-----------------------------
=> RPG Theory
=> GNS Model Discussion
=> Indie Game Design
-----------------------------
Independent Game Forums
-----------------------------
=> Adept Press
=> Arkenstone Publishing
=> Beyond the Wire Productions
=> Black and Green Games
=> Bully Pulpit Games
=> Dark Omen Games
=> Dog Eared Designs
=> Eric J. Boyd Designs
=> Errant Knight Games
=> Galileo Games
=> glyphpress
=> Green Fairy Games
=> Half Meme Press
=> Incarnadine Press
=> lumpley games
=> Muse of Fire Games
=> ndp design
=> Night Sky Games
=> one.seven design
=> Robert Bohl Games
=> Stone Baby Games
=> These Are Our Games
=> Twisted Confessions
=> Universalis
=> Wild Hunt Studios
-----------------------------
Inactive Forums
-----------------------------
=> My Life With Master Playtest
=> Adamant Entertainment
=> Bob Goat Press
=> Burning Wheel
=> Cartoon Action Hour
=> Chimera Creative
=> CRN Games
=> Destroy All Games
=> Evilhat Productions
=> HeroQuest
=> Key 20 Publishing
=> Memento-Mori Theatricks
=> Mystic Ages Online
=> Orbit
=> Scattershot
=> Seraphim Guard
=> Wicked Press
=> Review Discussion
=> XIG Games
=> SimplePhrase Press
=> The Riddle of Steel
=> Random Order Creations
=> Forge Birthday Forum