From owner-freebsd-current Mon Feb 17 3:48: 4 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C690B37B401; Mon, 17 Feb 2003 03:48:03 -0800 (PST) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 951AB43FBF; Mon, 17 Feb 2003 03:48:02 -0800 (PST) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.7/8.12.7) with ESMTP id h1HBm0EJ031148; Mon, 17 Feb 2003 14:48:00 +0300 (MSK) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.7/8.12.6/Submit) id h1HBlxKt031147; Mon, 17 Feb 2003 14:47:59 +0300 (MSK) (envelope-from ache) Date: Mon, 17 Feb 2003 14:47:59 +0300 From: "Andrey A. Chernov" To: Tim Robbins Cc: Kris Kennaway , current@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdlib rand.c Message-ID: <20030217114759.GA31054@nagual.pp.ru> References: <200302170352.h1H3qawJ062671@repoman.freebsd.org> <20030217045729.GA68471@rot13.obsecurity.org> <20030217164048.A28273@dilbert.robbins.dropbear.id.au> <20030217055309.GA28024@nagual.pp.ru> <20030217173955.A29826@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030217173955.A29826@dilbert.robbins.dropbear.id.au> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Feb 17, 2003 at 17:39:55 +1100, Tim Robbins wrote: > > variant (which generates bad quality ones), the only problem remains is > > first value monotonically increased with the seed. > > Here's an interesting picture of that: http://people.freebsd.org/~tjr/rand.gif > Nothing surprising here. It is common and know problem for all mod-type PRNGs. There is even good methods exists to eliminate this thing, see http://www.physik.uni-giessen.de:8081/PhysOfFinance/PoF09.pdf "Shuffling Algorithm" section for example. But all such methods will be incompatible with rand_r()... -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message