我有轮盘赌项目清单。
[
'id' => 1,
'probability' => 50 // probability in %
],
[
'id' => 2,
'probability' => 20 // probability in %
],
[
'id' => 3,
'probability' => 10 // probability in %
],
[
'id' => 4,
'probability' => 5 // probability in %
],
[
'id' => 5,
'probability' => 1 // probability in %
];
因此,我需要编写一种算法来描述由于概率引起的轮盘赌行为。
我没有主意,有人可以帮我一个主意吗?