首页 >
> 详细

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

- 4Cosc001w作业代做、Python程序语言作业调试、Python课程作 2019-11-20
- 代写csc 230作业、代做ascii留学生作业、Python，Java程序 2019-11-20
- Cmpt 361作业代写、代做system留学生作业、Java，C++编程语 2019-11-20
- 代做cs5783留学生作业、代写machine Learning作业、代写c 2019-11-20
- B365留学生作业代做、代写iris Data作业、代做r程序语言作业、代写 2019-11-20
- Inft 3033作业代做、代写c/C++编程语言作业、代做c++课程设计作 2019-11-20
- Cs610-101作业代写、Programming课程作业代做、C/C++, 2019-11-20
- Econ 385作业代做、R程序设计作业代写、代做r课程设计作业、Ols留学 2019-11-20
- Engg1330作业代做、代写programming作业、代写java编程语 2019-11-20
- 代写csv File作业、Dataset留学生作业代做、代写java，C++ 2019-11-20
- Web Scraping作业代做、代写media Website作业、Web 2019-11-19
- 代写module留学生作业、代写java课程设计作业、Java程序语言作业调 2019-11-19
- Cs 344留学生作业代做、C++编程作业调试、C++课程设计作业代写、代做 2019-11-19
- 代做econ 493作业、Data留学生作业代写、代做r实验作业、R编程设计 2019-11-19
- 代写cmpt 361作业、代做system留学生作业、代做python，C+ 2019-11-19
- Isa 414作业代写、R程序语言作业调试、R课程设计作业代做、代写canv 2019-11-19
- Mat 4378作业代做、代写categorical Data作业、代做r编 2019-11-19
- Stat 429作业代做、代写mathematics课程作业、代做r编程语言 2019-11-18
- 代做431 Quiz 2作业、R编程设计作业调试、R语言作业代写、代做dat 2019-11-18
- 代写mt5761留学生作业、代做statistical Modelling作 2019-11-18