Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Define system, model and simulation. Explain the different types of models and discuss the advantages and disadvantages of simulation.

System, Model and Simulation

System: A collection of entities (people, machines, components) that act and interact together toward the accomplishment of some logical end. It has a state described by state variables (e.g., number of customers in a bank).

Model: A simplified abstract representation of a system that captures its essential features and the relationships among them, used to study the system without experimenting on the real thing.

Simulation: The technique of imitating the operation of a real-world system over time by driving a model with inputs and observing its behaviour, in order to evaluate performance, test alternatives, and predict outcomes.

Types of Models

  • Physical (Iconic) vs Mathematical models — physical models are scaled-down tangible replicas (a wind-tunnel aircraft); mathematical models use symbols, equations and logical relations.
  • Static vs Dynamic — a static model represents a system at one point in time (Monte Carlo); a dynamic model evolves over time (queue evolution).
  • Deterministic vs Stochastic — deterministic models contain no randomness (same input → same output); stochastic models include random variables (random arrivals/service).
  • Continuous vs Discrete — in continuous models state changes smoothly with time (fluid flow, differential equations); in discrete models state changes only at distinct event instants (customer arrival).

Most computer simulations of interest are dynamic, stochastic and discrete-event models.

Advantages of Simulation

  • Allows study of systems that are too complex for analytical/mathematical solution.
  • New policies, designs, and "what-if" scenarios can be tested without disturbing or building the real system.
  • Time can be compressed (years simulated in seconds) or expanded.
  • Bottlenecks and the effect of changing variables can be identified and understood.

Disadvantages of Simulation

  • Building a valid model requires special training; results depend on model quality.
  • Can be expensive and time-consuming to develop, run and analyse.
  • Outputs are estimates with random error, sometimes mistaken for exact answers (hard to interpret).
  • Easy to misuse: an invalid or poorly verified model gives misleading conclusions.
simulation-concepts
2long10 marks

Explain the characteristics and structure of a basic queuing system. Discuss the various performance measures of a single-server (M/M/1) queuing system.

Characteristics and Structure of a Basic Queuing System

A queuing system arises whenever customers demand service from limited servers and may have to wait. Its key characteristics are:

  1. Arrival (input) process — how customers arrive, described by the inter-arrival time distribution; often Poisson arrivals with rate λ\lambda.
  2. Service mechanism — number of servers and the service-time distribution; often exponential service with rate μ\mu.
  3. Queue (system) capacity — finite or infinite waiting room.
  4. Queue discipline — order of service: FIFO, LIFO, priority, random.
  5. Calling population — finite or infinite source of customers.

Structure: Calling population → Arrivals → Queue (waiting line) → Server(s) → Departures. Customers join the queue, wait if all servers are busy, get served, then leave.

Performance Measures of an M/M/1 Queue

M/M/1: Poisson arrivals (rate λ\lambda), exponential service (rate μ\mu), single server, infinite capacity, FIFO. Let the traffic intensity be ρ=λ/μ\rho = \lambda/\mu (system stable only if ρ<1\rho < 1).

MeasureFormula
Server utilizationρ=λμ\rho = \dfrac{\lambda}{\mu}
Prob. of nn customersPn=(1ρ)ρnP_n = (1-\rho)\rho^n
Prob. system emptyP0=1ρP_0 = 1-\rho
Avg. number in systemL=ρ1ρ=λμλL = \dfrac{\rho}{1-\rho} = \dfrac{\lambda}{\mu-\lambda}
Avg. number in queueLq=ρ21ρ=λ2μ(μλ)L_q = \dfrac{\rho^2}{1-\rho} = \dfrac{\lambda^2}{\mu(\mu-\lambda)}
Avg. time in systemW=1μλW = \dfrac{1}{\mu-\lambda}
Avg. waiting time in queueWq=ρμλ=λμ(μλ)W_q = \dfrac{\rho}{\mu-\lambda} = \dfrac{\lambda}{\mu(\mu-\lambda)}

