0% found this document useful (0 votes)
3 views20 pages

Simulation Study Guide Marking Scheme

This document is a comprehensive study guide for COMP/OMP 423, covering simulation and modeling concepts through mock exams and structured questions. It includes definitions, advantages and disadvantages of simulation, and examples from various application areas such as healthcare and manufacturing. The guide emphasizes key formulas, memory tips, and structured answers to aid in exam preparation.

Uploaded by

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

Simulation Study Guide Marking Scheme

This document is a comprehensive study guide for COMP/OMP 423, covering simulation and modeling concepts through mock exams and structured questions. It includes definitions, advantages and disadvantages of simulation, and examples from various application areas such as healthcare and manufacturing. The guide emphasizes key formulas, memory tips, and structured answers to aid in exam preparation.

Uploaded by

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

COMP / OMP 423

SIMULATION AND MODELING


COMPREHENSIVE STUDY GUIDE & MARKING SCHEME

Mock Exam 1 + Mock Exam 2

All Questions · Full Answers · Memory Tips · Key Formulas

Based on Lectures 1–6 | Prepared for Exam Revision


HOW TO USE THIS GUIDE
This document contains EVERY question from both mock exams with full, easy-to-understand
answers based on your lecture notes. Here is how to study with it:
• Read the QUESTION first and try to answer it in your head.
• Then read the ANSWER section — it gives you everything the marker wants.
• Pay attention to the 💡 MEMORY TIP — these help you remember key points quickly.
• Key FORMULAS are shown in a special box — memorise these for the maths questions.
• Marks are shown in orange — use them to know how much detail to give.

MOCK EXAM 1 — SECTION A: SHORT ANSWER (30 Marks)


Answer ALL questions. This section tests your basic knowledge of simulation concepts.

Question 1 — Definitions (4 marks)


Q1a) Define the term 'Model' as used in simulation. (2 marks)
✔ ANSWER:
A model is a simplified representation of a real-world system. It describes the system using
mathematical, logical, or symbolic relationships between the parts of the system (called entities). Think
of it like a blueprint — it is not the actual building, but it shows you how the building works.
💡 MEMORY TIP: A model = a simplified copy of a real system that you can experiment on without touching
the real thing.

Q1b) Define the term 'Simulation' as used in simulation. (2 marks)


✔ ANSWER:
Simulation is the process of using a model to imitate or copy the operation of a real-world system over
time. By running the simulation, you can study how the system behaves and predict what will happen if
you make changes — without disturbing the actual system.
💡 MEMORY TIP: Simulation = running a model over time to see how the system behaves.

Question 2 — Advantages over Mathematical Methods (2 marks)


Q2) Give two advantages of simulation over mathematical methods.
✔ ANSWER:
• Simulation can handle complex systems that are too difficult or impossible to solve with
mathematics.
• Simulation allows you to model randomness (like random arrival times or failures) easily,
whereas mathematical methods often require many simplifying assumptions.
💡 MEMORY TIP: Math needs simple, perfect equations. Simulation works for messy, complex, real-world
systems.
Question 3 — Disadvantages of Simulation (3 marks)
Q3) State three disadvantages of simulation.
✔ ANSWER:
• It is expensive and time-consuming — building a good simulation model needs a lot of effort,
money, and special software.
• Results can be hard to interpret — because simulation uses random numbers, the output varies
each time, and it can be difficult to know if a result is due to the system or just by chance.
• Models may not be perfectly accurate — a simulation is only as good as the assumptions and
data used. Wrong inputs lead to wrong outputs ('garbage in, garbage out').
💡 MEMORY TIP: Remember 3 Ds: Difficult to build, Difficult to interpret, Depends on good data.

Question 4 — Entity vs Attribute (4 marks)


Q4) Differentiate between an entity and an attribute using an example from a manufacturing
system.
✔ ANSWER:
An ENTITY is an object of interest in the system — something you want to track.
An ATTRIBUTE is a property or characteristic that belongs to an entity — it describes the entity.

Example from a manufacturing system:


• Entity: A MACHINE on the factory floor (this is the object we care about).
• Attributes of the machine: its speed, its capacity, its current status (busy, idle, broken).
• Another entity: A JOB or work item moving through the factory.
• Attributes of the job: its due date, its priority level, its size.
💡 MEMORY TIP: Entity = the 'thing'. Attribute = the 'properties' of the thing.

Question 5 — Supermarket Checkout System (4 marks)


Q5) For a supermarket checkout system, identify: a) One entity, b) One activity, c) One event, d)
One state variable.
✔ ANSWER:
• Entity: A CUSTOMER (the person moving through the system that we track).
• Activity: SCANNING AND PAYMENT — the process of the cashier scanning items and the
customer paying. This takes a specific amount of time.
• Event: CUSTOMER ARRIVAL — when a customer arrives at the checkout queue. This happens
at a specific instant and changes the state of the system.
• State Variable: NUMBER OF CUSTOMERS IN QUEUE — this number tells you the current
condition of the system at any point in time.
💡 MEMORY TIP: Entity=who, Activity=what they do (takes time), Event=what happens instantly,
State=current condition of system.
Question 6 — When NOT to use Simulation (3 marks)
Q6) Explain why simulation is not appropriate when a problem can be solved analytically.
✔ ANSWER:
When a problem can be solved analytically (using exact mathematical formulas), simulation is not
appropriate for these reasons:
• Analytical solutions give exact, perfect answers — simulation only gives approximate answers.
• Simulation takes much more time to build and run compared to just plugging numbers into a
formula.
• Simulation uses random numbers, so every run gives a slightly different answer — this
unnecessary uncertainty is wasted when a perfect formula exists.
💡 MEMORY TIP: If a formula gives you the exact answer, why spend weeks building a simulation? Use the
formula!

