Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

4 questions
1long12 marks

(a) Define a system and explain the components of a system (entities, attributes, activities, state and events) with suitable examples. (6)

(b) Distinguish between a physical model and a mathematical model. With the help of a flowchart, explain the steps involved in a typical simulation study. (6)

(a) System and its components (6)

System: A system is a collection of entities (people, machines, objects) that interact together over time to accomplish one or more goals. Example: a bank, a factory, a computer network.

Components:

  • Entity: An object of interest in the system. Example: a customer in a bank.
  • Attribute: A property/characteristic of an entity. Example: the account balance or priority of a customer.
  • Activity: A time period of specified length representing an operation. Example: the act of serving a customer (a teller transaction).
  • State: The collection of variables needed to describe the system at any instant, relative to the objectives of the study. Example: number of busy tellers and number of customers waiting.
  • Event: An instantaneous occurrence that may change the state of the system. Example: the arrival of a customer or the completion of service (departure).
ConceptBank example
EntityCustomers, tellers
AttributeBalance, service-need
ActivityServing a customer
StateNo. waiting, no. busy tellers
EventArrival, departure

(b) Physical vs Mathematical model + steps of a simulation study (6)

Physical model: A tangible, scaled-down (iconic) replica of the real system whose physical properties resemble the original. Example: a wind-tunnel model of an aircraft, a model dam.

Mathematical model: Represents the system through logical and quantitative relationships (equations, inequalities, logical conditions) that are manipulated to see how the model reacts. Example: L=λ/(μλ)L = \lambda/(\mu-\lambda) for a queue. Simulation models are typically mathematical models solved numerically.

Physical modelMathematical model
Tangible / scaledAbstract / symbolic
Studied by physical experimentStudied by analysis or simulation
Costly to changeEasy to change parameters

Steps in a simulation study (flowchart, described in words):

  1. Problem formulation — state objectives.
  2. Setting objectives and overall plan.
  3. Model conceptualization — build the conceptual model.
  4. Data collection.
  5. Model translation — code the model in a language/tool.
  6. Verified? (No → return to step 5).
  7. Validated? (No → return to step 3/4).
  8. Experimental design — runs, length, replications.
  9. Production runs and analysis.
  10. More runs? (Yes → step 8).
  11. Documentation and reporting.
  12. Implementation.

The flowchart is a top-down flow from Problem formulation down to Implementation, with decision diamonds at Verification and Validation looping back, and a loop from production runs back to experimental design when more runs are needed.

system-and-model-conceptstypes-of-simulation
2long12 marks

Consider a single-server queuing system (M/M/1) where customers arrive at a counter. The inter-arrival times and service times for the first 6 customers are given below (all in minutes):

CustomerInter-arrival timeService time
104
232
355
421
563
642

(a) Prepare a simulation table showing arrival time, service-begin time, waiting time in queue, service-end time and time the customer spends in the system. (8)

(b) From your table, compute the average waiting time in the queue, the average time a customer spends in the system, and the server utilization. (4)

(a) Simulation table (8)

Arrival time = running sum of inter-arrival times. Service begins at max(arrival,previous service-end)\max(\text{arrival}, \text{previous service-end}).

CustIATArrivalService timeService beginWait in queueService endTime in system
10040044
23324163
358580135
42101133144
56163160193
64202200222
Sum17421

(b) Performance measures (4)

Average waiting time in queue:

Wq=waitN=46=0.67 minutesW_q = \frac{\sum \text{wait}}{N} = \frac{4}{6} = 0.67 \text{ minutes}

Average time in system:

W=time in systemN=216=3.5 minutesW = \frac{\sum \text{time in system}}{N} = \frac{21}{6} = 3.5 \text{ minutes}

Server utilization (total busy time over total simulation time; server idle gaps exist between customers):

ρ=total service timesimulation end time=1722=0.77  (77%)\rho = \frac{\text{total service time}}{\text{simulation end time}} = \frac{17}{22} = 0.77 \;(77\%)

