Boards to discuss Hârn, HârnWorld, HârnMaster, and RPGs in general.
Links - Home - Kelestia Productions - Columbia Games Inc
It is currently Thu May 23, 2013 12:29 am

All times are UTC + 10 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Aug 07, 2011 2:45 am 
Offline
Baron
Baron
User avatar

Joined: Thu Feb 21, 2002 10:20 am
Posts: 3114
Location: Gainesville, FL, USA
I have a little utility program I'd like to share with anyone who is interested. AFAIK it is unique in the world. I'm still looking for anyone/anything that can compute what this does so I'm just sharing the utility not the process.

Normally to calculate the probability of rolling a specific number sum on a number of dice you have to run a loop including every posibility and track the results. The problem is that every addtional die increases the computation time by a factor of the number of sides on the die. After about 20d6 even the fastest computers can't calculate the numbers in a useful time:
Attachment:
dicetest.jpg


This little utility can do upto about 100d6:

http://bellsouthpwp.net/g/a/garyashburn ... ceprob.exe


If anyone knows of any math texts / programs / whatever that can compute these numbers I'm interested in finding that information.

Either way this utility may be fun for math geeks. Enjoy.


You do not have the required permissions to view the files attached to this post.

_________________
Member of the CoE (Council of Elitists)


Top
 Profile  
 
PostPosted: Sun Aug 07, 2011 3:03 am 
Offline
Baron
Baron
User avatar

Joined: Thu Feb 21, 2002 10:20 am
Posts: 3114
Location: Gainesville, FL, USA
Output of the well known 3d6 for reference on reading the output:

Code:
C:\Users\Gary>diceprob

Number of dice: 3
Type of die:    6

Chance of totaling:
     N  on D -- S  sided dice is:       equals:
   3   3   6   1   /   216   =   0.00462963   1   /   216   =   0.00462963
   4   3   6   3   /   216   =   0.0138889   4   /   216   =   0.0185185
   5   3   6   6   /   216   =   0.0277778   10   /   216   =   0.0462963
   6   3   6   10   /   216   =   0.0462963   20   /   216   =   0.0925926
   7   3   6   15   /   216   =   0.0694444   35   /   216   =   0.162037
   8   3   6   21   /   216   =   0.0972222   56   /   216   =   0.259259
   9   3   6   25   /   216   =   0.115741   81   /   216   =   0.375
   10   3   6   27   /   216   =   0.125   108   /   216   =   0.5
   11   3   6   27   /   216   =   0.125   135   /   216   =   0.625
   12   3   6   25   /   216   =   0.115741   160   /   216   =   0.740741
   13   3   6   21   /   216   =   0.0972222   181   /   216   =   0.837963
   14   3   6   15   /   216   =   0.0694444   196   /   216   =   0.907407
   15   3   6   10   /   216   =   0.0462963   206   /   216   =   0.953704
   16   3   6   6   /   216   =   0.0277778   212   /   216   =   0.981481
   17   3   6   3   /   216   =   0.0138889   215   /   216   =   0.99537
   18   3   6   1   /   216   =   0.00462963   216   /   216   =   1

Completed in: 0 seconds


In English:
Chance of rolling a "3" on 3d6 is 1/216 = 0.00462963 Chance of rolling 3 or lower totals 1/216 = 0.00462963

(each column is tab separated so the output pastes into a spreadsheet program)


When I first built the program 20 years ago the timer tracking "completed in: 0 seconds" computers were slow enough it actually had meaning. Now even 100d6 or 50d50 or whatever is completed in less than a clock tick. (Which is a lot faster than any 50 billion+ years crunching the numbers would take.)

_________________
Member of the CoE (Council of Elitists)


Top
 Profile  
 
PostPosted: Sun Aug 07, 2011 5:07 am 
Offline
Woodward
Woodward

Joined: Thu Mar 24, 2005 7:43 am
Posts: 142
http://en.wikipedia.org/wiki/Dice#Probability


