From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.lisp.guile.user Subject: Re: Generating "independent" random numbers Date: Tue, 3 Oct 2023 18:04:45 +0200 Message-ID: References: <3e30da69-f5bd-44ed-b4f1-bd084c06e415@posteo.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+SbSlfwZbg1U6GNr" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1038"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user@gnu.org To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Oct 03 18:05:33 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qnhts-000ARs-DU for guile-user@m.gmane-mx.org; Tue, 03 Oct 2023 18:05:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnhtH-0002qn-Ke; Tue, 03 Oct 2023 12:04:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnhtE-0002ok-CP for guile-user@gnu.org; Tue, 03 Oct 2023 12:04:53 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnhtB-0007sp-MH for guile-user@gnu.org; Tue, 03 Oct 2023 12:04:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=GPfJuMLErh7SJuDFEH36XX7tn3epa/d2haQkvMoKvds=; b=tUO1kGP6/6bXbVaHIxkPz1tKVx PTcfikEHvn5cYMpu8IRm65QsLxkw5+69D/ahqmyzhEpwYvHMX4TU2biuFTzauyKwPtecYrkUlhrLO DhQpfW9e/IRhuuuHAkfiAt4jI7LGeLISi7s5p1aEwIt7toD1i58/Fez0WIkql0D/dCfEFmp8a9idm DDTBesKMjsTicJpfr1WH9DcaRosgFF7Pg8xB95mMNEEsK2mNRPnBR/+pxgLzPzF1L/U8rz9I64y/J NU/hZzGM0Pe0HCmYKqMuyu7iiB8LXM2F4wTMIYa0ER+lo7SNE7p3KcHth7rebq3Zd8C9OsgVcq86z 70E65yeA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1qnht7-0001j1-7w; Tue, 03 Oct 2023 18:04:45 +0200 Content-Disposition: inline In-Reply-To: <3e30da69-f5bd-44ed-b4f1-bd084c06e415@posteo.de> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19214 Archived-At: --+SbSlfwZbg1U6GNr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 03, 2023 at 03:08:03PM +0000, Zelphir Kaltstahl wrote: > Hello Guile Users, >=20 > today I want to verify some understanding I have about generating random > numbers using Guile. [...] > Some time ago, I wanted to generate uniformly distributed floats though. Wait a minute: you want uniformly distributed floats (in an interval, I assume)? > There seems to be no facility in Guile to do that. So I took a look at > Wikipedia: > https://en.wikipedia.org/wiki/Normal_distribution#Computational_methods: >=20 > > An easy-to-program approximate approach that relies on the central limit > theorem is as follows [...] What you get here is (an approximation to) a *normal* distribution, which is something totally different (you actually use N (=3D=3D 12 in your examp= le) *uniform* distributions to build that) [...] > Aha! They need to be "independent" too! Not only uniformly distributed! > Might be my code would be working wrong, if I do not pay attention to > statistical traps. If your random number generator is "good enough", consequent values are expected (heh) to be (statistically [1]) independent. So I wouldn't bother too much about it. On the contrary -- perhaps this mode is better tested than using twelve "parallel" PRNGs as you plan. Cheers [1] Yeah, deep philosophical rabbit holes everywhere. I mean it in some robust, practical way. --=20 t --+SbSlfwZbg1U6GNr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZRw7lQAKCRAFyCz1etHa RhFDAJ0TcgIoQTPCR33tElENlp+Q+ABlDQCeJHUbeMgjXObGCqUogi6AquVWVgo= =jkRZ -----END PGP SIGNATURE----- --+SbSlfwZbg1U6GNr--