So customers wait on average 0.67 min in the queue, spend 3.5 min in the system, and the server is busy 77% of the time.

discrete-event-simulationqueuing-models
3long12 marks

(a) Explain the Linear Congruential Method (LCM) for generating pseudo-random numbers. State the conditions (Hull-Dobell theorem) under which an LCM achieves a full period. (5)

(b) Using the multiplicative congruential generator X(n+1) = (17 X(n)) mod 100 with seed X(0) = 27, generate the first five random numbers and the corresponding U(0,1) values. (3)

(c) Describe the inverse-transform technique and use it to derive a procedure for generating random variates from an exponential distribution with mean 1/lambda. (4)

(a) Linear Congruential Method + Hull-Dobell theorem (5)

The Linear Congruential Method (LCM) produces a sequence of integers between 00 and m1m-1 by the recurrence:

Xn+1=(aXn+c)modm,n0X_{n+1} = (a X_n + c)\bmod m,\qquad n\ge 0

where X0X_0 = seed, aa = multiplier, cc = increment, mm = modulus. Random numbers on (0,1)(0,1) are then Un=Xn/mU_n = X_n/m. If c=0c=0 it is called the multiplicative congruential method.

Hull-Dobell theorem — a mixed LCG (c0c\neq 0) has full period mm if and only if:

  1. cc and mm are relatively prime (gcd(c,m)=1\gcd(c,m)=1);
  2. a1a-1 is divisible by every prime factor of mm;
  3. a1a-1 is divisible by 44 if mm is divisible by 44.

(b) Multiplicative generator (3)

Xn+1=(17Xn)mod100X_{n+1} = (17 X_n)\bmod 100, seed X0=27X_0 = 27.

nXnX_nUn=Xn/100U_n = X_n/100
117×27=459mod100=5917\times27=459 \bmod 100 = 590.59
217×59=1003mod100=317\times59=1003 \bmod 100 = 30.03
317×3=5117\times3=510.51
417×51=867mod100=6717\times51=867 \bmod 100 = 670.67
517×67=1139mod100=3917\times67=1139 \bmod 100 = 390.39

First five random numbers: 0.59, 0.03, 0.51, 0.67, 0.39.

(c) Inverse-transform technique for the exponential distribution (4)

Idea: If XX has CDF F(x)F(x) and UU(0,1)U\sim U(0,1), then X=F1(U)X = F^{-1}(U) has the desired distribution, because FF is monotone and P(F1(U)x)=P(UF(x))=F(x)P(F^{-1}(U)\le x)=P(U\le F(x))=F(x).

For the exponential distribution with mean 1/λ1/\lambda:

F(x)=1eλx,x0.F(x) = 1 - e^{-\lambda x},\quad x\ge 0.

Set U=F(X)U = F(X) and invert:

U=1eλX    eλX=1U    X=1λln(1U).U = 1 - e^{-\lambda X}\;\Rightarrow\; e^{-\lambda X} = 1-U \;\Rightarrow\; X = -\frac{1}{\lambda}\ln(1-U).

Since 1U1-U is also uniform on (0,1)(0,1), in practice we use:

X=1λlnU\boxed{X = -\frac{1}{\lambda}\ln U}

Procedure: generate UU(0,1)U\sim U(0,1); return X=1λlnUX=-\tfrac{1}{\lambda}\ln U as an exponential variate.

random-number-generationrandom-variate-generation
4long12 marks

(a) Differentiate between verification and validation of a simulation model. Describe at least three techniques used for verifying a simulation model. (7)

(b) Compare general-purpose programming languages with special-purpose simulation languages (such as GPSS / SIMSCRIPT) for building simulation models, listing the advantages and disadvantages of each. (5)

(a) Verification vs Validation + verification techniques (7)

Verification asks "Are we building the model right?" — it checks that the computer program/implementation correctly represents the conceptual (assumed) model, i.e. it is debugging the code.

Validation asks "Are we building the right model?" — it checks that the model is an accurate representation of the real system for the intended purpose, comparing model behavior with reality.

VerificationValidation
QuestionBuilt right?Right model?
ComparesCode vs conceptual modelModel vs real system
ConcernProgramming/logic errorsAccuracy/realism

Techniques for verifying a simulation model (any three):

  1. Structured walk-through / code review of the program by the modeler and others.
  2. Trace and debugging — print the state, clock, and event list as events occur and check them by hand for a few steps.
  3. Run with simplified/known input for which analytic answers exist (e.g. set arrival = service so the queue should behave predictably) and compare.
  4. Animation — observe the dynamic behavior graphically to spot logical errors.
  5. Check output reasonableness for a variety of input parameter settings.

(b) General-purpose vs special-purpose simulation languages (5)

General-purpose languages (C, C++, Java, Python):

  • Advantages: widely known, flexible, fast execution, low cost, no licensing, portable, integrates easily with other software.
  • Disadvantages: must program the simulation infrastructure (clock, event list, random generators, statistics) yourself; longer development time; more error-prone.

Special-purpose simulation languages (GPSS, SIMSCRIPT, SIMAN, SLAM):

  • Advantages: built-in simulation facilities — automatic time advance, event/queue handling, random-variate generators, automatic statistics collection; faster modeling; reduced coding/errors; good built-in reporting and often animation.
  • Disadvantages: must learn a new language; less flexible for unusual logic; may run slower; licensing cost; less portable.

Conclusion: general-purpose languages give maximum flexibility at the cost of effort, while simulation languages speed up development at the cost of flexibility and money.

verification-and-validationsimulation-languages-and-tools
B

Section B: Short Answer Questions

Attempt all / any as specified.

7 questions
5short8 marks

Apply the Kolmogorov-Smirnov test to the following sequence of random numbers to test for uniformity at the 0.05 level of significance (critical value D = 0.565 for n = 5): 0.44, 0.81, 0.14, 0.05, 0.93.

Kolmogorov-Smirnov (K-S) test for uniformity

Hypotheses: H0H_0: the numbers are uniform on (0,1)(0,1); H1H_1: they are not.

Step 1 — sort the numbers in ascending order:

0.05,  0.14,  0.44,  0.81,  0.930.05,\;0.14,\;0.44,\;0.81,\;0.93

Step 2 — compute D+=maxi(inR(i))D^+ = \max_i\left(\tfrac{i}{n} - R_{(i)}\right) and D=maxi(R(i)i1n)D^- = \max_i\left(R_{(i)} - \tfrac{i-1}{n}\right), with n=5n=5.

iiR(i)R_{(i)}i/ni/ni/nR(i)i/n - R_{(i)}(i1)/n(i-1)/nR(i)(i1)/nR_{(i)} - (i-1)/n
10.050.200.150.000.05
20.140.400.260.20-0.06
30.440.600.160.400.04
40.810.80-0.010.600.21
50.931.000.070.800.13
D+=0.26,D=0.21D^+ = 0.26,\qquad D^- = 0.21

Step 3 — test statistic:

D=max(D+,D)=max(0.26,0.21)=0.26D = \max(D^+, D^-) = \max(0.26,\,0.21) = 0.26

Step 4 — compare with critical value: Dα=D0.05=0.565D_{\alpha} = D_{0.05} = 0.565 for n=5n=5.

Since D=0.26<0.565=D0.05D = 0.26 < 0.565 = D_{0.05}, we do not reject H0H_0.

Conclusion: There is no evidence against uniformity at the 0.050.05 level — the numbers can be regarded as uniformly distributed on (0,1)(0,1).

random-number-generation
6short8 marks

For an M/M/1 queue with arrival rate lambda = 8 customers per hour and service rate mu = 10 customers per hour, calculate: (a) the server utilization, (b) the average number of customers in the system (L), (c) the average number in the queue (Lq), and (d) the average time a customer spends in the system (W).

