Re: TIB: "Weighting" Dice on TI-85


[Prev][Next][Index][Thread]

Re: TIB: "Weighting" Dice on TI-85




Jeremy Mullins wrote:
> 
> I used a slightly modified version of that in my program to make a user
> defineable
> weight factor.  Thanks.  You have a place in my docs :).
> 
> >Try this formula:
> >:int(rand*sides-2)+int(rand*2+1)+1->die1

Errhh...Come again? Try reducing this, using simple algebra:

= int(rand*sides)+int(rand*2)-2+1+1
= int(rand*sides)+int(rand*2)
Try this with 6 sides
= {0,1,2,3,4,5} *join* {0,1}
Which yields:
P(0) = 1/12
P(1) = 2/12
P(2) = 2/12
P(3) = 2/12
P(4) = 2/12
P(5) = 2/12
P(6) = 1/12

Let's say you eliminate all zeros.
I see 6 coming up half as often as every other possibility...

> >it isn't as accurate as defining ranges, but this will weight the die in
> favor
> >of higher numbers.  I assume that the numbers start with 1, not 0.
> Depending
> >on how you store the die values, you could put this into a for loop for the
> >number of die.  I'm not sure what you want to do with them, so i'll just
> leave
> >it like this.
> > Paul Chase II

Tell me you wrote the wrong thing and that you actually didn't do it
like this, and Jeremy, tell me you didn't use it without checking... :-/

-- 
          Rene Kragh Pedersen
------------------------------------------------------------------
man: Why did you get a divorce?
man:: Too many arguments.


References: