Probability
Probability
probabilityDistribution
function probabilityDistribution(uint256 seed, uint256[] distribution) internal pure returns (uint256 index)
returns a sample of the random variable described by distribution
| Name | Type | Description |
|---|---|---|
| seed | uint256 | an inputted random seed |
| distribution | uint256[] | array of cumulative probability distribution |
| Name | Type | Description |
|---|---|---|
| index | uint256 | randomly selected index of distribution |