<< Chapter < Page Chapter >> Page >

Matlab calculations for two-server queue (in file queue2.m)

Note that the procedure will not calculate P ( D > v ) if λ = μ .

L = input('Enter lambda '); % Type desired value, no extra space M = input('Enter mu '); % Type desired value, no extra spacea = [' lambda mu'];b = [L M];disp(a) disp(b)r = L/(2*M);EQ = (2*r^3)/(1 - r^2); EN = EQ + 2*r;EW = EQ/L; ED = EN/L;A = [' rho EN EQ EW ED']; % Identifies entries in B B = [r EN EQ EW ED]; disp(A)disp(B)v = input('Enter row matrix of values v ');t = 2*M*EW*(1 - r)/(1 - 2*r); PD2 = exp(-M*v).*(1 + t.*(1 - exp(-M*v + L*v))); % Calculates P(D>v) for L not equal MS = [' v P(D>v)'];s = [v; PD2]';disp(S) disp(s)
queue2Enter lambda 0.1 Enter mu 0.2lambda mu 0.1000 0.2000rho EN EQ EW ED0.2500 0.5333 0.0333 0.3333 5.3333Enter row matrix of values v [4 8 16] v P(D>v) 4.0000 0.47908.0000 0.2241 16.0000 0.0473

Comparison of single-server and two-server queues

