Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!uvaarpa!vdoe386!tjhsst!jmitchel From: jmitchel@tjhsst.vak12ed.edu (John Mitchell) Newsgroups: comp.lang.pascal Subject: Random numbers Message-ID: <1991Mar7.193727.1629@tjhsst.vak12ed.edu> Date: 7 Mar 91 19:37:27 GMT Sender: jmitchel@tjhsst.vak12ed.edu (John Mitchell) Organization: Fairfax Area Schools Lines: 20 How does TP 5.5 generate random numbers? We are using this statement: r := random; which returns a real number in the range [0,1). Does TP use some kind of formula to generate these values? Or is there an internal list of random numbers that is accessed? Does "randomize" seed a formula or find a spot in the list to start from? My students are writing a program to approximate pi using the Monte Carlo method. Our problem is that we are experiencing a relatively wide range of answers for pi (+/- 0.2) which is not improved by running the program with more iterations. Thanks in advance for your help. == John Mitchell== P.S. Does TP generate random integers using the same method? P.P.S. Would anyone be able to send me a formula for generating good random numbers that might be substituted for the TP function call?