How to fix: pixel index out of range art of HW5, problem 2 port cImage port sys
ID: 3592069 • Letter: H
Question
How to fix: pixel index out of range art of HW5, problem 2 port cImage port sys f zoomCimage, upperLeftX, upperLeftY, lowerRightx, lowerRightY, scalingFactor) width lowerRightx-upperLeftX+1 height- lowerRightY-upperLeftY+1 newimg-cImage. EmptyImage(width"scalingFactor ,height'scalingFactor) for cols in range(upperLeftX, lowerRightX+1): for rows in range(upperLeftY, lowerRightY+1): p= image, getPixel(cols, rows) for i in range(scal ingFactor): for j in range(scalingFactorD: newImg.setPixel(scalingFactor*colsi, scalingFactor rows+j,p) return newImgExplanation / Answer
Consider N = 5 servers, where each server completes a job with probability µ = 0:5 in each time slot. Assume that the number of jobs that arrive in each time slot is a Binomial random variable with parameters N and . When each job arrives, let the job join the queue with the fewest number of waiting jobs, i.e., join the shortest queue. If multiple jobs arrive in a time slot, do this for one job at a time, update the queue lengths, and then do this again for the next job. Plot the mean delay as a function of . You should keep track of each job to obtain the delay of the job. Choose = [0.2; 0.3; 0.4; 0.45; 0.49; 0.495].
You should run the simulations for 10^6 time slots. Plot a histogram of the delays for = 0.45, i.e., the x-axis would be the possible delays, 1 time slot, 2 time slots, etc. The y-axis would be the fraction of jobs that experience a delay of 1 time slot, 2 time slots, 3 time slots, etc.
Note: Choose one programming language to do the simulation from C/C++, Matlab, Python, Java, and R. Report should include the plot, and simulation code and annotations.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.