Starting from:

$25

CSC632-Homework 1 Solved

Introduction to Simulation and Modeling, CSC 432/632 

Assignment 1 

Chapters 1, 2, 3 

Chapter 1:  

1-      There are multiple simulation languages and software in the market, provide a list of three languages and three software packages and explain the pros and cons.  

 
2-      Use the “Managing Workshop Machinery” example in Page 17 and answer the following questions.


a)      Using the Classifying simulation models section in Page 9, in what classification

(static/dynamic, deterministic/stochastic, continuous/discrete) this problem falls into?  

b)      Using the Approaching a simulation-based problem section in Page 10, explain the seven steps you would take to solve this problem using simulation.  

3-      Similar to Q3 above, use the “Predator-prey model” example in Page 20 and answer the following questions.
 

c)      Using the Classifying simulation models section in Page 9, in what classification

(static/dynamic, deterministic/stochastic, continuous/discrete) this problem falls into?  

d)      Using the Approaching a simulation-based problem section in Page 10, explain the seven steps you would take to solve this problem using simulation.          

Chapter 2:  

4-      Random Number Generators using Python codes  

a)      In Linear congruential generator (in Page 34) explain the formula and elaborate the sensitivity of the random variable generator with respect to the parameters. In other words, do you have a better set of random variables for into higher a, c, and m? Set the parameters to (a =3, c= 4, m=5, and x=3) and generate the first 100 pseudorandom values in Python. Explain the role of each Python function you use.  

b)      Explain the Learmonth-Lewis generator method and its parameters (similar to Problem 5 above). Set the parameters equal to a = 60, c = 0, and m = 2^(31) -1, and generate the first uniform random variables in the range of [0, 1] in Python. Explain the commands and the role of each function you use.   

c)      Explain about Lagged Fibonacci generator method and provide a list of benefits over other methods. Explain what m is in this method and how it helps to improve the generator. Implement a simple example of additive LFG in Python using the following parameters: x0 = x1 = 1 and m = 2^(32).  

5-      Using Python function for random number generators do the following.

a)      Generate 20 Pseudorandom numbers between 0 and 1.

b)      Do part (a) using random.seed() function to generate the same list of random variables.  

c)      Make a random number generator using a “for-loop” that generates integer random numbers 'n' number of times

d)      Use a random generator to select three “same” sets of random countries from the following list.  

{Canada, USA, Italy, China, India, South Africa, Spain, Brazil, Mexico}

6-      Testing Uniformity of Final Exam Grades. A random sample of final examination grades for a college course follows.  

55 85 72 99 48 71 88 70 59 98 80 74 93 85 74 82 90

71 83 60 95 77 84 73 63 72 95 79 51 85 76 81 78 65

75 87 86 70 80 64  

In the book we had test of Uniformity. Use the above dataset and methods in page 4547to determine if these values are uniformly distributed. Setup your Null and Alternative hypothesis carefully.  

Chapter 3:  

****************************************************************************** 

Conditional Probability and Independence 

Conditional Probability of A given B:  The probability that event A will occur, given that event

 B has occurred.  If P(B) > 0, this is expressed as P(A B) =P(AÇB) . P(B)
 

Independent Events:  Events A and B are considered independent if knowing the outcome of A gives no information about the outcome of B.  If A and B are independent, then P(AÇB) =P(A)*P(B) , or equivalently, P(A B) =P(A). 

******************************************************************************

7-      According to the above definition, solve the following two problems.  

a)      Toss two fair dice.  Let A be the event that the sum of the two dice is 9.  Let B be the event that the first die is a 4.  Are A and B independent?  

b)      Toss two fair dice.  Suppose A is the event that the sum of the two dice equals 7, and B is the event that the first die shows a 4.  Are A and B independent? 

8-      Using Python functions, generate a uniform distribution of random numbers contained in interval [0, 50] and do the following.  

•      Draw a diagram in which we report the values of the 50 random numbers that we have generated. 

•      Draw a graph of the probability density function. 

•      Repeat the same graph by replicating 500 samples.  

9-      Using Python functions and libraries, evaluate the probability density function of a binomial distribution X as the probability of success with N = 500, n = 25, and p = 0.1.  • Generate the probability distribution 

•      Plot the data generated.  

•      Plot the histogram of the return values.  

•      Find probability of having 5 successes (that is p (X = 5))  

10-  Using Python functions and libraries, generate a normal probability distribution Y with mu= 25, sigma = 3.  

•      Generate the probability distribution 

•      Plot the data generated. Generate the same plot by changing Sigma =  4 and 5. 

•      Plot the histogram of the return values.  

•      Find P (Y > 20)  

•      Find P (Y = 22.5)   

More products