M/M/1 queue: λ=8/hr\lambda = 8/\text{hr}, μ=10/hr\mu = 10/\text{hr}

(a) Server utilization (traffic intensity):

ρ=λμ=810=0.8  (80%)\rho = \frac{\lambda}{\mu} = \frac{8}{10} = 0.8 \;(80\%)

(b) Average number in the system LL:

L=λμλ=8108=82=4 customersL = \frac{\lambda}{\mu - \lambda} = \frac{8}{10-8} = \frac{8}{2} = 4 \text{ customers}

(c) Average number in the queue LqL_q:

Lq=λ2μ(μλ)=6410×2=3.2 customers(=ρL=0.8×4)L_q = \frac{\lambda^2}{\mu(\mu-\lambda)} = \frac{64}{10\times 2} = 3.2 \text{ customers}\quad(=\rho L = 0.8\times4)

(d) Average time a customer spends in the system WW:

W=1μλ=12hr=0.5hr=30 minutesW = \frac{1}{\mu - \lambda} = \frac{1}{2}\,\text{hr} = 0.5\,\text{hr} = 30 \text{ minutes}

Summary: ρ=0.8\rho = 0.8, L=4L = 4, Lq=3.2L_q = 3.2, W=0.5W = 0.5 hr (30 min).

queuing-models
7short8 marks

(a) Explain the acceptance-rejection technique for generating random variates. (4)

(b) Describe how the convolution method can be used to generate an Erlang random variate. (4)

(a) Acceptance-Rejection technique (4)

Used when the inverse CDF is hard to obtain. To generate XX with density f(x)f(x), choose a simpler density g(x)g(x) from which we can sample, and a constant cc such that f(x)cg(x)f(x) \le c\,g(x) for all xx.

Algorithm:

  1. Generate YY from g(x)g(x).
  2. Generate UU(0,1)U\sim U(0,1) independently.
  3. If Uf(Y)cg(Y)U \le \dfrac{f(Y)}{c\,g(Y)}, accept and set X=YX = Y.
  4. Otherwise reject and return to step 1.

The accepted values follow f(x)f(x). The efficiency is 1/c1/c (the probability of acceptance), so a smaller cc (tighter envelope) means fewer rejections. Example: generating a U(0,1)U(0,1) variate from a Poisson/triangular density using a uniform envelope.

(b) Convolution method for an Erlang variate (4)

The convolution method uses the fact that some random variables are the sum of simpler, independent variates. The Erlang-kk distribution with rate λ\lambda (mean k/λk/\lambda) is the sum of kk independent exponential variates each with mean 1/λ1/\lambda:

X=i=1kXi,XiExp(λ).X = \sum_{i=1}^{k} X_i,\qquad X_i \sim \text{Exp}(\lambda).

Procedure:

  1. Generate kk independent uniforms U1,,UkU(0,1)U_1,\dots,U_k \sim U(0,1).
  2. Convert each to an exponential by inverse transform: Xi=1λlnUiX_i = -\tfrac{1}{\lambda}\ln U_i.
  3. Sum them:
X=i=1kXi=1λi=1klnUi=1λln ⁣(i=1kUi).X = \sum_{i=1}^{k} X_i = -\frac{1}{\lambda}\sum_{i=1}^{k}\ln U_i = -\frac{1}{\lambda}\ln\!\Big(\prod_{i=1}^{k} U_i\Big).

The result XX is an Erlang-kk variate. (Only k1k-1 multiplications/one log are needed using the product form.)

random-variate-generation
8short8 marks

Explain the autocorrelation test and the runs test (test for independence) used to evaluate a sequence of random numbers. What property of the random numbers does each test check?

Tests for independence of random numbers

Both tests check independence (no correlation/pattern), as opposed to uniformity.

Autocorrelation test

It checks whether numbers separated by a lag mm are correlated. For numbers RiR_i, the test computes the autocorrelation ρim\rho_{im} between every mm-th number starting from RiR_i:

