Category Archives: Decision Trees

(Unexpected) Lessons Learned From a Prescriptive Analytics Course Refresh

I’ve been teaching the core prescriptive analytics course in our MBA program since 2005, and it was once again time for a major refresh/improvement. Therefore, this past December I went for it, and then proceeded to ask myself the following question over and over during the first half of the spring semester: “Why did you do this to yourself?” It was grueling. It was hard. It was overwhelming. However, when I look at the end result, I am really proud of it. It’s far from perfect, but I collected tons of feedback from my students (THANK YOU!) and I’m already polishing it for the next iteration (that one will be close to spotless). The goal of this post is to share a portion of the feedback I received, which turned out to contain some unexpected surprises.

To give you some context, I improved the existing homework problems, Excel files, and lecture notes (everything now is in PDFs created with LaTeX; no Powerpoint anymore!). I also created a lot of new content (including a hands-on Lego exercise and a case study I developed from scratch), especially when it comes to decision-making under uncertainty. All in all, I’d say 50% of the course is new material, and the remaining 50% is a much better version of the previous material.

Here are the lecture themes (unless otherwise noted, each lecture is a 2-hour session; there are 2 sessions per week). An asterisk * indicates a brand new lecture:

  • Lecture 1: Introduction to Optimization: hands-on Lego exercise, investment, scheduling.
  • Lecture 2: Mixing and Carryovers: blending, cash flow, production and inventory planning.
  • Lecture 3: Networks: assignment, transshipment, shortest path.
  • Lecture 4: Integer and Binary Variables: budget allocation, logical conditions, covering, fixed costs.
  • Lecture 5: Sensitivity Analysis: shadow prices and reduced costs.
  • MIDTERM EXAM
  • Lecture 6*: Optimization Under Uncertainty: two-stage stochastic linear programming.
  • Lecture 7*: Decision Analysis and Decision Trees (incl. EVPI, EVSI, risk profiles, Bayes’ Rule).
  • Lecture 8*: Sequential Decision Processes: stochastic dynamic programming.
  • Lecture 9* (two sessions): Monte Carlo Simulation.
  • Lecture 10*: Case Discussion.
  • FINAL EXAM

On my final exam, I had a question asking students to name their favorite and least favorite lecture. I wanted to see where the home run was and where the big fail was. I had a total of 76 students, and here is the final tally:

You’ll notice that the columns don’t add up to 76 as they should. Some people provided two favorites, and some people did not indicate a least favorite lecture. Here’s what I infer from the table above. (Let me know if you see something I didn’t!)

  • Networks as the clear “home run” lecture: I would never have guessed that in a million years! This was so surprising to me. Some of the comments mentioned the visual aspect of it as an attractiveness. I can see that, but still…
  • Stochastic DP as the clear “big fail” lecture: I can actually see that because I wasn’t very fond of the lecture myself after I taught it. It looks OK on paper, but the classroom feeling I got from it was lukewarm. I’m thinking of replacing it with a second case study to take place after the first four lectures.
  • Two-stage stochastic LP as pretty much another big fail: This one I attribute to a fail on my part. The material in there is pretty good. It’s just a matter of my doing a better job motivating and explaining it (the written feedback points to its being hard to follow). I’ll keep it for sure and refine the delivery. (Two people actually loved it! :-)
  • Simulation as a bit of a polarizing topic: I honestly thought the simulation class was going to be a big home run. The 11 votes in the right column are likely my fault again (based on feedback). I fully believe in the quality of the content, but I need to do a better job connecting it with the statistics course that precedes mine (I assumed too much of the students).
  • Beloved decision trees: I had a lot of fun putting together and delivering the decision tree lecture, but I didn’t expect it would get so many “fave” votes. Being a new lecture, there were some hiccups that I can easily fix (the same being true for lectures 6, 8, and 9), and seeing how successful it already was gives me even more motivation.
  • Case study: I had never written a full-length case study before, but got excited about doing so after an instructional session organized for the faculty at our school. Despite liking the case on paper (it combines marketing and optimization aspects), I was a bit anxious before the actual discussion took place. My students did an amazing job and performed way beyond my expectations. After seeing where they went and what issues they brought up, I feel like I can polish the case to make it even better.
  • Lego exercise: Another pleasant surprise. I was worried the Lego exercise might be seen as too simple or silly. I was wrong! The feedback indicated it worked well as a motivational tool, a visual aid, and a good ice breaker (it’s the very first thing I do in Lecture 1).

I’m pretty happy overall and really enjoyed what I learned from this fave/least fave question. It can be pretty informative. Do you have any other creative ways to elicit student feedback that you find particularly helpful? If so, please share them in the comments below.

1 Comment

Filed under Decision Trees, Motivation, Network Flows, Teaching, Tips and Tricks

Should You Hire Security When Tenting Your House?

Last week I had my house tented because of termites. For those of you who don’t know what “tenting” is (I didn’t until about a year ago), it amounts to wrapping an entire house inside a huge tent and filling the tent with a poisonous gas that kills everything inside (and by everything I really do mean everything). Those who have been through this experience know what a hassle it is. We received a to-do list of pre-tenting tasks, which included:

  • Remove or discard all food that isn’t canned or packaged in tightly-sealed, never-opened containers
  • Turn off all A/C units and open one window in each room of the house
  • Open all closet and cabinet doors
  • Turn off all internal and external lights (including those operating on a timer)
  • Prune/move all outdoor plants away from the house to have a clearance of at least 18 inches
  • Soak the soil around the house (up to a foot away from the structure) on the day of the tenting
  • Warn your neighbors about the tenting (so that they can keep their pets away from the house)
  • etc.