Question 7 — Endogenous vs Exogenous Events (4 marks)


Q7) What is the difference between an endogenous event and an exogenous event? Give one
example of each.
✔ ANSWER:
ENDOGENOUS events come from INSIDE the system. They are caused by activities happening within
the model itself.
• Example: A machine breakdown — this happens inside the factory system as a result of its own
operation.

EXOGENOUS events come from OUTSIDE the system. They are caused by things from the
environment, not the model itself.
• Example: A customer arriving at a shop — this comes from outside, since customers are part of
the environment, not the shop itself.
💡 MEMORY TIP: Endo = inside (endoscope looks inside the body). Exo = outside (exotic = from outside).

Question 8 — Application Areas (4 marks)


Q8) List four primary application areas of simulation.
✔ ANSWER:
• Manufacturing and Production — optimising assembly lines, warehouses, and production
schedules.
• Healthcare — modelling patient flow in hospitals, resource allocation (beds, doctors).
• Transportation and Logistics — simulating traffic, port operations, supply chains.
• Aerospace and Defense — flight simulators for pilot training, testing weapon systems.
💡 MEMORY TIP: Remember: MHTA — Manufacturing, Healthcare, Transportation, Aerospace.

Question 9 — Discrete vs Continuous (2 marks)


Q9) Give one example each of: a) A discrete system, b) A continuous system.
✔ ANSWER:
• Discrete system: A BANK QUEUE — customers arrive and leave one at a time. The number of
customers changes in whole-number jumps (0, 1, 2, 3...).
• Continuous system: WATER LEVEL IN A DAM — the water level rises and falls smoothly over
time, not in jumps.
💡 MEMORY TIP: Discrete = counts (whole numbers). Continuous = flows (smooth changes like temperature
or water level).

MOCK EXAM 1 — SECTION B: STRUCTURED QUESTIONS (30


Marks)

Question 10 — Simulation vs Real System (8 marks)


Q10a) Explain why simulation is often used BEFORE implementation of a new system. (3 marks)
✔ ANSWER:
Simulation is used before implementation because:
• It is SAFE — you can test ideas without risking the real system or disrupting ongoing
operations.
• It is CHEAP — building and testing a model costs far less than building and modifying the real
system.
• It allows EXPERIMENTATION — you can test many different 'what if' scenarios to find the best
design before committing real resources.

Q10b) Give two scenarios where direct experiments are preferred over simulation. (2 marks)
✔ ANSWER:
• When the system is very simple and experiments are cheap and quick — e.g., testing two
different shelf layouts in a small shop.
• When a simulation model would be too hard to build accurately — e.g., studying human
behaviour which is too complex to model.

Q10c) A company wants to test a new factory layout. Why is simulation better than building a
physical prototype? (3 marks)
✔ ANSWER:
• COST: Building a real factory prototype is enormously expensive. A simulation model costs a
fraction of that.
• SPEED: A simulation can test years of factory operation in minutes. A physical prototype takes
months to build and test.
• FLEXIBILITY: In simulation, you can easily change the layout and test again. Changing a
physical prototype requires rebuilding.

Question 11 — Hospital Emergency Room (10 marks)


Q11) Consider a hospital ER with 2 doctors, 1 triage nurse, and patients arriving randomly.
Q11a) List three entities. (3 marks)
✔ ANSWER:
• PATIENT — the person who arrives at the ER needing treatment.
• DOCTOR — the medical professional who provides treatment.
• TRIAGE NURSE — the nurse who first assesses incoming patients.

Q11b) List two attributes for each entity. (3 marks)


✔ ANSWER:
• Patient attributes: Severity of illness (priority level), Time of arrival.
• Doctor attributes: Specialisation (what they can treat), Current status (busy or idle).
• Triage Nurse attributes: Experience level, Current status (busy or idle).

Q11c) List two activities. (2 marks)


✔ ANSWER:
• TRIAGE ASSESSMENT — the nurse examines the patient and assigns a priority. This takes a
certain amount of time.
• MEDICAL TREATMENT — the doctor examines and treats the patient. This also takes time.

Q11d) List two events. (2 marks)


✔ ANSWER:
• PATIENT ARRIVAL — a patient arrives at the ER. This happens instantly and changes the
queue.
• PATIENT DISCHARGE — a patient leaves after treatment. This happens instantly and frees up
a doctor.

Question 12 — Types of Models (12 marks)


Q12a) Explain the difference between discrete-event simulation and continuous simulation. (4
marks)
✔ ANSWER:
DISCRETE-EVENT SIMULATION (DES):
• The system state only changes at specific points in time — when events happen (like a
customer arriving or a machine breaking down).
• Between events, nothing changes, so the simulation can 'jump' to the next event.
• Example: Bank queue — the number of customers only changes when someone arrives or
leaves.

CONTINUOUS SIMULATION:
• The system state changes smoothly and constantly over time, described by mathematical
equations (differential equations).
• Time moves forward in small steps, and the system is updated at each step.
• Example: Temperature of a cooling object — it changes continuously every second.

