EMÜ322 Assignment 2 Solved

30.00 $

Category:

Description

Rate this product

General explanation: For the assignment, please submit a report that will include the codes of each question with explanations on how you do the simulation or a snapshot of your excel files that explains how you do the simulation and your results.

  1. Generate 20000 normal random variables with mean to be the sum of 5th digits of ID numbers of all your group members and standard deviation should be the sum of 7th digits of ID numbers of all your group members. Using these numbers, find the estimated probability that a normal random variable with the assumed  and assumed standard deviation  is less than or equal to x where x can take the following values: x=-4, -3.5, -3-2.5-2, -1.5, -0.5,

+0.5+, +1.5+2, +2.53, +3.5+4. Compare these estimated probabilities with the exact ones. Comment on the results.

Note: Don’t try to generate the normal random variables yourself. You can use the normal random variables generated by a library, software…

  1. Recall that three line segments can form a triangle if the triangular inequalities hold for these three line segments. Use simulation to estimate the probability that three line segments (continuous) uniformly distributed over the interval [0, 6] form a triangle. Please, perform the simulation for n=20, 50, 100, 500, 1000 times and then estimate the probability for each case.

 

  1. A coin having probability p=0.60 of coming up heads is successively flipped until 3 of the most recent 4 flips are heads. Let N denote the number of flips. Note that if the first 3 flips are heads, N=3. Simulate the situation for n=20, 50, 100, 500, 1000 times to compute the expected value of N.

 

  1. Estimate the following integral by using Monte Carlo simulation. Please, implement both ways (probability based and Riemann sum based) to estimate the following integral. Please use n=20,50,200,1000,5000,10000 points to estimate. Note that the argument is in radian. Comment on the results.

𝑑𝑢

𝑢=0

  1. Given independent random variables A, B, C, D and E; variable A is exponentially distributed with mean 200. Variable B is discrete uniformly distributed with probability distribution function p(b)=1/8 for b=0,100,200,300,400,500,600 and 800. Variable C is distributed in accordance with the following table.
Value of C Probability
500 0.20
600 0.30
700 0.15
800 0.35

Finally, D and E are both normally distributed with a mean of 100 and variance of 400. Simulation can be used to estimate the mean and the distribution of a new variable F, where F is defined as: F=(6AB+10C)/4DE. Let n be the number of replications.

  1. For n=1000,2000,3000,4000,5000, draw the graph of estimated mean of F versus n and draw the graph of estimated standard deviation of F versus n. Comment on the graphs.
  2. For n=5000, draw the histogram of Comment on the shape of the distribution of F.

Note: Don’t try to generate the exponential random variables yourself. You can use the exponential random variables generated by a library, software…

  1. A baker is trying to figure out how many bagels to bake each day. The probability distribution of the number of bagel customers is as follows:

 

Number of customers per day 10 12 14 16 18
Probability 0.20 0.10 0.30 0.25 0.15

 

Each customer, independent of the others, order 12, 24, 36 or 48 bagels according to the following probability distribution:

 

Number of bagels 12 24 36 48
Probability 0.30 0.40 0.25 0.05

 

Bagels sell for 1.4 TL per item. 6 bagels cost 5.4 TL to make. All bagels not sold at the end of the day are sold at half-price (0.7 TL per bagel) to a local grocery store. Based on 500 days of simulation, how many bagels should be baked each day? Try the following values:

216,228,240,252,264,276,288,300.

 

  1. A prisoner is trapped in a cell containing five doors. The first door leads to a tunnel which returns to his cell after three days of travel. The second leads to a tunnel which returns him to his cell after a single day of travel. The third door leads him immediately to freedom. The fourth door leads to a tunnel that will take him to freedom after two days of travel and the fifth door leads to a tunnel that will take him to the beginning of the tunnel of the second door after three days of travel. Assuming that the prisoner will always select doors 1, 2, 3, 4 and 5 with probabilities 0.25, 0.15, 0.1, 0.2 and 0.3 respectively, simulate the system for n=20, 50, 100, 500, 1000 times to compute the expected number and variance of days until the prisoner reaches freedom?

 

  1. A heart specialist schedules 16 patients each day, 1 every 30 minutes, starting at 9 A.M. Patients are expected to arrive for their appointments at the scheduled times. However, past experience shows that 10% of all patients arrive 15 minutes early, 25% arrive 5 minutes early, 50% arrive exactly on time, 10% arrive 10 minutes late, and 5% arrive 15 minutes late. The time the specialist spends with a patient varies, depending on the type of problem. Analysis of past data shows that the length of an appointment has the distribution in the following table. Simulate the system for 200 days to calculate the following performance measures:
    1. The probability that a patient will not wait in the queue.
    2. The probability that the last patient will not wait in the queue.
    3. The utilization of the specialist.
 Length of appointment  (minutes) 24 27 30 33 36 39
Probability 0.20 0.25 0.30 0.10 0.10 0.05

Note: You can assume that if a patient arrives early, the doctor will immediately start the examination if he is idle.

 

  1. A large car dealership employs a sales person where he works on commission, e.g. he is paid a percentage of profits from the cars that he sells. The dealership has three types of cars: luxury, midsize and compact. Data from past years show that the car sales per week and type of cars sold have the distributions given below. If the car sold is compact, the sales person is given a commission of 250 TL. For a midsize car, the commission is either 400 TL or 500 TL, depending on the model sold. On the midsize cars, a commission of 400 TL is paid out of 40% of the time and 500 TL is paid out the other 60% of the time. For a luxury car, commission is paid out according to three separate rates: 1000 TL with a probability of 35%, 1500 TL with a probability of 40%, and 2000 TL with a probability of 25%. For a van, commission is paid according to the following rates:

2000 TL with a probability of 40% and 3000 TL with a probability of 60%.

 

# of cars sold Probability
0 0.10
1 0.10
2 0.15
3 0.20
4 0.20
5 0.15
6 0.10
 

Type of car sold Probability
Compact 0.45
Midsize 0.30
Luxury 0.10
Van 0.15

Simulate the system for 300 weeks to estimate the expected commission that a salesperson is paid in a week and compute the probability that the sales person earns a commission more than 10000 TL per week.

  1. A simplified model for the spread of a rumor goes this way: There are N=30 people in a group of friends, of which some have heard of the rumor and the others have not. During any single period of time, two persons are selected at random from the group and assumed to interact. If one of these persons has heard the rumor and the other has not, then with a probability 0.20, the rumor is transmitted. Assuming that this process begins at time t=0 with a single person knowing the rumor and the first interaction occurs at time t=1, simulate the system for 200 times to find the following quantities:
    1. Average time that it takes for everyone to hear the rumor.
    2. Probability that at least 20 people know the humor at time t=100.
    3. Probability that at most 4 people know the humor at time t=10.
    4. What happens to the above quantities in part a, b and c if the transmission probability increases to 0.30? Are the results intuitively expected?
    5. What happens to the above quantities in part a, b and c if the transmission probability decreases to 0.001? Are the results intuitively expected?
    6. What happens to the above quantities in part a, b and c if the transmission probability increases to 0.999? Are the results intuitively expected?

 

  • HW2-20b4op.zip