def generateProbabilities(num):
rnds = [random.random() for i in range(<NUM_LIT:0>, num)]<EOL>rnds.sort()<EOL>vals = []<EOL>p = <NUM_LIT:0><EOL>for n in rnds :<EOL><INDENT>vals.append(n - p)<EOL>p = n<EOL><DEDENT>vals.append(<NUM_LIT:1> - p)<EOL>return vals<EOL>
@summary: generate <num> probabilities such that for each probability x
          0 <= x <= 1 and sum(xs) = 1
@param num: the number of probabilities to generate (int)