For example:<br><br>(require (lib &quot;27.ss&quot; &quot;srfi&quot;))<br><br>(define (random-test n)<br>&nbsp; (printf &quot;Random Test~n&quot;)<br>&nbsp; (do ((i 0 (+ i 1)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= i n) (void))<br>&nbsp;&nbsp;&nbsp; (printf &quot;~a~n&quot; (random-integer 2147483647))))
<br><br>(random-test 10)<br><br>Always gives (when run fresh):<br><br>Random Test<br>883280686<br>1747413071<br>1934990987<br>1651205883<br>1149373624<br>816936085<br>1019268308<br>797581408<br>1245017087<br>332329087<br>
<br>While,<br><br>(require (lib &quot;27.ss&quot; &quot;srfi&quot;))<br><br>(define (random-test n)<br>&nbsp; (printf &quot;Random Test~n&quot;)<br>&nbsp; (random-source-randomize! default-random-source)<br>&nbsp; (do ((i 0 (+ i 1)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= i n) (void))<br>&nbsp;&nbsp;&nbsp; (printf &quot;~a~n&quot; (random-integer 2147483647))))<br><br>(random-test 10)<br><br>gives different numbers, for example:<br><br>Random Test<br>1470382645<br>805875569<br>1100848099<br>2135863374
<br>1325475753<br>1919491546<br>1897091264<br>429945001<br>741596119<br>1171299075<br><br>Doug<br><br><div class="gmail_quote">On Jan 2, 2008 10:54 AM, Doug Williams &lt;<a href="mailto:m.douglas.williams@gmail.com">m.douglas.williams@gmail.com
</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Actually, SRFI 27 specifies repeatable random sources.&nbsp; You have to call random-source-randomize! to get different ones.&nbsp; And, there is a random-source-pseudo-randomize! procedure that gives you multiple, independent, repeatable random sources.&nbsp; There are also routines in the science collection to create vectors of independent random sources.
<br><font color="#888888"><br>Doug</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Jan 2, 2008 10:21 AM, Chongkai Zhu &lt;<a href="mailto:czhu@cs.utah.edu" target="_blank">czhu@cs.utah.edu</a>
&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Erich Rast wrote:<br>&gt; Hi,<br>&gt;<br>&gt; Sorry, I know this is a bit off-topic, but perhaps someone here has<br>&gt; already stumbled across the answer. I&#39;m looking for a good PRNG that<br>&gt; is portable, but it needs to be one that allows me to get exactly the
<br>&gt; same PRN sequence from the same seed.<br>&gt;<br>&gt; Can I use SRFI-27 for that purpose or does it only specify the<br>&gt; interface to possibly different PRNGs that might produce different<br>&gt; sequences?<br>

&gt;<br><br></div>SRFI-27 only specifies the interface to possibly different PRNGs that<br>might produce different sequences. But the reference implementation of<br>SRFI 27 is portable and allows you to get exactly the same PRN sequence
<br>from the same seed.<br><div><br>&gt; How about the built-in generator of MzScheme, might it change in<br>&gt; future or is it part of the specs that it won&#39;t change under the hood?<br>&gt;<br><br></div>
Matthew just changed the built-in generator of MzScheme, as a result of<br>a discussion here a few days ago. The SRFI 27 implementation in SVN<br>(v399) is build on top of the built-in generator, and produces the same<br>

sequence as the reference implementation of SRFI 27.<br><br>&gt; Best,<br>&gt;<br>&gt; Erich<br>&gt;<br><font color="#888888">Chongkai<br></font><div><div></div><div><br>_________________________________________________
<br> &nbsp;For list-related administrative tasks:<br> &nbsp;<a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme" target="_blank">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br></div></div></blockquote></div>
<br>
</div></div></blockquote></div><br>