Skip to main content

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

  1. 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.
  2. Relevance: include only the information relevant to the questions being studied; irrelevant detail adds complexity without value.
  3. Accuracy: the accuracy of information included must be consistent with the purpose and with the quality of available data.
  4. Aggregation: group parts of the real system into aggregate units where the detail is unnecessary, to keep the model manageable.
  5. Fallibility: a model is only an approximation; it cannot be perfect and must be validated against the real system.
  6. Simplicity (parsimony): start simple and add detail gradually; prefer the simplest model that meets the objective.
  7. Iteration: modelling is an evolving process of build, test, validate and refine.
  8. Verification and validation: check that the model is implemented correctly and that it represents the real system.
  9. 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 YY depends on the present and past values of XX:

Yt=α+β0Xt+β1Xt−1+β2Xt−2+⋯+βkXt−k+utY_t = \alpha + \beta_0 X_t + \beta_1 X_{t-1} + \beta_2 X_{t-2} + \dots + \beta_k X_{t-k} + u_t

Examples: the effect of advertising or of income on consumption, or price on supply, takes several periods. The coefficients βi\beta_i show the effect after ii 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, I=∫02x2 dxI=\int_0^2 x^2\,dx (exact value 8/3=2.6678/3 = 2.667).

Method: for I=∫abf(x) dxI=\int_a^b f(x)\,dx, generate uniform random numbers RiR_i in (0,1), set xi=a+(b−a)Rix_i = a + (b-a)R_i and estimate

I≈(b−a) 1N∑i=1Nf(xi)I \approx (b-a)\,\frac{1}{N}\sum_{i=1}^{N} f(x_i)

Take N=5N=5 random numbers 0.15, 0.62, 0.37, 0.89, 0.51 with a=0a=0, b=2b=2:

RiR_ixi=2Rix_i=2R_if(xi)=xi2f(x_i)=x_i^2
0.150.300.0900
0.621.241.5376
0.370.740.5476
0.891.783.1684
0.511.021.0404

Sum = 6.384, mean = 1.2768, so

I≈2×1.2768=2.5536I \approx 2 \times 1.2768 = 2.5536

This is close to the exact 2.667, and the estimate improves as NN increases (the error falls as 1/N1/\sqrt{N}). The same steps are applied to the given integral by changing aa, bb and f(x)f(x).

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: P0=5P_0 = 5, a=12a = 12, b=2b = 2, c=5c = 5, d=0.9d = 0.9

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:

Yt=α+β0Xt+β1Xt−1+⋯+βkXt−k+utY_t = \alpha + \beta_0X_t + \beta_1X_{t-1} + \dots + \beta_kX_{t-k} + u_t

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:

Demand: Qtd=a−bPtSupply: Qts=c+dPt−1\text{Demand: } Q_t^d = a - bP_t \qquad \text{Supply: } Q_t^s = c + dP_{t-1}

In equilibrium Qtd=QtsQ^d_t=Q^s_t:

a−bPt=c+dPt−1  ⇒  Pt=a−cb−dbPt−1a - bP_t = c + dP_{t-1} \;\Rightarrow\; P_t = \frac{a-c}{b} - \frac{d}{b}P_{t-1}

With a=12a=12, b=2b=2, c=5c=5, d=0.9d=0.9:

Pt=3.5−0.45 Pt−1P_t = 3.5 - 0.45\,P_{t-1}

Equilibrium price: P∗=a−cb+d=72.9=2.414P^* = \dfrac{a-c}{b+d} = \dfrac{7}{2.9} = 2.414.

Starting from P0=5P_0 = 5:

ttPtP_t
05.000
13.5 - 0.45(5) = 1.250
23.5 - 0.45(1.25) = 2.938
33.5 - 0.45(2.938) = 2.178
42.520
52.366
62.435

Cobweb graph: plot price on the vertical axis and quantity on the horizontal. Draw the demand line P=6−0.5QP = 6 - 0.5Q and the supply line P=(Q−5)/0.9P=(Q-5)/0.9. From P0=5P_0=5 move horizontally to the supply curve (quantity supplied next period), then vertically to the demand curve to read the new price P1=1.25P_1=1.25, then back to supply, and so on. The path spirals inward towards the intersection at P∗≈2.41P^*\approx2.41.

