MATH 3302, Intro to Operations Research II (Spring 2012)



Course Syllabus

Assignments

Please write your solutions to "pencil and paper" problems very neatly or (preferably) write them in Latex or Word.

Homework #1, due Tuesday, January 24

Chapter 2, #3,4,5,6,7,8,9,12,15,20,27,29,30

Homework #2, due Tuesday January 31

Roll 2 dice (red and blue). Let X be the value of the red die, and let Y be the sum of the two dice. Find Var(X), E(X|Y), Var(X|Y), E(Var(X|Y), and Var(E(X|Y). Confirm that Var(X) = E(Var(X|Y)) + Var(E(X|Y)).

Make sure you are ready to work with matlab next week.

Homework #3, due Tuesday February 7

(1) Estimate $\int_0^1 \int_0^1 exp(xy) dy dx$ by monte carlo. Can you evaluate the integral exactly?

(2) Let U1, U2, ... be iid U[0,1] r.v.'s, and let X_t = min{n: U1+U2+...+Un > t}. Use simulation to estimate g(t) = E(X_t), and plot g(t), 0
Homework #4, due Tuesday February 14

chapter 4 #4,7

chapter 5 #4,5,12,15

I noticed that a lot of students had trouble with the simulation for HW3 - plotting E(X_t), the expected number of U[0,1] r.v.'s needed to add up to t. Here is my solution. If you had trouble with this problem, study this program until you understand every step. In particular, make sure you understand the "inner" and "outer" loops, and where the variables tot and k are reset to zero. Misplacing any of these steps is likely to invalidate the program.

Here is my solution to one of the homework problems from chapter 5. It is an interesting and instructive problem, and we didn't really talk about it in class.

Homework #5, due Tuesday February 21

Let N(t) be a Poisson process with rate lambda = 1. Let T_n be the time of the nth event.

(a) Find Cov(N(10), N(15)-N(5)) by simulation. BONUS: Find the answer analytically.

(b) Explain why T_N(t) is the time of the last event before time t, and T_(N(t)+1) is the time of the first event after time t. Use simulation to find the mean and variance of T_(N(t)+1) - T_N(t), when t=10.

Homework #6, due Thursday, March 1

A bank has two tellers, and arriving customers join the shortest queue. If the two queues are the same length, the cusotmer flips a fair coin to decide which to join. Customers arrive as a Poisson process with rate Lambda and both tellers serve customers at rate Mu.

(a) Construct the transition diagram for this model. (Write the states (i,j) for i,j = 0,1,2,3,4,5 with all the "rate arrows" corresponding to all the possible state transitions.

(b) Write a simulation for the model with Lambda = 3 and Mu = 2. Determine the average number of customers in the bank.

Here is Matlab code that simulates two M/M/1 queues in tamdem. Sorry for the delay. We will talk about the program and extimate some quantities with it in class tomorrow (2/28).

Homework #7, due Tuesday, March 6

Use simulation to find T_n, the expected time it takes for an M/M/1 queue to empty out starting with n customers in the queue. Do n=1,2,...,10, and experiment with different values of lamda and mu. (Remember, you need lamda < mu.)

Can you derive an exact expression for T_n analytically? Hint: This is tricky, but easy once you see what to do. Use your simulation to guess the solution and then see if you can prove it. mework #7, due Tuesday, March 6

Here is the midterm exam . Have fun with it!

Here are some matlab programs that do discrete event simulations

G/G/1 tandem queues

Machine Repair

Also, on Thursday 3/15 we have a "field trip" instead of class to see the talk:

"Compressive Sensing in Industry": Rodney Price, Raytheon, Thursday March 15, 11:00 in CU 470

Bring your midterms to hand in!

Homework #8, due Tuesday, April 3

Simulate a queue with Poisson arrivals (rate lambda = 2) and exponential service times (rate 5). After service a customer flips a coin, and if it comes up Heads, he joins the queue again. Find the expected number of customers in the system and the average total time in the system for a customer (including all the times in the queue). Show how to use Little's theorem, so all you need to do is estimate the average number in the system. (Which is much easier than estimating waiting times!)

Here is the simulation of the priority queue we discussed in class. Recall: Customers enter with High priority, and after service they rejoin the queue as Low priority customers. I will post problems for next week shortly.

ok, here are two problems: Homework #9, due Tuesday, April 10

(1) Modify the simulation posted above for the priorty queue with feedback so that every time a customer completes service it flips a coin to see if it rejoins the queue. (Probability of rejoining is p.) The first time in the queue the customer has High priority, but all subsequent visits are at Low priority. What are the conditions on lambda, mu1, mu2, and p that assure a stable system? Use the simulation to find the expected number of customers (High and Low priority) in the system and then use Little's theorem to find the expected time in the system when lambda = 1, mu1 = 2, mu2 = 5, p = 1/2.

(2) A queue has two kinds of customers. Type 1 customers arrive as a Poisson process with rate lambda1, type 2 customers arrive at rate lambda2. Type 1 customers have service times exponential with rate mu1, and type 2 have service times exponential with rate mu2. The queue is first come first served. Using Little's theorem. write equations for L1, W1, L2, W2 like we've been doing in class, and solve the equations.

Homework #10, due Thursday, April 26 Simulate the waiting times of customers in an M/M/1 queue using the recursion w_n = max(0, w_{n-1} + s_{n-1} - a_n).

(a) Verify that your simulation works by showing that the average waiting time is E(W) = (lambda/mu)/(mu - lambda).

(b) A busy cycle starts and ends when a customer has a zero waiting time. Let X_i be the sum of the waiting times in the i-th busy cycle, and let Y_i be the number of customers in the i-th busy cycle. Modify the simulation in (a) to find X_1,X_2,... and Y_1,Y_2,...

Verify that your simulation in (b) works by showing that E(X)/E(Y) = E(W). (Why is this true?) Also, show that E(X/Y) is not the same as E(W).

Let Xbar_n = (X_1 +...+ X_n)/n and Ybar_n = (Y_1 +...+ Y_n)/n. plot sqrt(n) * ( Xbar_n/Ybar_n - E(W)) for 1 < n < 1000.

Here is the control variate simulation that some of you were asking about.

Homework #11, due Thursday, May 3

(1) Let B_t be standard brownian motion. Write a simulation that estimates P( a_1 < B_t < b_1 and a_2 < B_s < b_2), where a_1 < b_1, a_2 < b_2, and t < s. Now, write the probability as an integral. Hint: condition on B_t. (Don't try to evaluate the integral.)

(2) Write a simulation that estimates P(B_t = 0 for some t in (a,b)), where 0 < a < b. Now, write the probability as an integral. Hint: condition on B_a and use the formula for the distribution of the maximum of brownian motion. This one is tricky! If you really want to show off, evaluate the integral for an exact expression in terms of a and b.

Here's the FINAL EXAM, due next Thursday, May 10. Let me know if anything on it is unclear. Good luck!