Top
 Profile  
 
PostPosted: Sun Aug 07, 2011 7:52 am 
Offline
Baron
Baron
User avatar

Joined: Thu Feb 21, 2002 10:20 am
Posts: 3114
Location: Gainesville, FL, USA
Irisi Flimsi wrote:
http://en.wikipedia.org/wiki/Dice#Probability
Equivalently, the probability can be calculated using combinations

Yep that looks like it.
Thanks!

_________________
Member of the CoE (Council of Elitists)


Top
 Profile  
 
PostPosted: Tue Sep 20, 2011 9:18 pm 
Offline
Cottar
Cottar
User avatar

Joined: Tue Sep 20, 2011 8:52 pm
Posts: 6
Location: Surrey, BC, Canada
I can go on for a while and show you all the math involved as to the probality factors for dice, but I won't. Instead I post some code for all of you if you are interested in putting some dice rolling in your Excel sheet (or any other app that uses VB).

__________________________________________________________________________


Public Function RollDice(Sides As Integer, _
Optional Quantity As Integer = 1, _
Optional BestOf As Integer = 0) As Integer

Dim DieNumber As Integer, Die() As Integer, PipValue As Integer
Dim RollValue As Integer, BestOfCounter As Integer

Randomize

If CLng(Quantity) * CLng(Sides) > 15000 Then Exit Function
ReDim Die(Quantity) As Integer

For DieNumber = 1 To Quantity
Die(DieNumber) = Int(Rnd() * Sides + 1)
Next DieNumber

BestOfCounter = 0: RollValue = 0

If BestOf <= 0 Or Quantity <= BestOf Then
For DieNumber = 1 To Quantity
RollValue = RollValue + Die(DieNumber)
Next DieNumber
RollDice = RollValue
Exit Function
End If

Do
For PipValue = Sides To 1 Step -1
For DieNumber = 1 To Quantity
If Die(DieNumber) = PipValue Then
BestOfCounter = BestOfCounter + 1
RollValue = RollValue + PipValue
If BestOfCounter = BestOf Then Exit Do
End If
Next DieNumber
Next PipValue
Loop

RollDice = RollValue
End Function

__________________________________________________________________________
This can generate any size of die up to 15,000 sides and roll as many as 15,000 of them. The limites are Die Sides X Dice Count = 15,000 maximum.

But I usually do combos like

3d6 =RollDice(6,3) << Mathematical average of 10.5
5d6 Best 3 =RollDice(6,5,3) << Mathematical average of 13
d20+4 =RollDice(20) + 4
d100 =RollDice(100)
50+3d6 =50 + RollDice(6,3)


Top
 Profile  
 
PostPosted: Wed May 09, 2012 10:23 am 
Offline
Woodward
Woodward
User avatar

Joined: Fri Apr 09, 2004 3:10 pm
Posts: 108
Location: Sudbury, Ontario, Canada
Feanor wrote:
I have a little utility program I'd like to share with anyone who is interested. AFAIK it is unique in the world. I'm still looking for anyone/anything that can compute what this does so I'm just sharing the utility not the process.


