Important Questions

CSC328 · Exam intelligence

Simulation and Modeling important questions

From 6 past TU papers: which questions keep coming back, how much they carry, and what is most likely to show up next. Every question links to a model answer.

Most likely in the next examStatistical

Ranked by how often a topic is asked, its marks weight, and whether it is due after skipping the 2082 paper. No guarantees; study the whole syllabus.

1asked 6xavg 10 marks · Tests for Randomness - Uniformity and independence
Answer

What are the properties of random numbers?

The sequence of numbers 0.23, 0.45, 0.67, 0.12, 0.89, 0.34, 0.56, 0.78, 0.19, 0.41, 0.63, 0.08, 0.85, 0.29, 0.51, 0.73, 0.16, 0.94, 0.37, 0.59 has been generated. Test for the independence among numbers in the sequence starting with index $i = 2$ and lag $m = 3$ using auto-correlation test. ($\alpha = 0.05$, $Z_{\alpha/2} = 1.96$)[10]

Properties of Random Numbers and Auto-Correlation Test

Part 1: Properties of Random Numbers

Random numbers $R_i$ must satisfy two key properties:

1. Uniformity The numbers are uniformly distributed on $(0,1)$; every value is equally likely. The pdf is:

$$f(x) = \begin{cases} 1 & 0 \le x \le 1 \ 0 & \text{otherwise} \end{cases}$$

with $E(R) = \tfrac{1}{2}$ and $Var(R) = \tfrac{1}{12}$.

2. Independence The current value has no correlation with previous values; the probability of observing a value in a subinterval is independent of prior draws.


Part 2: Auto-Correlation Test

Given Data

Index12345678910
Value0.230.450.670.120.890.340.560.780.190.41
Index11121314151617181920
Value0.630.080.850.290.510.730.160.940.370.59
  • $i = 2$, $m = 3$, $N = 20$, $\alpha = 0.05$, $Z_{\alpha/2} = 1.96$

Step 1: Find M

$M$ is the largest integer such that $i + (M+1)m \le N$:

$$2 + (M+1)\cdot 3 \le 20 \Rightarrow (M+1)\cdot 3 \le 18 \Rightarrow M+1 \le 6 \Rightarrow M \le 5$$

$$\boxed{M = 5}$$

Step 2: Subsequence Values

Indices $2 + 3k$ for $k = 0,1,\dots,5$:

kIndexValue
020.45
150.89
280.78
3110.63
4140.29
5170.16

Step 3: Auto-Correlation Estimate

$$\hat{\rho}m = \frac{1}{M+1}\left[\sum{k=0}^{M} R_{i+km},R_{i+(k+1)m}\right] - 0.25$$

The summation runs $k = 0$ to $M$, giving $M+1 = 6$ products of consecutive pairs:

k$R_{i+km}$$R_{i+(k+1)m}$Product
00.450.890.4005
10.890.780.6942
20.780.630.4914
30.630.290.1827
40.290.160.0464
50.16?-

Note on convention: The standard Banks/Carson formula sums $k=0$ to $M$ using pairs $R_{i+km}\cdot R_{i+(k+1)m}$, where the last term needs $R_{i+(M+1)m} = R_{2+18} = R_{20} = 0.59$.

Including the $k=5$ term: $0.16 \times 0.59 = 0.0944$.

$$\sum_{k=0}^{5} = 0.4005 + 0.6942 + 0.4914 + 0.1827 + 0.0464 + 0.0944 = 1.9096$$

$$\hat{\rho}_m = \frac{1.9096}{5+1} - 0.25 = \frac{1.9096}{6} - 0.25 = 0.31827 - 0.25 = 0.06827$$

Step 4: Standard Deviation of the Estimate

$$\sigma_{\hat{\rho}_m} = \frac{\sqrt{13M + 7}}{12(M+1)} = \frac{\sqrt{13(5)+7}}{12(6)} = \frac{\sqrt{72}}{72} = \frac{8.4853}{72} = 0.11785$$

Step 5: Test Statistic

$$Z_0 = \frac{\hat{\rho}m}{\sigma{\hat{\rho}_m}} = \frac{0.06827}{0.11785} = 0.5793$$

Step 6: Decision

Since $|Z_0| = 0.5793 < Z_{\alpha/2} = 1.96$, we fail to reject the null hypothesis of independence.

$$\boxed{\text{The numbers are independent (no significant autocorrelation).}}$$

2asked 6xavg 8 marks · Simulation Languages
Answer

Describe the MARK and TABULATE block in GPSS. A coffee shop has a single barista serving customers. Customers arrive at an average rate of one every 3 minutes and the barista takes an average of 2.5 minutes to serve a customer. Create a simulation model and block diagram representing the coffee shop using GPSS blocks and simulate the system for 8 hours.[10]

MARK and TABULATE Block in GPSS & Coffee Shop Simulation


Part A: MARK Block

The MARK block is used to record the current simulation clock time into a specified parameter of a transaction. This timestamp is later used to calculate the transit time (total time spent in the system).

Syntax:

MARK A
  • If operand A is specified: the current clock time is stored in parameter A of the transaction
  • If A is blank: the clock time is stored in the Mark Time word of the transaction
  • Used in conjunction with the TABULATE block to measure time intervals
  • Helps collect time-in-system statistics for performance analysis

Symbol:

+--------+
|  MARK  |
|   A    |
+--------+

Part B: TABULATE Block

The TABULATE block is used to collect statistical data and record frequency distributions into a TABLE entity. Each time a transaction passes through this block, one entry is made in the specified table.

Syntax:

TABULATE A
  • Operand A specifies the TABLE name/number where data is recorded
  • Works with a previously defined TABLE definition statement

TABLE Definition Syntax:

name TABLE A, B, C, D
ParameterMeaning
AVariable to be tabulated (e.g., MP1 for transit time from parameter 1)
BUpper limit of the first frequency class
CWidth of each frequency class
DNumber of frequency classes

Symbol:

+-----------+
| TABULATE  |
|     A     |
+-----------+

How MARK and TABULATE work together:

  1. MARK records the arrival time in a transaction parameter (e.g., parameter 1)
  2. TABULATE later computes the elapsed time as: Current Clock Time - Marked Time
  3. This elapsed time is entered into the specified TABLE for statistical analysis

Part C: Coffee Shop Simulation Model

Given Data

ParameterValue
Inter-arrival timeAverage 3 minutes (exponential)
Service timeAverage 2.5 minutes (exponential)
Number of servers1 (single barista)
Simulation duration8 hours = 480 minutes

System Type

This is an M/M/1 queuing system:

  • Poisson arrivals (exponential inter-arrival times)
  • Exponential service times
  • Single server (one barista)
  • FIFO discipline

Theoretical Performance (Pre-Simulation)

Server Utilization (rho):

rho = lambda / mu
    = (1/3) / (1/2.5)
    = 2.5 / 3
    = 0.833  (83.3%)

Expected customers served in 480 minutes:

Customers = 480 / 3 = 160 customers (approximately)

Since rho < 1, the system is stable.


Block Diagram

         +------------------+
         |   GENERATE 3     |  <-- Customers arrive every 3 min (exponential)
         +------------------+
                  |
         +------------------+
         |     MARK 1       |  <-- Record arrival time in parameter 1
         +------------------+
                  |
         +------------------+
         |   QUEUE  LINE    |  <-- Customer joins the waiting line
         +------------------+
                  |
         +------------------+
         |  SEIZE  BARISTA  |  <-- Customer occupies the barista
         +------------------+
                  |
         +------------------+
         |  DEPART  LINE    |  <-- Customer leaves the queue count
         +------------------+
                  |
         +------------------+
         |  ADVANCE 2.5,FN$ |  <-- Service time avg 2.5 min (exponential)
         +------------------+
                  |
         +------------------+
         | RELEASE BARISTA  |  <-- Barista is freed for next customer
         +------------------+
                  |
         +------------------+
         | TABULATE THRUPUT |  <-- Record transit time in table
         +------------------+
                  |
         +------------------+
         |   TERMINATE      |  <-- Customer leaves the system
         +------------------+

GPSS Program Code

* ================================================
* Coffee Shop Simulation Model
* Single Barista, 8-hour simulation (480 minutes)
* ================================================

        SIMULATE

* Define Table for Transit Time (time in system)
* MP1 = transit time from parameter 1
* Upper limit of first class = 0
* Class width = 1 minute
* Number of classes = 20

THRUPUT TABLE MP1,0,1,20

* ------------------------------------------------
* Customer Arrival and Service Segment
* ------------------------------------------------

        GENERATE  3,FN$XPDIS    ;Customers arrive, avg every 3 min (exponential)
        MARK      1              ;Store arrival time in parameter 1
        QUEUE     LINE           ;Customer joins the waiting line
        SEIZE     BARISTA        ;Customer seizes the single barista
        DEPART    LINE           ;Customer departs from queue
        ADVANCE   2.5,FN$XPDIS  ;Service takes avg 2.5 min (exponential)
        RELEASE   BARISTA        ;Barista is released
        TABULATE  THRUPUT        ;Record time-in-system in table
        TERMINATE                ;Customer exits the system

* ------------------------------------------------
* Timer Segment (controls simulation end time)
* ------------------------------------------------

        GENERATE  480            ;Generate one transaction at 480 minutes
        TERMINATE 1              ;Decrement termination counter to 0

* ------------------------------------------------
* Control Statement
* ------------------------------------------------

        START     1              ;Run simulation until counter reaches 0
        END

Explanation of Each Block

BlockPurpose
GENERATE 3,FN$XPDISCreates a customer transaction on average every 3 minutes, the function XPDIS spreading the inter-arrival times exponentially
MARK 1Writes the current clock time into parameter 1 of the customer, fixing the instant of arrival
QUEUE LINEEnters the customer in the queue entity LINE and starts collecting waiting line statistics
SEIZE BARISTAThe customer takes the single server facility BARISTA, and waits here if the barista is already busy
DEPART LINERemoves the customer from the queue count once service begins
ADVANCE 2.5,FN$XPDISHolds the customer for the service time, exponentially distributed about a mean of 2.5 minutes
RELEASE BARISTAFrees the barista so that the next waiting customer can be served
TABULATE THRUPUTEnters the elapsed time since the MARK block into the table THRUPUT
TERMINATERemoves the served customer from the model, leaving the termination counter unchanged
GENERATE 480Timer segment: produces a single transaction at clock time 480, the end of the 8 hour day
TERMINATE 1Reduces the termination counter by 1, bringing it to zero and stopping the run
START 1Sets the termination counter to 1 and starts the simulation

What the 8 Hour Run Produces

The line THRUPUT TABLE MP1,0,1,20 is a definition statement rather than a block: MP1 is the transit time measured from parameter 1, the first frequency class closes at 0, each class is 1 minute wide, and 20 classes are kept. Since MARK writes the arrival time and TABULATE reads it back through MP1, every entry in THRUPUT is one customer's total time in the shop.

When the timer transaction drives the termination counter to zero at 480 minutes, GPSS prints its standard report: the utilisation and number of entries of the facility BARISTA, the average and maximum contents of the queue LINE together with the average waiting time, and the THRUPUT table with its mean and standard deviation. With $\lambda = 1/3$ per minute and $\mu = 1/2.5 = 0.4$ per minute, the M/M/1 results give the values those simulated figures should settle near:

$$\rho = \frac{\lambda}{\mu} = 0.833, \qquad L_s = \frac{\rho}{1 - \rho} = 5 \text{ customers}, \qquad L_q = \frac{\rho^2}{1 - \rho} = 4.17 \text{ customers}$$

$$W_s = \frac{1}{\mu - \lambda} = 15 \text{ minutes}, \qquad W_q = \frac{\rho}{\mu - \lambda} = 12.5 \text{ minutes}$$

So over the 8 hour day about 160 customers arrive, the barista is busy for roughly 83 percent of the time, and a customer spends about 15 minutes in the shop of which about 12.5 minutes is spent waiting for service. A single 480 minute run is short, so the figures the simulation reports scatter around these analytical values rather than reproduce them exactly.

3asked 4xavg 5 marks · due (skipped 2082) · Verification of Simulation Models
Answer

Describe the process of model building, verification and validation in detail with example. [5]

Model building is the process of constructing a conceptual and computational representation of a real-world system. The key steps involved are: Step Description ------------------- Problem Formulation Clearly state the problem to be stud...

4asked 4xavg 4 marks · due (skipped 2082) · Characteristics and Structure of Basic Queuing System
Answer

Write short notes on: a. Queuing discipline b. Random variate [5]

Short Notes

a. Queuing Discipline (2.5 marks)

Definition: The logical ordering of customers in a waiting line that determines which customer will be chosen for service next is called queuing discipline.

The number of customers that can wait in a line is called system capacity. The simplest case is an unlimited queue which can accommodate any number of customers (unlimited capacity). However, many systems such as web servers and call centers have limits on the number of entities that can be in the queue at any given time. Arrivals that come when the queue is full are turned away.

Common Types of Queuing Disciplines:

  1. FIFO (First In, First Out): Customers are served in the order they arrive. This is the most common and default discipline. Example: bank queues.

  2. LIFO (Last In, First Out): The most recently arrived customer is served first. Example: stack-based processing systems.

  3. SIRO (Service In Random Order): Customers are selected randomly from the waiting queue regardless of arrival order.

Note in Kendall Notation: In the standard Kendall Notation (A/B/C/D/N/K), D represents the queuing discipline. If not specified, the default is FIFO. For example, M/D/2/FIFO/5/∞ represents a system with exponential arrivals, deterministic service, 2 servers, FIFO discipline, capacity of 5, and infinite population.


b. Random Variate (2.5 marks)

Definition: A random variate is a particular outcome or realization generated from a specified probability distribution. It is a value produced by a random variable when the underlying random experiment is performed.

Key Points:

  • A random variate is used in simulation modeling to represent uncertain quantities such as inter-arrival times, service times, and processing durations.
  • Random variates are generated using techniques such as the Inverse Transform Method, Acceptance-Rejection Method, and Composition Method.
  • They are drawn from distributions such as Exponential (M), Deterministic (D), and Erlang (E) distributions, which are commonly used in queuing models.
  • In Markov Chain Monte Carlo (MCMC), sequences of random variates are generated to reflect complicated desired probability distributions.

Example: If service time follows an exponential distribution with mean 1/μ, then a random variate for service time is generated as:

$$x = -\frac{1}{\mu} \ln(U)$$

where U is a uniform random number between 0 and 1.

Random variates are essential in discrete event simulation to mimic real-world stochastic behavior of systems such as queuing networks.

5asked 5xavg 7 marks · Types of Model
Answer

Explain static mathematical model with suitable example. [5]

A static mathematical model is a type of mathematical model that represents a system at a particular point in time, where the system attribute values do not change over time. It uses symbolic notation and mathematical equations to repres...

Most repeated questions

Topics asked at least twice, most-asked first.

asked 6xavg 10 marks · 2082, 2081, 2080, 2079, 2078...
Answer

What are the properties of random numbers?

The sequence of numbers 0.23, 0.45, 0.67, 0.12, 0.89, 0.34, 0.56, 0.78, 0.19, 0.41, 0.63, 0.08, 0.85, 0.29, 0.51, 0.73, 0.16, 0.94, 0.37, 0.59 has been generated. Test for the independence among numbers in the sequence starting with index $i = 2$ and lag $m = 3$ using auto-correlation test. ($\alpha = 0.05$, $Z_{\alpha/2} = 1.96$)[10]

Properties of Random Numbers and Auto-Correlation Test

Part 1: Properties of Random Numbers

Random numbers $R_i$ must satisfy two key properties:

1. Uniformity The numbers are uniformly distributed on $(0,1)$; every value is equally likely. The pdf is:

$$f(x) = \begin{cases} 1 & 0 \le x \le 1 \ 0 & \text{otherwise} \end{cases}$$

with $E(R) = \tfrac{1}{2}$ and $Var(R) = \tfrac{1}{12}$.

2. Independence The current value has no correlation with previous values; the probability of observing a value in a subinterval is independent of prior draws.


Part 2: Auto-Correlation Test

Given Data

Index12345678910
Value0.230.450.670.120.890.340.560.780.190.41
Index11121314151617181920
Value0.630.080.850.290.510.730.160.940.370.59
  • $i = 2$, $m = 3$, $N = 20$, $\alpha = 0.05$, $Z_{\alpha/2} = 1.96$

Step 1: Find M

$M$ is the largest integer such that $i + (M+1)m \le N$:

$$2 + (M+1)\cdot 3 \le 20 \Rightarrow (M+1)\cdot 3 \le 18 \Rightarrow M+1 \le 6 \Rightarrow M \le 5$$

$$\boxed{M = 5}$$

Step 2: Subsequence Values

Indices $2 + 3k$ for $k = 0,1,\dots,5$:

kIndexValue
020.45
150.89
280.78
3110.63
4140.29
5170.16

Step 3: Auto-Correlation Estimate

$$\hat{\rho}m = \frac{1}{M+1}\left[\sum{k=0}^{M} R_{i+km},R_{i+(k+1)m}\right] - 0.25$$

The summation runs $k = 0$ to $M$, giving $M+1 = 6$ products of consecutive pairs:

k$R_{i+km}$$R_{i+(k+1)m}$Product
00.450.890.4005
10.890.780.6942
20.780.630.4914
30.630.290.1827
40.290.160.0464
50.16?-

Note on convention: The standard Banks/Carson formula sums $k=0$ to $M$ using pairs $R_{i+km}\cdot R_{i+(k+1)m}$, where the last term needs $R_{i+(M+1)m} = R_{2+18} = R_{20} = 0.59$.

Including the $k=5$ term: $0.16 \times 0.59 = 0.0944$.

$$\sum_{k=0}^{5} = 0.4005 + 0.6942 + 0.4914 + 0.1827 + 0.0464 + 0.0944 = 1.9096$$

$$\hat{\rho}_m = \frac{1.9096}{5+1} - 0.25 = \frac{1.9096}{6} - 0.25 = 0.31827 - 0.25 = 0.06827$$

Step 4: Standard Deviation of the Estimate

$$\sigma_{\hat{\rho}_m} = \frac{\sqrt{13M + 7}}{12(M+1)} = \frac{\sqrt{13(5)+7}}{12(6)} = \frac{\sqrt{72}}{72} = \frac{8.4853}{72} = 0.11785$$

Step 5: Test Statistic

$$Z_0 = \frac{\hat{\rho}m}{\sigma{\hat{\rho}_m}} = \frac{0.06827}{0.11785} = 0.5793$$

Step 6: Decision

Since $|Z_0| = 0.5793 < Z_{\alpha/2} = 1.96$, we fail to reject the null hypothesis of independence.

$$\boxed{\text{The numbers are independent (no significant autocorrelation).}}$$

asked 6xavg 8 marks · 2082, 2081, 2080, 2079, 2078...
Answer

Describe the MARK and TABULATE block in GPSS. A coffee shop has a single barista serving customers. Customers arrive at an average rate of one every 3 minutes and the barista takes an average of 2.5 minutes to serve a customer. Create a simulation model and block diagram representing the coffee shop using GPSS blocks and simulate the system for 8 hours.[10]

MARK and TABULATE Block in GPSS & Coffee Shop Simulation


Part A: MARK Block

The MARK block is used to record the current simulation clock time into a specified parameter of a transaction. This timestamp is later used to calculate the transit time (total time spent in the system).

Syntax:

MARK A
  • If operand A is specified: the current clock time is stored in parameter A of the transaction
  • If A is blank: the clock time is stored in the Mark Time word of the transaction
  • Used in conjunction with the TABULATE block to measure time intervals
  • Helps collect time-in-system statistics for performance analysis

Symbol:

+--------+
|  MARK  |
|   A    |
+--------+

Part B: TABULATE Block

The TABULATE block is used to collect statistical data and record frequency distributions into a TABLE entity. Each time a transaction passes through this block, one entry is made in the specified table.

Syntax:

TABULATE A
  • Operand A specifies the TABLE name/number where data is recorded
  • Works with a previously defined TABLE definition statement

TABLE Definition Syntax:

name TABLE A, B, C, D
ParameterMeaning
AVariable to be tabulated (e.g., MP1 for transit time from parameter 1)
BUpper limit of the first frequency class
CWidth of each frequency class
DNumber of frequency classes

Symbol:

+-----------+
| TABULATE  |
|     A     |
+-----------+

How MARK and TABULATE work together:

  1. MARK records the arrival time in a transaction parameter (e.g., parameter 1)
  2. TABULATE later computes the elapsed time as: Current Clock Time - Marked Time
  3. This elapsed time is entered into the specified TABLE for statistical analysis

Part C: Coffee Shop Simulation Model

Given Data

ParameterValue
Inter-arrival timeAverage 3 minutes (exponential)
Service timeAverage 2.5 minutes (exponential)
Number of servers1 (single barista)
Simulation duration8 hours = 480 minutes

System Type

This is an M/M/1 queuing system:

  • Poisson arrivals (exponential inter-arrival times)
  • Exponential service times
  • Single server (one barista)
  • FIFO discipline

Theoretical Performance (Pre-Simulation)

Server Utilization (rho):

rho = lambda / mu
    = (1/3) / (1/2.5)
    = 2.5 / 3
    = 0.833  (83.3%)

Expected customers served in 480 minutes:

Customers = 480 / 3 = 160 customers (approximately)

Since rho < 1, the system is stable.


Block Diagram

         +------------------+
         |   GENERATE 3     |  <-- Customers arrive every 3 min (exponential)
         +------------------+
                  |
         +------------------+
         |     MARK 1       |  <-- Record arrival time in parameter 1
         +------------------+
                  |
         +------------------+
         |   QUEUE  LINE    |  <-- Customer joins the waiting line
         +------------------+
                  |
         +------------------+
         |  SEIZE  BARISTA  |  <-- Customer occupies the barista
         +------------------+
                  |
         +------------------+
         |  DEPART  LINE    |  <-- Customer leaves the queue count
         +------------------+
                  |
         +------------------+
         |  ADVANCE 2.5,FN$ |  <-- Service time avg 2.5 min (exponential)
         +------------------+
                  |
         +------------------+
         | RELEASE BARISTA  |  <-- Barista is freed for next customer
         +------------------+
                  |
         +------------------+
         | TABULATE THRUPUT |  <-- Record transit time in table
         +------------------+
                  |
         +------------------+
         |   TERMINATE      |  <-- Customer leaves the system
         +------------------+

GPSS Program Code

* ================================================
* Coffee Shop Simulation Model
* Single Barista, 8-hour simulation (480 minutes)
* ================================================

        SIMULATE

* Define Table for Transit Time (time in system)
* MP1 = transit time from parameter 1
* Upper limit of first class = 0
* Class width = 1 minute
* Number of classes = 20

THRUPUT TABLE MP1,0,1,20

* ------------------------------------------------
* Customer Arrival and Service Segment
* ------------------------------------------------

        GENERATE  3,FN$XPDIS    ;Customers arrive, avg every 3 min (exponential)
        MARK      1              ;Store arrival time in parameter 1
        QUEUE     LINE           ;Customer joins the waiting line
        SEIZE     BARISTA        ;Customer seizes the single barista
        DEPART    LINE           ;Customer departs from queue
        ADVANCE   2.5,FN$XPDIS  ;Service takes avg 2.5 min (exponential)
        RELEASE   BARISTA        ;Barista is released
        TABULATE  THRUPUT        ;Record time-in-system in table
        TERMINATE                ;Customer exits the system

* ------------------------------------------------
* Timer Segment (controls simulation end time)
* ------------------------------------------------

        GENERATE  480            ;Generate one transaction at 480 minutes
        TERMINATE 1              ;Decrement termination counter to 0

* ------------------------------------------------
* Control Statement
* ------------------------------------------------

        START     1              ;Run simulation until counter reaches 0
        END

Explanation of Each Block

BlockPurpose
GENERATE 3,FN$XPDISCreates a customer transaction on average every 3 minutes, the function XPDIS spreading the inter-arrival times exponentially
MARK 1Writes the current clock time into parameter 1 of the customer, fixing the instant of arrival
QUEUE LINEEnters the customer in the queue entity LINE and starts collecting waiting line statistics
SEIZE BARISTAThe customer takes the single server facility BARISTA, and waits here if the barista is already busy
DEPART LINERemoves the customer from the queue count once service begins
ADVANCE 2.5,FN$XPDISHolds the customer for the service time, exponentially distributed about a mean of 2.5 minutes
RELEASE BARISTAFrees the barista so that the next waiting customer can be served
TABULATE THRUPUTEnters the elapsed time since the MARK block into the table THRUPUT
TERMINATERemoves the served customer from the model, leaving the termination counter unchanged
GENERATE 480Timer segment: produces a single transaction at clock time 480, the end of the 8 hour day
TERMINATE 1Reduces the termination counter by 1, bringing it to zero and stopping the run
START 1Sets the termination counter to 1 and starts the simulation

What the 8 Hour Run Produces

The line THRUPUT TABLE MP1,0,1,20 is a definition statement rather than a block: MP1 is the transit time measured from parameter 1, the first frequency class closes at 0, each class is 1 minute wide, and 20 classes are kept. Since MARK writes the arrival time and TABULATE reads it back through MP1, every entry in THRUPUT is one customer's total time in the shop.

When the timer transaction drives the termination counter to zero at 480 minutes, GPSS prints its standard report: the utilisation and number of entries of the facility BARISTA, the average and maximum contents of the queue LINE together with the average waiting time, and the THRUPUT table with its mean and standard deviation. With $\lambda = 1/3$ per minute and $\mu = 1/2.5 = 0.4$ per minute, the M/M/1 results give the values those simulated figures should settle near:

$$\rho = \frac{\lambda}{\mu} = 0.833, \qquad L_s = \frac{\rho}{1 - \rho} = 5 \text{ customers}, \qquad L_q = \frac{\rho^2}{1 - \rho} = 4.17 \text{ customers}$$

$$W_s = \frac{1}{\mu - \lambda} = 15 \text{ minutes}, \qquad W_q = \frac{\rho}{\mu - \lambda} = 12.5 \text{ minutes}$$

So over the 8 hour day about 160 customers arrive, the barista is busy for roughly 83 percent of the time, and a customer spends about 15 minutes in the shop of which about 12.5 minutes is spent waiting for service. A single 480 minute run is short, so the figures the simulation reports scatter around these analytical values rather than reproduce them exactly.

asked 5xavg 7 marks · 2082, 2081, 2079, 2078, 2076
Answer

Explain static mathematical model with suitable example. [5]

A static mathematical model is a type of mathematical model that represents a system at a particular point in time, where the system attribute values do not change over time. It uses symbolic notation and mathematical equations to repres...

asked 5xavg 5 marks · 2082, 2080, 2079, 2078, 2076
Answer

Write a short note on: a. Mid Square Method b. Digital Analog Simulation [2.5+2.5]

--- The Mid Square Method is one of the earliest and simplest techniques for generating pseudo-random numbers. It was proposed by John von Neumann. 1. Start with an n-digit seed number (initial value) $X0$. 2. Square the seed to obtain a...

asked 4xavg 5 marks · 2081, 2080, 2079, 2078
Answer

Describe the process of model building, verification and validation in detail with example. [5]

Model building is the process of constructing a conceptual and computational representation of a real-world system. The key steps involved are: Step Description ------------------- Problem Formulation Clearly state the problem to be stud...

asked 4xavg 4 marks · 2081, 2080, 2079, 2076
Answer

Write short notes on: a. Queuing discipline b. Random variate [5]

Short Notes

a. Queuing Discipline (2.5 marks)

Definition: The logical ordering of customers in a waiting line that determines which customer will be chosen for service next is called queuing discipline.

The number of customers that can wait in a line is called system capacity. The simplest case is an unlimited queue which can accommodate any number of customers (unlimited capacity). However, many systems such as web servers and call centers have limits on the number of entities that can be in the queue at any given time. Arrivals that come when the queue is full are turned away.

Common Types of Queuing Disciplines:

  1. FIFO (First In, First Out): Customers are served in the order they arrive. This is the most common and default discipline. Example: bank queues.

  2. LIFO (Last In, First Out): The most recently arrived customer is served first. Example: stack-based processing systems.

  3. SIRO (Service In Random Order): Customers are selected randomly from the waiting queue regardless of arrival order.

Note in Kendall Notation: In the standard Kendall Notation (A/B/C/D/N/K), D represents the queuing discipline. If not specified, the default is FIFO. For example, M/D/2/FIFO/5/∞ represents a system with exponential arrivals, deterministic service, 2 servers, FIFO discipline, capacity of 5, and infinite population.


b. Random Variate (2.5 marks)

Definition: A random variate is a particular outcome or realization generated from a specified probability distribution. It is a value produced by a random variable when the underlying random experiment is performed.

Key Points:

  • A random variate is used in simulation modeling to represent uncertain quantities such as inter-arrival times, service times, and processing durations.
  • Random variates are generated using techniques such as the Inverse Transform Method, Acceptance-Rejection Method, and Composition Method.
  • They are drawn from distributions such as Exponential (M), Deterministic (D), and Erlang (E) distributions, which are commonly used in queuing models.
  • In Markov Chain Monte Carlo (MCMC), sequences of random variates are generated to reflect complicated desired probability distributions.

Example: If service time follows an exponential distribution with mean 1/μ, then a random variate for service time is generated as:

$$x = -\frac{1}{\mu} \ln(U)$$

where U is a uniform random number between 0 and 1.

Random variates are essential in discrete event simulation to mimic real-world stochastic behavior of systems such as queuing networks.

asked 3xavg 7 marks · 2081, 2080, 2078
Answer

Why is it Necessary to Analyze Simulation Output? Explain Different Estimation Methods Used in Simulation Output Analysis [10]

Why is it Necessary to Analyze Simulation Output? Estimation Methods in Simulation Output Analysis


Why Analyze Simulation Output? (Necessity)

Simulation models incorporate random variates and random number generators to mimic real-world stochastic behavior. As a result, the output produced by a simulation is itself random (stochastic) rather than deterministic. This fundamental characteristic makes statistical analysis of simulation output absolutely necessary.

Key Reasons:

  1. Stochastic Nature of Output: Each simulation run produces different results due to random inputs. A single run cannot be trusted as a definitive answer.

  2. Need for Performance Estimation: We need to estimate performance parameters such as mean waiting time, throughput, or utilization with known precision. For discrete-time data (Y1, Y2, ..., Yn), the ordinary mean θ must be estimated properly.

  3. Bias Detection: The point estimator θ̂ is unbiased only if E(θ̂) = θ. If E(θ̂) ≠ θ, the estimator is biased and the bias E(θ̂) - θ must be identified and corrected.

  4. Initial Bias (Warm-up Problem): Simulations started from an idle or empty state introduce initial bias into the output. The first part of the simulation run may need to be ignored, and pilot runs should be used to judge how long the initial bias remains.

  5. Quantifying Uncertainty: Raw output values alone do not tell us how reliable our estimates are. Confidence intervals are needed to quantify uncertainty.

  6. Comparing Alternatives: To meaningfully compare two or more system designs, statistically valid output analysis is required.

  7. Determining Sufficient Sample Size: Without analysis, we cannot know whether enough data has been collected for valid conclusions.

Without proper output analysis, decisions based on simulation results may be misleading, biased, or statistically invalid.


Estimation Methods in Simulation Output Analysis

The core estimation framework is as follows:

  • Discrete-time data: (Y1, Y2, ..., Yn) with ordinary mean θ
  • Continuous-time data: {Y(t), 0 ≤ t ≤ T} with time-weighted mean θ

A. Point Estimation

A point estimate is a single numerical value computed from simulation output to estimate an unknown population parameter θ.

For discrete-time data:

$$\hat{\theta} = \bar{Y} = \frac{1}{n} \sum_{i=1}^{n} Y_i$$

Properties:

  • The estimator is unbiased if: E(θ̂) = θ
  • The estimator is biased if: E(θ̂) ≠ θ, and the quantity E(θ̂) - θ is called the bias

Sample Variance (estimating spread):

$$S^2 = \frac{1}{n-1} \sum_{i=1}^{n} (Y_i - \bar{Y})^2$$

Limitation: A point estimate gives no information about the precision or reliability of the estimate.


B. Interval Estimation (Confidence Intervals)

An interval estimate provides a range within which the true parameter θ is expected to lie with a specified probability (confidence level 1 - α).

Confidence interval for the mean:

$$\bar{Y} \pm t_{n-1,, \alpha/2} \cdot \frac{S}{\sqrt{n}}$$

Where:

  • t_{n-1, α/2} = critical value from the t-distribution with n-1 degrees of freedom
  • S = sample standard deviation
  • n = number of observations

Common confidence levels: 90%, 95%, 99%

Advantage: Provides both an estimate and a measure of its precision.


C. Method of Independent Replications

The simulation is run multiple independent times, each with a different random number seed.

Procedure:

  1. Perform k independent replications
  2. Compute the output mean for each replication: Y̅₁, Y̅₂, ..., Y̅ₖ
  3. Compute the overall mean and confidence interval across replications

Confidence interval:

$$\bar{Y} \pm t_{k-1,, \alpha/2} \cdot \frac{S}{\sqrt{k}}$$

Advantage: Observations across replications are independent, so standard statistical methods apply directly without approximation.

Limitation: Each replication must go through a warm-up phase, which can be wasteful. One remedy is to start the system in a more representative state, or to ignore the initial section, to eliminate initial bias.


D. Method of Batch Means

A single long simulation run is divided into k equal-sized batches (sub-intervals).

Procedure:

  1. Run the simulation for a long time T
  2. Divide the run into k batches, each of length m
  3. Compute the mean of each batch: Y̅₁, Y̅₂, ..., Y̅ₖ
  4. Treat these batch means as approximately independent observations
  5. Compute confidence interval using these k batch means

Condition: Batch size m must be large enough to ensure approximate independence between batch means (to reduce autocorrelation).

Advantage:

  • Avoids repeated warm-up phases
  • Efficient use of a single long run
  • Addresses the initial bias problem by discarding the initial warm-up period before batching (consistent with the recommendation to ignore the first part of the run)

E. Method of Regenerative Analysis

This method identifies regeneration points in the simulation, which are time points where the system probabilistically restarts in the same state.

Procedure:

  1. Identify regeneration points (e.g., moments when the system becomes empty in a queue)
  2. Divide the simulation into regenerative cycles
  3. Each cycle is independent of the others and the cycles are identically distributed
  4. Perform the statistical analysis on the cycle averages

Advantage: Produces strictly independent observations without any approximation.

Limitation: Not every simulation has easily identifiable regeneration points.


F. Autoregressive Method

This method models the autocorrelation structure of the output data directly instead of trying to remove it.

Procedure:

  1. Fit an autoregressive model to the time series of output observations
  2. Estimate the autocorrelation parameters from that fit
  3. Widen the confidence interval to account for the correlation between successive observations

Advantage: Uses every observation of a single run, with no need to discard data or form batches.

Limitation: Requires the correct autoregressive order to be identified, which is not always straightforward.


Conclusion

Analysing simulation output is essential because a simulation produces stochastic results that need statistical methods to be interpreted correctly. The choice of estimation method depends on whether the study is of a terminating or a steady-state simulation, and on the nature of the correlation in the output data. In practice, the method of independent replications and the method of batch means are the two most widely used.

asked 3xavg 5 marks · 2081, 2080, 2078
Answer

Describe different phases of simulation study with help of flowchart. [5]

Phases of Simulation Study

Definition

A simulation study is a systematic process of building, validating, and using a simulation model to analyze a real-world system. It involves a series of well-defined phases that guide the analyst from problem identification to final implementation.


Flowchart of Phases in Simulation Study

         +---------------------------+
         |   1. Problem Formulation  |
         +---------------------------+
                      |
                      v
         +---------------------------+
         | 2. Setting Objectives &   |
         |    Overall Project Plan   |
         +---------------------------+
                      |
                      v
         +---------------------------+
         |  3. Model Conceptualization|
         +---------------------------+
                      |
                      v
         +---------------------------+
         |    4. Data Collection     |
         +---------------------------+
                      |
                      v
         +---------------------------+
         |   5. Model Translation    |
         +---------------------------+
                      |
                      v
         +---------------------------+
         |     6. Verification       |
         +-------------+-------------+
                       |
              [Program works?]
              /              \
            NO                YES
            |                  |
     (Go back to            v
      Step 5)   +---------------------------+
                |      7. Validation        |
                +-------------+-------------+
                              |
                   [Represents real system?]
                   /                    \
                 NO                     YES
                 |                       |
         (Go back to                     v
          Step 3/4)      +---------------------------+
                         |  8. Experimental Design   |
                         +---------------------------+
                                      |
                                      v
                         +---------------------------+
                         | 9. Production Runs &      |
                         |       Analysis            |
                         +---------------------------+
                                      |
                              [More runs needed?]
                              /               \
                            YES               NO
                            |                  |
                    (Go back to                v
                     Step 8)   +---------------------------+
                               | 10. Document and Report   |
                               +---------------------------+
                                            |
                                            v
                               +---------------------------+
                               |    11. Implementation     |
                               +---------------------------+

Description of Each Phase

1. Problem Formulation

  • Clearly state the problem to be studied.
  • Define the boundaries and scope of the system to be simulated.

2. Setting Objectives and Overall Project Plan

  • Define what questions the simulation should answer.
  • Plan how to approach the problem, including resources, timeline, and team.

3. Model Conceptualization

  • Establish a reasonable conceptual model of the system.
  • Identify key components, variables, and their relationships.

4. Data Collection

  • Collect all data necessary to run the simulation.
  • This includes arrival rates, service rates, arrival processes, queue disciplines, etc.

5. Model Translation

  • Convert the conceptual model into a simulation programming language (e.g., GPSS, SIMSCRIPT, or general-purpose languages).

6. Verification

  • Check whether the program works properly.
  • Ensure the model is correctly translated into the computer program (debugging).

7. Validation

  • Check whether the simulation model accurately represents the real system.
  • Compare simulation outputs with real-world data.

8. Experimental Design

  • Decide:
    • How many simulation runs to perform?
    • How long each run should last?
    • What input variations (parameters) to test?

9. Production Runs and Analysis

  • Actually run the simulation.
  • Collect and statistically analyze the output data.

10. Repetition

  • If results are inconclusive or more accuracy is needed, repeat the experiments with different random numbers or parameter settings.

11. Document and Report

  • Document the model, assumptions, data, and results.
  • Report findings to decision-makers.

12. Implementation

  • If simulation results show it is advantageous, implement the new system or policy in the real world.

Summary Table

PhaseActivity
1Problem Formulation
2Objectives and Project Plan
3Model Conceptualization
4Data Collection
5Model Translation
6Verification
7Validation
8Experimental Design
9Production Runs and Analysis
10Repetition
11Document and Report
12Implementation

These phases ensure that the simulation study is systematic, reliable, and produces valid results that can be confidently applied to real-world decision making.

asked 3xavg 5 marks · 2080, 2079, 2078
Answer

Explain Monte Carlo simulation method with example. [5]

Monte Carlo Simulation Method

Definition

Monte Carlo simulation is a computerized mathematical technique that generates random sample data based on some known distribution for numerical experiments. It is applied to risk quantitative analysis and decision making problems, and is used by professionals in finance, project management, energy, manufacturing, engineering, research & development, transportation, and other fields.


Key Characteristics

Monte Carlo method has three important characteristics:

  1. The output must generate random samples
  2. The input distribution must be known
  3. The result must be known while performing an experiment

Flowchart for Monte Carlo Simulation

        Start
          |
          v
  Define the Problem
          |
          v
  Identify Input Variables
  (with known distributions)
          |
          v
  Generate Random Numbers
          |
          v
  Simulate the Experiment
  (compute output for each sample)
          |
          v
  Repeat N times
          |
          v
  Aggregate and Analyze Results
          |
          v
        Stop

Example: Estimating the Value of π

Problem: Use Monte Carlo simulation to estimate the value of π.

Approach:

  • Consider a unit square of side 1 and a quarter circle of radius 1 inscribed in it.
  • Area of quarter circle = π/4
  • Area of square = 1

Steps:

  1. Generate random points (x, y) where x and y are uniformly distributed between 0 and 1.
  2. Check if the point falls inside the quarter circle using the condition:

$$x^2 + y^2 \leq 1$$

  1. Count the number of points inside the circle (M) out of total points (N).
  2. Estimate π as:

$$\pi \approx 4 \times \frac{M}{N}$$

Numerical Illustration:

Trialxyx² + y²Inside Circle?
10.30.60.45Yes
20.80.71.13No
30.50.40.41Yes
40.20.90.85Yes
50.90.81.45No
  • Total points N = 5
  • Points inside circle M = 3

$$\pi \approx 4 \times \frac{3}{5} = 4 \times 0.6 = \mathbf{2.4}$$

Note: As N increases (more random samples), the estimate converges closer to the true value of π ≈ 3.14159.


Applications

  • Financial risk analysis
  • Project scheduling and management
  • Engineering design optimization
  • Manufacturing process simulation
  • Transportation and logistics planning

Summary

Monte Carlo simulation is a powerful technique that uses repeated random sampling to obtain numerical results. The more iterations performed, the more accurate and reliable the result becomes. It is especially useful when analytical solutions are difficult or impossible to obtain.

asked 3xavg 5 marks · 2082, 2081, 2080
Answer

Define Markov Chain. Explain with suitable example. [5]

Markov Chain: Definition and Explanation

Definition

A Markov Chain is a sequence of random variables X₁, X₂, X₃, ... with the Markov property, namely that, given the present state, the future and past states are independent.

Formally, this can be written as:

P(Xₙ₊₁ = xₙ₊₁ | X₁ = x₁, X₂ = x₂, ..., Xₙ = xₙ) = P(Xₙ₊₁ = xₙ₊₁ | Xₙ = xₙ)

This property is called the "memoryless" property - the next state depends only on the current state, not on the sequence of states that preceded it.


Key Concepts

TermMeaning
StateA possible condition the system can be in
TransitionMovement from one state to another
Transition ProbabilityProbability of moving from state i to state j
Transition MatrixMatrix containing all transition probabilities

Example: Weather Prediction

Consider a simple weather model with two states:

  • State 1: Sunny (S)
  • State 2: Rainy (R)

Transition Probabilities

Suppose:

  • If today is Sunny, probability of Sunny tomorrow = 0.8, Rainy = 0.2
  • If today is Rainy, probability of Sunny tomorrow = 0.4, Rainy = 0.6

Transition Matrix

$$P = \begin{pmatrix} 0.8 & 0.2 \ 0.4 & 0.6 \end{pmatrix}$$

Where rows represent the current state and columns represent the next state.

State Diagram

        0.8                  0.6
    [Sunny] ←→ 0.2 →→ [Rainy]
        ↑                    ↑
        ←←←← 0.4 ←←←←←←←←←←

Applying the Markov Property

If today is Sunny, the probability that it will be Rainy after 2 days is:

  • Sunny → Sunny → Rainy = 0.8 × 0.2 = 0.16
  • Sunny → Rainy → Rainy = 0.2 × 0.6 = 0.12
  • Total = 0.16 + 0.12 = 0.28

This calculation depends only on today's state (Sunny), not on what the weather was yesterday. This demonstrates the Markov property.


Application in Queuing Systems

Markov Chains are widely used in queuing models. For example, a single-server queue can be modeled as a continuous time Markov chain with transition matrix:

$$Q = \begin{pmatrix} -\lambda & \lambda \ \mu & -\mu \end{pmatrix}$$

The system is stable only if the utilization factor P = λ/μ < 1, meaning the arrival rate must be less than the service rate.


Summary

  • Markov Chain models systems that transition between states over time.
  • The key assumption is that the future depends only on the present, not the past.
  • It is widely used in simulation, queuing theory, weather forecasting, and network modeling.
asked 3xavg 5 marks · 2082, 2080, 2076
Answer

Explain non-stationary Poisson process in brief. [5]

A non-stationary Poisson process is a Poisson process in which the arrival rate varies with time. Unlike the stationary Poisson process where the arrival rate λ is constant, here the arrival rate λ(t) is a function of time. --- The defin...

asked 3xavg 5 marks · 2082, 2081, 2076
Answer

Explain the iterative process of calibrating a model. [5]

Iterative Process of Calibrating a Model

Definition

Calibration is the iterative process of comparing the model to the real system, making adjustments to the model, comparing again, and so on, until the model adequately represents the real system. The comparison of the model to reality is carried out by a variety of tests.


Steps in the Iterative Calibration Process

The calibration process follows a cycle of repeated steps as described below:

Step 1: Build the Initial Model

Construct an initial version of the simulation or mathematical model based on available data, assumptions, and understanding of the real system.

Step 2: Run the Model

Execute the model to generate outputs under defined conditions or inputs.

Step 3: Compare Model Output to Real System

Compare the model's output against observed real-world data or behavior. This comparison is carried out using a variety of tests, such as:

  • Statistical tests (mean, variance comparison)
  • Graphical comparisons (trend matching)
  • Sensitivity analysis

Step 4: Identify Discrepancies

Identify where and how the model output deviates from the real system behavior. These discrepancies indicate areas where the model needs adjustment.

Step 5: Adjust the Model

Modify model parameters, assumptions, or structure to reduce the identified discrepancies. Adjustments may include:

  • Changing input distributions
  • Modifying rate parameters
  • Revising model logic or equations

Step 6: Repeat (Iterate)

Return to Step 2 and repeat the process. The cycle continues until the model output closely matches the real system behavior within an acceptable tolerance.


Diagram of the Iterative Calibration Process

+------------------+
|  Build/Adjust    |
|     Model        |
+--------+---------+
         |
         v
+--------+---------+
|   Run the Model  |
+--------+---------+
         |
         v
+--------+---------+
| Compare Model to |
|   Real System    |
+--------+---------+
         |
    +---------+
    | Match?  |
    +---------+
    /         \
  YES          NO
   |            |
   v            v
Accept      Adjust Model
Model       (Go back to top)

Key Points

AspectDescription
NatureIterative (repeated cycles)
GoalModel output matches real system behavior
ToolVariety of comparison tests
OutcomeA validated, calibrated model ready for use

Conclusion

Calibration ensures that the simulation model is a reliable representation of the real system. Since no model is perfect on the first attempt, the iterative nature of calibration is essential to progressively improve model accuracy before it is used for decision-making or analysis.

asked 2xavg 8 marks · 2081, 2079
Answer

What is analog computer? Explain with suitable example. [5]

Analog computers are those computers that are unified with devices like adders and integrators so as to simulate the continuous mathematical model of a system, which generates continuous outputs. The electronic analog computer is based o...

asked 2xavg 5 marks · 2079
Answer

Why Confidence interval is needed in the analysis of simulation output. How can we establish a confidence interval? [5]

In the analysis of simulation output, a confidence interval is needed because: 1. Random Variability in Output: Output data from a simulation shows random variability when random number generators are used. Two different random number st...

asked 2xavg 5 marks · 2079, 2076
Answer

What is markov chain? Explain with example. [5]

A Markov Chain is a sequence of random variables X₁, X₂, X₃, ... with the Markov property, namely that, given the present state, the future and past states are independent. Mathematically, this property is expressed as: P(Xₙ₊₁ = xₙ₊₁ X₁ ...

Study every one of these with model answers, flashcards, and MCQs.

Open CSC328 study modes