HW 3: Building Simulation Models and Analyzing Customer Data HW 3: Building Simulation Models and Analyzing Customer Data Purpose of This Assignment In this assignment, we first build a simulation...

R programming assignment, I have attached the file


HW 3: Building Simulation Models and Analyzing Customer Data HW 3: Building Simulation Models and Analyzing Customer Data Purpose of This Assignment In this assignment, we first build a simulation model. Building models is a useful skill to have in its own right (especially for making operational or financial decisions). It also gives you another chance to write for-loops (or use sapply()) in an applied context, and the concepts in this problem will reinforce your understanding of probability. In the second problem, we explore data that Citi Bike, a bike-sharing company, has made public. Citi Bike made its data public so that it can effectively crowdsource its analytics efforts (and hire new talent). For us, this presents an opportunity to build our data wrangling and exploratory data analysis (EDA) skills. In Problems #3 – #5, you build up your probability foundations through applied problems. Simulation Model: Inventory Management (25 points total) Your friend is running Brew and Blendz and wants to know how many muffins to stock tomorrow. The per unit cost of a muffin is $0.20. The price for a muffin for customers (the per unit revenue) is $2.50. Based on historical data from the last few months, the daily demand was found to be roughly Normally distributed with a mean of µ = 120 and standard deviation σ = 25. Muffins have no salvage/resale value (unsold muffins are donated at the end of the day). How many muffins should be stocked tomorrow to maximize the expected profit? The first few questions will help you through the logic of the problem before trying to code anything. 1a. (1 point) If the demand tomorrow is 120 and only 100 muffins were stocked, then muffins are understocked. What would be the profit if only 100 muffins were stocked and it turns out that 100 hungry students and 20 hungry professors stopped by to buy muffins (with each person buying one muffin)? 1b. (1 point) If the demand is only 80 and 100 muffins were stocked, then muffins were overstocked. What would be the profit in this case? 1c. (1 point) What is the decision variable here (i.e., what lever is used to maximize expected profit)? 1d. (5 points) The expected profit changes for different stocking levels. What is the stocking level that maximizes the expected profit? (Hint: Writing a for-loop and using the which.max() function may help. But again, think through the logic of your approach before trying to code anything.) 1e. (3 points) At the optimal stocking level, what’s the chance that all the demand for tomorrow will be met? Note: This is what operations managers call the critical fractile. 1f. (3 points) Conditional on running out, how much excess demand is there on average if stocking optimally? 1g. (3 points) Conditional on overstocking, how much excess supply is there on average if stocking optimally? 1h. (4 points) In this setting, how does higher demand variability impact expected profits? Create a plot of your expected profit at the optimal stocking level as a function of the standard deviation. In particular, your plot’s x-axis should have σ between σ = 0 and σ = 30 in increments of 5. For each σ, figure out the optimal stocking level and the corresponding profit (essentially re-doing part (d) of the problem across different values of σ). Then plot (preferably using ggplot or plotly) the corresponding profit as a function of the demand’s standard deviation, σ. 1i. (4 points) Suppose that the folks running the bakery Brew and Blendz buys the muffins from are celebrating their ten-year anniversary tomorrow by giving Brew and Blendz 100 muffins for free. How many additional muffins on top of the free 100, if any, should Brew and Blendz purchase tomorrow (at the regular price)? Note: Brew and Blendz is not giving muffins away for free, only their supplier is. 1 Exploratory Data Analysis: Citi Bike (30 points total) In this problem, we will try to get a sense how much Citi Bike can make off of overage charges from its subscribers and non-subscriber customers in a single month. url <- "https://s3.amazonaws.com/tripdata/202101-citibike-tripdata.csv.zip"="" you="" can="" manually="" download="" the="" data="" to="" your="" hard="" drive,="" or="" you="" can="" do="" as="" we="" did="" in="" class.="" temp=""><- tempfile()="" download.file(url,="" temp)="" citibike=""><- read.csv(unz(temp,="" "202101-citibike-tripdata.csv"),="" stringsasfactors="FALSE)" unlink(temp)="" some="" rows="" may="" have="" missing="" information.="" remove="" all="" rows="" for="" which="" usertype="" is="" missing.="" citibike.trips=""><- citibike="" %="">% filter(usertype == "Subscriber" | usertype == "Customer") Citi Bike charges Customers a fixed fee for renting, and Subscribers pay a yearly membership to forgo that fee. However, both Customers and Subscribers are charged overage charges. In particular, Customers who go over 30 minutes pay $3 every 30 minutes over the 30-minute mark. They start incurring this charge once their trip takes longer than 30 minutes. Subscribers who go over 45 minutes pay $2.50 per 15-minute interval over the 45-minute mark. For example a Customer who spends 128 minutes would incur a charge of $3×4 = $12, while a Subscriber who spends 128 minutes would incur $2.50 × 6 = $15 overage charge. Information can be found here: https://www.citibikenyc.com/pricing/single-ride and https://www.citibikenyc.com/pricing/annual. Ignore lost/stolen bikes (bikes are considered lost or stolen if the trip duration is over 24 hours). We just want to get an idea of the average overage charge, and we don’t want to include fines for lost/stolen bikes. 2a. (3 points) To simplify things, first consider the case when charges are continuously accrued. A charge of $2.50 every 15 minutes means that you’re being charged 2.5015×60 dollars per second. Similarly, a charge of $3 every 30 minutes would amount to being charged 330×60 dollars per second. Suppose Citi Bike’s policy was to have overage charges accumulate continuously per second in this way. Conditional on paying an overage charge, what would be the average overage charge for a Citi Bike user? Round to the nearest ten cents. 2b. (3 points) What would be the standard deviation of the overage charge? Round to the nearest ten cents. 2c. (4 points) Under the continuous charge policy, what is the total overage charge revenue from Subscribers? What is the total overage charge revenue from Customers? Round to the nearest thousand dollars. 2d. (4 points) For the remainder of the problem, we will take into consideration that these charges are incurred in fixed increments (Citi Bike’s actual pricing policy) instead of continuously accruing. With this policy, conditional on paying something, what is the average overage charge? Round to the nearest ten cents. 2e. (4 points) What is the standard deviation of the overage charge? Round to the nearest ten cents. 2f. (4 points) Citi Bike asks you if they should modify their pricing policy. In particular, they’re wondering which policy is better purely in terms of obtaining greater total overage charges. Would you recommend continuous charge or would you recommend that Citi Bike sticks with its current pricing policy? 2g. (4 points) Citi Bike is wondering about the variability in their profits due to overage charges. Is it the case that the policy that has a higher expected overage charge also has a lower standard deviation? 2h. (4 points) Under Citi Bike’s policy, conditional on paying an overage charge, what is the expected overage charge for a Subscriber? And similarly, what is the expected charge for a Customer? Round to the nearest ten cents. 2 https://www.citibikenyc.com/pricing/single-ride https://www.citibikenyc.com/pricing/annual Probability and Simulation Models: A Model of Consumer Demand (10 points) 3. Farmer Jill has been selling fresh-pressed apple juice at the farmer’s market for some time now. She has noticed that the higher she sets the price, fewer people bought her apple juice. She wants to model how demand depends on price. Suppose that 50 people independently walk by her stand at the market on any given day. Further suppose that whether or not they purchase her apple juice depends on the price. If she sets the price at p = 0, then everyone who walks by would buy. If she sets price at p = 10, then no one would buy. Suppose that the chance of a person buying is given by purchase probability = 1 − p10 , where p is the price of the apple juice. Suppose for simplicity that a person buys at most one apple juice bottle if they buy at all. In the following question, suppose that 50 people independently walk by the Jill’s stand today and each person’s chance of buying one apple juice bottle is given above. 3a. (2 points) Given a fixed price p, what type of distribution does the total demand have? You can imagine that the distribution of the total demand depends on the price p. As p gets higher and higher, fewer people would be willing to pay and so the expected demand would decrease. 3b. (2 points) What would be the expected demand if the price was $2? 3c. (2 points) What would be the standard deviation of the demand if the price was $2? 3d. (2 points) What would be the expected demand if the price was $4? 3e. (2 points) What would be the standard deviation of the demand if the price was $4? 3 Probability and Simulation Models: Inventory Management, Part II (15 points) 4. Going back to the Inventory Management problem above, let’s re-do that problem with basic economics to see that the solution from the simulation model matches the theoretically optimal solution. While doing this problem, think about Problem 1i). Suppose you were trying to solve for the theoretically optimal solution of the Inventory Management problem. You don’t know what to stock because you cannot perfectly forecast the demand D (specifically, the daily demand D has a Normal distribution with a mean of µ = 120 and standard deviation σ = 25), but you want to figure out some stocking level (let’s denote it as S∗) to maximize expected profit. Thinking about it economically, if the cost of stocking one more muffin outweighed the expected benefit of having more stocked, then you would not want to stock more. On the other hand, if the expected benefit of stocking another muffin outweighed the cost of a muffin, then you would want to stock more. Therefore, at your optimal decision S∗, the expected marginal revenue of stocking an additional muffin (the benefit) should equal the expected marginal cost. 4a. (2.5 points) What is the expected marginal cost of stocking one more muffin? Hint: This is just a number (cost is not a random variable, so the expected marginal cost is just the cost of stocking one more muffin). 4b. (2.5 points) What is the expected marginal revenue of stocking one more muffin? To help you, fill in the blank below: E[Marginal Revenue] = ( ) × 2.50 Hint: This is a mathematical expression involving S∗. No more hints, otherwise this would be a giveaway. 4c
Oct 23, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here