Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Differentiate between true and pseudo-random numbers. Explain the linear congruential method of generating pseudo-random numbers with an example.

True vs Pseudo-Random Numbers

AspectTrue random numbersPseudo-random numbers
SourcePhysical phenomena (thermal/atmospheric noise, radioactive decay, coin tosses)A deterministic mathematical algorithm
ReproducibilityNot reproducibleFully reproducible from the same seed
PeriodicityNo periodEventually repeat (finite period)
Speed/costSlow, need special hardwareVery fast, cheap
Use in simulationHard to use (cannot repeat experiments)Standard choice (debugging, variance reduction)

True random numbers are genuinely unpredictable but cannot be reproduced, so simulation uses pseudo-random numbers: a deterministic sequence that appears random and passes statistical tests of uniformity and independence.

Linear Congruential Method (LCG)

The LCG generates a sequence of integers X0,X1,X2,X_0, X_1, X_2, \dots using the recurrence:

Xi+1=(aXi+c) mod mX_{i+1} = (a X_i + c)\ \text{mod}\ m

where:

  • X0X_0 = seed (start value), 0X0<m0 \le X_0 < m
  • aa = multiplier, cc = increment, mm = modulus

Random numbers in [0,1)[0,1) are obtained by Ri=Xi/mR_i = X_i / m.

If c0c \ne 0 it is a mixed LCG; if c=0c = 0 it is a multiplicative LCG. The maximum period is mm; choosing a,c,ma, c, m carefully (Hull–Dobell conditions) gives a full period.

Example

Let a=5, c=3, m=16, X0=7a = 5,\ c = 3,\ m = 16,\ X_0 = 7.

X1=(57+3) mod 16=38 mod 16=6R1=6/16=0.375X_1 = (5\cdot 7 + 3)\ \text{mod}\ 16 = 38\ \text{mod}\ 16 = 6 \Rightarrow R_1 = 6/16 = 0.375 X2=(56+3) mod 16=33 mod 16=1R2=1/16=0.0625X_2 = (5\cdot 6 + 3)\ \text{mod}\ 16 = 33\ \text{mod}\ 16 = 1 \Rightarrow R_2 = 1/16 = 0.0625 X3=(51+3) mod 16=8 mod 16=8R3=8/16=0.5X_3 = (5\cdot 1 + 3)\ \text{mod}\ 16 = 8\ \text{mod}\ 16 = 8 \Rightarrow R_3 = 8/16 = 0.5 X4=(58+3) mod 16=43 mod 16=11R4=11/16=0.6875X_4 = (5\cdot 8 + 3)\ \text{mod}\ 16 = 43\ \text{mod}\ 16 = 11 \Rightarrow R_4 = 11/16 = 0.6875

So the generated sequence is 7,6,1,8,11,7, 6, 1, 8, 11, \dots giving uniform random numbers 0.375,0.0625,0.5,0.6875,0.375, 0.0625, 0.5, 0.6875, \dots

random-numbers
2long10 marks

Explain discrete-event simulation. Describe the event-scheduling/time-advance algorithm used in simulation with a flowchart.

Discrete-Event Simulation (DES)

In discrete-event simulation the state of the system changes only at discrete points in time, called events (e.g. a customer arrival, start/end of service). Between events the system state is assumed constant, so the simulation "jumps" from one event to the next rather than advancing in fixed steps. This makes DES efficient for systems such as queues, networks and inventories.

Key components:

  • System state – variables describing the system (e.g. number in queue, server busy/idle).
  • Simulation clock – current value of simulated time.
  • Event list (FEL) – list of future events ordered by their scheduled time.
  • Statistical counters – accumulate output measures (waiting time, utilisation).

Event-Scheduling / Time-Advance Algorithm

The next-event time-advance approach repeatedly removes the most imminent event from the future event list (FEL), advances the clock to that event's time, executes the corresponding event routine (which updates state, statistics and may schedule new events), and repeats.

1. Initialize: clock = 0, set initial state,
   initialize statistical counters,
   schedule initial (first arrival) event in FEL.
