Chapter 3
Simulation and Modeling
PU BCA past exam questions
Past questions and answers
14 questions set from this chapter. Most repeated first.
- 2024 Spring · 7 marks
Define Stochastic activities. Explain principles of Modelling in details.
Answer
Stochastic activities
A stochastic activity is an activity whose duration or outcome is not fixed but random, described by a probability distribution. The time to complete it cannot be predicted exactly, e.g. the service time of a customer at a bank or the arrival of a call. Such activities are simulated by sampling values from distributions (exponential, normal, uniform, Poisson) using random numbers. In contrast, a deterministic activity has a fixed, known duration.
Principles of modelling
- Block building: the model should be built from well-defined, independent blocks (subsystems), each with clearly defined inputs and outputs, so that blocks can be tested and replaced separately.
- Relevance: include only the information relevant to the questions being studied; irrelevant detail adds complexity without value.
- Accuracy: the accuracy of information included must be consistent with the purpose and with the quality of available data.
- Aggregation: group parts of the real system into aggregate units where the detail is unnecessary, to keep the model manageable.
- Fallibility: a model is only an approximation; it cannot be perfect and must be validated against the real system.
- Simplicity (parsimony): start simple and add detail gradually; prefer the simplest model that meets the objective.
- Iteration: modelling is an evolving process of build, test, validate and refine.
- Verification and validation: check that the model is implemented correctly and that it represents the real system.
- Clear objectives: define the purpose, boundary, variables, parameters and performance measures before building.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 8 marks
What do you mean by distributed lag model? Estimate the value of the integral given in the paper using monte carlo method.
Answer
Distributed lag model
A distributed lag model is a dynamic model in which the effect of an explanatory variable on the dependent variable is spread over several time periods, so the current value of depends on the present and past values of :
Examples: the effect of advertising or of income on consumption, or price on supply, takes several periods. The coefficients show the effect after periods, and their sum is the long-run multiplier. Special forms are the Koyck (geometric) lag and the Almon polynomial lag.
Monte Carlo estimate of an integral
The integral printed in the paper is not reproduced here, so the method is shown on a typical example, (exact value ).
Method: for , generate uniform random numbers in (0,1), set and estimate
Take random numbers 0.15, 0.62, 0.37, 0.89, 0.51 with , :
| 0.15 | 0.30 | 0.0900 |
| 0.62 | 1.24 | 1.5376 |
| 0.37 | 0.74 | 0.5476 |
| 0.89 | 1.78 | 3.1684 |
| 0.51 | 1.02 | 1.0404 |
Sum = 6.384, mean = 1.2768, so
This is close to the exact 2.667, and the estimate improves as increases (the error falls as ). The same steps are applied to the given integral by changing , and .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 7 marks
Describe the Distributed Lag model. Use the Distributed Lag model to represent the price fluctuations of supply and demand in the market model. Create the price fluctuation graph using Cob-Web model for the following data: , , , ,
Answer
Distributed lag model
A distributed lag model expresses a dependent variable in terms of the current and past values of explanatory variables, because the response to a change is spread over time:
Market model with lag (cobweb)
Producers decide supply on the price of the previous period, since production takes time, while demand responds to the current price:
In equilibrium :
With , , , :
Equilibrium price: .
Starting from :
| 0 | 5.000 |
| 1 | 3.5 - 0.45(5) = 1.250 |
| 2 | 3.5 - 0.45(1.25) = 2.938 |
| 3 | 3.5 - 0.45(2.938) = 2.178 |
| 4 | 2.520 |
| 5 | 2.366 |
| 6 | 2.435 |
Cobweb graph: plot price on the vertical axis and quantity on the horizontal. Draw the demand line and the supply line . From move horizontally to the supply curve (quantity supplied next period), then vertically to the demand curve to read the new price , then back to supply, and so on. The path spirals inward towards the intersection at .
Conclusion: since the slope ratio (the coefficient of has magnitude below 1), the price oscillates with decreasing amplitude and converges: the market is stable (convergent cobweb).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 8 marks
Define analog computer with its components in detail. Draw and explain a block diagram using Analog computer method for liver.
Answer
Analog computer
An analog computer represents variables of a problem by continuously varying physical quantities (usually voltages) and solves differential equations by electrical circuits that behave like the system modelled. It works in real time, in parallel and continuously, as opposed to a digital computer, which works on discrete numbers.
Components
- Summer (adder): produces the sum of input voltages (with sign inversion), .
- Integrator: gives the time integral of its input, ; the key element for differential equations.
- Coefficient potentiometer: multiplies a signal by a constant between 0 and 1.
- Inverter (sign changer): reverses the sign.
- Multiplier and function generators: form products and nonlinear functions.
- Operational amplifiers: high-gain amplifiers used to build the above.
- Comparators, switches and initial-condition circuits.
- Output devices: oscilloscope, plotter or recorder.
Block diagram for the liver
The liver is modelled with a compartment model, e.g. a drug (or substance) in the blood and liver. Let = amount in blood and = amount in liver, with rate constants (blood to liver) and (liver elimination), and an input :
Analog setup:
- Input and the feedback go into a summer; its output is .
- An integrator (initial value ) produces ; a potentiometer set to forms , which is fed back to the first summer through an inverter, and also forwarded to the second stage.
- Second stage: and feed a summer giving , followed by an integrator (initial value ) giving ; a potentiometer set to returns as feedback.
- The outputs and are recorded on a plotter.
Block flow: [Summer] [Integrator] [Pot ] feedback to the summer and forward to [Summer] [Integrator] [Pot ] feedback.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 7 marks
Define CSMP? Give examples to illustrate the various statement kinds in CSMP.
Answer
CSMP
CSMP (Continuous System Modelling Program) is a simulation language developed by IBM for modelling continuous systems described by differential equations. It was designed to replace analog computers: the user writes the equations in block-diagram-like statements, the processor sorts them into the correct computational order and integrates them numerically, and prints or plots the results. Its statements are order-independent (the program sequences them).
Statement kinds
- Structure statements: describe the model using functional blocks such as INTGRL, and algebraic expressions.
Y = INTGRL(Y0, DY)integrates DY with initial value Y0.DY = -K*Y + Uis an equation for a derivative.- Function blocks:
STEP(T0),RAMP(T0),IMPULS,DELAY,LIMIT,FCNSW.
- Data statements: assign values to parameters, constants and initial conditions.
PARAMETER K = 0.5,CONSTANT Y0 = 10.0, A = 2.0,INCON X0 = 1.0.TABLEfor function tables.
- Control statements: control the run and output.
TIMER FINTIM = 20.0, OUTDEL = 1.0, PRDEL = 0.5set finish time, output interval and print interval.PRINT Y, DY,PRTPLT,LABEL,METHOD RKS,END,STOP.
Example (decay )
Y = INTGRL(Y0, DY)
DY = -K*Y
CONSTANT Y0 = 100.0
PARAMETER K = 0.3
TIMER FINTIM = 10.0, OUTDEL = 1.0
PRINT Y
END
STOP
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 8 marks
"Call gets lost when link is not available or line is busy." Verify this statement on the basis of various states involved in this simulation.
Answer
The statement is true. In a telephone system simulation a call is a temporary entity that passes through a series of states, and a call is lost whenever it reaches the point where no free path to the called party exists.
States of a call
- Idle / on-hook: The subscriber is not using the line.
- Call origination (off-hook): The caller lifts the handset and the call arrives in the system. The arrival time is generated randomly (usually exponential inter-arrival times).
- Dialling / connecting: The exchange tries to set up a path from the caller to the called party through the trunk lines (link).
- Availability test: The simulation checks two conditions:
- Is a link/trunk free?
- Is the called line free (not already engaged)?
- Connected / conversation: If both are free, the link and line are seized, the call proceeds for the holding time (a random service time) and then the resources are released. This is a completed call.
- Busy / blocked: If the link is not available, or the called line is busy, the call cannot be set up. There is no queue in a loss system, so the caller hears a busy tone.
- Call lost / abandoned: The blocked call leaves the system and the lost-call counter is increased. The caller may retry later as a new call.
Verification
Flow of the simulation: arrival, then test (link free AND line free). If the answer is yes, then connected, then conversation, then release, then completed. If the answer is no, the call goes to busy and is lost.
Since a call that finds either the link unavailable or the line busy has no other state to move to except the lost state, the call gets lost exactly under the stated conditions: "when the link is not available or the line is busy". Calls are lost only in this branch, and the loss probability (number lost divided by number of attempts) is a measure of performance used to decide how many links are needed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 7 marks
What is the purpose of the next event time advance mechanism in a discrete system?
Answer
In a discrete-event simulation the system state changes only at certain instants (events such as an arrival or the end of a service), and nothing changes between them. The next-event time advance mechanism is the way the simulation clock is moved forward.
Purpose
- To advance the simulation clock directly from the time of one event to the time of the next scheduled event, skipping the idle periods in between, instead of moving in small fixed steps.
- To save computing time, since no processing is done when nothing happens.
- To keep the model exact, because each event is executed at its precise time and not rounded to a time step.
How it works
- Initialise the clock to 0 and place the first events in the event list (future event list), ordered by time.
- Remove the imminent (earliest) event from the list.
- Set the clock to the time of that event.
- Execute the event: update the system state and statistics, and schedule any new future events (for example, an arrival schedules the next arrival and, if the server is free, a departure).
- Repeat until the stopping condition (end time or number of events) is met.
Example: if the event list holds arrivals at and and a departure at , the clock jumps .
It contrasts with the fixed-increment method, which advances by and may waste time or lose precision. Next-event advance is used in languages such as GPSS and SIMSCRIPT.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 8 marks
Define KS test for uniformity. Use the KS test to determine whether the input set of random integers provided below is uniform: 0.54, 0.73, 0.98, 0.11, 0.68, 0.45. Assume level of significance to be .
Answer
(a) Kolmogorov-Smirnov (KS) test for uniformity
The KS test checks whether a set of random numbers follows the uniform distribution on by comparing the empirical cumulative distribution of the sample with the theoretical uniform CDF . The statistic is the largest absolute difference between them.
Hypotheses: : the numbers are uniformly distributed; : they are not.
Steps:
- Rank the numbers in ascending order .
- Compute
- .
- Compare with the critical value at the significance level. If , do not reject ; otherwise reject it.
(b) Application
Sorted data, : 0.11, 0.45, 0.54, 0.68, 0.73, 0.98.
| 1 | 0.11 | 0.1667 | 0.0567 | 0.1100 |
| 2 | 0.45 | 0.3333 | -0.1167 | 0.2833 |
| 3 | 0.54 | 0.5000 | -0.0400 | 0.2067 |
| 4 | 0.68 | 0.6667 | -0.0133 | 0.1800 |
| 5 | 0.73 | 0.8333 | 0.1033 | 0.0633 |
| 6 | 0.98 | 1.0000 | 0.0200 | 0.1467 |
Critical value (given) at : .
Since , the null hypothesis is not rejected. There is no evidence at the 5% level that the numbers differ from a uniform distribution, so the set can be accepted as uniform.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 7 marks
Explain the SIMSCRIPT execution cycle.
Answer
SIMSCRIPT is a general purpose, process and event oriented simulation language. Its execution is controlled by a timing routine that works on the event set (pending events) in the following cycle.
Elements
- Event notice: A record of a scheduled event holding the event type, the time at which it will occur and any attributes.
- Event set: The list of event notices ordered by increasing time of occurrence (the future event list).
- Timing routine: The built-in routine that selects and activates events.
- Event routine: The user-written code that updates the system state when the event occurs.
Execution cycle
- Initialisation: The
mainprogram creates the entities, sets the initial state, and schedules the first events (for example the first arrival) withschedule ... now/in .. units. - Selection: The timing routine looks at the event set and removes the event notice with the earliest time.
- Clock update: The simulation clock
time.vis advanced to the time of this event notice. - Execution: The corresponding event routine is called. It changes the state variables, collects statistics, and may schedule new events (adding notices to the event set), cancel events or create/destroy entities.
- Return: When the routine ends, control returns to the timing routine.
- Termination test: The cycle repeats from step 2 until the event set is empty, the stop time is reached, or a
stopstatement is executed. Then the report is printed.
In process-oriented SIMSCRIPT, a process activates, works or waits for time, requests and relinquishes resources; the process notices are stored in the event set, and the same cycle resumes each process at the correct time.
Simple form: schedule, take the earliest event, advance the clock, execute the event routine, and repeat.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 8 marks
Worker come to a supply store at the rate of one every 7±2 minute. Their requisitions are processed by one of the two clerks who take 8±4 minutes for each requisition. The requisitions are then passed to a single storekeeper who fills them one at time, taking 4±2 minutes for each request. Draw the GPSS block diagram to simulate the queue of workers and measure the distribution of time taken for 800 requisitions to be filled.
Answer
Model description
- Workers arrive every minutes (uniform between 5 and 9).
- Two clerks serve requisitions, taking minutes (uniform 4 to 12); modelled as a storage of capacity 2.
- One storekeeper, with a single facility, fills requisitions in minutes (uniform 2 to 6).
- The total time in the system for 800 requisitions is tabulated.
Block diagram (flow of blocks)
GENERATE 7,2 arrival of a worker/requisition
|
QUEUE CLQ join the clerk queue
|
ENTER CLERKS take one of the 2 clerks
|
DEPART CLQ leave the queue
|
ADVANCE 8,4 clerk processes the requisition
|
LEAVE CLERKS free the clerk
|
QUEUE SKQ join the storekeeper queue
|
SEIZE KEEPER take the storekeeper
|
DEPART SKQ leave the queue
|
ADVANCE 4,2 storekeeper fills requisition
|
RELEASE KEEPER free the storekeeper
|
TABULATE TIMES record total time in system
|
TERMINATE 1 remove transaction, count 1
GPSS program
CLERKS STORAGE 2
TIMES TABLE M1,10,10,20
GENERATE 7,2
QUEUE CLQ
ENTER CLERKS
DEPART CLQ
ADVANCE 8,4
LEAVE CLERKS
QUEUE SKQ
SEIZE KEEPER
DEPART SKQ
ADVANCE 4,2
RELEASE KEEPER
TABULATE TIMES
TERMINATE 1
START 800
END
Explanation
GENERATE 7,2creates transactions with inter-arrival time uniform on 5 to 9 minutes.- The storage
CLERKSof capacity 2 represents the two clerks, so up to two requisitions are processed together; others wait in the queueCLQ. - The
ADVANCE 8,4block holds the transaction for 4 to 12 minutes. - The single storekeeper is a facility (
SEIZE/RELEASE); other transactions wait inSKQ. M1is the transit time of the transaction (time since it entered the model), soTABULATE TIMESbuilds a frequency table of the total time for each requisition, with the first class limit at 10 and class width 10 over 20 classes.- Each
TERMINATE 1decreases the termination counter, andSTART 800ends the run after 800 requisitions have been filled. The output gives the table of times, queue statistics, and clerk and storekeeper utilisation.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 8 marks
Why is the analysis of simulation output necessary? In output analysis, how is the estimation approach applied?
Answer
(a) Need for analysis of simulation output
A stochastic simulation uses random inputs, so the output of a single run is only one sample of a random process and differs from run to run. Without proper analysis we may draw wrong conclusions. Analysis is needed:
- To estimate the true performance measures (mean waiting time, utilisation, throughput) from sample results.
- To measure the precision (variance, confidence interval) of those estimates.
- To decide the run length, warm-up period and number of replications required.
- To deal with the autocorrelation of successive observations in one run and with initial bias.
- To compare alternative system designs reliably.
- To validate the model against the real system.
(b) Estimation approach
The aim is to estimate a parameter (for example the mean waiting time) from output observations .
- Point estimation: The sample mean is used as the estimate
- Interval estimation: A confidence interval shows the reliability of the estimate: For example, a 95% interval means that in 95% of repeated experiments the interval would contain the true mean.
- Terminating simulations (a natural end, such as a bank open from 9 to 5) use the method of independent replications: run replications with different random number streams, take one value (the mean of run ) from each, and apply the formulas above to the , which are independent.
- Steady-state (non-terminating) simulations require removing the initial transient by a warm-up deletion, then using one of:
- Replication-deletion: several runs, delete the warm-up from each.
- Batch means: one long run split into batches, whose means are treated as nearly independent observations.
- Regenerative method: split the run at regeneration points.
- Run length: Increase or the number of replications until the half-width of the interval is small enough, since it decreases roughly as .
The result is reported as a point estimate together with its confidence interval.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 5 marks
Write short notes on: Bootstrapping
Answer
Bootstrapping is a resampling technique used in simulation to estimate the sampling distribution of a statistic (mean, variance, confidence interval) from a single observed data set, without assuming a particular theoretical distribution.
Procedure
- Take the original sample of size .
- Draw a bootstrap sample of size with replacement from it, using random numbers to pick indices. Some observations appear more than once and some not at all.
- Compute the statistic of interest (e.g. the mean) for this resample.
- Repeat steps 2-3 a large number of times (e.g. 1000) to obtain .
- Use these values to estimate the bias, standard error and confidence interval:
A percentile interval is taken from the th and th percentiles of the sorted values.
Uses in simulation
- Estimating confidence intervals of output measures when the output distribution is unknown.
- Validating a model by comparing simulated and real data.
- Working with small samples where normal assumptions fail.
Advantages: simple, distribution-free, works for almost any statistic. Limitations: needs many computations, and it cannot fix a sample that is unrepresentative or too small.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 5 marks
Write short notes on: Pseudorandom number
Answer
Pseudorandom numbers are numbers generated by a deterministic algorithm that appear random and pass statistical tests of randomness (uniformity and independence), yet are completely reproducible from a starting value called the seed. They are used in simulation because truly random numbers are slow to produce and cannot be repeated.
Generation (linear congruential method)
Here is the seed, the multiplier, the increment and the modulus. For example, with , , , : , , , giving , , .
Desirable properties
- Uniformly distributed on .
- Statistically independent (no correlation between successive values).
- Long period before the sequence repeats.
- Fast, uses little memory.
- Reproducible, so experiments can be repeated and compared.
Tests: chi-square or Kolmogorov-Smirnov for uniformity; runs test and autocorrelation test for independence.
Drawback: the sequence eventually repeats, and a poor choice of gives short periods or patterns. Pseudorandom numbers are then converted by inverse transform or other methods into variates from other distributions.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2024 Spring · 5 marks
Write short notes on: Parasite-host model
Answer
The parasite-host model is a biological (continuous or discrete) system model describing how the populations of a host species and the parasite that lives on it affect each other. It is a predator-prey type interaction and a standard example of simulating a dynamic system with feedback.
Basic idea
- The parasite depends on the host for survival and reproduction, so parasite growth requires hosts.
- Parasites reduce host survival or reproduction.
- When hosts are abundant, parasites multiply; as parasites increase, hosts decline; then fewer hosts cause the parasite population to fall, allowing hosts to recover. This produces cyclic oscillations.
Mathematical form (Lotka-Volterra type)
Let be the host population and the parasite population:
where is the host growth rate, the rate at which parasites reduce hosts, the parasite growth gained from hosts, and the parasite death rate. The equilibrium is , .
A discrete version is the Nicholson-Bailey model, in which and .
Simulation: starting from initial values , the equations are solved step by step (e.g. Euler's method with a small time step) to observe how the populations change and to test the effect of changing parameters. The model is applied in epidemiology, pest control and ecology.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
Questions from PU BCA 2024 Spring E-Business (Pokhara University BCA, Spring 2024), PU BCA 2024 Spring Linux (Pokhara University BCA, Spring 2024) and PU BCA 2024 Spring Simulation and Modeling (Pokhara University BCA, Spring 2024). Answers are written for this site; check them against your class notes.