Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Recall that a way of simulating a sequence x 1 , x 2 , . . . pseudorandom numbers is via a linear congruential generator

Recall that a way of simulating a sequence x1, x2,... pseudorandom numbers
is via a linear congruential generator (LCG),
xj+1= axj + b mod m.(1)
(a)(6 marks) Write a function with inputs n, a, b, m, s to produce a sequence of n (i.e. list/array of length n) pseudorandom numbers according
to (1) with seed s (i.e. x0= s).
(b)(2 marks) Demonstrate your function works by creating a list of 20
pseudorandom numbers with a =51 and b =13, m =28+1, s =7.
(c)(2 marks) Why would the choice of parameters a =2, b =4, m =8 be
a bad choice for creating pseudorandom numbers?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data And Hadoop Fundamentals Tools And Techniques For Data Driven Success

Authors: Mayank Bhushan

2nd Edition

9355516665, 978-9355516664

More Books

Students also viewed these Databases questions