2. While FEL not empty AND stopping condition not met:
     a. Remove the imminent event (smallest event time) from FEL.
     b. Advance simulation clock to that event time.
     c. Execute the event routine:
          - update system state
          - update statistical counters
          - generate future events and insert into FEL
3. End: compute and report output statistics.

Flowchart (described in words)

        +------------------------+
        |   Initialization        |
        | clock=0, FEL, counters  |
        +-----------+------------+
                    v
        +------------------------+
        | Remove imminent event   |
        | Advance clock to it     |
        +-----------+------------+
                    v
        +------------------------+
        | Execute event routine:  |
        | update state & stats,   |
        | schedule new events     |
        +-----------+------------+
                    v
            < Stop condition? >---No--> (back to Remove imminent event)
                    | Yes
                    v
        +------------------------+
        | Generate report /       |
        | output statistics       |
        +------------------------+

The loop continues until a stopping condition (fixed time, fixed number of customers, or empty FEL) is reached, after which output measures are reported.

discrete-event
3long10 marks

Explain the different stages/steps involved in a sound simulation study with a flowchart.

Steps in a Sound Simulation Study

A disciplined simulation study (Banks, Carson, Nelson & Nicol) follows these stages:

  1. Problem formulation – clearly state the problem and objectives.
  2. Setting objectives and overall project plan – define questions to answer, scope, resources, timeline.
  3. Model conceptualization – abstract the real system into a conceptual model (entities, variables, logic).
  4. Data collection – gather input data (arrival rates, service times, distributions).
  5. Model translation – code the model in a simulation language/package (GPSS, SIMSCRIPT, Arena, etc.).
  6. Verification – check that the program correctly implements the conceptual model (debugging).
  7. Validation – check that the model accurately represents the real system; compare with real data, often iteratively (loops back to conceptualization/data).
  8. Experimental design – decide which scenarios, run lengths, number of replications.
  9. Production runs and analysis – execute runs and statistically analyse output.
  10. More runs? – if needed, design and run additional experiments.
  11. Documentation and reporting – document model, assumptions and results.
  12. Implementation – put the recommended solution into practice.

Flowchart (described in words)

Problem formulation
        |
Set objectives & project plan
        |
Model conceptualization <---------+
        |                          |
Data collection ------------------+   (loops back if validation fails)
        |
Model translation (coding)
        |
   < Verified? >--No--> back to Model translation
        | Yes
   < Validated? >--No--> back to Model conceptualization / data
        | Yes
Experimental design
        |
Production runs & analysis
        |
   < More runs? >--Yes--> Experimental design
        | No
Documentation & reporting
        |
Implementation

Verification and validation are decision points that feed back into earlier stages, making the process iterative rather than purely sequential.

simulation-languages
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Explain Markov chains and their application in simulation with an example.

Markov Chains

A Markov chain is a stochastic process {Xn}\{X_n\} that moves among a finite set of states such that the next state depends only on the current state, not on the past history (the Markov / memoryless property):

P(Xn+1=jXn=i,Xn1,)=P(Xn+1=jXn=i)=pijP(X_{n+1}=j \mid X_n=i, X_{n-1}, \dots) = P(X_{n+1}=j \mid X_n=i) = p_{ij}

The one-step transition probabilities pijp_{ij} form a transition matrix PP, where each row sums to 1. The state probability vector after nn steps is π(n)=π(0)Pn\pi^{(n)} = \pi^{(0)} P^{n}, and the long-run (steady-state) distribution π\pi satisfies π=πP\pi = \pi P.

Application in Simulation

Markov chains model systems whose future depends only on present state, e.g. machine up/down status, weather, customer brand switching, queue length. In simulation we generate a uniform random number RR at each step and use the current row of PP to decide the next state, producing a realistic state trajectory.

Example (Weather)

States: Sunny (S), Rainy (R), with

P=(0.80.20.40.6)P = \begin{pmatrix} 0.8 & 0.2 \\ 0.4 & 0.6 \end{pmatrix}

If today is Sunny, then P(Sunny tomorrow)=0.8P(\text{Sunny tomorrow}) = 0.8. To simulate, draw R[0,1)R \in [0,1): if R<0.8R < 0.8 next state is Sunny, else Rainy. The steady-state π=(πS,πR)\pi = (\pi_S, \pi_R) solves π=πP\pi = \pi P, giving πS=2/3, πR=1/3\pi_S = 2/3,\ \pi_R = 1/3 — i.e. about 67% sunny days in the long run.

markov
5short5 marks

Differentiate between physical models and mathematical models with examples.

Physical vs Mathematical Models

Physical (iconic) model – a tangible, scaled physical representation of the real system that looks and/or behaves like it. The model's properties are represented by physical properties.

Mathematical model – represents the system using mathematical symbols, equations and logical relationships among variables; it is solved analytically or by simulation rather than built physically.

AspectPhysical modelMathematical model
FormTangible, scaled objectEquations / symbols
Cost & flexibilityExpensive, hard to changeCheap, easy to modify
SolutionObservation/experiment on the objectAnalytical or numerical/simulation
Accuracy of "what-if"LimitedEasily explores many scenarios

Examples

  • Physical models: a wind-tunnel model of an aircraft, a scaled model of a dam or building, a globe representing the Earth.
  • Mathematical models: Newton's F=maF = ma, the queuing relation L=λWL = \lambda W (Little's law), Xi+1=(aXi+c)modmX_{i+1}=(aX_i+c)\bmod m for an LCG, a set of differential equations describing population growth.

Most computer simulations are built on mathematical models because they are flexible, inexpensive and allow rapid experimentation.

system-modeling
6short5 marks

Explain the mid-square method and the additive congruential method of generating random numbers.

Mid-Square Method

Proposed by von Neumann, it generates random numbers by squaring the seed and extracting the middle digits.

Steps (for nn-digit numbers):

  1. Take a seed X0X_0 of nn digits.
  2. Square it; pad with leading zeros to 2n2n digits.
  3. Extract the middle nn digits → next number X1X_1.
  4. Repeat; Ri=Xi/10nR_i = X_i / 10^{n}.

Example (n=4n=4, seed =5735= 5735):

  • 57352=328902255735^2 = 32890225 → middle 4 digits =8902= 8902X1=8902, R1=0.8902X_1 = 8902,\ R_1 = 0.8902
  • 89022=792456048902^2 = 79245604 → middle 4 digits =2456= 2456X2=2456, R2=0.2456X_2 = 2456,\ R_2 = 0.2456

Drawback: if the middle digits become 0 the sequence degenerates and the period can be short.

Additive Congruential Method

This method extends the linear congruential idea by adding two (or more) previous values instead of multiplying. The general recurrence uses the last kk seeds:

Xi=(Xi1+Xi2++Xik) mod mX_i = (X_{i-1} + X_{i-2} + \dots + X_{i-k})\ \text{mod}\ m

A common form (lagged Fibonacci) uses two earlier terms:

Xi=(Xi1+Xik) mod m,Ri=Xi/mX_i = (X_{i-1} + X_{i-k})\ \text{mod}\ m, \qquad R_i = X_i/m

It requires an initial set of kk seed values. It is fast and can achieve very long periods, but is more sensitive to the choice of seeds and lags than the LCG.

Example: with m=10m = 10 and seeds X1=1,X2=1,X3=2X_1=1, X_2=1, X_3=2, using Xi=(Xi1+Xi2)mod10X_i=(X_{i-1}+X_{i-2})\bmod 10: X4=(2+1)=3X_4=(2+1)=3, X5=(3+2)=5X_5=(3+2)=5, X6=(5+3)=8X_6=(5+3)=8, X7=(8+5)mod10=3,X_7=(8+5)\bmod10=3,\dots

midsquare
7short5 marks

Define entity, attribute, activity, event and state of a system in the context of simulation.

Basic Simulation Terminology

  • Entity – an object of interest in the system whose behaviour is modelled. It may be dynamic (moves through the system, e.g. a customer, a part) or static (e.g. a server). Example: customers in a bank.

  • Attribute – a property or characteristic of an entity. Example: a customer's arrival time, priority, or account balance.

  • Activity – a time-consuming operation or process that changes the system, with a known/specified duration. Example: the service of a customer by a teller.

  • Event – an instantaneous occurrence that changes the state of the system (it takes no time). Example: a customer arrival or a service completion (departure).

  • State of the system – the collection of variables needed to describe the system at any instant, relative to the study's objectives. Example: number of customers in the queue and whether the teller is busy or idle.