Though I have not used it myself, there is a program called Troll (http://www.diku.dk/hjemmesider/ansatte/torbenm/Troll/) that is pretty powerful for most gaming needs, by allowing you to randomly generate results, or show the distribution probabilities.

To use an example, for a typical D&D attribute generation I've used it can do the sum of 3 largest dice from a 4d6 roll, while re-rolling 1's.

Over the years of being on the rpg-create yahoogroup a fair number of people have come asking how to work out the probabilities for a variety of dice mechanics. The creator of troll is on the list, and up to this point I haven't seen Troll not able to handle anything that was thrown at it, but I don't think most people would need to figure out the probabilities of something like 50d6.

I found an interesting example in the manual. If you enter into the program:
"Str |>Dex|>Con|>Int|>Wis|>Chr" || 6’sum largest 3 4d6

It'll output:
Str 18
Dex 8
Con 6
Int 15
Wis 16
Chr 11

The program requires Moscow ML (instructions are in the zip), and it can be installed on Unix/Linux or Windows/DOS. It uses the command line interface for it's input.

There is a web/html version, but doesn't seem to be accessible from the site at the moment.


Top
 Profile  
 
PostPosted: Wed May 09, 2012 12:23 pm 
Offline
Baron
Baron
User avatar

Joined: Thu Feb 21, 2002 10:20 am
Posts: 3114
Location: Gainesville, FL, USA
I had the need to figure out the "Vampire the Masquerade" dice system - which I eventually converted partly to a partial d% roll for simplicity and better consistancy.

The system had a difficulty X roll a dice pool of N d10 and count all the dice greater or equal to the difficulty X BUT subtract 1 for every 1 rolled. :roll:

I couldn't use any straitforward mathematics to get the peices and calculating every posibility difficuty 1 thru for 1d10 to 10d10 is too time consuming.

I had to use a sampling to produce. Produce enough random samples and the odds become clear even if they aren't exact or can't be calculated:


You do not have the required permissions to view the files attached to this post.

_________________
Member of the CoE (Council of Elitists)


Top
 Profile  
 
PostPosted: Wed May 09, 2012 3:49 pm 
Offline
Baron
Baron
User avatar

Joined: Thu Feb 21, 2002 10:20 am
Posts: 3114
Location: Gainesville, FL, USA
Feanor wrote:
The system had a difficulty X roll a dice pool of N d10 and count all the dice greater or equal to the difficulty X BUT subtract 1 for every 1 rolled. :roll:

Also if the skill was equal or greater then the difficulty the result was supposed to be an automatic success.

Combining the results and the thumb rules I converted the Vampire dice system to a strait d% with skill=difficulty=>100 EML and -10 EML for every skill level less.

Rather than sum up the -1's to to get results totaling less than 0 to determine "dramatic failures" I made it into the Harninc max EML is 95 and failures ening in 5 or 0 resulting CF (dramatic failure).

The result was immediately familiar to Harnmaster players, was a lot faster and easier than the Vampire system and produced similar results.

In the Vampire system rolling Damage or Effect though was often done separately from the initial roll: first roll dex+melee of 7d10 vs difficulty X and add it up >0 to determine if a success and then if successful roll str+melee of 8d10 vs difficulty of 6 to get damage. Instead the Success was a HarnMaster like d% roll and then the damage was rolled as in Vampire.

Although rolling Nd10 and adding together number of dice greater than X can be a bit bulky to determine Effect/Damage it does produce some beautiful probability distributions. With difficulty 6 (the default) it produces a binary distribution bell curve like flipping a number of coins and counting heads (not unlike rolling 3d6 or whatever). But altering the difficulty higher or lower than the 50/50 coin flipping situation shifts the bellcurve in ways rolling dice and adding would have difficulty reproducing.

Attachment:
Difficulty vs Effect example.jpg


In some ways what Harn Master achieves thru multiple success levels and xd6+weapon impact this other system accomplishes thru altering the bell curve. Imagine overlapping and combining the 1d6,2d6,3d6&4d6 impact dice as a rough bellcurve weighted to the low end - shaped similar to the difficulty 9 damage curve above for 10 dice (.1 near 0, peaks at 2, slopes slowly to 0 at 6).


(If you haven't guessed from the above our Harn Group is currently playing a round of 1992 AD Vampire.)


Anyway, even if you can't calculate it directly repetitive testing and a sufficient sample size can often produce an accurate model/estimation. We were actually using similar techniques a lot in my advanced engineering math courses in college - though obviously if you build a bad model with wrong assumptions you get results that have no bearing on reality (for example the numerous global warming model predictions).


You do not have the required permissions to view the files attached to this post.

_________________
Member of the CoE (Council of Elitists)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 10 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group