Coder's Guild Mailing List

Re: Star Wars random stuff

Posted by Rocket Scientist on 2001-06-15

> Date: Thu, 14 Jun 2001 14:52:16 -0400
> From: "justin adams" <munki_@xxxxxxx.xxx>
> Subject: Re: Re: Star Wars Random stuff
>
> im no mud programmer, but i just happend to glance at the code for
the
> percentage of chance thing.  and if you got a random number b/t 1-100
and
> you tested for GREATER THAN or equal to 63, wouldnt that be a 37%
chance?  i
> dont mean to correct anyone, im just making sure im thinking
correctly.
>
> -justin

Not quite.  If 63 AND 100 are possibilities, which they are, it turns
out to be
a 38% chance.  Easiest way to look at it is to imagine that we're
testing a
random number 1-100 for being >=1.  Obviously there is a 100% chance,
even
though 100 - 1 = 99.  So maybe I should have said to test for the
number being
just > 63.  That would be a 38/101 chance.  Best of all would be to
have the
random number be 1-99 instead of 1-100.  Then <=37 would have a 37%
chance.

Thanks for asking, I hadn't really thought about the math of it.

=====
--Aaron Jordan, head programmer of Tmud.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/