Thus events are the instants at which activities begin and end, entities possess attributes, and the values of the state variables evolve as events occur.

entities-attributes
8short5 marks

Explain the importance of output analysis in simulation. Differentiate between terminating and steady-state simulation.

Importance of Output Analysis

Simulation output is random (because inputs are random variates), so a single run gives only one realization. Output analysis applies statistical methods to these random outputs to draw valid conclusions. Its importance:

  • Estimates performance measures (mean waiting time, utilisation) with confidence intervals rather than a single uncertain number.
  • Distinguishes real differences between system alternatives from random noise.
  • Determines required run length, warm-up period and number of replications.
  • Prevents wrong decisions from treating one lucky/unlucky run as truth.

Terminating vs Steady-State Simulation

AspectTerminating simulationSteady-state (non-terminating) simulation
StoppingA natural terminating event/condition (e.g. bank closes at 5 pm) defines run lengthNo natural end; runs "forever", interested in long-run behaviour
InterestBehaviour over the finite interval [0,TE][0, T_E]Steady-state (long-run) performance independent of initial conditions
Initial conditionsImportant and part of the answerA transient/warm-up period must be discarded to remove initial bias
Analysis methodIndependent replicationsBatch means or replication/deletion after warm-up
ExampleBank open 9–5; one-day shift of a machineA continuously running telephone exchange or hospital ICU

In terminating simulations the modeller runs many independent replications and averages; in steady-state simulations the initial transient is removed and methods like batch means are used to estimate the long-run mean.

output-analysis
9short5 marks

Explain the Poisson and exponential distributions and their role in queuing simulation.

Poisson Distribution

A discrete distribution giving the probability of kk events occurring in a fixed interval when events happen independently at a constant average rate λ\lambda:

P(X=k)=eλλkk!,k=0,1,2,P(X = k) = \frac{e^{-\lambda}\lambda^{k}}{k!}, \qquad k = 0,1,2,\dots

with mean =λ= \lambda and variance =λ= \lambda. It models the number of arrivals per unit time.

Exponential Distribution

A continuous distribution describing the time between successive events of a Poisson process, with rate λ\lambda:

f(t)=λeλt,t0,F(t)=1eλtf(t) = \lambda e^{-\lambda t}, \quad t \ge 0, \qquad F(t) = 1 - e^{-\lambda t}

mean =1/λ= 1/\lambda. It is memoryless: P(T>s+tT>s)=P(T>t)P(T>s+t\mid T>s) = P(T>t).

Role in Queuing Simulation

These two distributions are duals: if arrivals are Poisson with rate λ\lambda (number per unit time), then inter-arrival times are exponential with mean 1/λ1/\lambda. The same holds for service: exponential service times correspond to Poisson service completions. This is the basis of the classic M/M/1 queue (Markovian arrivals/Markovian service, one server), where both inter-arrival and service times are exponential.

In simulation we generate exponential inter-arrival and service times by inversion:

T=1λln(1R)(RU[0,1))T = -\frac{1}{\lambda}\ln(1 - R) \quad (R \sim U[0,1))

These variates drive the event list to schedule arrivals and departures.

distributions
10short5 marks

Explain the features of a general-purpose simulation language (e.g., GPSS).

General-Purpose Simulation Language (GPSS)

GPSS (General Purpose Simulation System) is a process/transaction-oriented, discrete-event simulation language especially suited to queuing systems. Its main features:

  • Transaction (entity) flow model: the system is described as dynamic entities called transactions moving through a sequence of blocks that represent operations (GENERATE, ADVANCE, QUEUE, SEIZE, RELEASE, TERMINATE).
  • Built-in resources: Facilities (single-server resources), Storages (multi-capacity resources) and Queues are predefined, so modelling servers and waiting lines is easy.
  • Automatic clock and event handling: the simulation clock, future-event scheduling and entity movement are managed by the system; the modeller does not code the time-advance logic.
  • Built-in random-number and distribution generators for arrival and service times.
  • Automatic statistics collection: utilisation, queue length, average waiting time and counts are gathered and reported automatically.
  • Block-diagram (flowchart) representation: models map directly to an easy-to-read block diagram, reducing programming effort.

Because these queuing constructs and statistics are built in, GPSS lets a modeller build and analyse discrete-event models quickly with little general-purpose programming, at the cost of less flexibility than a general language.

gpss
11short5 marks

Explain the chi-square test for testing the uniformity of random numbers with an example.

Chi-Square Test for Uniformity

The chi-square (χ2\chi^2) goodness-of-fit test checks whether a set of random numbers is uniformly distributed on [0,1)[0,1).

Procedure:

  1. Divide [0,1)[0,1) into nn equal sub-intervals (classes).
  2. Count the observed frequency OiO_i of numbers falling in each class.
  3. For NN numbers and nn equal classes the expected frequency is Ei=N/nE_i = N/n.
  4. Compute the statistic
χ02=i=1n(OiEi)2Ei\chi^2_0 = \sum_{i=1}^{n} \frac{(O_i - E_i)^2}{E_i}
  1. Compare with the critical value χα,n12\chi^2_{\alpha, n-1} (degrees of freedom =n1= n-1). If χ02χα,n12\chi^2_0 \le \chi^2_{\alpha,n-1}, do not reject H0H_0 — the numbers are uniform.

Example

Suppose N=100N = 100 numbers are placed into n=10n = 10 classes, so Ei=100/10=10E_i = 100/10 = 10. Observed counts:

Class12345678910
OiO_i8129111013710119
χ02=(810)2+(1210)2+(910)2+(1110)2+0+(1310)2+(710)2+0+(1110)2+(910)210\chi^2_0 = \frac{(8-10)^2+(12-10)^2+(9-10)^2+(11-10)^2+0+(13-10)^2+(7-10)^2+0+(11-10)^2+(9-10)^2}{10} =4+4+1+1+0+9+9+0+1+110=3010=3.0= \frac{4+4+1+1+0+9+9+0+1+1}{10} = \frac{30}{10} = 3.0

Degrees of freedom =9= 9. At α=0.05\alpha = 0.05, χ0.05,92=16.92\chi^2_{0.05,9} = 16.92. Since 3.0<16.923.0 < 16.92, we do not reject H0H_0: the numbers are uniformly distributed.

chi-square
12short5 marks

Explain the classification of models: static vs dynamic, deterministic vs stochastic, continuous vs discrete.

Classification of Simulation Models

Static vs Dynamic

  • Static model: represents a system at a particular point in time; time plays no role. Example: a Monte-Carlo model estimating π\pi or evaluating an integral.
  • Dynamic model: represents a system as it evolves over time. Example: a bank queue simulated over an 8-hour day.

Deterministic vs Stochastic

  • Deterministic model: contains no random variables; the same input always gives the same output. Example: a set of differential equations for a known chemical reaction.
  • Stochastic model: contains one or more random variables, so outputs are themselves random and must be analysed statistically. Example: a queue with random (exponential) arrival and service times.

Continuous vs Discrete

  • Continuous model: the state variables change continuously with respect to time, typically described by differential equations. Example: the level of water in a reservoir.
  • Discrete model: the state variables change only at discrete points in time (events). Example: the number of customers in a queue, which changes only at arrivals/departures.

These dimensions are independent; a real model is described by one choice from each pair (e.g. a single-server queue is dynamic, stochastic, discrete).

model-types

Frequently asked questions

Where can I find the BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) question paper 2078?
The full BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) 2078 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Simulation and Modelling (BSc CSIT, CSC317) 2078 paper come with solutions?
Yes. Every question on this Simulation and Modelling (BSc CSIT, CSC317) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) 2078 paper?
The BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) 2078 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Simulation and Modelling (BSc CSIT, CSC317) past paper free?
Yes — reading and attempting this Simulation and Modelling (BSc CSIT, CSC317) past paper on Kekkei is completely free.