[1] Poission's Arrival Parttern::
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define e 2.71
void fact(int a);
int main()
{
int lamda;
float x, poi;
clrscr();
printf("\n service rate 'lamda':");
scanf("%d", &lamda);
printf("\n Enter the capacity of lamda 'x':");
scanf("%f", &x);
poi=(pow(e,(-lamda)))*(pow(lamda,(x)));
printf("\n probability: %f",(1-(poi/fact(x))));
getch();
}
int fact(int a)
{
if(a==1)
{
return 1;
}
else
{
return (a*fact(a-1));
}
}
[2] Measures of QUEUE:
#include<stdio.h>
#include<conio.h>
void main()
{
float mu, lambda, rho, Ls, Lq, Wq, Ws;
clrscr();
printf("\n Enter the arrival rate:");
scanf("%f", &lambda);
printf("\n Enter the Service rate:");
scanf("%f", &mu);
Ls=lambda/(mu-lambda);
rho=lambda/mu;
Lq=(lambda*lambda)/mu*(mu-lambda);
Ws=1/(mu-lambda);
Wq=lambda/mu*(mu-lambda);
printf("\n The avg no. of customers in system is: %f",Ls);
printf("\n Server Utilization:%f", rho);
printf("\n The avg no. of customers in queue is: %f", Lq);
printf("\n Avg waiting time in system is: %f", Ws);
printf("\n the avg waiting time in the queue is: %f",Wq);
getch();
}
[3] Markov chain And Its applications::
#include<stdio.h>
#include<conio.h>
void main()
{
float mu, lambda, rho, Ls, Lq, Wq, Ws;
clrscr();
printf("\n Enter the arrival rate:");
scanf("%f", &lambda);
printf("\n Enter the Service rate:");
scanf("%f", &mu);
Ls=lambda/(mu-lambda);
rho=lambda/mu;
Lq=(lambda*lambda)/mu*(mu-lambda);
Ws=1/(mu-lambda);
Wq=lambda/mu*(mu-lambda);
printf("\n The avg no. of customers in system is: %f",Ls);
printf("\n Server Utilization:%f", rho);
printf("\n The avg no. of customers in queue is: %f", Lq);
printf("\n Avg waiting time in system is: %f", Ws);
printf("\n the avg waiting time in the queue is: %f",Wq);
getch();
}
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define e 2.71
void fact(int a);
int main()
{
int lamda;
float x, poi;
clrscr();
printf("\n service rate 'lamda':");
scanf("%d", &lamda);
printf("\n Enter the capacity of lamda 'x':");
scanf("%f", &x);
poi=(pow(e,(-lamda)))*(pow(lamda,(x)));
printf("\n probability: %f",(1-(poi/fact(x))));
getch();
}
int fact(int a)
{
if(a==1)
{
return 1;
}
else
{
return (a*fact(a-1));
}
}
[2] Measures of QUEUE:
#include<stdio.h>
#include<conio.h>
void main()
{
float mu, lambda, rho, Ls, Lq, Wq, Ws;
clrscr();
printf("\n Enter the arrival rate:");
scanf("%f", &lambda);
printf("\n Enter the Service rate:");
scanf("%f", &mu);
Ls=lambda/(mu-lambda);
rho=lambda/mu;
Lq=(lambda*lambda)/mu*(mu-lambda);
Ws=1/(mu-lambda);
Wq=lambda/mu*(mu-lambda);
printf("\n The avg no. of customers in system is: %f",Ls);
printf("\n Server Utilization:%f", rho);
printf("\n The avg no. of customers in queue is: %f", Lq);
printf("\n Avg waiting time in system is: %f", Ws);
printf("\n the avg waiting time in the queue is: %f",Wq);
getch();
}
[3] Markov chain And Its applications::
#include<stdio.h>
#include<conio.h>
void main()
{
float mu, lambda, rho, Ls, Lq, Wq, Ws;
clrscr();
printf("\n Enter the arrival rate:");
scanf("%f", &lambda);
printf("\n Enter the Service rate:");
scanf("%f", &mu);
Ls=lambda/(mu-lambda);
rho=lambda/mu;
Lq=(lambda*lambda)/mu*(mu-lambda);
Ws=1/(mu-lambda);
Wq=lambda/mu*(mu-lambda);
printf("\n The avg no. of customers in system is: %f",Ls);
printf("\n Server Utilization:%f", rho);
printf("\n The avg no. of customers in queue is: %f", Lq);
printf("\n Avg waiting time in system is: %f", Ws);
printf("\n the avg waiting time in the queue is: %f",Wq);
getch();
}