These are linked by Little's Law: L=λWL = \lambda W and Lq=λWqL_q = \lambda W_q.

Example: If λ=6/hr\lambda = 6/\text{hr}, μ=8/hr\mu = 8/\text{hr}, then ρ=0.75\rho = 0.75, L=0.75/0.25=3L = 0.75/0.25 = 3 customers, W=1/(86)=0.5W = 1/(8-6) = 0.5 hr = 30 min.

queuing
3long10 marks

Explain the Monte Carlo simulation method with a suitable example. Use Monte Carlo simulation to estimate the value of pi.

Monte Carlo Simulation Method

Monte Carlo simulation is a static, stochastic technique that uses repeated random sampling to obtain numerical estimates of quantities that may be deterministic but are difficult to compute analytically. The general steps are:

  1. Define a domain of possible inputs and a probability model.
  2. Generate inputs randomly (using random numbers UU(0,1)U \sim U(0,1)).
  3. Perform a deterministic computation on each sample.
  4. Aggregate (average) the results to estimate the desired quantity.

As the number of samples NN \to \infty, by the Law of Large Numbers the estimate converges to the true value; error decreases as O(1/N)O(1/\sqrt{N}).

Simple example (estimating an integral): to estimate 01f(x)dx\int_0^1 f(x)\,dx, draw xiU(0,1)x_i \sim U(0,1) and average f(xi)f(x_i).

Estimating π\pi by Monte Carlo

Consider a unit square [0,1]×[0,1][0,1]\times[0,1] containing a quarter circle of radius 1. The quarter circle has area π/4\pi/4 and the square has area 1, so a random point lands inside the quarter circle with probability π/4\pi/4.

Algorithm:

import random

def estimate_pi(N):
    inside = 0
    for _ in range(N):
        x = random.random()   # U(0,1)
        y = random.random()
        if x*x + y*y <= 1.0:  # inside quarter circle
            inside += 1
    return 4.0 * inside / N

print(estimate_pi(1_000_000))   # ~3.1416

Reasoning:

points inside circletotal pointsπ/41    π4insideN.\frac{\text{points inside circle}}{\text{total points}} \approx \frac{\pi/4}{1} \;\Rightarrow\; \pi \approx 4\cdot\frac{\text{inside}}{N}.

With N=1,000,000N = 1{,}000{,}000 random points the estimate is close to 3.14163.1416; accuracy improves as NN increases.

monte-carlo
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

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

Classification of Models

Static vs Dynamic

  • Static model: represents a system at a particular instant of time, with no role for time evolution (e.g., a Monte Carlo model of a single roll of dice).
  • Dynamic model: represents the system as it changes over time (e.g., a bank queue evolving as customers arrive and leave).

Deterministic vs Stochastic

  • Deterministic model: contains no random variables; a given set of inputs always produces the same output (e.g., a fixed schedule of patients with known service times).
  • Stochastic model: contains one or more random inputs, so outputs are themselves random and described by distributions (e.g., random customer arrivals and service times).

Continuous vs Discrete

  • Continuous model: state variables change continuously with respect to time, usually described by differential equations (e.g., level of water in a reservoir).
  • Discrete model: state variables change only at discrete (separated) points in time when events occur (e.g., number of customers changing only at an arrival or a departure).

These dimensions are independent; a typical simulation is dynamic, stochastic and discrete.

model-types
5short5 marks

Explain the tests for randomness. Describe the frequency (Kolmogorov-Smirnov) test and the runs test.

Tests for Randomness

Generated pseudo-random numbers must be tested for two properties: uniformity (the numbers are uniformly distributed on (0,1)(0,1)) and independence (no correlation between successive numbers). Common tests include the frequency (Kolmogorov-Smirnov / chi-square) test for uniformity and the runs test, gap test, poker test, and autocorrelation test for independence.

