Tribhuwan University

Institute of Science and Technology

2076

Bachelor Level / Third Year / Fifth Semester / Science

B.Sc in Computer Science and Information Technology (CSC328)

(Simulation and Modeling)

Full Marks: 60

Pass Marks: 24

Time: 3 Hours

Candidates are required to give their answers in their own words as for as practicable.

The figures in the margin indicate full marks.

Section A

Long Answers Questions

Attempt any TWO questions.
[2*10=20]
1.
Define queuing system. Explain different queuing disciplines. Also explain different performance measures for evaluation of queuing system.[10]

Queuing System: Definition, Disciplines, and Performance Measures

A queuing system is a mathematical model used to study waiting lines where customers arrive, wait for service if it is not immediately available, and leave after being served.


Definition of Queuing System

A queuing system consists of customers arriving at a service facility, waiting in a queue (if necessary), getting served, and then departing. It is represented using Kendall's notation: A/B/c/K/N/DA/B/c/K/N/D, where A = arrival distribution, B = service distribution, c = number of servers, K = system capacity, N = population size, D = queue discipline.

Key components of a queuing system:

  • Arrival process – Pattern in which customers arrive (e.g., Poisson process)
  • Service mechanism – How customers are served (number of servers, service time distribution)
  • Queue discipline – Rule that determines the order of service
  • System capacity – Maximum number of customers allowed in the system
  • Customer population – Finite or infinite source of customers

Queuing Disciplines

Queue discipline defines the rule by which customers are selected from the queue for service.

  • FCFS (First Come, First Served) – The customer who arrives first is served first. This is the most common discipline (e.g., bank queues, ticket counters).

  • LCFS (Last Come, First Served) – The customer who arrives last is served first. This works like a stack (e.g., elevator system, stack of plates).

  • SIRO (Service In Random Order) – Customers are selected randomly from the queue regardless of their arrival time (e.g., lottery-based token systems).

  • Priority Scheduling – Customers are served based on assigned priority levels rather than arrival order.

    • Preemptive Priority – A higher priority customer can interrupt the service of a lower priority customer.
    • Non-Preemptive Priority – The current service is completed before serving the higher priority customer.
  • Round Robin – Each customer gets a fixed time slice of service in a cyclic manner (e.g., CPU scheduling in operating systems).


Performance Measures for Evaluation of Queuing System

These are the metrics used to evaluate how efficiently a queuing system operates:

Symbol Performance Measure Meaning
LsL_s Average number of customers in the system Total customers (in queue + being served)
LqL_q Average number of customers in the queue Customers waiting only
WsW_s Average time a customer spends in the system Total time (waiting + service)
WqW_q Average waiting time in the queue Time spent waiting only
ρ\rho Server utilization (traffic intensity) Fraction of time server is busy
P0P_0 Probability of system being empty No customer in the system

Key formulas (for M/M/1 queue):

  • Traffic intensity: ρ=λμ\rho = \frac{\lambda}{\mu}, where λ\lambda = arrival rate, μ\mu = service rate

  • Average number in system: Ls=λμλL_s = \frac{\lambda}{\mu - \lambda}

  • Average number in queue: Lq=λ2μ(μλ)L_q = \frac{\lambda^2}{\mu(\mu - \lambda)}

  • Average time in system: Ws=1μλW_s = \frac{1}{\mu - \lambda}

  • Average waiting time in queue: Wq=λμ(μλ)W_q = \frac{\lambda}{\mu(\mu - \lambda)}

  • Little's Formula: Ls=λWsL_s = \lambda \cdot W_s and Lq=λWqL_q = \lambda \cdot W_q

  • Server utilization: ρ=λμ\rho = \frac{\lambda}{\mu} (system is stable only when $\rho < 1$)


Conclusion

A queuing system provides a mathematical framework to analyze waiting lines. By understanding different queue disciplines and measuring performance parameters like LsL_s, WqW_q, and ρ\rho, we can optimize service systems to reduce waiting time and improve efficiency in real-world applications like hospitals, banks, and computer networks.

2.
Difference between chi-square test and KS test for uniformity. Use KS test to check for the uniformity for the input set of random numbers given below. 0.54, 0.73, 0.98, 0.11, 0.68, 0.45. Assume level of significance to be Da=0.05=>0.565D_{a=0.05} => 0.565[10]
3.
What do you understand by static mathematical model? Explain with example. Differentiate between stochastic and deterministic activities.[10]
Section B

Short Answers Questions

Attempt any Eight questions.
[8*5=40]
4.
Differentiate between validation and calibration. How can we perform validation of a model? [5]
5.
What do you mean by replication of runs. Why it is necessary? [5]
6.
Explain generation of non uniform random number generation using inverse method. [5]
7.
Parts are being made at the rate of one every 10 minutes. They are of two types, A and B. And are mixed randomly with about 10% being type B. A separate inspector is assigned to examine each part. Inspection of part A takes 6 ± 2 minutes. Both inspector rejects 10% of parts they inspect. Draw GPSS block diagram to simulate the above problem for 100 parts. [5]
8.
Write short notes on (any two): a. System and its environment b. Simulation run statistics [5]
9.
Discuss the merits and demerits of system simulation. [5]
10.
Explain Markov's chain with a suitable example. [5]
11.
Define arrival pattern. Explain non-stationary Poisson process. [5]
12.
Use Mixed congruential method to generate a sequence of random numbers with X0X_{0} = 27, n = 17, m = 100 and c = 43. [5]