Sie sind auf Seite 1von 6

# IENG362

Homework Assignment #4

IENG461

## Homework Assignment No. 4

Due Date:

Solve the following exercises from chapter 8 of your Textbook 3rd edition:

## 1) Solve Exercise 1 on page 316.

2) Solve Exercise 2 on page 316.
3) Solve Exercise 4 on page 316.
4) Solve Exercise 5 on page 317.
5) Solve Exercise 9 on page 317.
6) Solve Exercise 11 on page 317.
Exercise-1: Develop a random-variate generator for a random variable X with the pdf

f(x) ={

Solution:

## Step 1: make the integration for and , therefore;

F(x)= = , -<x<0

And

F(x)= + = { - { = - +

Therefore; F(x) = {

## = R, this implies x = -(1/2)(ln(2-2R)), for all R such that 1/2<R< 1

Exercise-2: Develop a generation scheme for the triangular distribution with pdf:

(x-2), 2x3

## f(x) = (2- x/3), 3<x6

0, otherwise.

Generate 10 values of the random variate, compute the sample mean, and compare it to the true mean
of the distribution.

Solution:

Step 1.
cdf = F (x)= 1 - x + x2 /4, 2 = x<3
x - x2 /12 - 2, 3 <x= 6

## Step 2. Set F (X)=R on 2 = X = 6

Step 3. Solve for X:

X= {
( )

## The true mean is(a + b + c)/3=(2+3+6)/3=11/3= 3.67.

I generated 10 random numbers by excel and Ill use them to generate values for the random Variate X:

## The sample average for the random Variate X is 3.819.

Exercise-4.

Develop a generator for a triangular distribution with range (1, 10) and a mean of 4.

Therefore: b=1

## Since the cdf of Triangular distribution is:

0, xa
( )
F(x) = ( )(
, a<xb
)

( )
1 ( )(
, b<xc
)

1, x>c

Step-1:

Therefore:

| 0, x1

( )
F(x)= | 1- , 1<x10
|1, 10<x

Step-2:

## Step-3: Solve for x=?

X= 10 81(1-R), 0 R1

Exercise-5.

Given the following cdf for a continuous variable with range -3 to 4, develop a generator for the
variable.

0, x -3.

+ x/6, -3<x 0.

1, 4<x.

Solution:

6(R-1/2), 0<R

X= ( ) <R1

Exercise-9.

## The cdf of a discrete random variable X is given by:

( )( )
F(x) = ( )( )
x = 1, 2, ......, n

Solution:

n=4

## Then by direct computation:

F(1)=6/180= 0.033, F(2)= 30/180= 0.167, F(3)= 84/180= 0.467, and F(4)=1.

## Ceate the table look-up:

X 1 2 3 5
F(x) 0.033 0.167 0.467 1

Therefore;

## Using R3=0.57 it implies X3=4.

Exercise-11.

Data have been collected on service times at a drive-in bank window at the Shady Lane National Bank.
This data are summarized into intervals as follows:

## Interval (Seconds) Frequency

15-30 10
30-45 20
45-60 25
60-90 35
90-120 30
120-180 20
180-300 10

Set up a table for generating service times by the table-lookup method and generate five values of
service time using four-digit random numbers.

Solution:

## Interval Probability Cumulative Slope (ai)

x(i-1)<xxi 1/n Probability (i/n) ai=(xi-x(i-1)/(1/n)
1 15<x30 1/7= 0.1429 0.1429 105
2 30<x45 0.1429 0.2857 105
3 45<x60 0.1429 0.4206 105
4 60<x90 0.1429 0.5714 210
5 90<x120 0.1429 0.7143 210
6 120<x180 0.1429 0.8571 420
7 180<x300 0.1429 1.00 840

X = x(i-1)+ ai(R- (i-1)/n), for any R such that (i-1)/n < R i/n, n = 7, and i= 1,2,..,7.