You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于二项分布的两个技术问询:非一致成功概率场景探讨

Calculating k Successes in Independent but Non-Identical Bernoulli Trials

Great question! The standard binomial distribution only works when every trial has the same success probability—but your scenario (mixing 5 bias-towards-heads coins and 5 bias-towards-tails coins) falls into a related category called the Poisson binomial distribution, which handles independent trials with different success probabilities. Let’s walk through how to solve this step by step.

Step 1: Define Your Trial Groups

First, let’s formalize your example clearly:

  • Group 1: 5 coins, each with success probability ( p_1 ) (e.g., ( p_1 = 0.7 ) for heads-biased coins)
  • Group 2: 5 coins, each with success probability ( p_2 ) (e.g., ( p_2 = 0.3 ) for tails-biased coins)
  • Total trials: ( n = 5 + 5 = 10 )
  • We want the probability of exactly ( k ) total successes across all 10 trials.

Step 2: Sum Over All Valid Success Combinations

To get the total probability of ( k ) successes, we need to account for every possible way to split those ( k ) successes between the two groups. For each possible number of successes ( x ) from Group 1, the remaining ( k - x ) successes must come from Group 2.

The valid range for ( x ) is constrained by the size of each group:

  • Minimum: ( \max(0, k - 5) ) (you can’t get more than 5 successes from Group 2, so if ( k > 5 ), you need at least ( k - 5 ) successes from Group 1)
  • Maximum: ( \min(5, k) ) (you can’t get more than 5 successes from Group 1, or more than ( k ) total successes)

For each valid ( x ), calculate the probability of getting ( x ) successes in Group 1 and ( k - x ) successes in Group 2, then sum all these probabilities together.

The Formula for Your Example

[
P(k) = \sum_{x = \max(0, k-5)}^{\min(5, k)} \left[ \binom{5}{x} p_1^x (1-p_1)^{5-x} \right] \times \left[ \binom{5}{k-x} p_2^{k-x} (1-p_2)^{5-(k-x)} \right]
]

Let’s make this concrete with numbers. Suppose ( p_1 = 0.7 ), ( p_2 = 0.3 ), and ( k = 4 ):

  • Valid ( x ) values: 0, 1, 2, 3, 4 (since ( k=4 ), ( k-x ) can’t exceed 5, so x ranges from 0 to 4)
  • Calculate each term:
    • ( x=0 ): ( \binom{5}{0}(0.7)0(0.3)5 \times \binom{5}{4}(0.3)4(0.7)1 )
    • ( x=1 ): ( \binom{5}{1}(0.7)1(0.3)4 \times \binom{5}{3}(0.3)3(0.7)2 )
    • ... and so on up to ( x=4 )
  • Add all these terms together to get ( P(4) ).

Generalizing to More Groups

If you had more than two groups of trials (e.g., 3 types of coins with different biases), the logic stays identical:

  1. Define each group with ( n_i ) trials and success probability ( p_i )
  2. Sum over all combinations of ( x_1, x_2, ..., x_m ) where ( x_1 + x_2 + ... + x_m = k )
  3. For each combination, multiply the binomial probability of ( x_i ) successes in group ( i ), then add all products.

Key Difference from Binomial Distribution

The standard binomial distribution is just a special case of the Poisson binomial distribution where all ( p_i = p ) (every trial has the same success probability). In your scenario, since ( p_1 \neq p_2 ), we can’t use the simple ( \binom{n}{k}pk(1-p){n-k} ) formula—we have to account for the different probabilities across groups.

内容的提问来源于stack exchange,提问作者Adam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:44:58