A recursive procedure for density estimation on the binary hypercube