While there are several ways to take samples from randomised collection or generate random values N times, in your particular case I’d just go with this:
Well, even though @dimitarvp’s answer definitely gives you the random binary, it doesn’t answer your question about “running function x times and accumulate”
I think the most idiomatic answer to this were probably: