1 / 4

Random Number Generation

Random Number Generation. Dates Setting up Random Dates is a simple process using the Date function. = Randbetween ( StartDate,EndDate ) Dates in a Range of Years

teigra
Télécharger la présentation

Random Number Generation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Random Number Generation • Dates • Setting up Random Dates is a simple process using the Date function. =Randbetween(StartDate,EndDate) Dates in a Range of Years =Randbetween(Date(2000,1,1),Date(2011,12,31)) Will give a list of Random dates between 1 Jan 2000 and 31 Dec 2011 Dates in a Month =Date(2010, 6, Randbetween(1,30)) Will give a list of Random dates between 1 June 2010 and 30 June 2010 Prepared by Sam Mosallaeipour

  2. Random Integers Return Integers between Start and Finish • =Randbetween(Start, Finish) • =Randbetween(50, 100) • Will return an Integer between 50 and 100 • Random Numbers =Rand() Will return a random number between 0 and 1 If you want to generate a uniform distribution you should use “=RAND ()*(b-a) +a” which produce a set of numbers between a And B with a uniform distribution. =Round(Rand()*100, 2) Will Return Numbers between 0 and 100 with 2 Decimal places Prepared by Sam Mosallaeipour

  3. Random Numbers Based on a Distribution =Norminv(Rand(), Mean, SD) Will return a random number between 0 and 1 based on a distribution of Average = Mean and Standard Deviation = SD =Norminv(Rand(), 50, 17) Will return a random number between 0 and 100 based on a distribution of Average = 50 and Standard Deviation = 17, • Random Numbers Fitting a Trend If your distribution has to match a trend add a Random component to the Trends equation eg; Y=mX+c = rand() * X + rand()*5 = rand() * A2 + rand()*5 Prepared by Sam Mosallaeipour

  4. Combination Text and Numbers The above techniques can be combined to make lists of Alpha Numeric Data Say your business has a fleet of vehicles (TR=Truck, VN=Van, CAR=Car) =Choose(Randbetween(1,3),”TR”,”VN”,”CAR”) & Text(Randbetween(1,15),”0#”) Will randomly choose 1 of “TR”,”VN”,”CAR” and add a random number between 1 and 15 to it format with a leading 0, eg: TR05 Prepared by Sam Mosallaeipour

More Related