From owner-freebsd-current Tue Feb 4 4: 7:35 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 B660537B401 for ; Tue, 4 Feb 2003 04:07:34 -0800 (PST) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E14843FA3 for ; Tue, 4 Feb 2003 04:07:33 -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.6/8.12.6) with ESMTP id h14C7Vd6091957; Tue, 4 Feb 2003 15:07:32 +0300 (MSK) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.6/8.12.6/Submit) id h14C7VBm091956; Tue, 4 Feb 2003 15:07:31 +0300 (MSK) (envelope-from ache) Date: Tue, 4 Feb 2003 15:07:30 +0300 From: "Andrey A. Chernov" To: Kris Kennaway , current@FreeBSD.ORG Subject: Re: rand() is broken Message-ID: <20030204120730.GA91888@nagual.pp.ru> References: <20030202070644.GA9987@rot13.obsecurity.org> <20030202090422.GA59750@nagual.pp.ru> <20030203002639.GB44914@HAL9000.homeunix.com> <20030203100002.GA73386@nagual.pp.ru> <20030204054020.GA2447@HAL9000.homeunix.com> <20030204094659.GA87303@nagual.pp.ru> <20030204115237.GA6483@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030204115237.GA6483@HAL9000.homeunix.com> 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 Tue, Feb 04, 2003 at 03:52:37 -0800, David Schultz wrote: > > You can do better than the present generator with 32 bits of state. > See the following page by Neal Wagner (not to be confused with David Wagner): > http://www.cs.utsa.edu/~wagner/laws/rng.html > The section on LCGs suggests that the multiplier FreeBSD uses (7^5) > is not particularly good, and points out some better values suggested > by Knuth. I can't find the original discussion in TAOCP vol. 2, but Thank for your pointer, I'll look at later. > Well, if 0 doesn't work, and 10 doesn't work, and 100 doesn't > work, then I'm not too hopeful about 2000. I appeal to Asimov's > zero, one, infinity law. I found that f.e. 50 is worse than 100, but 200 isn't better. 100 is better than 0 because remove monotonically increased sequence. -- 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