MODELLING AND SIMULATION Ai guide
Question One
a) Describe stochastic processes and its mathematical representation (2 marks)
A stochastic process is defined as an ordered set of random variables. The ordering is
usually with respect to time. It is a mathematical model for a system that evolves
randomly over time. A stochastic activity is one where the output is random, giving
rise to a stochastic variable represented by a sequence of random numbers occurring
over time.
Mathematical Representation: A stochastic process can be represented as {X(t), t ∈ T},
where:
• T is an index set (typically representing time).
• For each t in T, X(t) is a random variable.
b) Explain the four (4) classes of stochastic processes with relevant examples (8
marks)
Based on the notes, the classification can be based on state space and time.
1. Discrete-Time, Discrete-State Process: The index set T is discrete (e.g., t = 0, 1,
2,...), and the random variables X(t) can only take on discrete values.
o Example: The number of customers in a bank at the close of each
business day.
2. Discrete-Time, Continuous-State Process: The index set T is discrete, but the
random variables X(t) can take on a continuum of values.
o Example: The daily closing price of a stock.
3. Continuous-Time, Discrete-State Process: The index set T is continuous (e.g., t
≥ 0), and the random variables X(t) can only take on discrete values. This is
often called a random or stochastic sequence.
o Example: The number of emails in your inbox at any given time t.
4. Continuous-Time, Continuous-State Process: The index set T is continuous,
and the random variables X(t) can take on a continuum of values.
o Example: The temperature in a room measured continuously over a day.
c) Write short notes on the following types of stochastic processes. (2 marks each)
i. Counting process: A counting process is a stochastic process that represents the
total number of events that have occurred up to time t. It is an integer-valued, non-
decreasing function of time. For example, the number of arrivals at a service station
by time t is a counting process.
ii. Bernoulli Process: This is a discrete-time stochastic process with a discrete state
space, where each trial (or time step) has only two possible outcomes (e.g.,
success/failure), and each trial is independent of the others. The sequence of tossing
a fair coin multiple times is a Bernoulli process.
iii. Markov process: A Markov process is a stochastic process with the property that
the future state depends only on the present state and not on the sequence of
events that preceded it. This "memoryless" property simplifies analysis. The
movement of a particle in a fluid, where its next position depends only on its current
position, is an example.
d) As a modeling and simulation expert, how can stochastic process be applied in our
day-to-day life. (4 marks)
Stochastic processes model systems with inherent randomness.
1. Queue Management: Modeling customer arrivals (Poisson process) and
service times at banks, toll booths, or call centers to determine optimal staff
levels and reduce waiting times.
2. Inventory Control: Modeling the random demand for products and lead times
for replenishment to optimize stock levels, minimizing both holding costs and
stock-out costs.
3. Finance: Modeling stock price movements (e.g., Geometric Brownian Motion)
to assess risk and value financial options.
4. Reliability Engineering: Modeling the random times to failure of system
components to predict overall system reliability and plan maintenance
schedules.
Question Two
a) Input models provide the driving force for a simulation model, discuss the four (4)
steps of input model development: (8 marks)
1. Data Collection: The first step is to gather high-quality data from the real
system. This could involve historical records, direct observation, or automated
logging. The accuracy of the simulation depends heavily on the accuracy of
this data.
2. Identify the Distribution: Using the collected data, the next step is to identify a
standard probability distribution that closely matches the data. This involves
using histograms, summary statistics, and goodness-of-fit tests like the Chi-
Square or Kolmogorov-Smirnov test.
3. Choose Parameters: Once the distribution family is identified (e.g.,
Exponential, Normal, Poisson), its parameters (e.g., mean λ for
Exponential, μ and σ for Normal) must be estimated from the data.
4. Evaluate the Chosen Model: The final step is to test the goodness-of-fit of the
chosen distribution and parameters. If the model is rejected by the tests, the
process from step 2 is repeated with a different candidate distribution.
b) Differentiate between Model Validation and Model Credibility (2 marks)
• Model Validation is the technical process of ensuring that the computer
model implements the conceptual model correctly and that its output has a
satisfactory range of accuracy for the model's intended purpose. It answers
the question: "Did we build the model right?"
• Model Credibility is the broader perception by the model's users and decision-
makers that the model is a reasonable and trustworthy representation of the
real system. It answers the question: "Did we build the right model?"
c) What are the techniques for developing valid and credible models? (8 marks)
1. Face Validity: Having domain experts review the model to see if it looks
reasonable based on their experience and common sense.
2. Comparison with Existing System Data (For existing systems): Using historical
input data to run the model and comparing the model's output with the
actual output from the real system.
3. Sensitivity Analysis: Systematically varying model parameters to see how
sensitive the output is to these changes. A valid model should show changes
in output that are consistent with real-world expectations.
4. Internal Validity: Making multiple replications of the simulation run with
different random number streams to check the internal variability of the
model. A high variance might indicate an unstable or invalid model.
5. Animation: Using graphical animation to visually verify that the model's logic
and behavior match the real system.
6. Historical Data Validation: Using one set of historical data to build the model
and another, different set to validate its predictions.
7. Subsystem Validity: For a complex model, validating individual subsystems
separately before integrating them.
d) As a simulator, provide a suggestion on how to obtain good model data (2 marks)
Use a combination of historical records and direct observation while ensuring the
data collection process is consistent and covers a sufficiently long period to capture
the natural variability of the system. The data should be gathered specifically for the
purpose of the simulation study to ensure relevance.
Question Three
(This question is identical to Question Two in the exam paper. Please refer to the
answers above for Question Two, parts a, b, c, and d.)
Question Four
a) Explain the most prevalent world views a modeler adopts for developing a model
(6 marks)
The notes describe these as approaches to representing time in discrete system
simulation:
1. Event-Scheduling / Next-Event World View: The simulation clock advances to
the time of the next most imminent event. The system state changes only at
these event times. This is efficient as it skips over periods of
inactivity. Example: Simulating a bank where the clock jumps from one
customer arrival or departure to the next.
2. Fixed-Increment Time Advance / Fixed-Time-Step World View: The simulation
clock is advanced by a fixed time increment Δt. After each update, the system
is scanned to see if any events occurred during that interval. All events within
the interval are treated as if they occurred at the end of the interval. This is
simpler but can be less accurate and efficient. Example: Simulating a
population of fish by checking for births and deaths once every simulated day.
3. Activity-Scanning World View: The modeler describes the conditions under
which activities can start and end. The simulation proceeds by repeatedly
scanning all activities to see which conditions are met. It is less common but
can be natural for some systems.
b) Differentiate between exogenous and Endogenous events. (2 marks)
• Endogenous activities or events are those that occur within the system
boundary. Example: A machine breaking down in a factory simulation.
• Exogenous activities or events are those that occur in the
system's environment and affect the system. Example: A power cut from the
main grid affecting the factory.
c) Discuss the difference between deterministic and stochastic models, providing
examples for each (2 marks)
• Deterministic Model: The outcome of an activity can be described completely
in terms of its input. There is no randomness. Example: The calculation of force
in a physics simulation using F = ma.
• Stochastic Model: The effects of an activity vary randomly over various
possible outcomes. Randomness is an integral part. Example: Simulating the
throw of a dice or the arrival time of customers at a store.
d) You are tasked with improving traffic flow in a busy city... (10 marks)
1. Problem Definition & Data Collection: Clearly define the objectives (e.g.,
reduce average journey time by 20%). Collect data on traffic volumes, vehicle
types, signal timings, road layouts, and arrival patterns at key intersections.
2. Model Building (Type of Model): I would use a Discrete-Event Simulation (DES)
model with a Next-Event world view. Entities would be vehicles, resources
would be roads and traffic lights, and activities would be driving, stopping,
and accelerating. The model would be stochastic to account for random arrival
patterns and driver behavior.
3. Factors for Analysis:
o Arrival Patterns: Model vehicle inter-arrival times using a distribution
(e.g., Poisson process).
o Service Times: Model the time taken to cross an intersection.
o Queuing Discipline: Typically FIFO (First-In-First-Out) at traffic lights.
o System Parameters: Traffic light cycle times, green light durations,
number of lanes, presence of roundabouts.
4. Simulation & Experimentation: Run the model to establish a baseline
performance. Then, experiment with different scenarios:
o Altering traffic signal timing (cycle length, green wave coordination).
o Implementing one-way systems.
o Adding new lanes or roundabouts.
5. Output Analysis & Validation: Compare the output (average queue length,
waiting time, journey time) of each scenario against the baseline. Validate the
model by ensuring its baseline output matches real-world traffic data.
6. Recommendation: Propose the solution that shows the most significant
improvement in the key performance indicators.
Question Five
a) Consider a hospital emergency department... (10 marks)
• Components of the System:
o Entities: Patients, doctors, nurses, equipment.
o Attributes of a Patient: Triage level, age, medical condition, arrival time.
o Activities: Triage, consultation, diagnostic tests (X-ray, blood tests),
treatment.
o State of the System: The number of patients waiting, the status of each
doctor (busy/idle), the number of free beds.
• Arrivals: Patients arrive according to a stochastic arrival pattern, often
modeled as a Poisson process, meaning inter-arrival times are exponential.
The arrival distribution A₀(t) describes the probability that the time between
arrivals is greater than t.
• Significance: Understanding arrivals and patient attributes allows management
to:
o Predict peak loads and schedule staff accordingly (using the mean
arrival rate λ).
o Prioritize patients effectively using triage levels (an attribute).
o Allocate resources (like diagnostic equipment) based on the mix of
patient conditions (attributes).
b) Explain with suitable examples: (1 mark each)
a. Inter-arrival time: The time between two consecutive arrivals. Example: The time
between one customer entering a bank and the next customer entering.
b. Service time: The time required to serve a customer. Example: The time a bank
teller spends with a single customer.
c. Utility Time: (Note: The notes refer to this concept but typically use "Service Time". In
queuing, "Utilization" is the proportion of time a server is busy.)
d. Idle time of a queuing system: The time a server spends waiting for a customer to
serve. Example: The time a bank teller spends with no customers in their queue.
c) What are some of the customer and server's behaviour encountered during
queuing (6 marks)
• Customer Behavior:
1. Balking: A customer who decides not to join the queue upon seeing its
length.
2. Reneging: A customer who joins the queue but leaves before being
served due to impatience.
3. Jockeying: A customer who moves from one queue to another hoping
for faster service.
• Server Behavior:
1. Breakdowns: The server may become unavailable randomly (e.g., a
machine failure).
2. Scheduled Unavailability: The server may be periodically removed from
service (e.g., for lunch breaks or maintenance).
3. Variable Service Rate: The server's speed may change over time due to
fatigue or learning.
Question Six
a) In science and engineering, modeling and simulation techniques are applied to
two distinct types of system, Write and explain these system types. (5 marks)
1. Discrete System: Systems in which the state variables change instantaneously
at separated points in time. The changes are predominantly
discontinuous. Example: A factory system where events like a job arriving at a
machine or a machine finishing a part cause state changes.
2. Continuous System: Systems in which the state variables change continuously
with respect to time. The changes are predominantly smooth. Example: An
aircraft in flight, where attributes like position and velocity change
continuously.
b) Agent-based simulation (ABS)... outline five (5) key characteristics of ABS. (5 marks)
(While the core notes focus on traditional DES, ABS characteristics can be inferred and
are standard knowledge.)
1. Autonomous Agents: The system is composed of individual agents that make
their own decisions based on a set of rules.
2. Heterogeneity: Agents can have different attributes and rules, allowing for
diverse behaviors.
3. Emergent Behavior: The overall system behavior emerges from the
interactions of the individual agents, which is often unpredictable from the
rules of a single agent.
4. Bottom-Up Modeling: The global system behavior is generated from the
bottom up, starting from the individual agent level.
5. Interaction: Agents interact with each other and with their environment,
leading to complex dynamics.
c) Mention four (4) tools used in Agent-based simulation. (2 marks)
(From general knowledge)
1. NetLogo
2. Repast
3. AnyLogic
4. Mesa (for Python)
d) Explain the most prevalent world views a modeler adopts for developing a model
(6 marks)
(This is a repeat of Question 4a. Please refer to the answer for Question Four, part a.)
e) Differentiate between exogenous and Endogenous events. (2 marks)
(This is a repeat of Question 4b. Please refer to the answer for Question Four, part b.)