n <- 10
v <- function(coalition) {
if (length(coalition) > n/2) {
return(1)
} else {
return(0)
}
}
banzhaf(v, method = "exact", n_players = n)
banzhaf(v, method = "appro", n_rep = 4000, n_players = n, replace = TRUE)
v<-c(0,0,0,1,2,1,3)
banzhaf(v, method = "exact")
banzhaf(v, method = "appro", n_rep = 4000, replace = TRUE)
Run the code above in your browser using DataLab