[R] Looking for simpler solution to probabilistic question

2008-01-15 Thread Rainer M Krug
Hi I have two processes which take with a certain probability (p1 and p2) x number of years to complete (age1 and age2). As soon as thge first process is completed, the second one begins. I want to calculate the time it takes for the both processes to be completed. I have the following script

Re: [R] Looking for simpler solution to probabilistic question

2008-01-15 Thread Berwin A Turlach
G'day Rainer, On Tue, 15 Jan 2008 14:24:08 +0200 Rainer M Krug [EMAIL PROTECTED] wrote: I have two processes which take with a certain probability (p1 and p2) x number of years to complete (age1 and age2). As soon as thge first process is completed, the second one begins. I want to calculate

Re: [R] Looking for simpler solution to probabilistic question

2008-01-15 Thread Rainer M Krug
Berwin A Turlach wrote: G'day Rainer, On Tue, 15 Jan 2008 14:24:08 +0200 Rainer M Krug [EMAIL PROTECTED] wrote: ager - range(age1) + range(age2) ager - ager[1]:ager[2] pp1 - c(cumsum(p1), rev(cumsum(rev(p1 pp2 - c(cumsum(p2[-21]), rev(cumsum(rev(p2)))[-1]) pr - pp1+pp2 pr -