vendredi 30 ao没t 2019

How to generate pseudorandom numbers using power generator containing seed in C

The power generator is a method for generating pseudorandom numbers. To use the power generator, parameters 饾憹 and 饾憫 are specified, where 饾憹 is a prime, 饾憫 is a positive integer such that 饾憹∤饾憫, and a seed 饾懃0 is specified. The pseudorandom numbers 饾懃1,饾懃2,⋯ are generated using the recursive definition '''饾懃饾憶+1 = 饾懃饾憶饾憫 (饾拵饾拹饾拝 饾憹)'''. Write a program to generate pseudorandom numbers using power generator method and test your program to (a) find the sequence of pseudorandom numbers generated by the power generator with 饾憹 = 3,5,& 7 (choose the integer 饾憫 accordingly) and take the seed 饾懃0=2

I did solved this problem in java but I am having trouble in doing that in C.




Aucun commentaire:

Enregistrer un commentaire