Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- T=20
- p=0
- wynik=c()
- for (i in 1:100){
- xs1=runif(1,min=0,max=100) #z rozkładu jednorodnego (domyslnie 0-1), zmieniamy na 0-100
- xs1 #czas zdatności systemu s1
- xs2=rgamma(1,shape=100,scale=10)
- xs2 #czas zdatności systemu s2
- y=rexp(1,0.5)
- y
- if(xs2<xs1){
- x=xs1
- }else{
- if (y+xs1<xs2){
- x=max(xs1+y+xs1,xs2)
- }
- else{
- x=xs2
- }
- }
- if (x>=T){
- p=p+1
- }
- wynik=c(wynik,x)
- }
- p
- wynik
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement