0% found this document useful (0 votes)
2 views8 pages

Sample Past Exam

The document outlines the final examination for the Modelling and Simulation Techniques module, detailing the structure, instructions, and content of the exam. It includes two sections, with Section A requiring all questions to be answered and Section B allowing for the selection of two questions. The exam covers various topics such as dynamic systems, queueing theory, statistical measures, and simulation methods.

Uploaded by

sab301146782298
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

Sample Past Exam

The document outlines the final examination for the Modelling and Simulation Techniques module, detailing the structure, instructions, and content of the exam. It includes two sections, with Section A requiring all questions to be answered and Section B allowing for the selection of two questions. The exam covers various topics such as dynamic systems, queueing theory, statistical measures, and simulation methods.

Uploaded by

sab301146782298
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module Code (21COMP02H)

Final Examination
2021/2022

Module Title
Modelling and Simulation Techniques
Module Leader: Semester:
Dr. Gamal A. Ebrahim One, January 2022
Equipment allowed
Scientific Calculator

Instructions to Students

• The exam is in TWO sections.


• Answer ALL questions in section A and any TWO questions in section B.
• The exam paper is THREE pages, including this page.
• The allocation of marks is shown in brackets next to each question.
• Write your answers in the answer book provided, not on the exam papers.
• You may make reasonable approximations and assumptions. State and justify
any such assumptions and approximations you do make.
• Submit exam paper with your answer booklet.

This examination is TWO hours long (2 hrs).

[Turn Over only when instructed to do so]


21COMP02H Modelling and Simulation Techniques Final Exam - January 2022
Section A: Answer all questions

QA1 [Total: 30 marks]


a) Consider the dynamic system given in the Figure
QA1.a, where m represents a mass, K represents the
spring constant of the spring, b represents the
damping constants of the dampers and F represents
the external force applied on mass M.
i. Sketch the free body diagram. [4 marks]
ii. Write the dynamic equations that model this [6 marks]
system. Then, find its transfer function assuming
the input is F and the output is the displacement x. Figure QA1.a
b) Consider the following differential equation:

i. Use backward Euler’s method with a step size of h = 0.1 to find approximate values [4 marks]
of the solution at t = 0.1, 0.2, 0.3, and 0.4.
ii. Discuss the causes of having the errors computed in (i) and explain how you can [3 marks]
reduce this error.
iii. Explain the effect of changing the step to 0.05 on the accuracy of the results. [3 marks]
c) For M/M/3 queue, describe the input process type, service process type, number of [10 marks]
servers, queue size, call population size, and queue discipline. Then, derive the
mathematical formula that finds the average waiting time in the queue and the average
number of items in the queue.

QA2 [Total: 30 marks]


a) Assume we have simulated the queueing system for the students’ affairs office in a
university. Assume it is modelled as M/M/1 queue. The students arrive to the queue in
a random pattern at an average rate of 5 students every 15 minutes. Meanwhile, the
average service time is 2 minutes. Calculate the following statistical measures of system
performance:
i. Utilization. [2 marks]
ii. Average waiting time in the system. [2 marks]
iii. Average queueing time. [2 marks]
iv. Probability that the queue is empty. [2 marks]
v. Average number of students in the queue. [2 marks]
vi. Average number of students in the system. [2 marks]
b) Assume a simulation is conducted to find the number of students N admitted in each [10 marks]
day to a university X, assume we have collected the inter-arrival times (in seconds)
between the students as follows: 40, 10, 55, 34, 12, 22, 13, 25, 36, 44, 64, 71, and 18.
Use 2 test to test if the collected values of s fits with the exponential distribution with
expected inter-arrival time between students of 20 seconds, assuming the error critical
value is 3.1.
c) Assume we have carried out an experiment to measure the relationship between the [8 marks]
years of experience and the salary for professional careers. The following table shows
the collected results.
Years of Experience 5 17 22 13 6 23 7 4 19
Salary (in 1000 Units) 80 137 115 31 74 57 113 56 65
Use the least-square method to find a linear regression model between the years of
experience and the salary.
Page 1 of 2
21COMP02H Modelling and Simulation Techniques Final Exam - January 2022
Section B: Answer TWO questions only

QB1 [Total: 20 marks]


a) Use multiplicative congruential method to generate a set of random numbers [10 marks]
uniformly distributed in the interval ]0, 1[, assume the seed is 16, assume a = 4, c =
0, and m = 17. Find the cycle of the generated sequence then compare with the aid
of examples this method with mid-square method from the accuracy and efficiency
perspectives. Use the generated random number sequence to generate a random
𝑥−11
variate for a random variable that has a CDF given by 𝐹(𝑋 = 𝑘) = ( 6 ).
b) i. In simulation, there is always cost incurred. Describe the cost components for [4 marks]
building and simulating a model. Then, discuss the advantages and
disadvantages of using general-purpose programming language versus general
simulation language in doing your simulation.
ii. Suppose that a simulation model is built for a manufacturing system that [6 marks]
consists of a large number of machines in series separated by buffers (queues).
Since the computer execution time of the model is excessive, it is decided to
divide the model into two sub-models. The first sub-model runs and the
departure time of each part in the simulated manufacturing process is written
to a file. The second sub-model is executed by driving it with the information
stored in the file. Discuss the validation of this modeling approach.

QB2 [Total: 20 marks]


a) i. Explain with the aid of examples the interpretation of the confidence interval. [5 marks]
Then, discuss how we can use goodness-of-fit method to check if the collected
statistics follows a specific probability distribution.
ii. A random sample of 120 employees showed an average yearly progress mark to [5 marks]
be 87 out of 100 with a standard deviation of 1.3 marks. Find a 95% confidence
interval for the average marks if 𝑍∝⁄2 = 1.96.
b) Differentiate with the aid of examples each of the following pairs:
i. Validation and verification [2 marks]
ii. Simulation and model [2 marks]
iii. Discrete state and discrete time models [2 marks]
iv. State variable and attribute [2 marks]
v. M/M/c/50/2000/∞ and M/D/c queues [2 marks]

QB3 [Total: 20 marks]


a) A study is conducted to find the percentage of defected items in a production line. [10 marks]
A sample of 10000 items are simulated, and there are 280 defected items. Estimate
the error in estimating the proportion of defected items with a 98% confidence
interval if we know that 𝑍∝⁄2 = 2.33. Then, compute the sample size if we need the
estimated value of defected items to be within 0.001 of the actual value.
b) Explain with the aid of examples each of the following:
i. Pure continuous simulation [2 marks]
ii. Discrete time model [2 marks]
iii. The period of random number generator [2 marks]
iv. Long Kendall's notation for queueing model [2 marks]
v. Mathematical model [2 marks]

Page 2 of 2
21COMP02H Modelling and Simulation Techniques Final Exam – January 2022
Model Answer
Section A: Answer all questions

QA1 [Total: 30 marks]


a) Consider the dynamic system given in the shown
figure, where m represents a mass, K represents the
spring constant of the spring, b represents the
damping constants of the dampers and F represents
the external force applied on mass M.
i. Sketch the free body diagram. [4 marks]

Figure QA1.a

ii. Write the dynamic equations that model this system. Then, find its transfer [6 marks]
function assuming the input is F and the output is the displacement x.

b) Consider the following differential equation:

i. Use backward Euler’s method with a step size of h = 0.1 to find approximate values [4 marks]
of the solution at t = 0.1, 0.2, 0.3, and 0.4.
The following steps should be followed:
• Convert the differential equation into an approximate difference equation.
• Use the step provided to find the values of y(k) using the previous values of y
(y(k-1))

ii. Discuss the causes of having the errors computed in (i) and explain how you can [3 marks]
reduce this error.
The cause of errors are mainly due to the approximation of the differential equation
into difference equation, hence, the computed values are approximate values.

iii. Explain the effect of changing the step to 0.05 on the accuracy of the results. [3 marks]
When reducing the step size is the increase in the accuracy of the computed values.

c) For M/M/3 queue, describe the input process type, service process type, number of [10 marks]
servers, queue size, call population size, and queue discipline. Then, derive the
mathematical formula that finds the average waiting time in the queue and the average
number of items in the queue.

Input process: Poisson process


Service process: Poisson process
Number of servers: 1

Page 1 of 5
21COMP02H Modelling and Simulation Techniques Final Exam – January 2022
Model Answer
Queue size: ∞
Queue Discipline: FIFO
Call Population Size: ∞

QA2 [Total: 30 marks]


a) Assume we have simulated the queueing system for the students’ affairs office in a
university. Assume it is modelled as M/M/1 queue. The students arrive to the queue in
a random pattern at an average rate of 5 students every 15 minutes. Meanwhile, the
average service time is 2 minutes. Calculate the following statistical measures of system
performance:
i. Utilization = (5/15)/(1/2) = 66.667% [2 marks]
ii. Average waiting time in the system = (1/((1/2) - (5/15) )) = 6 minutes [2 marks]
iii. Average queueing time = 0.66667 * 6 = 4 minutes [2 marks]
iv. Probability that the queue is empty = (1-0.66667) = 33.333% [2 marks]
v. Average number of students in the queue = 4*(5/15) = 1.333 students [2 marks]
vi. Average number of students in the system = 6*(5/15) = 2 students [2 marks]
b) Assume a simulation is conducted to find the number of students N admitted in each [10 marks]
day to a university X, assume we have collected the inter-arrival times (in seconds)
between the students as follows: 40, 10, 55, 34, 12, 22, 13, 25, 36, 44, 64, 71, and 18.
Use 2 test to test if the collected values of s fits with the exponential distribution with
expected inter-arrival time between students of 20 seconds, assuming the error critical
value is 3.1.

The student should compute 2 then compare it with the given error critical value. If
the error is less than 3.1, then it fits with the given distribution, otherwise it does fit
with the given exponential distribution.

c) Assume we have carried out an experiment to measure the relationship between the [8 marks]
years of experience and the salary for professional careers, the following table shows
the collected results.
Years of Experience 5 17 22 13 6 23 7 4 19
Salary (in 1000 Units) 80 137 115 31 74 57 113 56 65
Use the least-square method to find a linear regression model between the years of
experience and the salary.

The student should compute the following parameters:

Page 2 of 5
21COMP02H Modelling and Simulation Techniques Final Exam – January 2022
Model Answer
Section B: Answer TWO questions only
QB1 [Total: 20 marks]
a) Use multiplicative congruential method to generate a set of random numbers [10 marks]
uniformly distributed in the interval ]0, 1[, assume the seed is 16, assume a = 4, c =
0, and m = 17. Find the cycle of the generated sequence then compare with the aid
of examples this method with mid-square method from the accuracy and efficiency
perspectives. Use the generated random number sequence to generate a random
𝑥−11
variate for a random variable that has a CDF given by 𝐹(𝑋 = 𝑘) = ( ).
6

0.941176
0.764706
0.058824
0.235294
0.941176

The cycle of the generated numbers is 4.

x = 6F + 11, we need to substitute with the generated numbers for F, so that we get:

16.64706
15.58824
11.35294
12.41176
16.64706

b) iii. In simulation, there is always cost incurred. Describe the cost components for [4 marks]
building and simulating a model. Then, discuss the advantages and
disadvantages of using general-purpose programming language versus general
simulation language in doing your simulation.
Cost components: [6 marks]
1. Purchase price of the software
2. Programmer / Analyst time
Using general purpose programming language:
Advantages
• Little or no additional software cost
• Universally available (portable)
• No additional training (Everybody knows…(language X) ! )
Disadvantages
• Every model starts from scratch
• Very little reusable code
• Long development cycle for each model
• Difficult verification phase

General simulation language


Advantages
• Standardized features often needed in modeling
• Shorter development cycle for each model
• Much assistance in model verification
• Very readable code

Page 3 of 5
21COMP02H Modelling and Simulation Techniques Final Exam – January 2022
Model Answer
Disadvantages
• Higher software cost
• Additional training required
• Limited portability

iv. Suppose that a simulation model is built for a manufacturing system that
consists of a large number of machines in series separated by buffers (queues).
Since the computer execution time of the model is excessive, it is decided to
divide the model into two sub-models. The first sub-model runs and the
departure time of each part in the simulated manufacturing process is written
to a file. The second sub-model is executed by driving it with the information
stored in the file. Discuss the validation of this modeling approach.

The student should show that why there is a major difference in the results in
simulating this way. Both of them will lead to different result since there other factors
affect the model other than the departure time, for example the arrival process, the
service process, the randomization used in the experiment.

QB2 [Total: 20 marks]


a) i. Explain with the aid of examples the interpretation of the confidence interval. Then, [5 marks]
discuss how we can use goodness-of-fit method to check if the collected statistics follows
a specific probability distribution.

The interpretation mainly indicates that the actual parameter can be estimated
from the estimator with a value less than 100%. For the goodness-of-fit, the
student should indicate how divide the domain into intervals, and compute the
estimated and observed values, then compute the chi-square value and compare
it with error critical value.

ii. A random sample of 120 employees showed an average yearly progress mark to be 87 [5 marks]
out of 100 with a standard deviation of 1.3 marks. Find a 95% confidence interval for
the average marks if 𝑍∝⁄ = 1.96.
2

87 ± 0.2325995

b) Differentiate with the aid of examples each of the following pairs:


i. Validation and verification [2 marks]
A property of an entity. e.g., account balance for the entity Customer
Verification: concerned with building the model right. It is utilized in the
comparison of the conceptual model to the computer representation that
implements that conception.

ii. Simulation and model [2 marks]


Simulation is the execution of the model while the model is a similfied
representation of the system.

iii. Discrete state and discrete time models [2 marks]


The state variables are discrete in the model, while in discrete time the change
in the time is discretized.

Page 4 of 5
21COMP02H Modelling and Simulation Techniques Final Exam – January 2022
Model Answer
iv. State variable and attribute [2 marks]
The state variables are the set of variables that give a complete description of
the system at any particular time are called state variables (e.g., length of the
job queue.) while attribute is a property of an entity. e.g., account balance for
the entity Customer

v. M/M/c/50/2000 and M/D/c queues


A queue with Poisson input and service distribution, with c servers, the queue [2 marks]
length is 50 and the calling population is 2000 with FIFO queuing discipline.

While M/D/c is a queue with input Poisson process, deterministic service time
with c servers, infinite queue capacity, infinite calling population, and FIFO
queue discipline.

QB3 [Total: 20 marks]


a) A study is conducted to find the percentage of defected items in a production line. [10 marks]
A sample of 10000 items are simulated, and there are 280 defected items. Estimate
the error in estimating the proportion of defected items with a 98% confidence
interval if we know that 𝑍∝⁄2 = 2.33. Then, compute the sample size if we need the
estimated value of defected items to be within 0.001 of the actual value.

Error = 2.33 * SQRT((280/10000)*(1-(280/10000))/10000) = 0.003843864


Sample size = 25000 items
b) Explain with the aid of examples each of the following:
i. Pure continuous simulation [2 marks]
Continuous state continuous time simulation.

ii. Discrete time model [2 marks]


A model where the time changes in discrete intervals.

iii. The period of random number generator [2 marks]


The number of generated random numbers until the sequence repeats itself.

iv. Long Kendall's notation for queueing model [2 marks]


A mathematical representation of the queueing system that is described as
follows:

v. Mathematical model [2 marks]


Mathematical representation of the system in the form of one or more
equations that describe a simplified system behavior

The student should support his answer with proper examples.


Page 5 of 5

You might also like