Q12b) Classify each as discrete or continuous:


✔ ANSWER:
• Number of customers in a queue → DISCRETE (you count whole people: 0, 1, 2, 3...)
• Water level in a dam → CONTINUOUS (it rises and falls smoothly)
• Traffic light colour changes → DISCRETE (it jumps between states: red, yellow, green)
• Speed of a car → CONTINUOUS (speed changes smoothly, not in sudden jumps)

Q12c) What is a STATIC simulation model? Give one example. (2 marks)


✔ ANSWER:
A static simulation model represents a system at a single point in time — it does NOT change over
time. Time is not a factor.
• Example: MONTE CARLO SIMULATION — you randomly sample values many times to
estimate a probability, like rolling dice 10,000 times to estimate the probability of getting a 6.

Q12d) What is a DYNAMIC simulation model? Give one example. (2 marks)


✔ ANSWER:
A dynamic simulation model tracks how a system changes over time. Time IS a key factor in the model.
• Example: A simulation of a bank queue over 8 hours — you track customers arriving and
leaving as time passes.

MOCK EXAM 1 — SECTION C: LONG ANSWER (40 Marks) —


Answer ANY TWO

Question 13 — Advantages & Disadvantages of Simulation (20 marks)


Q13a) Discuss FIVE advantages of simulation. (10 marks)
✔ ANSWER:
Give about 2 sentences of explanation per advantage for full marks:
• 1. SAFE EXPERIMENTATION without disrupting the real system. You can test new policies,
layouts, or procedures without risking real operations. E.g., test a new hospital patient flow
before changing the real ward.
• 2. TIME COMPRESSION/EXPANSION. The simulation clock can be sped up to see years of
operation in minutes, or slowed down to study fast events in detail. E.g., simulate 10 years of
factory wear in an hour.
• 3. INSIGHT INTO SYSTEM INTERACTIONS. Simulation reveals how different parts of the
system affect each other — something that is hard to see by just looking at the system. E.g.,
discover that adding one extra cashier reduces queue time by 40%.
• 4. BOTTLENECK ANALYSIS. Simulation shows WHERE in the system work piles up
(bottlenecks), so you know where to make improvements. E.g., identify that the packing station
is the slowest step in a factory.
• 5. TESTING BEFORE BUILDING. New hardware, layouts, or systems can be tested in
simulation before real money is spent. E.g., test a new airport terminal design before
construction.

Q13b) Discuss FIVE disadvantages of simulation. (10 marks)


✔ ANSWER:
• 1. HIGH COST AND TIME. Building a high-quality simulation model requires expensive
software, specialised expertise, and weeks or months of work. Small organisations may not
afford it.
• 2. RESULTS ARE APPROXIMATE. Simulation uses random numbers, so results are estimates
— not exact answers. You need many runs to get reliable statistics.
• 3. RESULTS ARE HARD TO INTERPRET. Because output varies between runs, it can be
difficult to tell if a result is real or just random variation. Statistical analysis is required.
• 4. REQUIRES GOOD QUALITY DATA. If the input data is wrong or the assumptions are
incorrect, the model's output will be wrong too — 'garbage in, garbage out'.
• 5. NEEDS SPECIAL TRAINING. Building and validating a simulation model requires specific
skills that not everyone has. Misuse by untrained users can lead to bad decisions.

Question 14 — System Modeling: Petrol Station (20 marks)


Q14a) Identify all components of the petrol station system. (10 marks)
✔ ANSWER:
• ENTITIES: Cars (the objects moving through the system); Fuel pump attendant (the server
providing service).
• ATTRIBUTES: Car attributes — fuel type needed (petrol/diesel), time of arrival. Attendant
attributes — speed of service, current status.
• ACTIVITIES: FUELLING — the process of filling a car with fuel. This takes a variable amount of
time.
• EVENTS: CAR ARRIVAL — a car arrives at the station (instantaneous). SERVICE
COMPLETION — fuelling finishes and the car leaves (instantaneous).
• STATE VARIABLES: Number of cars in the queue; Status of the fuel pump (busy or idle).

Q14b) Is this system discrete or continuous? Justify. (3 marks)


✔ ANSWER:
This is a DISCRETE system. The reason is that the state of the system only changes at specific
instants — when a car arrives or when service ends. Between these events, nothing changes. Cars are
counted in whole numbers (0, 1, 2...), not as a smooth flow.

Q14c) Is this system stochastic or deterministic? Justify. (3 marks)


✔ ANSWER:
This is a STOCHASTIC (random) system. Cars arrive at random times — you cannot predict exactly
when the next car will come. Service times also vary randomly — some cars need more fuel than
others. Because of this randomness, you need probability distributions to model it.

Q14d) Give two reasons why simulation is appropriate for this system. (4 marks)
✔ ANSWER:
• The system involves RANDOMNESS (random arrivals and service times) that makes exact
mathematical analysis very difficult — simulation handles randomness naturally.
• You can test different scenarios (e.g., adding a second pump, changing service speed) SAFELY
without actually building a new pump — saving cost and time.

Question 15 — When Simulation Works and When It Fails (20 marks)