Frequency Test — Kolmogorov-Smirnov (K-S)

The K-S test checks uniformity by comparing the empirical CDF of the sample with the theoretical uniform CDF F(x)=xF(x)=x on (0,1)(0,1).

  1. Rank the NN numbers in ascending order: R(1)R(2)R(N)R_{(1)} \le R_{(2)} \le \dots \le R_{(N)}.
  2. Compute
D+=max1iN(iNR(i)),D=max1iN(R(i)i1N).D^{+}=\max_{1\le i\le N}\left(\frac{i}{N}-R_{(i)}\right),\qquad D^{-}=\max_{1\le i\le N}\left(R_{(i)}-\frac{i-1}{N}\right).
  1. Let D=max(D+,D)D=\max(D^{+},D^{-}).
  2. If DDαD \le D_{\alpha} (critical value from the K-S table for sample size NN and significance α\alpha), accept the hypothesis that the numbers are uniform; otherwise reject.

Runs Test

The runs test checks independence. A run is a succession of similar events (e.g., a run up = increasing sequence, run down = decreasing). The numbers, not their values, are examined for the pattern of increases/decreases.

  • Count the total number of runs aa in the sequence of NN numbers.
  • Under independence, the mean and variance of the number of runs (runs up and down) are
μa=2N13,σa2=16N2990.\mu_a=\frac{2N-1}{3},\qquad \sigma_a^2=\frac{16N-29}{90}.
  • Form the standardized statistic Z=aμaσaZ=\dfrac{a-\mu_a}{\sigma_a}.
  • If zα/2Zzα/2-z_{\alpha/2}\le Z\le z_{\alpha/2}, accept independence; otherwise reject (too few or too many runs indicates dependence).
random-tests
6short5 marks

Explain the basic properties of random numbers: uniformity and independence.

Basic Properties of Random Numbers

A sequence of random numbers R1,R2,R_1, R_2, \dots used in simulation must behave like independent draws from a Uniform (0,1)(0,1) distribution. The two essential statistical properties are uniformity and independence.

1. Uniformity

The numbers must be uniformly distributed over the interval (0,1)(0,1); every value is equally likely. If the interval is divided into nn equal sub-intervals, each should contain about N/nN/n of the NN numbers. Formally, the probability density function is

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

with expected value E(R)=12E(R)=\tfrac12 and variance Var(R)=112\operatorname{Var}(R)=\tfrac{1}{12}.

2. Independence

Each random number must be statistically independent of the others; the value of one number gives no information about the next. Therefore there should be no correlation between successive numbers, and the probability of observing a value in any sub-interval is independent of previous values.

Uniformity is verified using frequency tests (chi-square, Kolmogorov-Smirnov); independence is verified using the runs test, autocorrelation test, gap test, etc. A generator satisfying both properties produces numbers acceptable for simulation.

random-properties
7short5 marks

Explain the inverse transform technique for generating random variates from the exponential distribution.

Inverse Transform Technique (Exponential Distribution)

The inverse transform method generates a random variate XX with a given CDF F(x)F(x) by setting F(X)=RF(X)=R, where RU(0,1)R\sim U(0,1), and solving X=F1(R)X=F^{-1}(R).

Steps

  1. Write the CDF. The exponential distribution with rate λ\lambda (mean 1/λ1/\lambda) has pdf f(x)=λeλxf(x)=\lambda e^{-\lambda x}, x0x\ge 0, and CDF
F(x)=1eλx,x0.F(x)=1-e^{-\lambda x},\quad x\ge 0.
  1. Set F(X)=RF(X)=R:
R=1eλX.R = 1 - e^{-\lambda X}.
  1. Solve for XX:
eλX=1R    λX=ln(1R)    X=1λln(1R).e^{-\lambda X}=1-R \;\Rightarrow\; -\lambda X=\ln(1-R) \;\Rightarrow\; X=-\frac{1}{\lambda}\ln(1-R).
  1. Simplify. Since 1R1-R is also U(0,1)U(0,1), we may write
