mardi 2 mai 2017

Generate a Uniform Distribution using Names

I am attempting to generate a uniform distribution of numbers between 0 and 3 in python. The program takes the user's full name as an input and then uses that to seed the PRN generator.

import random

name = input('Enter your name')
random.seed(name, version=2)
value = random.randrange(0,4,1)  # should produce uniform distribution

The intention here is to make the PRN deterministic for each person. However, given that the letters in names are not uniformly distributed, I am not getting a uniform distribution.

Is there a better method of generating PRN's for this application?




Aucun commentaire:

Enregistrer un commentaire