View Single Post
  #2   Report Post  
bj
 
Posts: n/a
Default

I don't know why you would have problems with doing it by hand. there are
only 10 to the 36 cominations for 40 eight sided dies.

You can do combination probabilities, but hey get pretty complex,
to do similar things, I have calculated the loest probablity numbers and
done monte carlos to get the higher probability combos.


The lowest probability ones can be calculated fairly easily.
probability of 8 or 320 is 1/(8 raised to the (40))
probability of 9 or 319 is 40/(8 raised to the (40))
probability of 10 or 318 is (40+(40*39)/2)/(8 raised to the (40))
etc.

a monte carlo which would do what you want would be
sub montedie()
dim output(320) as interger
dim die as integer
dim tot as integer
dim nm as integer
for nm = 1 to 1000000
tot = 0
for die = 1 to 40
tot=tot+randbetween(1,8)
next die
output(tot)=output(tot)+1
next nm
for r = 1 to 320
cells(r,1)=r
cells(r,2)=output(r)
next nm
end sub

There are of course many ways to do this.


"Galamdring" wrote:


Greetings,

I have been trying to make a worksheet in excel 2003 to calculate
probabilities associated with dice throws... I am setting it up so that
i can define the number of dice i want to roll and also the number of
sides they have... I found that rand between is a good way to simulate
it...

My problem is with probabilities. Is there a function or a way to
automatically calculate the probability of having a result of x as the
sum of y dice with z sides each? The prob function requires you to have
an array with results and probabilities... It is too cumbersome to make
by hand for... say... 40 eight sided dice!

Thanks in advance :)


--
Galamdring
------------------------------------------------------------------------
Galamdring's Profile: http://www.excelforum.com/member.php...o&userid=25459
View this thread: http://www.excelforum.com/showthread...hreadid=389015