Re: OT: Math question Message #14 Posted by Valentin Albillo on 21 May 2009, 9:36 a.m., in response to message #1 by KC
Hi, KC:
Your t=D/(n+1) formula is correct. It can be arrived at in a number of ways, but let's try a Monte Carlo approach by running a simulation in our trusty HP71.
This little 3line (108byte) program here will run a simulation for any given number of trials N and from 1 to 5 buses:
10 DESTROY ALL @ INPUT N @ RANDOMIZE 1 @ FOR B=1 TO 5 @ S=0
20 FOR I=1 TO N @ T=RND*30 @ FOR J=2 TO B @ T=MIN(T,RND*30) @ NEXT J
30 S=S+T @ NEXT I @ DISP USING "D,2X,2D.2D";B;S/N @ NEXT B
Upon running it with 1000 trials, then 100,000 (under Emu71 to save time) we have:
>RUN
? 1000
1 14.84
2 10.04
3 7.39
4 5.98
5 5.10
>RUN
? 100000
1 14.98
2 9.98
3 7.51
4 6.02
5 5.02
and the numbers clearly are going to 15, 10, 7.5, 6, and 5, respectively, i.e. 30/2, 30/3, 30/4, 30/5, and 30/6, thus the best fit to them is indeed your formula, t=D/(n+1).
Best regards from V.
Edited: 21 May 2009, 9:39 a.m.
