human
Additive Congruence method for generating Pseudo Random Numbers | Function to generate random numbers.
Initialize the seed state.
Traverse to generate required numbers of random numbers.
Follow the linear congruential method.
Driver Code.
Seed value.
Modulus parameter.
Multiplier term.
Number of Random numbers to be generated.
To store random numbers.
Function Call.
Print the generated random numbers"
Solution in Python:
 Give me a code to additive Congruence method for generating Pseudo Random Numbers and the other steps required?
assistant
#Here is code to additive Congruence method for generating Pseudo Random Numbers and the other steps required.
 def additiveCongruentialMethod ( Xo , m , c , randomNums , noOfRandomNums ) :
	randomNums [ 0 ] = Xo
	for i in range ( 1 , noOfRandomNums ) :
		randomNums [ i ] = ( randomNums [ i - 1 ] + c ) % m
if __name__ == ' _ _ main _ _ ' :
	Xo = 3
	m = 15
	c = 2
	noOfRandomNums = 20
	randomNums = [ 0 ] * ( noOfRandomNums )
	additiveCongruentialMethod ( Xo , m , c , randomNums , noOfRandomNums )
	for i in randomNums :
		print ( i , end = " ▁ " )