首页 >
> 详细

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.

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp

- 代写econ426留学生作业、代做monetary Economics作业、 2020-02-28
- Anlt 207作业代写、代写python实验作业、代做analysis课程 2020-02-28
- Csci 4152作业代做、代写computer Science作业、Pyt 2020-02-28
- 代写comp 4200/5430作业、代做data课程作业、代写python 2020-02-28
- 代做se 3314B留学生作业、代做java编程语言作业、代写python， 2020-02-28
- Iy2840留学生作业代做、代写threat Detection作业、代写r 2020-02-28
- Q-Learning作业代做、代写python课程作业、代做network作 2020-02-28
- 代写mixed Models作业、Python编程语言作业调试、Java，C 2020-02-28
- 代写comp 250作业、代做java编程设计作业、代写java语言作业、代 2020-02-28
- Algorithm留学生作业代做、代写python语言作业、代做data课程 2020-02-28
- Comp 2406作业代做、Java编程语言作业调试、代写java实验作业、 2020-02-26
- 代写data留学生作业、代做program课程作业、代写java，C/C++ 2020-02-26
- 代做ubgmw9-15-3作业、代写matlab实验作业、代做civil E 2020-02-25
- 代做comp 2406作业、代写java语言作业、代做programming 2020-02-25
- 代做openmp留学生作业、代写system课程作业、代做c/C++实验作业 2020-02-24
- Cs 5100作业代写、Prolog Program作业代做、代写pytho 2020-02-24
- 代做programming作业、代写c++语言作业、C++编程设计作业调试、 2020-02-24
- Program 1 Ics-33: Intermediate Program... 2020-02-23
- Masters Programmes In Communicationsso... 2020-02-23
- Mech 203 Week 4 2020-02-23