我有一个轮盘赌项目清单。铁
[
'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 %
];
所以我需要编写一个算法来描述轮盘赌由于概率引起的行为。
我没有想法,有人可以帮我一个想法吗?