Conclusion: since the slope ratio d/b=0.45<1d/b = 0.45 < 1 (the coefficient of Pt−1P_{t-1} 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

  1. Summer (adder): produces the sum of input voltages (with sign inversion), eo=−(e1+e2+… )e_o = -(e_1+e_2+\dots).
  2. Integrator: gives the time integral of its input, eo=−1RC∫ei dte_o = -\frac{1}{RC}\int e_i\,dt; the key element for differential equations.
  3. Coefficient potentiometer: multiplies a signal by a constant between 0 and 1.
  4. Inverter (sign changer): reverses the sign.
  5. Multiplier and function generators: form products and nonlinear functions.
  6. Operational amplifiers: high-gain amplifiers used to build the above.
  7. Comparators, switches and initial-condition circuits.
  8. 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 xx = amount in blood and yy = amount in liver, with rate constants k1k_1 (blood to liver) and k2k_2 (liver elimination), and an input u(t)u(t):

dxdt=u−k1x,dydt=k1x−k2y\frac{dx}{dt} = u - k_1 x, \qquad \frac{dy}{dt} = k_1x - k_2y

Analog setup:

  1. Input uu and the feedback −k1x-k_1x go into a summer; its output is dx/dtdx/dt.
  2. An integrator (initial value x0x_0) produces −x-x; a potentiometer set to k1k_1 forms k1xk_1x, which is fed back to the first summer through an inverter, and also forwarded to the second stage.
  3. Second stage: k1xk_1x and −k2y-k_2y feed a summer giving dy/dtdy/dt, followed by an integrator (initial value y0y_0) giving yy; a potentiometer set to k2k_2 returns k2yk_2y as feedback.
  4. The outputs x(t)x(t) and y(t)y(t) are recorded on a plotter.

Block flow: u→u \to [Summer] →\to [Integrator] →x→\to x \to [Pot k1k_1] →\to feedback to the summer and forward to [Summer] →\to [Integrator] →y→\to y \to [Pot k2k_2] →\to 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

  1. 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 + U is an equation for a derivative.
    • Function blocks: STEP(T0), RAMP(T0), IMPULS, DELAY, LIMIT, FCNSW.
  2. 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.
    • TABLE for function tables.
  3. Control statements: control the run and output.
    • TIMER FINTIM = 20.0, OUTDEL = 1.0, PRDEL = 0.5 set finish time, output interval and print interval.
    • PRINT Y, DY, PRTPLT, LABEL, METHOD RKS, END, STOP.

Example (decay dy/dt=−kydy/dt=-ky)

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

  1. Idle / on-hook: The subscriber is not using the line.
  2. 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).
  3. Dialling / connecting: The exchange tries to set up a path from the caller to the called party through the trunk lines (link).
  4. Availability test: The simulation checks two conditions:
    • Is a link/trunk free?
    • Is the called line free (not already engaged)?
  5. 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.
  6. 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.
  7. 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

  1. Initialise the clock to 0 and place the first events in the event list (future event list), ordered by time.
  2. Remove the imminent (earliest) event from the list.
  3. Set the clock to the time of that event.
  4. 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).
  5. Repeat until the stopping condition (end time or number of events) is met.

Example: if the event list holds arrivals at t=3t=3 and t=7t=7 and a departure at t=5t=5, the clock jumps 0→3→5→70 \to 3 \to 5 \to 7.

It contrasts with the fixed-increment method, which advances by Δt\Delta t 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 α=0.05⇒0.565\alpha = 0.05 \Rightarrow 0.565.

Answer

(a) Kolmogorov-Smirnov (KS) test for uniformity

The KS test checks whether a set of random numbers follows the uniform distribution on (0,1)(0,1) by comparing the empirical cumulative distribution SN(x)S_N(x) of the sample with the theoretical uniform CDF F(x)=xF(x)=x. The statistic is the largest absolute difference between them.

Hypotheses: H0H_0: the numbers are uniformly distributed; H1H_1: they are not.

Steps:

  1. Rank the NN numbers in ascending order R(1)≤R(2)≤⋯≤R(N)R_{(1)}\le R_{(2)}\le\dots\le R_{(N)}.
  2. Compute D+=max⁡i(iN−R(i)),D−=max⁡i(R(i)−i−1N)D^+=\max_i\left(\frac{i}{N}-R_{(i)}\right),\qquad D^-=\max_i\left(R_{(i)}-\frac{i-1}{N}\right)
  3. D=max⁡(D+,D−)D=\max(D^+,D^-).
  4. Compare with the critical value DαD_\alpha at the significance level. If D≤DαD \le D_\alpha, do not reject H0H_0; otherwise reject it.

(b) Application

Sorted data, N=6N=6: 0.11, 0.45, 0.54, 0.68, 0.73, 0.98.

iiR(i)R_{(i)}i/Ni/Ni/N−R(i)i/N-R_{(i)}R(i)−(i−1)/NR_{(i)}-(i-1)/N
10.110.16670.05670.1100
20.450.3333-0.11670.2833
30.540.5000-0.04000.2067
40.680.6667-0.01330.1800
50.730.83330.10330.0633
60.981.00000.02000.1467

D+=0.1033,D−=0.2833D^+ = 0.1033,\qquad D^- = 0.2833 D=max⁡(0.1033, 0.2833)=0.2833D=\max(0.1033,\,0.2833)=0.2833

Critical value (given) at α=0.05\alpha=0.05: Dα=0.565D_\alpha = 0.565.

Since D=0.2833<0.565D = 0.2833 < 0.565, 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

  1. Initialisation: The main program creates the entities, sets the initial state, and schedules the first events (for example the first arrival) with schedule ... now/in .. units.
  2. Selection: The timing routine looks at the event set and removes the event notice with the earliest time.
  3. Clock update: The simulation clock time.v is advanced to the time of this event notice.
  4. 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.
  5. Return: When the routine ends, control returns to the timing routine.
  6. Termination test: The cycle repeats from step 2 until the event set is empty, the stop time is reached, or a stop statement 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 7±27\pm2 minutes (uniform between 5 and 9).
  • Two clerks serve requisitions, taking 8±48\pm4 minutes (uniform 4 to 12); modelled as a storage of capacity 2.
  • One storekeeper, with a single facility, fills requisitions in 4±24\pm2 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,2 creates transactions with inter-arrival time uniform on 5 to 9 minutes.
  • The storage CLERKS of capacity 2 represents the two clerks, so up to two requisitions are processed together; others wait in the queue CLQ.
  • The ADVANCE 8,4 block holds the transaction for 4 to 12 minutes.
  • The single storekeeper is a facility (SEIZE/RELEASE); other transactions wait in SKQ.
  • M1 is the transit time of the transaction (time since it entered the model), so TABULATE TIMES builds 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 1 decreases the termination counter, and START 800 ends 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 θ\theta (for example the mean waiting time) from output observations X1,…,XnX_1,\dots,X_n.

  1. Point estimation: The sample mean is used as the estimate Xˉ=1n∑i=1nXi,S2=1n−1∑i=1n(Xi−Xˉ)2\bar X = \frac{1}{n}\sum_{i=1}^{n}X_i,\qquad S^2=\frac{1}{n-1}\sum_{i=1}^{n}(X_i-\bar X)^2
  2. Interval estimation: A confidence interval shows the reliability of the estimate: Xˉ±tα/2, n−1Sn\bar X \pm t_{\alpha/2,\,n-1}\frac{S}{\sqrt n} For example, a 95% interval means that in 95% of repeated experiments the interval would contain the true mean.
  3. Terminating simulations (a natural end, such as a bank open from 9 to 5) use the method of independent replications: run nn replications with different random number streams, take one value YjY_j (the mean of run jj) from each, and apply the formulas above to the YjY_j, which are independent.
  4. 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 kk batches, whose means are treated as nearly independent observations.
    • Regenerative method: split the run at regeneration points.
  5. Run length: Increase nn or the number of replications until the half-width of the interval is small enough, since it decreases roughly as 1/n1/\sqrt n.

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

  1. Take the original sample x1,x2,…,xnx_1, x_2, \dots, x_n of size nn.
  2. Draw a bootstrap sample of size nn with replacement from it, using random numbers to pick indices. Some observations appear more than once and some not at all.
  3. Compute the statistic of interest θ^∗\hat\theta^* (e.g. the mean) for this resample.
  4. Repeat steps 2-3 a large number BB of times (e.g. 1000) to obtain θ^1∗,…,θ^B∗\hat\theta^*_1, \dots, \hat\theta^*_B.
  5. Use these values to estimate the bias, standard error and confidence interval:

SE^=1B−1∑b=1B(θ^b∗−θˉ∗)2\widehat{SE}=\sqrt{\frac{1}{B-1}\sum_{b=1}^{B}\left(\hat\theta^*_b-\bar{\theta}^*\right)^2}

A 95%95\% percentile interval is taken from the 2.52.5th and 97.597.5th percentiles of the sorted θ^b∗\hat\theta^*_b 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)

Xi+1=(aXi+c) mod m,Ri=XimX_{i+1}=(aX_i+c)\bmod m,\qquad R_i=\frac{X_i}{m}

Here X0X_0 is the seed, aa the multiplier, cc the increment and mm the modulus. For example, with a=5a=5, c=3c=3, m=16m=16, X0=7X_0=7: X1=(35+3) mod 16=6X_1=(35+3)\bmod 16=6, X2=(30+3) mod 16=1X_2=(30+3)\bmod 16=1, X3=(5+3) mod 16=8X_3=(5+3)\bmod 16=8, giving R1=0.375R_1=0.375, R2=0.0625R_2=0.0625, R3=0.5R_3=0.5.

Desirable properties

  • Uniformly distributed on (0,1)(0,1).
  • 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 a,c,ma, c, m 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 HH be the host population and PP the parasite population:

dHdt=aH−bHP,dPdt=cHP−dP\frac{dH}{dt}=aH-bHP,\qquad \frac{dP}{dt}=cHP-dP

where aa is the host growth rate, bb the rate at which parasites reduce hosts, cc the parasite growth gained from hosts, and dd the parasite death rate. The equilibrium is H∗=d/cH^*=d/c, P∗=a/bP^*=a/b.

A discrete version is the Nicholson-Bailey model, in which Ht+1=λHte−aPtH_{t+1}=\lambda H_t e^{-aP_t} and Pt+1=cHt(1−e−aPt)P_{t+1}=cH_t\left(1-e^{-aP_t}\right).

Simulation: starting from initial values H0,P0H_0, P_0, 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.