X=1λlnR.\boxed{X=-\frac{1}{\lambda}\ln R}.

Example

If λ=2\lambda = 2 and a random number R=0.25R = 0.25, then

X=12ln(0.25)=12(1.386)=0.693.X=-\frac{1}{2}\ln(0.25)=-\tfrac12(-1.386)=0.693.

Each uniform random number RR thus yields one exponential variate; repeating gives a sample of exponential inter-arrival or service times for the simulation.

random-variate
8short5 marks

Explain Kendall's notation for queuing systems with examples.

Kendall's Notation for Queuing Systems

Kendall's notation is a shorthand A/B/c/N/K/ZA/B/c/N/K/Z used to describe a queuing system, where:

SymbolMeaning
AInter-arrival time distribution
BService time distribution
cNumber of parallel servers
NSystem capacity (max customers; default \infty)
KSize of calling population (default \infty)
ZQueue discipline (default FIFO)

Usually only the first three are written: A/B/c. Common codes for A and B:

  • M — Markovian / exponential (Poisson process)
  • D — Deterministic (constant)
  • Ek_k — Erlang of order kk
  • G — General (arbitrary) distribution

Examples

  • M/M/1 — Poisson arrivals, exponential service, single server, infinite capacity, FIFO.
  • M/M/c — Poisson arrivals, exponential service, cc identical servers (e.g., bank with cc tellers).
  • M/D/1 — Poisson arrivals, constant (deterministic) service time, one server (e.g., automated car wash).
  • M/M/1/N — single server but finite capacity NN (customers turned away when full).
  • G/G/1 — general arrival and service distributions, one server.
queuing-kendall
9short5 marks

What is a simulation clock? Differentiate between fixed-increment and next-event time-advance mechanisms.

Simulation Clock

The simulation clock is a variable that records the current value of simulated time in the model. It is not real time; it advances according to the model logic and tells the simulation "when" the current state holds. Because nothing of interest happens between events, the clock is advanced from event to event. Two mechanisms advance it:

Fixed-Increment Time Advance

  • The clock advances in uniform, fixed steps Δt\Delta t (e.g., 1 minute at a time).
  • After each step, the model checks whether any events occurred during that interval and processes them, assuming they happened at the end (or start) of the interval.
  • Pros: simple; suitable for continuous systems sampled periodically.
  • Cons: wasted computation on intervals with no events; loss of accuracy because events are forced onto step boundaries; choosing Δt\Delta t is a trade-off between speed and precision.

Next-Event Time Advance

  • The clock jumps directly to the time of the next imminent event, skipping idle periods.
  • The system maintains a future event list (FEL); at each step the earliest event is selected, the clock is set to that event time, and the state and statistics are updated.
  • Pros: no idle steps, so it is efficient; events are processed at their exact times (accurate). This is the standard mechanism for discrete-event simulation.
  • Cons: more complex bookkeeping (event list management).

Key Difference

Fixed-increment moves time in equal pre-set steps regardless of events; next-event moves time to wherever the next event occurs, making it faster and more accurate for discrete-event systems.

simulation-clock
10short5 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 set of states such that the future state depends only on the present state, not on the past — the memoryless or Markov property:

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

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

Application in Simulation

Markov chains model systems whose state evolves probabilistically over time — queue lengths, machine up/down status, weather, inventory levels, web-page navigation, and Markov-Chain Monte Carlo (MCMC) sampling. In simulation, the transition matrix is used with random numbers to decide the next state at each step.

Example — Weather Model

States: Sunny (S) and Rainy (R). Transition matrix:

from \ toSR
S0.80.2
R0.40.6

