<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2655.35">
<TITLE>problem with random number generation?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2 FACE="Arial">Hi,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Please have a look at the following sample. The result</FONT>
<BR><FONT SIZE=2 FACE="Arial">isn't exactly what I've expected. There should be</FONT>
<BR><FONT SIZE=2 FACE="Arial">something wrong, but I can't see what it is. Your help</FONT>
<BR><FONT SIZE=2 FACE="Arial">would be appreciated.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Regards,</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Jürgen</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">% two-dimensional uniform distribution</FONT>
<BR><FONT SIZE=2 FACE="Arial">\documentclass{scrartcl}</FONT>
<BR><FONT SIZE=2 FACE="Arial">\usepackage{pst-all}</FONT>
<BR><FONT SIZE=2 FACE="Arial">\begin{document}</FONT>
<BR><FONT SIZE=2 FACE="Arial">\pstVerb{%</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp; rrand srand&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; % initializes the random generator</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp; /k 20 def</FONT>
<BR><FONT SIZE=2 FACE="Arial">}%</FONT>
<BR><FONT SIZE=2 FACE="Arial">\psset{unit=1mm}</FONT>
<BR><FONT SIZE=2 FACE="Arial">\begin{pspicture}(-20,-20)(20,20)</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp; \psframe(-20,-20)(20,20)</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp; \psplot[plotpoints=1000,showpoints=true,</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dotsize=1pt,linestyle=none]{0}{0}{%</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; rand 2147483647 div 0.5 sub 2 mul</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; k mul</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; exch</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; rand 2147483647 div 0.5 sub 2 mul</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; k mul</FONT>
<BR><FONT SIZE=2 FACE="Arial">&nbsp; }</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">\end{pspicture}</FONT>
<BR><FONT SIZE=2 FACE="Arial">\end{document}</FONT>
</P>
<BR>
<BR>
<BR>

<P><FONT SIZE=2 FACE="Arial">Mit freundlichen Grüßen</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Jürgen Göbel</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">OPE26</FONT>
</P>

</BODY>
</HTML>