我更喜欢以以下广义形式来思考这个问题:我们有一个完整的二叉树hight n,其中每个节点的编号为st,这些编号的总和为1。我们可以将叶子分为两个集合,即st的总和吗?数字他们接近吗?
If we have biased coin with parameter p and q=1−p, the nodes will have values piqn−i.
As noted in other answers, for most piratical purposes taking parity of the bits is good. The bias will be ∑i(ni)parity(x)piqn−i=∑i(ni)(−p)iqn−i=(q−p)n.
In general, if we have enough computing resources (say PSpace in number of random bits), we can partition the nodes in the best possible way.
EDIT
"This is basically the Shannon coding problem." (Thanks to Per Vognsen.)
END of EDIT
On the other hand, if we are only allowed to use AC0, then it is not hard to show that we can not achieve much because of switching lemma. The circuit will be approximated exponentially well by a CNF and it is not hard to show that a CNF can not compute an answer with a good bias.
(This answer may contain errors, I have not checked the details.)