Q15a) Describe FIVE situations where simulation IS the right tool. (10 marks)
✔ ANSWER:
• 1. COMPLEX SYSTEMS with many interacting parts — e.g., a large hospital with many
departments. Too complex for simple math.
• 2. SYSTEMS WITH RANDOMNESS — e.g., a call centre with random call arrivals. Simulation
models the randomness naturally.
• 3. WHEN EXPERIMENTS ON THE REAL SYSTEM ARE DANGEROUS OR IMPOSSIBLE —
e.g., simulating a nuclear plant meltdown to test safety procedures without actual danger.
• 4. TRAINING PURPOSES — e.g., flight simulators for pilots. Train safely without risking a real
aircraft.
• 5. BEFORE COMMITTING TO A NEW DESIGN — e.g., testing a new factory layout before
spending millions building it.

Q15b) Describe FIVE situations where simulation is NOT appropriate. (10 marks)
✔ ANSWER:
• 1. WHEN A SIMPLE FORMULA SOLVES THE PROBLEM — e.g., calculating the area of a
room. No need to simulate.
• 2. WHEN COMMON SENSE IS ENOUGH — e.g., knowing that hiring more staff reduces queue
time. Obvious without simulation.
• 3. WHEN DIRECT EXPERIMENTS ARE CHEAP AND QUICK — e.g., rearranging shelves in a
small shop and observing customer behaviour directly.
• 4. WHEN THE SYSTEM IS TOO SIMPLE — e.g., a single machine producing one type of item
at a fixed rate. A formula is faster and exact.
• 5. WHEN TIME AND RESOURCES ARE NOT AVAILABLE — simulation requires significant
investment. If there is no time or budget, it is better to use a simpler method.
MOCK EXAM 2 — SECTION A: SHORT ANSWER (30 Marks)
This exam covers ALL six lectures. Marks are evenly distributed.

Question 1 — Definitions (6 marks)


Q1a) Define 'Model' as used in simulation. (2 marks)
✔ ANSWER:
A model is a simplified, conceptual framework (using mathematical and logical relationships) that
represents how a system works. It captures the key features of the real system so you can study it
without touching the real thing.

Q1b) Define 'Verification'. (2 marks)


✔ ANSWER:
Verification means making sure that the computer program (code) correctly implements the logic of
your conceptual model. The key question is: 'Did we BUILD the model RIGHT?' — i.e., does the code
do what we intended?
💡 MEMORY TIP: Verification = checking the CODE is correct.

Q1c) Define 'Validation'. (2 marks)


✔ ANSWER:
Validation means making sure that the model actually represents the real-world system accurately. The
key question is: 'Did we build the RIGHT model?' — i.e., does the model match reality?
💡 MEMORY TIP: Validation = checking the MODEL matches the real world.

Question 2 — Utilization Factor (2 marks)


Q2) What is the utilization factor (ρ) in queueing theory? Write its formula.
✔ ANSWER:
The utilization factor (ρ) is the fraction of time that the server(s) are busy. It tells you how busy (or
loaded) the system is on average.
ρ = λ / (s × μ)
Where: λ = arrival rate, μ = service rate, s = number of servers.
For a single server (M/M/1 queue), s=1, so: ρ = λ / μ
For the system to be stable, ρ must be LESS than 1. If ρ ≥ 1, the queue grows forever.
💡 MEMORY TIP: ρ < 1 = system is stable. ρ = 0.8 means the server is busy 80% of the time.

Question 3 — Disadvantages of Simulation (3 marks)


Q3) State three disadvantages of simulation.
✔ ANSWER:
• High cost and time — building and running simulations requires expensive software and skilled
people.
• Results are only approximations — because of randomness, results are never exact and require
many runs.
• Results are hard to interpret — it can be difficult to know if the output is caused by the system or
just random chance.

Question 4 — Verification vs Validation with Example (4 marks)


Q4) Differentiate between verification and validation using a simple example.
✔ ANSWER:
Simple way to remember:
• VERIFICATION = 'Are we building the model right?' → Checks the CODE is correct.
• VALIDATION = 'Are we building the right model?' → Checks the MODEL matches REALITY.

Example: You build a simulation of a bank queue.


• Verification: You check that your Excel formulas correctly calculate waiting times (no formula
errors). This is checking the code is right.
• Validation: You compare the simulation's average waiting time to actual measured waiting times
in the real bank. This is checking the model matches reality.

KEY POINT: A model can be VERIFIED (code is correct) but still INVALID (because you used the
wrong assumptions about the real system).
💡 MEMORY TIP: Think: Verification = a spell-check (catches typos in code). Validation = a peer review
(checks if the ideas are correct).

Question 5 — M/M/1 Queue Formulas (2 marks)


Q5) For an M/M/1 queue, write the formula for: a) L (expected number in system), b) W (expected
waiting time in system).
✔ ANSWER:
a) L = λ / (μ - λ) [also written as ρ / (1 - ρ)]
b) W = 1 / (μ - λ)
Where λ = arrival rate, μ = service rate.
💡 MEMORY TIP: Notice: W = 1/(μ-λ) and L = λ × W. These are related by Little's Law: L = λW.

Question 6 — Monte Carlo Simulation (3 marks)


Q6) What is Monte Carlo simulation? Give one application area.
✔ ANSWER:
Monte Carlo simulation is a computerised technique that uses RANDOM NUMBERS to simulate
uncertain situations many times and then analyses the overall results statistically. Instead of solving a
problem with one equation, you run hundreds or thousands of experiments using random samples.
How it works in simple terms: Define the problem → Identify uncertain variables → Assign probability
distributions → Generate random values → Run many times → Analyse the results.
• Application area: FINANCE — used to estimate the risk of an investment portfolio by simulating
thousands of possible market scenarios.
• Other examples: project management (estimating project completion times), engineering
reliability testing.
💡 MEMORY TIP: Monte Carlo = many random experiments to get a statistical answer. Named after the
famous casino in Monaco!

Question 7 — Simulation Software (3 marks)


Q7) Name three simulation software tools mentioned in Lecture 5.
✔ ANSWER:
• GPSS (General Purpose Simulation System) — developed by IBM in 1961; uses the process-
interaction approach; statistics are generated automatically.
• SIMSCRIPT — a comprehensive, English-like programming language designed for simulation;
was developed by the RAND Corporation.
• Arena — a modern graphical simulation tool where you can see an animation of the model;
based on the SIMAN language.
Others mentioned: Dynamo, Simula, AutoMod, FlexSim, OPNET Modeler.
💡 MEMORY TIP: Remember 3 from the lectures: GPSS (old IBM), SIMSCRIPT (RAND Corp), Arena
(modern graphics).

Question 8 — RAND() and Exponential Variate (3 marks)


Q8) In Excel, what does RAND() do? Write the formula for generating an exponential random
variate with mean λ.
✔ ANSWER:
RAND() generates a random number uniformly distributed between 0 and 1. Every time you press F9 or
change anything in the spreadsheet, it generates a new random number.
Formula for generating a Uniform distribution between a and b:
= RAND() * (b - a) + a
Formula for generating an EXPONENTIAL random variate with mean 1/λ (i.e., arrival rate λ):
= -( 1/λ ) * LN( RAND() )
Or if you are given the mean directly (mean = m):
= -m * LN( RAND() )
💡 MEMORY TIP: Exponential formula uses the natural log (LN) of the random number. The negative sign
makes it positive.

Question 9 — Verification or Validation? (2 marks)


Q9) State whether each refers to Verification or Validation:
✔ ANSWER:
• a) 'Does the code correctly implement the logic?' → VERIFICATION (checking the
code/program is built correctly).
• b) 'Is the correct model built for the problem?' → VALIDATION (checking the model represents
the real world correctly).

Question 10 — Goal Seek in Excel (2 marks)


Q10) What is the purpose of Goal Seek in Excel? Give one limitation.
✔ ANSWER:
PURPOSE: Goal Seek is a What-If Analysis tool in Excel that works BACKWARDS. You tell it the
target output you want, and it automatically finds the input value needed to achieve that target.
Example: 'What price gives a profit of Ksh 8,000?' — Goal Seek finds the price for you.
LIMITATION: Goal Seek only works for CONTINUOUS, LINEAR (or near-linear) relationships. If the
formula has a jump or discontinuity (like an IF statement that creates a sudden step), Goal Seek may
fail or give a wrong answer because it cannot handle the gap.
💡 MEMORY TIP: Goal Seek = Excel's backwards solver. It finds the INPUT when you know the desired
OUTPUT. Fails with IF statements and sudden jumps.

MOCK EXAM 2 — SECTION B: STRUCTURED QUESTIONS (30


Marks)

Question 11 — Verification and Validation (10 marks)


Q11a) Explain why verification is necessary but NOT sufficient for model validity. (3 marks)
✔ ANSWER:
Verification checks that the computer code is correct — i.e., the code does what you intended. But this
alone is NOT enough to trust the model, because:
• A model can be PERFECTLY CODED but still use WRONG ASSUMPTIONS about the real
world. For example, you might assume arrivals follow a normal distribution when they actually
follow a Poisson distribution. The code is correct, but the model is wrong.
• Therefore, after verification (code is right), you still need VALIDATION (model matches reality)
before you can trust the results.
• Think of it this way: verification is like making sure a recipe is followed correctly. But if the recipe
itself is wrong, the food will still taste bad — that is why you also need to taste-test (validate).

Q11b) Describe three verification techniques from Lecture 2. (3 marks)


✔ ANSWER:
• STRUCTURED WALKTHROUGHS: A team of people (not the original programmer) reviews the
code line by line to check for errors like off-by-one mistakes or wrong logic.
• TRACES: Print out the intermediate values of the simulation step by step and manually follow
one entity (e.g., one customer) through the system to check each step is correct.
• EXTREME CONDITION TESTS / CONSISTENCY CHECKS: Test the model with extreme
values (e.g., set arrival rate to 0 or infinity) and check if the model behaves logically. Also check
units are consistent (e.g., are you mixing minutes and seconds?).
Q11c) Describe two validation techniques from Lecture 2. (2 marks)
✔ ANSWER:
• HISTORICAL DATA VALIDATION: Compare the model's output to real historical data. If the
model gives similar results to what actually happened in reality, it is likely valid. Statistical tests
(like t-tests or chi-square) are used to compare.
• SENSITIVITY ANALYSIS: Change the input parameters and check if the output changes in the
expected direction. For example, increase the arrival rate — does the queue length increase? If
yes, the model behaves logically.

Q11d) What is face validity? Give one weakness. (2 marks)


✔ ANSWER:
Face validity means asking DOMAIN EXPERTS (e.g., managers, operators who know the real system)
whether the model looks reasonable and sensible to them.
WEAKNESS: Experts can be wrong. They tend to judge based on averages and typical behaviour, and
may miss unusual patterns or emergent behaviour that only appears when the model is run statistically.
Also, different experts may give different opinions.

Question 12 — Queueing Theory Calculations (10 marks)


Q12) M/M/1 queue: λ = 5 customers/hour, μ = 8 customers/hour. Calculate all measures.
✔ ANSWER:
GIVEN: λ = 5, μ = 8, s = 1 (single server)

Part a) Utilization factor ρ (2 marks)


ρ = λ / μ = 5 / 8 = 0.625
This means the server is busy 62.5% of the time. Since ρ < 1, the system is stable.

Part b) Expected number in system L (2 marks)


L = λ / (μ - λ) = 5 / (8 - 5) = 5 / 3 ≈ 1.667 customers
On average, about 1.67 customers are in the system (waiting + being served).

Part c) Expected waiting time in system W (2 marks)


W = 1 / (μ - λ) = 1 / (8 - 5) = 1/3 hour ≈ 20 minutes
On average, a customer spends 20 minutes in the system (waiting + service).

Part d) Expected number in queue Lq (2 marks)


Lq = λ² / [μ(μ - λ)] = 25 / [8 × 3] = 25 / 24 ≈ 1.042 customers
On average, about 1.04 customers are waiting in the queue.

Part e) Expected waiting time in queue Wq (2 marks)


Wq = λ / [μ(μ - λ)] = 5 / [8 × 3] = 5/24 ≈ 0.208 hours ≈ 12.5 minutes
On average, a customer waits about 12.5 minutes IN THE QUEUE (before service begins).
CHECK: W = Wq + 1/μ → 20 min = 12.5 min + 7.5 min ✓ (1/8 hour = 7.5 minutes)
💡 MEMORY TIP: Always check: W = Wq + 1/μ and L = λ × W (Little's Law). If these hold, your calculations
are correct.

Question 13 — Simulation Software and Excel (10 marks)


Q13a) List three reasons to use specialised simulation software instead of a general
programming language. (3 marks)
✔ ANSWER:
• NECESSARY FEATURES ARE BUILT IN — random number generation, time advancement,
queue management, and statistics collection are automatically available. In Python or Java, you
would have to build all of this from scratch.
• MORE NATURAL LANGUAGE FOR SIMULATION — simulation software uses terms and
concepts that match simulation thinking (entities, events, queues), making it easier to build
models.
• COMMON ERRORS ARE CHECKED AUTOMATICALLY — simulation software detects logical
errors (like an entity getting stuck) that a general language would ignore.

Q13b) Difference between event-driven and process-driven simulation approaches. (2 marks)


✔ ANSWER:
• EVENT-DRIVEN approach: The simulation jumps from one event to the next. Time advances
only when an event occurs (like a customer arriving or leaving). Nothing is computed in
between. Most efficient.
• PROCESS-DRIVEN approach: You model the complete journey (process) of each entity
through the system. The entity 'moves' through stages: arrive → wait → be served → leave.
GPSS uses this approach.

Q13c) How to generate a Uniform(10, 20) random number in Excel. (2 marks)


✔ ANSWER:
= RAND() * (20 - 10) + 10
= RAND() * 10 + 10
This formula scales the 0-to-1 random number from RAND() so it falls uniformly between 10 and 20.

Q13d) One limitation of Goal Seek and an example where it fails. (3 marks)
✔ ANSWER:
LIMITATION: Goal Seek assumes the relationship between the input and output is CONTINUOUS
(smooth, no sudden jumps). If the formula contains an IF() statement that creates a sudden jump in
value, Goal Seek may fail or give a wrong answer.
EXAMPLE WHERE IT FAILS: From Lecture 6 — A salesperson earns a bonus of Ksh 2,000 if sales
exceed Ksh 25,000. The earnings function JUMPS at Ksh 25,000 (you suddenly earn Ksh 2,000 extra).
If you ask Goal Seek to find the sales needed for earnings of Ksh 6,000, it cannot find an answer
because Ksh 6,000 falls in the 'impossible gap' between the two salary levels. The earnings jump from
about Ksh 5,250 to Ksh 7,250 at the bonus threshold.
MOCK EXAM 2 — SECTION C: LONG ANSWER (40 Marks) —
Answer ANY TWO

Question 14 — Simulation Basics + V&V (20 marks)


Q14a) Define simulation and explain three advantages of using simulation in industry. (6 marks)
✔ ANSWER:
DEFINITION: Simulation is the imitation of the operation of a real-world process or system over time. A
simulation model is built, and then run to study how the system behaves, so we can understand,
predict, or improve it without touching the real system.

THREE ADVANTAGES IN INDUSTRY:


• SAFE TESTING OF NEW IDEAS — companies can test new production schedules, layouts, or
technologies in simulation before implementing them, avoiding costly mistakes. E.g., test a new
assembly line before building it.
• TIME COMPRESSION — simulation can run months or years of factory operation in minutes,
helping managers quickly evaluate long-term strategies. E.g., simulate 5 years of machine wear
in one hour.
• BOTTLENECK IDENTIFICATION — simulation reveals which part of the production process is
slowest (the bottleneck), so managers know exactly where to invest. E.g., discover that the
packaging station causes 80% of delays.

Q14b) Three verification techniques a company should perform. (6 marks)


✔ ANSWER:
• STRUCTURED WALKTHROUGHS: Get a team of people who did NOT build the model to
review the code step by step. They look for logical errors, off-by-one mistakes, and wrong event
handling. This 'fresh eyes' approach catches errors the original programmer might miss.
• TRACE / MANUAL TRACKING: Run the simulation and print out every step. Manually follow
one entity (e.g., one job through the factory) and check each calculation by hand. Compare with
what the simulation shows.
• EXTREME CONDITION TESTING: Set inputs to extreme values and check if the model
responds sensibly. E.g., set machine failure rate to zero — the factory should run perfectly. Set
arrival rate to zero — the system should be empty. If the model behaves strangely, there is a
bug.

Q14c) Three validation techniques to perform after verification. (6 marks)


✔ ANSWER:
• HISTORICAL DATA VALIDATION: Compare the model's outputs (average production rate,
queue lengths) to real historical data from the actual factory. Use statistical tests (t-tests) to
check if the difference is statistically significant.
• SENSITIVITY ANALYSIS: Change key input parameters (e.g., increase arrival rate by 10%) and
check if the output changes in the expected direction. If increasing demand increases queue
length, the model is behaving logically.
• FACE VALIDITY: Show the model (and its outputs) to experts who know the real factory
(managers, engineers, workers). Ask them: 'Does this look right?' Their expert judgment can
catch errors that statistics cannot.

Q14d) Why is absolute validation impossible? (2 marks)


✔ ANSWER:
Absolute validation is impossible because:
• A model is always a SIMPLIFICATION of reality — it cannot capture every detail of the real
system. There will always be some aspects that are not perfectly represented.
• The real system itself CHANGES OVER TIME — a model validated today may not be valid for
future conditions. We can only increase confidence in the model, never be 100% certain it is
perfect.

Question 15 — Continuous Simulation + Monte Carlo + Queueing (20 marks)


Q15a) What is continuous simulation? Give two real-world examples. (4 marks)
✔ ANSWER:
Continuous simulation models systems where the state variables change SMOOTHLY AND
CONTINUOUSLY over time (not in sudden jumps). It uses differential equations (mathematical
equations that describe rates of change) to track how the system evolves. Time advances in small fixed
steps.
• Example 1: TEMPERATURE CHANGE — simulating how a hot object cools down.
Temperature decreases smoothly every second according to Newton's Law of Cooling.
• Example 2: POPULATION GROWTH — simulating how a bacteria colony grows over time. The
population increases continuously as bacteria reproduce.

Q15b) How continuous simulation differs from discrete-event simulation. (6 marks)


✔ ANSWER:
KEY DIFFERENCES:
• STATE CHANGES: In continuous simulation, state variables change SMOOTHLY at every time
step (e.g., temperature drops a tiny bit every millisecond). In discrete-event simulation, state
variables only change INSTANTANEOUSLY at specific events (e.g., queue length jumps by 1
when a customer arrives).
• TIME REPRESENTATION: Continuous simulation uses fixed or adaptive time steps — time
moves forward in small regular increments. Discrete-event simulation uses NEXT-EVENT time
advance — time jumps directly to the moment of the next event, skipping empty periods.
• GOVERNING EQUATIONS: Continuous simulation is governed by DIFFERENTIAL
EQUATIONS (describing rates of change). Discrete-event simulation is governed by LOGIC
RULES and QUEUEING FORMULAS (e.g., if server is idle, begin service).

Q15c) What is Monte Carlo simulation? List the six steps. (6 marks)
✔ ANSWER:
Monte Carlo simulation is a technique that uses REPEATED RANDOM SAMPLING to estimate
outcomes in situations with uncertainty. Instead of one calculation, you run thousands of random
experiments and analyse the results statistically.

THE SIX STEPS (from Lecture 3):


• Step 1: DEFINE THE PROBLEM / MODEL — clearly state what you are trying to find out.
• Step 2: IDENTIFY UNCERTAIN INPUTS — which variables are random? (e.g., demand, price,
time).
• Step 3: ASSIGN PROBABILITY DISTRIBUTIONS — decide what distribution each uncertain
variable follows (e.g., normal, uniform, exponential).
• Step 4: GENERATE RANDOM VALUES — use random numbers to sample values from those
distributions.
• Step 5: RUN MANY SIMULATIONS — repeat steps 3 and 4 hundreds or thousands of times.
• Step 6: ANALYSE RESULTS — calculate statistics (mean, variance, probability of outcomes)
from all the runs.

Q15d) Bank queue: λ = 10, μ = 15, s = 1. Calculate L, W, and ρ. (4 marks)


✔ ANSWER:
ρ = λ / μ = 10 / 15 = 0.667 (server is busy 66.7% of the time)
L = λ / (μ - λ) = 10 / (15 - 10) = 10 / 5 = 2 customers
W = 1 / (μ - λ) = 1 / (15 - 10) = 1/5 hour = 12 minutes
CHECK using Little's Law: L = λ × W → 2 = 10 × (1/5) = 2 ✓
💡 MEMORY TIP: Always verify with Little's Law: L = λW. If it holds, calculations are correct!

Question 16 — Excel Simulation + Goal Seek + Software (20 marks)


Q16a) How to perform a random arrival time simulation in Excel using RAND(). Include steps
and key formulas. (6 marks)
✔ ANSWER:
SETUP: We want to simulate customers arriving at a checkout, with interarrival times uniformly
distributed between 1 and 10 minutes, and service times uniformly distributed between 1 and 6
minutes.