If today is Sunny, then P(tomorrow Rainy)=0.2P(\text{tomorrow Rainy})=0.2. To simulate, draw RU(0,1)R\sim U(0,1): from state S, if R<0.8R<0.8 next state is Sunny, else Rainy. Iterating generates a sequence of weather states whose long-run fractions converge to the steady-state distribution found from π=πP\pi=\pi P (here πS=23\pi_S=\tfrac{2}{3}, πR=13\pi_R=\tfrac{1}{3}).

markov
11short5 marks

Differentiate between physical models and mathematical models with examples.

Physical Models vs Mathematical Models

Physical (Iconic) Model: A tangible, scaled physical replica of the real system that looks like what it represents. It captures geometric and physical properties and is used for visualization and physical experimentation.

Mathematical Model: An abstract representation that uses symbols, variables, equations and logical relationships to describe how the system behaves. It captures functional relationships rather than physical appearance and is studied analytically or by computer simulation.

AspectPhysical ModelMathematical Model
FormTangible, scaled objectSymbols, equations, logic
ResemblanceLooks like the real systemAbstract; no physical likeness
ManipulationPhysical experimentsSolved analytically / on computer
Cost & flexibilityCostly, hard to modifyCheaper, easy to change parameters
ExamplesScale model of a building, wind-tunnel aircraft, globe, model carE=mc2E=mc^2, queuing equations L=λ/(μλ)L=\lambda/(\mu-\lambda), a simulation program of a bank

Examples:

  • Physical: a miniature aeroplane tested in a wind tunnel; a planetarium model of the solar system.
  • Mathematical: Newton's law of motion F=maF=ma; an M/M/1 queue described by its rate equations; a computer simulation of traffic flow.

Most computer simulations use mathematical models because they are flexible, inexpensive and easy to experiment with.

system-modeling
12short5 marks

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

Mid-Square Method

A technique proposed by von Neumann to generate pseudo-random numbers:

  1. Start with a seed X0X_0 of nn digits (commonly 4 digits).
  2. Square it to get a 2n2n-digit number (pad with leading zeros if necessary).
  3. Take the middle nn digits as the next number X1X_1.
  4. Repeat; the random number in (0,1)(0,1) is Ri=Xi/10nR_i = X_i / 10^{n}.

Example (4-digit seed X0=7182X_0 = 7182):

  • 71822=515811247182^2 = 51\,581\,124 \to middle 4 digits =5811= 5811, so X1=5811X_1 = 5811, R1=0.5811R_1 = 0.5811.
  • 58112=337677215811^2 = 33\,767\,721 \to middle digits 76777677, X2=7677X_2 = 7677, R2=0.7677R_2 = 0.7677.

Drawback: the sequence may degenerate (collapse to zero or fall into a short cycle), so it is rarely used in practice.

Additive Congruential Method

A generator that produces the next number by adding previous terms (a lagged generalization of the linear congruential method). The recurrence is

Xi=(Xi1+Xik)modm,X_i = (X_{i-1} + X_{i-k}) \bmod m,

for some lag kk, where mm is the modulus. It requires kk seed values X0,X1,,Xk1X_0, X_1, \dots, X_{k-1}. The corresponding uniform numbers are Ri=Xi/mR_i = X_i / m.

Example (k=2k=2, i.e. Fibonacci-type, m=10m = 10, seeds X0=3,X1=5X_0=3, X_1=5):

  • X2=(5+3)mod10=8X_2 = (5+3)\bmod 10 = 8
  • X3=(8+5)mod10=3X_3 = (8+5)\bmod 10 = 3
  • X4=(3+8)mod10=1X_4 = (3+8)\bmod 10 = 1, and so on, giving Ri=Xi/10R_i = X_i/10.

Additive (lagged-Fibonacci) generators can produce very long periods, which makes them useful for large simulations.

midsquare

Frequently asked questions

Where can I find the BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) question paper 2074?
The full BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) 2074 (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) 2074 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) 2074 paper?
The BSc CSIT (TU) Simulation and Modelling (BSc CSIT, CSC317) 2074 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.