We had to sleep two nights in a hotel, with two dogs, one of which had just had knee surgery. What an adventure!

The main point of concern was that the house would stay vulnerable (open windows) and unattended during the process. On top of that, one of our neighbors told us that he knew of a house that had been robbed during tenting a couple of months ago. So we started to consider hiring a security guard to sit outside the house for 48 hours. Would that be a good idea? Let’s think about this.

Our insurance’s deductible is $2500. I assume that if thieves are willing to risk their lives (wearing gas masks; oh yeah! they do that!) to enter a tented house, they’d steal more than $2500 worth of stuff. Therefore, being robbed would cost us $2500. This doesn’t take into account that one might have irreplaceable items in the house. However, most of the time those can be taken with you (unless they are too big or inconvenient to carry). In my case, I took the external hard drive to which I back up my data, and the mechanical pencil I’ve owned and used since 1991 (yes, you guessed right, the eraser at the end doesn’t exist any more). The security company we called would charge $15 per hour for an unarmed guard to be outside our house. Multiplying that by 48 hours brings the cost of hiring security to $720.

Let’s say that the likelihood (a.k.a. probability) of being robbed while your house is tented without a security guard is p_1 (in percentage terms; for example, p_1 for the White House is pretty close to 0%), and when a security guard is on duty that likelihood is p_2. Unless p_1 > p_2, there’s no point in having this entire discussion, so I’ll assume that is true. Here’s a pretty neat rule of thumb that you can use: divide the cost of hiring security by your deductible to get a number n between zero and one (of course, if hiring a guard costs more than your deductible, don’t do it!). Unless the presence of the guard reduces your chance of being robbed (p_1) by more than n, you should not hire security! (Later on, I’ll explain where this rule comes from.) For example, in my case 720/2500 is approximately equal to 29%. If the chance of being robbed without security is 30%, unless hiring a guard brings that chance down to 1% or less, it’s better not to do it. If the value of p_1 is less than or equal to 29% to begin with (I live in a reasonably safe neighborhood), the answer is also not to hire security (probabilities cannot be negative). This rule works regardless of the value of p_1; what matters is how great the improvement to p_1 is.

In addition to looking at the numbers, we also took into account the following clause from the security company’s contract:

…the Agency makes no warranty or guarantee, including any implied warranty of merchantability or fitness, that the service supplied will avert or prevent occurrences or the losses there from which the service is designed to detect or avert.

In other words, if you hire us (the security company) and still get robbed, we have nothing to lose!

So what did we do? We chose not to hire security and, fortunately, our house was not robbed. However, even though the tenting instructions  say that you don’t have to wash your glasses and plates after returning home, we decided to do so anyway (as they say in Brazil: “seguro morreu de velho”).

Disclaimer: The advice contained herein does not guarantee that your house will not be robbed. Use it at your own risk!

Details of the Analysis

So where does that rule of thumb come from? We can look at this problem from the point of view of a decision tree, as pictured below.

In node 0, we make one of two decisions: hire a security guard (payoff = -$720, i.e. a cost), or not (payoff = -$0). For each of those decisions (branches), we create event nodes (1 and 2) to take into account the possibility of being robbed. At the top branch of the tree (node 2), the house will be robbed with probability p_2, in which case we incur an additional cost of $2500, and the house will be safe with probability (1-p_2), in which case we incur no additional expense. Therefore, the expected monetary value of hiring security, which we call EMV_2, is to spend $720+$2500 with probability p_2, and to spend $720 with probability (1-p_2). Hence

EMV_2 = - 3220p_2 - 720(1-p_2) = - 2500p_2 - 720

Through a similar analysis of the bottom branch (node 1), we conclude that the expected monetary value of not hiring security, which we call EMV_1, is to spend $2500 with probability p_1 and to spend $0 with probability (1-p_1). Therefore

EMV_1 = -2500p_1 - 0(1-p_1) = - 2500p_1

Hiring security will be the best choice when it has greater expected monetary value than not hiring security, that is when EMV_2 > EMV_1, which yields

-2500p_2 - 720 > -2500p_1

\Downarrow

2500(p_1 - p_2) > 720

\Downarrow

p_1 - p_2 > \frac{720}{2500}

which is the result we talked about earlier (recall that p_1 > p_2).

How Does Analytics Fit In?

The Analytics process is composed of three main phases: descriptive (what does the data tell you about what has happened?), predictive (what does the data tell you about what’s likely to happen?), and prescriptive (what should you do given what you learned from the data?). In this problem we can identify a descriptive phase in which we try to obtain probabilities p_1 and p_2. This could be accomplished by looking at police or insurance company records of robberies in your area. It’s not always possible to get a hold of those records, of course, so one might need to get a little creative in estimating those numbers. Having knowledge of the probabilities, the calculation described above could be classified as a prescriptive phase: what’s the course of action? Hire security if (cost of security)/(insurance deductible) < p_1 - p_2. There is no predictive phase here because our analysis does not require the knowledge of any future event (only how likely it is to occur). Operations Research can be used in some or all of these phases. Most of what I do in my research and consulting projects lies in the prescriptive phase (optimization). Recently, however, I’ve decided to broaden my horizons and learn more about the other two phases as well, starting with some self-teaching of data mining.

13 Comments

Filed under Analytics, Applications, Decision Trees, INFORMS Monthly Blog Challenge, Security