title: C++ - Efficient way to generate random bitset with configurable mean "1s to 0s" ratio
body: <p>I'm looking for a highly efficient way to generate random <code>std::bitset</code> of set length. I'd also like to be able to influence the probability of <code>1</code>s appearing in the result, so if the probability value is set low enough, only a small percentage of all the results will even contain a <code>1</code>, but it's still possible (but very unlikely) to result in all <code>1</code>s. It's going to be used in a very computation-heavy application, so every possible optimization is welcome.</p>