Home Page > > Details

Stochastic Operations Research

Programming Assignment 1

Due date: Friday, October 25, 1pm

In this assignment I would like you to implement a certain computational task using a programming language

of your choice. For everyone in INSY 3010 I would strongly suggest that you use Python. The following

instructions are written with Python in mind. If you are not taking, or have never taken INSY 3010, you

are free to use any programming language you choose and feel free to talk to me about your situation and

options. I strongly suggest that you do not try to do this assignment on the day before it is due, unless you

are very comfortable with computer programming!

Note: all submissions will be processed through an automatic plagiarism detection tool. It will compare the

Python codes submitted and find pairs that are similar. All submissions that exceed critical similarity score

will be reported to Academic Honesty Committee.

Assignment overview. Our goal is to perform an analysis of a stochastic system using Monte-Carlo simulation,

i.e., by observing its behavior repeatedly and then determining expected outcomes. As the basis for

this assignment we will use a problem similar to III.11 from the practice set (discussed in class). Your task

is to estimate a few characteristics for the processing time. Let’s denote as X the random variable for the

total time (in minutes) required to complete all jobs (see problem description below). You are interested in

characteristics (average, variance, quantiles, etc) of X. To do that you can create a sample: N independent

realizations (x1, x2, . . . , xN ) and then calculate sample average and sample variance as

Directions:

• Consider the following system.

n jobs need to be completed in a day. Usually, p% of all jobs are easy, so that the time it takes

to complete them is well-described by normal distribution with average µ1 minutes and standard

deviation σ1 minutes. The rest are challenging jobs, so that completion time is well-modeled with

exponential distribution with average µ2 minutes.

• Pick values for parameters n, p, µ1, µ2, σ1 by following links below.

N is a special parameter that determines the accuracy of the result (you will learn more about it in the

Simulation class next semester). For this assignment, you will need to try different values.

• Your code should consist of two parts: create the sample and calculate sample average and variance.

• To create the sample, your code should repeat the following N times

– first determine how many easy and how many challenging jobs there are. Observe that the number

of easy jobs has binomial distribution with parameters n and p. Hence, to get your values,

draw one sample (call it m) from binomial random variable with your parameters. Then m is the

realized number of simple jobs and n − m is the number of challenging jobs.

– draw m samples from normal (with parameters µ1, σ1) distribution and n − m samples from

exponential (with average µ2)

– add all samples together to calculate the total processing time

– write down the total processing time value

• With the calculated sample of N realizations of the total processing time, apply formulas above to

calculate sample average and sample variance

• Your code can look something like this

r e p e a t N ti m e s

m : = b i n o mi al ( n , p )

e a s y J o b s : = m s am pl e s f rom n o rmal ( mu1 , si gma 1 )

c h a l l n g i n g J o b s : = n−m s am pl e s f rom e x p o n e n t i a l ( mu2 )

t o t a l T i m e : = sum ( e a s y J o b s ) + sum ( c h a l l e n g i n g J o b s )

x [ j ] : = t o t a l T i m e

j : = j +1

a p pl y sam ple a v e r a g e and v a r i a n c e f o r m u l a s t o t h e sam ple l i s t

• You will need to learn how to draw random samples from standard distributions. In Python, you

can use package numpy.random. Reference manual is here:

and carefully read the function description.

• To complete assignment, run your code with your parameter values and different values for N. Determine

the value for N that is sufficient for you to be confident in reporting sample average and sample

variance with two digit accuracy.

Submission instructions. Submit your code and a brief (not more than one page) report on Canvas. In

the report clearly identify the values of parameters that you used, the values for sample average and sample

standard deviation, and the value of N that you determined to be appropriate. Also describe the procedure

you used to select N. The report should be in .pdf, .doc or .docx format. If you are using Python submit

your .py file, otherwise, submit all of the files required to recreate your experiments.

Contact Us(Ghostwriter Service)

- QQ：99515681
- WeChat：codinghelp
- Email：99515681@qq.com
- Work Time：8:00-23:00

- Rtos Kernel Assignmenthelp With ,Ghost... 2019-11-14
- Algorithm Course Assignmentghostwriter... 2019-11-14
- Help With Fpu Assignment,Ghostwriter P... 2019-11-14
- Ghostwriter Msc/Icy Course Assignment,... 2019-11-14
- Cse105 Assignmenthelp With ,Java Progr... 2019-11-14
- Ghostwriter Fm 9528 Assignment,Help Wi... 2019-11-14
- Cmt115 Assignmenthelp With ,Programmin... 2019-11-14
- Eng5298 Assignmenthelp With ,Ghostwrit... 2019-11-14
- Stat 432 Assignmentghostwriter ,R Prog... 2019-11-14
- Jit104 Assignmenthelp With ,Ghostwrite... 2019-11-13
- Help With Stat 3675Q Assignment,Ghostw... 2019-11-13
- Csc 360 Assignmentghostwriter ,Help Wi... 2019-11-13
- Ghostwriter Cpt120 Assignment,Ghostwri... 2019-11-13
- Comp9444 Assignmenthelp With ,Python P... 2019-11-13
- Help With Cs1026 Assignment,Analysis C... 2019-11-13
- Lp002 Assignmenthelp With ,Ghostwriter... 2019-11-13
- Ghostwriter Comp 250 Assignment,Help W... 2019-11-13
- Cmt107 Assignmenthelp With ,Ghostwrite... 2019-11-12
- Econometrics Assignmenthelp With ,Ghos... 2019-11-12
- Help With Dataset Course Assignment,Gh... 2019-11-12

Contact Us - Email：99515681@qq.com WeChat：codinghelp

© 2014 www.asgnhelp.com

Programming Assignment Help！