STEP-BY-STEP:
• Step 1: Set up column headers: Customer | Interarrival Time | Service Time | Arrival Clock |
Service Begins | Service Ends | Time in System | Clerk Idle Time
• Step 2: Enter Customer 1 manually. Arrival = 0. Service begins = 0. Generate service time:
=INT(RAND()*6)+1
• Step 3: For Customer 2 onwards, generate interarrival time: =INT(RAND()*10)+1
• Step 4: Arrival Clock for Customer n = previous arrival + interarrival time
• Step 5: Service Begins = MAX(arrival time, previous service end time) — customer waits if
server is busy
• Step 6: Service Ends = Service Begins + Service Time
• Step 7: Time in System = Service Ends - Arrival Time
• Step 8: Clerk Idle = Service Begins - previous Service End (if positive, else 0)
KEY FORMULAS:
Interarrival time (Uniform 1-10): =INT(RAND()*10)+1
Service time (Uniform 1-6): =INT(RAND()*6)+1
Service begins: =MAX(arrival_cell, prev_service_end_cell)
Time in system: =service_ends - arrival_clock
Press F9 to refresh and get a new random replication.

Q16b) Explain Goal Seek. Give two appropriate and two inappropriate use cases. (6 marks)
✔ ANSWER:
WHAT IS GOAL SEEK: Goal Seek is Excel's What-If Analysis tool that works BACKWARDS. You
specify the output value you want, and Excel automatically calculates the input value needed to achieve
it.
How to use it: Data → What-If Analysis → Goal Seek → Set the output cell → Enter target value →
Choose the input cell → Click OK.

TWO APPROPRIATE USE CASES:


• BREAK-EVEN ANALYSIS: 'How many units must I sell to make zero profit?' — Goal Seek finds
the exact number of units. (Works because profit is a continuous, smooth function of units sold.)
• PRICE OPTIMISATION: 'What price achieves Ksh 8,000 profit, given that higher price = fewer
sales?' — Goal Seek can solve this because demand changes smoothly with price.

TWO INAPPROPRIATE USE CASES:


• BONUS STRUCTURES WITH IF STATEMENTS: If earnings include a sudden bonus (IF sales
> Ksh 25,000 THEN add Ksh 2,000), Goal Seek fails because the earnings function jumps
discontinuously at the threshold.
• MULTI-VARIABLE OPTIMISATION: If profit depends on BOTH price AND advertising spend,
Goal Seek cannot handle it — it only changes ONE variable at a time. Use Solver instead.

Q16c) List five capabilities that any simulation software must have. (5 marks)
✔ ANSWER:
According to Lecture 5, every simulation software MUST be able to:
• 1. MODEL RANDOM PHENOMENA — generate random numbers (uniform U(0,1)) and
generate random variates from specific probability distributions (exponential, normal, etc.).
• 2. ADVANCE TIME — maintain a simulated clock and determine the next event from the event
list.
• 3. OUTPUT STATISTICS — produce tables, reports, and graphs of results.
• 4. LIST MANAGEMENT — store and retrieve data from queues correctly; manage the event list
and entities waiting for service.
• 5. ERROR DETECTION — detect and report logical inconsistencies and error conditions in the
model.

Q16d) Briefly describe GPSS, SIMSCRIPT, and Arena. (3 marks)


✔ ANSWER:
• GPSS (General Purpose Simulation System): Developed by IBM in 1961. Uses the PROCESS-
INTERACTION approach (you model the journey of entities). Statistics are generated
automatically. Was very widely used; now available as aGPSS for personal computers.
• SIMSCRIPT: Developed by the RAND Corporation. The most COMPREHENSIVE simulation
language — it is both a general-purpose programming language AND a simulation language. It
is English-like and self-documenting, making it readable. Very powerful but complex.
• Arena: A MODERN, graphical simulation tool where the model is shown visually on screen.
Shows animations of entities moving through the system. Based on the SIMAN language.
Widely used in industry today for manufacturing and service simulations.
QUICK REFERENCE: KEY FORMULAS TO MEMORISE

Queueing Theory — M/M/1 Formulas


(Single server, Poisson arrivals, Exponential service)
ρ = λ / μ (Utilization factor — must be < 1 for
stability)
L = λ / (μ - λ) (Average number in SYSTEM)
Lq = λ² / [μ(μ - λ)] (Average number in QUEUE)
W = 1 / (μ - λ) (Average time in SYSTEM)
Wq = λ / [μ(μ - λ)] (Average time in QUEUE)
W = Wq + 1/μ (Check formula — always verify this!)
L = λ × W (Little's Law)
Lq = λ × Wq (Little's Law for queue)

Excel Random Number Formulas


Uniform(a, b): = RAND() * (b - a) + a
Exponential(mean): = -mean * LN(RAND())
Integer Uniform: = INT(RAND() * (b - a + 1)) + a

Key V&V Distinctions


• Verification: 'Did we BUILD the model RIGHT?' → Checks the CODE.
• Validation: 'Did we build the RIGHT model?' → Checks model matches REALITY.
• Both are needed! Verified ≠ Valid.

Continuous vs Discrete Summary


• Discrete: State changes at EVENTS (jumps). Examples: queues, traffic lights.
• Continuous: State changes SMOOTHLY. Governed by differential equations. Examples:
temperature, water level.
• Monte Carlo: Static simulation using MANY random samples to estimate probabilities.

You might also like