¡@

Home 

python Programming Glossary: listsumvalue

How to create a list of random integer vector whose sum is x

http://stackoverflow.com/questions/11380491/how-to-create-a-list-of-random-integer-vector-whose-sum-is-x

import multinomial import math def RandIntVec ListSize ListSumValue Distribution 'Normal' Inputs ListSize the size of the list.. 'Normal' Inputs ListSize the size of the list to return ListSumValue The sum of list values Distribution can be 'uniform' for uniform.. list of random integers of length 'ListSize' whose sum is 'ListSumValue'. if type Distribution list DistributionSize len Distribution..