matchbox <- function(n,b) choose(2*n-b,n)*2^(b-2*n) plot(0:30, mapply(matchbox, 30, 0:30))