funct.1and1 <- function(games, times, prob1) { first <- c(rbinom(times*games, size=1, prob=prob1)) second <- c(rbinom(times*games, size=1, prob=prob1)) result1 <- (first + first*second)/games cat("average 1 and 1 points per game =", sum(result1),"\n") } funct.1and1(25, 9, .72) funct.1and1(30, 12,.85)