Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43248 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4342 invoked from network); 4 Mar 2009 13:50:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Mar 2009 13:50:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=kkooporation@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kkooporation@googlemail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.198.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kkooporation@googlemail.com X-Host-Fingerprint: 209.85.198.227 rv-out-0506.google.com Received: from [209.85.198.227] ([209.85.198.227:22521] helo=rv-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/43-22733-F078EA94 for ; Wed, 04 Mar 2009 08:50:08 -0500 Received: by rv-out-0506.google.com with SMTP id g9so882267rvb.7 for ; Wed, 04 Mar 2009 05:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=0tWfETKUuOeAzFpozXF0h7wfd53i5/PO4LGR4dpszqY=; b=IObTM4ugSaeqX+PA1yVd/CxIukqcmlsXQy1Of3IMBM/yoHt23MolvPDUo7yzOXhWRU 3nU6yONcz+R3akG8qHNi3BiuxL+uGW12OzdvIwXucBYpC4fYsrQC4UyW1aZhINWOj47D 7TwP9cr5lTeMMUtbRggEKItI1UZKAcTFPPsF8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=tBxNZUrujQsvWhP4dTARpyF43nxoXzPR0K6xxMYcSmU6QsgVhHOJGghRZO3N2TyL/S QP9Lre8tcxM1G4jz+u7ALUx3sVP8hels/RcPSu3pV1GSuheRtETuCC88R7DKTWp1Jj5n +qKGxd3fhoe3aKCFdGBJVhQfycTU8M/X3qBzQ= MIME-Version: 1.0 Sender: kkooporation@googlemail.com Received: by 10.143.12.20 with SMTP id p20mr4207093wfi.169.1236174605356; Wed, 04 Mar 2009 05:50:05 -0800 (PST) Date: Wed, 4 Mar 2009 14:50:05 +0100 X-Google-Sender-Auth: b6fd2638f702e217 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001636e910103b8e5704644b5408 Subject: Really random ? From: kureal@kkooporation.de (Kenan Sulayman) --001636e910103b8e5704644b5408 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hello PHP internals, I've been running several million tests regarding the arithmetically-random-functions. The returning value at the end: Avg: mt_r: 1073848211.4106 r: 16384.155746685 ~8016909 Avg: mt_r: 1073904131.0286 r: 16384.164383921 ~8503575 Avg: mt_r: 1074010520.4456 r: 16384.091213092 ~13136327 Shape: Avg: mt_r: { avg of mt_rand() } r: { avg of rand() } ~ { value of $i ( iterations ) } Means: Average of mersenne twister in 8016909 it's is 1073848211.4106 ( corresponding to that in 8503575 it's the avg. is 1073904131.0286). That's acceptable. The rand(x) function alters the avg in 5M iterations really by just 0.1 ? Wow, that's creepy. Is there any way - to make it better ( or a bit as good as the m_twister is ? ) ? Thanks, -- (c) Kenan Sulayman Freelance Designer and Programmer Life's Live Poetry --001636e910103b8e5704644b5408--