[Tutor] Random module.. or?

Kent Johnson kent37 at tds.net
Tue Aug 7 21:57:36 CEST 2007


Tony Noyeaux wrote:
> How can you control randomness... lets say for fish.
>  
> CatfishBreedA
> Can be say, 4inches, to 24inches long
> Most fish caught are say 7-14inches long
> Maybe 1 in 1000 catfish caught are say, 16-20 inches long
> Maybe 1 in 10000 catfish caught are say, 20inches +
>  
> How.. can you program that kind of randomness?
>  
> Or another way to look at it.
>  
> BasketballerA
> Can score 4-45pts a game.
> Most games, he scores 15-25 pts
> Maybe 1 in 1000 games he scores 30 plus pts
> Maybe 1 in 10000 he scores 45 pts.

This sounds a lot like a normal distribution.
http://en.wikipedia.org/wiki/Normal_distribution

You can generate normally distributed random variables with random.gauss()

Kent


More information about the Tutor mailing list