A queueing system has Poisson arrivals, rate λ and exponential ( μ ) service times.

  1. In system one, there is one server, with expected service time 1 / μ = 1 minute. Determine
    [ E [ N ] , E [ Q ] , E [ W ] , E [ D ] , and P ( D > v ) , v = 1 , 3 , 5 , 10
    for expected arrival rates λ = 0 . 6 , 0 . 9 , 0 . 99 customers per minute.
  2. In system two there are two servers, each with expected service time 1 / μ = 2 minutes. Calculate the same quantities as for system one and compare the results for the two systems.
queue1 Enter lambda 0.6Enter mu 1 lambda mu0.6000 1.0000rho EN EQ EW ED 0.6000 1.5000 0.9000 1.5000 2.5000Enter row matrix of values v [1 3 5 10]v P(D>v) 1.0000 0.67033.0000 0.3012 5.0000 0.135310.0000 0.0183 Ov = ones(1,length(v));R = r*Ov; % Row vector with all terms = r r1 = R;E11 = B; v11 = PD;queue1Enter lambda 0.9 Enter mu 1lambda mu 0.9000 1.0000rho EN EQ EW ED0.9000 9.0000 8.1000 9.0000 10.0000Enter row matrix of values v v % Calls for previously entered vv P(D>v) 1.0000 0.90483.0000 0.7408 5.0000 0.606510.0000 0.3679 R = r*Ov;r2 = R; E12 = B;v12 = PD;queue1Enter lambda 0.99 Enter mu 1lambda mu 0.9900 1.0000rho EN EQ EW ED0.9900 99.0000 98.0100 99.0000 100.0000Enter row matrix of values v v v P(D>v) 1.0000 0.99003.0000 0.9704 5.0000 0.951210.0000 0.9048 R = r*Ov;r3 = R; E13 = B;v13 = PD;queue2 % Begin calculations for second system Enter lambda 0.6Enter mu 0.5 lambda mu0.6000 0.5000rho EN EQ EW ED 0.6000 1.8750 0.6750 1.1250 3.1250Enter row matrix of values v vv P(D>v) 1.0000 0.75013.0000 0.3988 5.0000 0.201910.0000 0.0328 E21 = B; % Not necessary to determne r1, r2, r3, sincev21 = PD2; % they are the same as for system one.queue2 Enter lambda 0.9Enter mu 0.5 lambda mu0.9000 0.5000rho EN EQ EW ED 0.9000 9.4737 7.6737 8.5263 10.5263Enter row matrix of values v vv P(D>v) 1.0000 0.92453.0000 0.7749 5.0000 0.641010.0000 0.3916E22 = B; v22 = PD2;queue2Enter lambda 0.99 Enter mu 0.5lambda mu 0.9900 0.5000rho EN EQ EW ED0.9900 99.4975 97.5175 98.5025 100.5025Enter row matrix of values v v v P(D>v) 1.0000 0.99203.0000 0.9743 5.0000 0.955710.0000 0.9094 E23 = B;v23 = PD2; C = [E11; E21; zeros(E11); E12; E22; zeros(E11); E13; E23]; % Zeros are spacersdisp(A) rho EN EQ EW EDdisp(C) 0.6000 1.5000 0.9000 1.5000 2.50000.6000 1.8750 0.6750 1.1250 3.1250 0 0 0 0 00.9000 9.0000 8.1000 9.0000 10.0000 0.9000 9.4737 7.6737 8.5263 10.52630 0 0 0 0 0.9900 99.0000 98.0100 99.0000 100.00000.9900 99.4975 97.5175 98.5025 100.5025H = [' rho v P(D1>v) P(D2>v)'];PDV = [r1 r2 r3; v v v; v11 v12 v13; v21 v22 v23]';disp(H)rho v P(D1>v) P(D2>v) disp(PDV)1.0000 1.0000 0.6703 0.7501 1.0000 3.0000 0.3012 0.39881.0000 5.0000 0.1353 0.2019 1.0000 10.0000 0.0183 0.03280.9000 1.0000 0.9048 0.9245 0.9000 3.0000 0.7408 0.77490.9000 5.0000 0.6065 0.6410 0.9000 10.0000 0.3679 0.39160.9900 1.0000 0.9900 0.9920 0.9900 3.0000 0.9704 0.97430.9900 5.0000 0.9512 0.9557 0.9900 10.0000 0.9048 0.9094

Questions & Answers

differentiate between demand and supply giving examples
Lambiv Reply
differentiated between demand and supply using examples
Lambiv
what is labour ?
Lambiv
how will I do?
Venny Reply
how is the graph works?I don't fully understand
Rezat Reply
information
Eliyee
devaluation
Eliyee
t
WARKISA
hi guys good evening to all
Lambiv
multiple choice question
Aster Reply
appreciation
Eliyee
explain perfect market
Lindiwe Reply
In economics, a perfect market refers to a theoretical construct where all participants have perfect information, goods are homogenous, there are no barriers to entry or exit, and prices are determined solely by supply and demand. It's an idealized model used for analysis,
Ezea
What is ceteris paribus?
Shukri Reply
other things being equal
AI-Robot
When MP₁ becomes negative, TP start to decline. Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of lab
Kelo
Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of labour (APL) and marginal product of labour (MPL)
Kelo
yes,thank you
Shukri
Can I ask you other question?
Shukri
what is monopoly mean?
Habtamu Reply
What is different between quantity demand and demand?
Shukri Reply
Quantity demanded refers to the specific amount of a good or service that consumers are willing and able to purchase at a give price and within a specific time period. Demand, on the other hand, is a broader concept that encompasses the entire relationship between price and quantity demanded
Ezea
ok
Shukri
how do you save a country economic situation when it's falling apart
Lilia Reply
what is the difference between economic growth and development
Fiker Reply
Economic growth as an increase in the production and consumption of goods and services within an economy.but Economic development as a broader concept that encompasses not only economic growth but also social & human well being.
Shukri
production function means
Jabir
What do you think is more important to focus on when considering inequality ?
Abdisa Reply
any question about economics?
Awais Reply
sir...I just want to ask one question... Define the term contract curve? if you are free please help me to find this answer 🙏
Asui
it is a curve that we get after connecting the pareto optimal combinations of two consumers after their mutually beneficial trade offs
Awais
thank you so much 👍 sir
Asui
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities, where neither p
Cornelius
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities,
Cornelius
Suppose a consumer consuming two commodities X and Y has The following utility function u=X0.4 Y0.6. If the price of the X and Y are 2 and 3 respectively and income Constraint is birr 50. A,Calculate quantities of x and y which maximize utility. B,Calculate value of Lagrange multiplier. C,Calculate quantities of X and Y consumed with a given price. D,alculate optimum level of output .
Feyisa Reply
Answer
Feyisa
c
Jabir
the market for lemon has 10 potential consumers, each having an individual demand curve p=101-10Qi, where p is price in dollar's per cup and Qi is the number of cups demanded per week by the i th consumer.Find the market demand curve using algebra. Draw an individual demand curve and the market dema
Gsbwnw Reply
suppose the production function is given by ( L, K)=L¼K¾.assuming capital is fixed find APL and MPL. consider the following short run production function:Q=6L²-0.4L³ a) find the value of L that maximizes output b)find the value of L that maximizes marginal product
Abdureman
types of unemployment
Yomi Reply
What is the difference between perfect competition and monopolistic competition?
Mohammed
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Topics in applied probability. OpenStax CNX. Sep 04, 2009 Download for free at http://cnx.org/content/col10964/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Topics in applied probability' conversation and receive update notifications?

Ask