ρ^im=1M+1k=0MRi+kmRi+(k+1)m0.25,\hat\rho_{im} = \frac{1}{M+1}\sum_{k=0}^{M}R_{i+km}R_{i+(k+1)m} - 0.25,

where MM is the largest integer with i+(M+1)mNi+(M+1)m \le N. The standardized statistic

Z0=ρ^imσρ^imZ_0 = \frac{\hat\rho_{im}}{\sigma_{\hat\rho_{im}}}

is compared with the standard normal critical value zα/2z_{\alpha/2}. If Z0zα/2|Z_0| \le z_{\alpha/2} we accept H0H_0 (the numbers are independent / not autocorrelated at lag mm). Property checked: independence — absence of correlation between numbers a fixed distance apart.

Runs test (test for independence)

A run is a succession of numbers in the same direction. We look at runs up and down: mark ++ when the next number is larger and - when smaller; a run is a maximal block of identical signs. Count the total number of runs aa. For nn numbers the expected number and variance of runs are:

μa=2n13,σa2=16n2990.\mu_a = \frac{2n-1}{3},\qquad \sigma_a^2 = \frac{16n-29}{90}.

The statistic Z0=(aμa)/σaZ_0 = (a-\mu_a)/\sigma_a is compared with zα/2z_{\alpha/2}. Too few or too many runs both indicate dependence. Property checked: independence — whether the sequence has patterns/trends (clustering or rapid oscillation).

Summary: the autocorrelation test detects correlation between numbers at a given lag; the runs test detects trends/patterns in the order of the numbers. Both assess independence, not uniformity.

random-number-generation
9short8 marks

Describe the event-scheduling / time-advance algorithm used in discrete-event simulation. Explain the role of the future event list (FEL) and the system clock with the help of a diagram.

Event-scheduling / time-advance algorithm in DES

In discrete-event simulation the system state changes only at discrete points in time called events. The simulation jumps from one event time to the next using the next-event time-advance approach (the clock skips over idle periods).

Key data structures:

  • System clock (CLOCK): holds the current simulation time.
  • Future Event List (FEL): an ordered list of pending events, each tagged with the (event type, event time). It is kept sorted by event time so the imminent (earliest) event is always at the head.
  • State variables and statistical counters.

Algorithm:

1. Initialize: CLOCK = 0; set state variables and counters;
   schedule initial event(s) and place them in the FEL.
2. While (FEL not empty AND stopping condition not met):
   a. Remove the imminent event (smallest time) from the FEL.
   b. Advance the CLOCK to that event's time.
   c. Execute the event routine:
        - update system state,
        - update statistical counters,
        - generate and schedule future events (insert into FEL),
        - generate random variates as needed.
3. End while -> compute and report summary statistics.

Role of FEL and clock (diagram, in words): Imagine a horizontal time axis. The FEL is a queue of event notices ordered left-to-right by time, e.g. [t=3 Arrival] -> [t=4 Departure] -> [t=7 Arrival]. The simulation engine repeatedly: (1) pops the leftmost (imminent) notice, (2) sets the CLOCK to its time, (3) runs the corresponding event routine which may push new notices back into the FEL in sorted order. Thus the CLOCK never moves backward and only stops at instants where the state actually changes, making the simulation efficient.

discrete-event-simulation
10short8 marks

(a) Differentiate between continuous and discrete simulation, and between deterministic and stochastic simulation, with one example of each. (4)

(b) Explain the Monte Carlo simulation technique and describe one practical application where it is used. (4)

(a) Classifications of simulation (4)

Continuous vs Discrete:

  • Discrete simulation: the state variables change only at discrete (countable) points in time. Example: number of customers in a bank queue (changes at arrivals/departures).
  • Continuous simulation: the state variables change continuously over time, usually described by differential equations. Example: the water level in a reservoir, or velocity of a moving vehicle.

