Re: Interesting Simulation Problems....
- To: mathgroup@smc.vnet.net
- Subject: [mg12323] Re: Interesting Simulation Problems....
- From: Seth Chandler <SChandler@Central.UH.Edu>
- Date: Thu, 7 May 1998 18:52:09 -0400
- Organization: University of Houston
- References: <6imdiu$gaq@smc.vnet.net>
As Robert Pratt suggested, this problem can also be solved analytically.
One method of doing so is to determine the probability density function
of the difference between arrival times, where the arrival times are
themselves density functions (here called f). If one then integrates
the probability density function of the difference (here called g)
between -1/3 and 1/3, one obtains the odds that our two friends will be
in the same place at the same time. We get the same answer as everyone
else, 5/9.
Needs["Calculus`DiracDelta`"]
f[x_] = UnitStep[x] - UnitStep[x - 1];
g[m_] = Integrate[f[x]*f[m + x], {x, 0, 1}]
Integrate[g[q], {q, -1/3, 1/3}]
5/9
Seth J. Chandler
Associate Professor of Law
University of Houston Law Center
Tomas Garza wrote:
> LinLee wrote:
>
> > Problem 2. Two persons agree to arrive at the two clock sometime
> between 1 pm
> > and 2 pm and to
> > stay for 20 minutes. What is the probability that they will be
> there
> > at the same time?
>
> LinLee:
>
> Another approach to a simulation solution, more in line with
> Mathematica: arrivals are independent, uniformly distributed r.v.
> between 1 and 2. Choose two arrivals, order them, and see if the
> difference between the first and the second arrival is greater than 20
> minutes.
>
> sample=ble[Sort[{Random[Real,{1,2}],Random[Real,{1,2}]}],{10000}];
> br=mple/.{a_,b_}->a-b+1/3;
> Count[br,_?NonNegative]
>
> Good luck,
>
> Tomas Garza
> Mexico City