Bernstein-type approximation using the beta-binomial distribution