2022-11-30 01:35:53 +00:00
|
|
|
p_a = 0.8
|
|
|
|
p_b = 0.5
|
|
|
|
p_c = p_a * p_b
|
|
|
|
|
2022-12-03 13:14:08 +00:00
|
|
|
dist_0 = 0
|
|
|
|
dist_1 = 1
|
|
|
|
dist_some = SampleSet.fromDist(1 to 3)
|
|
|
|
dist_many = SampleSet.fromDist(2 to 10)
|
|
|
|
|
|
|
|
dists = [dist_0, dist_1, dist_some, dist_many]
|
|
|
|
weights = [(1 - p_c), p_c/2, p_c/4, p_c/4 ]
|
|
|
|
|
|
|
|
result = mixture(dists, weights)
|
|
|
|
mean(result)
|