Skip to content
Prev 81002 / 398502 Next

some questions

Firstly, these are all very basic questions, thah you coukld probobly answer 
yourself by searching the manual and help files. Nevertheless, here are the 
answers to give you a little head start.
v1<-runif(n=150,min=-1,max=1)
v2<-runif(n=150,min=-1,max=1)
r<-(v1)^2+(v2)^2
newr<-r[r<1]
newr<-newr[r>0]
z<-(v1)*sqrt(-2*log(r)/r)
z[1:100] #or
print(z[1:100])
hist(v1)
hist(v2)
hist(r)
I hope this helps,

Ales Ziberna