Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### PREGUNTA N°2
- X2=vector()
- Y2=vector()
- U=vector()
- U1=vector()
- U2=vector()
- n=1000
- for (i in 1:n) {
- U1[i]=runif(1,0,1)
- U2[i]=runif(1,0,1)
- U[i]=runif(1,0,1)
- Y2[i]=(exp((2*U[i])^2)+(exp((1-2*U[i])^2)))/2
- X2[i]=(exp((U1[i]+U2[i])^2)+(exp((U1[i]+U2[i])^2)))/2
- }
- Antiteticas2=mean(Y2)
- Antiteticas2
- var(Y2)/n
- Diferentes2=mean(X2)
- Diferentes2
- var(X2)/n
Advertisement
Add Comment
Please, Sign In to add comment