Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0C047525 for ; Mon, 24 Oct 2011 05:30:25 +0000 (UTC) Received: (qmail 37259 invoked by uid 500); 24 Oct 2011 05:30:24 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 36265 invoked by uid 500); 24 Oct 2011 05:30:21 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 36254 invoked by uid 99); 24 Oct 2011 05:30:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 05:30:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ahmed.elmasri@gmail.com designates 209.85.213.171 as permitted sender) Received: from [209.85.213.171] (HELO mail-yx0-f171.google.com) (209.85.213.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Oct 2011 05:30:09 +0000 Received: by yxl31 with SMTP id 31so4136986yxl.30 for ; Sun, 23 Oct 2011 22:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=bO3DbsRQJYAgGXpHfRn82myMxo8adysaBM3HdR7YGfs=; b=X7037T6TEAxi7qzMrzCt2axnoDqdpjEP1W/X0qzZxocHvslJvWppSy79IXdz9tHSJr +PzXTYTDnHAizNVN0/BNV22oyaMiCNL5OX1l04TY1fRLdNNJu/vgXzaREazysc5Yq6gJ ofyr0znN6cygTzTRGtjPEbL8Nru2iVkNK/s8k= MIME-Version: 1.0 Received: by 10.236.192.132 with SMTP id i4mr5785802yhn.80.1319434188984; Sun, 23 Oct 2011 22:29:48 -0700 (PDT) Received: by 10.236.157.68 with HTTP; Sun, 23 Oct 2011 22:29:48 -0700 (PDT) Reply-To: ahmed.elmasri@gmail.com In-Reply-To: <4EA4F08A.2000404@gmail.com> References: <4EA38A25.7000506@gmail.com> <4EA4E73B.1080805@gmail.com> <4EA4F08A.2000404@gmail.com> Date: Mon, 24 Oct 2011 01:29:48 -0400 Message-ID: Subject: Re: [math] Re: binomial random generator From: Ahmed Abdeen Hamed To: Commons Users List Content-Type: multipart/alternative; boundary=20cf3040e36223930904b004b61a --20cf3040e36223930904b004b61a Content-Type: text/plain; charset=ISO-8859-1 Thanks Phil! This was most helpful and it has gotten so much faster than using the JDK generator. More importantly, I tried 10 experiments and they didn't break. I have 250 experiments that they must all pass. I will let you know if I need more assistance. For now, thank you and to everyone who contributed to this chain! Ahmed On Mon, Oct 24, 2011 at 12:58 AM, Phil Steitz wrote: > On 10/23/11 9:51 PM, Ahmed Abdeen Hamed wrote: > > Hi Phil, > > > > Thank you for your response. The answer you provided gave me only half of > > what I need. The other half is how to get this boolean value with a given > > probability much the same as nextBonimial? > > Sorry, I misread your code. To do that, I would just use > gen.nextDouble() with a test against Simulation.M_RATE as the > commented out code does. > > Phil > --20cf3040e36223930904b004b61a--