Two Plus Two Older Archives  

Go Back   Two Plus Two Older Archives > General Gambling > Probability
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
Old 08-05-2005, 09:22 PM
irchans irchans is offline
Senior Member
 
Join Date: Sep 2002
Posts: 157
Default Simulation Results

pvn,

I wrote a quick simulation for an additional comparison. I don't think my Mathematica code is really readable, but it beats writing a longer c++ program. Here is the code and the results:

<font class="small">Code:</font><hr /><pre>
(* deln computes the differences between elements of the
vector v whose indices differ by n *)
deln[v_List, n_Integer] := Drop[v, n] - Drop[v, -n];

vOverlaps = Table[
(* generate 400 start times in seconds past Jan 1 *)
vStartTimes = Table[ Random[Integer, {0, 365*24*60*60}], {400}] // Sort;

(* count the overlaps where the start times differ
by less than 3600*3 seconds *)
iOverlaps = Count[ Join @@ Table[
deln[vStartTimes, n], {n, 5}],
x_ /; Abs[x] &lt; 3600*3],
{10000}];

(* print the average number of overlaps *)
Print[ Plus @@ vOverlaps /10000. ];
</pre><hr />

I ran the code above twice and got the following results:

first run - ave 54.6250 overlaps/year over 10000 years.
second run - ave 54.6962 overlaps/year over 10000 years.

I think I can use the reasoning in your previous post to generate a number near 54.

As uuDevil pointed out, the expected number of failures in a three hour period is 400/(24*365/3)=0.136986.

We expect to have 400 failure events (averaging three hours each) in a year. During each one of those, the expected number of other machines that will start fail is 399* 3/365/24 = 0.136644. (Except after 9 pm December 31st.)

Now if we multiply 400*0.136644 = 54.6575 we get the expected number of failures. We have not counted any overlaps twice because for each failure start time we only counted overlaps with failures that began after the original start time.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.