An efficient probabilistic algorithm that gets a natural number N and returns a random number R in range 0<=R<=N using a coin toss
i get a natural number N (0,1,2..) and i need to use coin tosses to get a random number R that will appear in the range 0<=R<=N, i am trying to figure out how many tosses i'll need to make it works?
Aucun commentaire:
Enregistrer un commentaire