At 09:27 AM 8/13/02 -0700, Brian wrote: >I'm sorry, I just have to. :o) Has anyone considered making >normalized dice? > >The problem with truely random dice is that it can make certain games >boring. For instance: playing Risk, some of my friends and I have >discovered that we will occasionally get on streaks of really bad >rolling, where we should have little or no resistance to our force, >yet our 30 some armies get devastated by no more than 7 enemy armies. > >So, one of my friends, who is a computer scientist came up with the >idea to make dice that biased, not completely altered, but biased the >roll such that there was not equal probability of hitting any number >after the first roll. Instead there was a weighting towards numbers >which had been rolled less often. This is called "equidistribution" or "uniformity", which is commonly confused with "randomness", even by experts. What does "random" mean? It means that there is zero autocorrelation to high order, or the spectrum is near-"white". This does not require equidistribution. For example, the sequence {1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,...} is perfectly equidistributed, but not random. The term "uniform random numbers" should be used to indicated the presence of both attributes. >Anyway, making a random number to sort with is not too difficult. >It's the making a weighting system without to heavily or too lightly >biasing the dice that's the problem. Since this principle doesn't >conform to natural law, there is no predefined formula set that can >be used for this. > >So, does anyone see how to do this easily? This type of solution is called a quasi-random sequence. It's quite easy to do. A simple method is to just use the fractional part of k*sqrt(2), k=1,2,3,... Obviously this just translates into a multiplicative-congruential generator of a type. A better method for a PIC in assembler is to use a Hammersley sequence: For each k=1,2,3,... 1. Express k in binary (e.g., "6" = "1100"). (This is easy on a PIC!) 2. Reflect the number to give a binary fraction (e.g., for "6" -> "0011"). (This is also easy on a PIC). 3. Express the answer as a number x in [0,1]. 4. If you want a die roll from 1..6, use 6*x+1 as your value. Very simple, but it gives equidistribution to O(1/N) and has high apparent randomness (i.e., low autocorrelations). By the way, this sequence of numbers is superior for any purpose to any form of pseudorandom numbers. The equidistribution even on subsets is asymptotically guaranteed, it gives more accurate answers in estimation problems. It also has guaranteed low autocorrelations. ================================================================ Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com Least Cost Formulations, Ltd. URL: http://lcfltd.com/ 824 Timberlake Drive Tel: 757-467-0954 Virginia Beach, VA 23464-3239 Fax: 757-467-2947 "Vere scire est per causas scire" ================================================================ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body