Probability – How to Choose Boolean Functions with a Specific Probability of 1

binarybinary operationsboolean-algebracomplex systemsprobability

So let's say I have a boolean function $f(x)$ that takes in a size k binary vector and outputs a binary scalar. Each function is defined as a $2^k$ vector. For example $f((0,0)) = 0, f((0,1)) = 1, f((1,0)) = 1, f((1,1)) = 0$ would be XOR. There would be a total of $2^{2^k}$ possible unique functions $f_i$. The expected probability of any of these functions returning a 1 would be $1/2$.

How would one choose between these functions in order to satisfy a specified expected probability of getting a 1? If by default there is a uniform probability for each choice, resulting in a $p$ of $0.1$, how would the distribution have to change or shift in order to bias this choice to result in an expected probability of $0.23$ for example?

To give you my specific case, in random boolean networks you can get complex behaviour (or critical dynamics) by ensuring that the expected probability of a boolean function returning 1 in the network is $p = \frac{k – \sqrt{k(k – 2)})}{2k}$ (according to this). So I need to be able to create random boolean networks with boolean functions that approximate this probability on average. This is done in numerical experiments in a number of papers including this, but they never explain how they achieved this.

Best Answer

So the solution seems so obvious now but I just used the binomial distribution and set the probability of success to $p$ and the total number of trials to $2^k$. I then randomly chose an outcome of $n$ successes using the probability mass function as weights (a weighted choose). I then created a random permutation of $a = (1,2,...,2^k)$ and created a $2^k$ bit vector $v$ representing my chosen boolean function with the definition $v_i = \begin{cases} 1, & \text{ if } a_i <= n \\ 0, & \text{ if } a_i > n \end{cases}$.

Related Question