I want to genearte different probabilities in a range of [0,1]. The only things which changes is the number of the probabilities, so for example in my code below I wanted to generate 4 numbers randomly five times. My main problem is that with my code they don't sum up to 1. How can I achieve this? Thank you.
def generateRandom():
for i in range (0,5):
data_uniform = uniform.rvs(size=4, loc = 0.0, scale=1)
sum_uni=0
for i in range(0,len(data_uniform)):
sum_uni+=data_uniform[i]
print(data_uniform,sum_uni)