Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set.seed(0)
- n = 10^6 #no. simulations
- sam = replicate(n, sample(0:1, 7, replace = T))
- L = sam[,sam[7,]==0]
- (freq_ending_in_T_and_three_heads = sum(colSums(L)==3)/n)
- [1] 0.156561
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement