0% found this document useful (0 votes)
10 views8 pages

Ie306 ps2

Uploaded by

emrebarutcuoff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

Ie306 ps2

Uploaded by

emrebarutcuoff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Boğaziçi University

IE 306 - Systems Simulation


PS4
Instructor: Gönenç Yücel
TA & Prepared by: Halis Oğuz

Date: 07.11.2024

1 Questions
Definition: For given positive integers X0 , a and m; equation (1) defines a
multiplicative congruential generator.

Xi+1 = (aXi ) Modulo m, i → N0 (1)


Theorem: For a multiplicative congruential generator, when m = 2n , the
max period is P = m/4 = 2n→2 and it is achieved when X0 is odd, and
a = ±3 + 8k, where n and k are positive integers.

1. Please test whether the Theorem above holds with a function of your
implementation. (We will choose m = 28 , X0 = 13, and k = 2 [a = 19])
Do they have the desired properties of a uniform random number stream?
(Definition and Theorem from lecture notes of Prof. Dr. Barlas)

2. Halis has been observing a grocery shop operate( again :) ). He has


spent his last week to estimate the distributions associated with the gro-
cery shop. Shop operates as a GI/G/2/↑/↑/FCFS system according to
Kendall ’s notation [David George Kendall (1918-2007)], that is inter-arrival
distribution is general, and two parallel servers with general service time dis-
tributions exist, queue capacity and calling population are infinitely large
and first come first served rule is applied. All waiting customers are lined up
in a single queue. Servers are not identical and first server is preferred by the
locals due to her competence on cash register. Also, please use the conven-
tion of generating an inter-arrival time before a service time when both must
be done at that instant. Please use the random number stream below as
necessary to prepare, generate the random variables( by Inverse Transform
Technique) and execute 4 lines (including initialization) of a hand simula-
tion table( Use them in order when you need a uniform r.v). At t = 0 both
servers are idle, and a customer arrives to the system.

1
Random Number Stream: = {0.775, 0.6988058, 0.26[ ], 0.41, 0.975, 0.6671289}
3.75
Please let X denote the random variable for inter-arrival times where f (x)
is the pdf of X. Accordingly, please let Y, Z (and g(y) pdf of Y , h(z) pmf
of Z) denote the random variables for service time 1 and service time 2,
respectively. The distributions are as follows:

1
 10x


 3 if 0 ↓ x ↓ 0.6 


 

 
f (x) = 5 ↔ 5x if 0.6 < x ↓ 1 (2)

 


 

 
0 else

g(y) = e→y , y↗0 (3)

 

 0.25 if z = 1.6 


 


 


 

 0.125 if z = 1.7 
h(z) = (4)

 


 0.5 if z = 1.8 


 


 

 
0.125 if z = 1.9
3. Additionally, for the distributions above, please utilize the streams below
to generate independent, identically distributed X, Y, Z random variables.
Do they produce similar results as in the first PS?

1
IA RN stream: = {0.775, 0.26, 0.975, 0.9, 0.6, 0.9, 0.84375, 0.94375, 1, 0.416( )}
2.4
S1 RN stream: = {0.6988058, 0.6671289, 0.6988058, 0.5934303, 0.6321206,
0.7768698, 0.5934303, 0.4511884}
S2 RN stream: = {0.41, 0.94, 0.20, 0.56, 0.29, 0.12, 0.67, 0.81}

4. From L09 of Gönenç Hoca, please let us go through the Example 8.2
and Example 8.3 (Pages 10-14 both included).

5. Given the distribution function


 x3 
 3 if 0 ↓ x ↓ 1 
F (x) = (5)
 2 3 5 
21 x + 21 if 1 < x ↓ 2

Please generate two realizations of the r.v. X utilizing IT technique with


rn.s 0.04167, 0.64.

2
① m = 20 Xo = 134 = 2 (a ]
=

↓* 17
or
=-
1

x =
(19 .

13) 2 = 247

Yz
=
(19 .

247/z =
85 . . . .

p-264-depudet ! if
13)
a = -k13

on
on many

and

multiplicative
X
,
o
is odd

13 (taking X
=
=

congruential
generator
&,
& F(x) =
/
X0

Dex

rfzJdt -

-
5x2
2
+ 5x -
15 .

,
0 67XXC
.

2 I x -
1

g(y) + G(y) =

ye +
dt =
1 - et , yz0

,3
0
n + H(z) =
S
24 16 .

0 25 1 61z < 17
,
. .
.

0 .
375 1 74z .
< 18
.

0 .

875 1 8211 9.
.

S 11231 . 9
F()wX
u
= Ou 10 6 .

# Tx -
15 =

-
x2 -
2x + 3=
(x -

1)2 z =
-

(x 1)2
z-
-

IX-11 =
-2 and since 0 .
61x11

>
-
1 -x =
E -

E = x =
1 -

E-

if 06 .
<X = 1
(( v)
F (u) 1 ey y
= -

For >
-

= v = -
=

y ,

() -
1 6 if OU <0 25
,
. .

Forz
1 7
.

if 0 25.
100.375

(
1 8 .
if 0 . 375 u < 0 875
.

1. 9 if 0 .
875 LuLf

I
j

3 n
T

-
&
-
C
-

II
O

T ·

5 & G

O
o
-

--
s
--

.
-

- 0

·
B
i T
·
·
8 ,

· h
&
&
&

Se
I -

You might also like