Return-Path: william@bourbon.usc.edu
Delivery-Date: Sat Nov 18 00:01:29 2006
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu
X-Spam-Level:
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.3
Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75])
by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id kAI81TpK004499
for ; Sat, 18 Nov 2006 00:01:29 -0800
Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1])
by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id kAI7usTU001684
for ; Fri, 17 Nov 2006 23:56:54 -0800
Message-Id: <200611180756.kAI7usTU001684@bourbon.usc.edu>
To: cs551@merlot.usc.edu
Subject: Re: CS551: probability question
Date: Fri, 17 Nov 2006 23:56:54 -0800
From: william@bourbon.usc.edu
Someone wrote:
> Consider the following example:
>
> The probability in the ini file is 1.
> Node receives a store message and it flips a coin and got 0.4.
> Do we need to cache this file?
If the probability is 1, then it should always cache the file.
> I'm trying to figure out the probability calculation. If the
> probability we got is less than what we have in the ini file,
> then do we perform caching or not?
If the probability of an event occurring is 0.3, then 3 out of
10 tries should have the event occurring. You should assume
that drand48() gives you values that are uniformly distributed
between 0 and 1. Therefore, if drand48() <= 0.3, you should
force the event to occur.
--
Bill Cheng // bill.cheng@usc.edu