Deterministic vs Stochastic:

  • Deterministic simulation: contains no random variables; the same input always gives the same output. Example: a fixed-schedule chemical reaction model.
  • Stochastic simulation: contains one or more random variables; outputs are random and must be treated as statistical estimates. Example: a queue with random arrival and service times.

(b) Monte Carlo simulation (4)

Monte Carlo simulation is a technique that uses repeated random sampling from probability distributions to obtain numerical estimates of quantities that may be deterministic but hard to compute analytically. It is generally static (no time-advance mechanism). Steps: model the problem with random inputs, sample many values, evaluate the outcome each time, and aggregate (average) the results, whose accuracy improves with the number of trials (1/N\propto 1/\sqrt{N}).

Example application — estimating π\pi / numerical integration: Throw NN random points uniformly in the unit square; the fraction landing inside the quarter circle approximates π/4\pi/4, so π4×(points inside/N)\pi \approx 4 \times (\text{points inside}/N). Other practical uses: evaluating definite integrals, risk and financial-portfolio analysis, reliability estimation, and inventory/project-cost analysis.

types-of-simulation
11short8 marks

Write short notes on any TWO of the following:

(a) Steps in building a simulation model

(b) Calibration and validation of models

(c) Advantages and disadvantages of simulation

Short notes (any two)

(a) Steps in building a simulation model

  1. Problem formulation — define the problem and objectives.
  2. Model conceptualization — identify entities, attributes, activities, events and assumptions.
  3. Data collection — gather input data and fit distributions.
  4. Model translation (coding) — implement in a language or simulation package.
  5. Verification — check that the program matches the conceptual model.
  6. Validation — check that the model represents the real system.
  7. Experimental design — decide run length, number of replications, warm-up.
  8. Production runs and analysis of output.
  9. Documentation, reporting and implementation.

(b) Calibration and validation of models

  • Calibration is the iterative process of tuning/adjusting model parameters and assumptions so that model output matches observed real-system data as closely as possible. It is an internal refinement loop.
  • Validation is the process of confirming that the (calibrated) model is an accurate representation of the real system for its intended purpose, typically by comparing model output with independent real-world data, using face validity, historical-data validation and sensitivity analysis.
  • Relationship: calibration adjusts the model; validation judges whether the adjusted model is good enough. Over-calibrating to one data set can hurt validity, so validation should use data not used in calibration.

(c) Advantages and disadvantages of simulation

Advantages:

  • Can study systems too complex for analytical solution.
  • "What-if" experiments without disturbing the real system.
  • Compresses or expands time; cheaper and safer than real experiments.
  • Gives insight into how the system works and which variables matter.

Disadvantages:

  • Model building requires special skill and is time-consuming.
  • Results can be hard to interpret (random output needs statistical analysis).
  • Can be expensive and may consume much computer time.
  • May be misused — a model that looks realistic may still be invalid.
system-and-model-conceptsverification-and-validation

Frequently asked questions

Where can I find the BE Computer Engineering (IOE, TU) Simulation and Modeling (IOE, CT 751 / ENCT 353) question paper 2078?
The full BE Computer Engineering (IOE, TU) Simulation and Modeling (IOE, CT 751 / ENCT 353) 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 Modeling (IOE, CT 751 / ENCT 353) 2078 paper come with solutions?
Yes. Every question on this Simulation and Modeling (IOE, CT 751 / ENCT 353) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BE Computer Engineering (IOE, TU) Simulation and Modeling (IOE, CT 751 / ENCT 353) 2078 paper?
The BE Computer Engineering (IOE, TU) Simulation and Modeling (IOE, CT 751 / ENCT 353) 2078 paper carries 80 full marks and is meant to be completed in 180 minutes, across 11 questions.
Is practising this Simulation and Modeling (IOE, CT 751 / ENCT 353) past paper free?
Yes — reading and attempting this Simulation and Modeling (IOE, CT 751 / ENCT 353) past paper on Kekkei is completely free.