mercredi 16 octobre 2019

How to get a random output function according to an known random output function?

This is an algorithm problem. So help me with key steps. Thanks. Define f as a function which can output a random integer. The output integer is within the range of [0,5](that means: 0,1,2,3,4,5). Suppose the probability of the output number is equal.

Generate a new function g by using f. The new function g has the ability to produce integers within the range of [0,13](that means: 0,1,2,3,4,5,6,7,8,9,10,11,12,13). The probability of the output number is equal too.




Aucun commentaire:

Enregistrer un commentaire