Thursday, 31 March 2016
MOSI Contoh Kasus 2
Contoh Kasus 2
Jika waktu antar kedatangan pemesanan via telepon di
salah satu outlet Pizza Hut Delivery diketahui terdistribusi
eksponensial, dengan rata-rata 0,1 menit.
a. Simulasikan lima waktu antar kedatangan pesanan dari
konsumen dengan asumsi :
a = 7
m = 128
Z0 = 10112730
b. Tentukan total waktu kedatangan pesanannya !
Source code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int zi[101];
zi[0]=10112730;
int bb=800000,ba=1000000,a=7,m=128,i;
float ui[10],beta=-0.1,T;
printf(" *************************************************\n");
printf(" CONTOH KASUS 2 \n");
printf(" *************************************************\n");
printf("+-------------------------------------------------------------------------------+\n");
printf("| NO | Zi | Ui | T |\n");
printf("+-------------------------------------------------------------------------------+\n");
for(i=1;i<101;i++){
zi[i]=(a*zi[i-1])%m;
float m=139;
ui[i]=zi[i]/m;
T=beta*log(ui[i]);
printf("| %i | %i | %.7f | %.9f |\n",i,zi[i],ui[i],T);
}
return 0;
}
Sekian terimakasih
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment