cards <- 1:13 S <- cards S[1] <- 11 S[11:13] <- 10 sum((1:11) * sapply(1:11, function(s) sum(S==s)/13))