Category Archives: INFORMS Monthly Blog Challenge

Today I’m going to write about a decision that’s made by many American families each year: how to pick summer camps for our kids. There are several issues to take into account, such as cost, benefit, hours, and kids’ preferences. I’ll introduce an optimization model for summer camp selection through a numerical example. The example portrays a large family, but the same ideas apply if a few smaller families want to get together and solve this problem. This way they can take advantage of the discounts and take turns driving the kids around.

The Joneses have six kids: Amy, Beth, Cathy, David, Earl and Fred (yes, their first names are alphabetically sorted, matching their increasing order of age; Mr. and Mrs. Jones always knew they’d have six kids and hence named their firstborn with an ‘F’ name). This year, they’ve narrowed down their list of potential summer camps to the following ten: Math, Chess, Nature, Crafts, Cooking, Gymnastics, Soccer, Tennis, Diving, and Fishing. The Nature camp takes kids on a hike through the woods with the guidance of a biologist; they make frequent stops upon encountering specific plants and animals, during which a mini science lecture is delivered (pretty cool!). The Cooking camp involves cooking chemistry instruction, à la Alton Brown (also pretty cool).

The following table contains some data related to each camp:

The Cost column indicates the cost per child. The Discount column indicates the percentage discount that each child enrolled after the first would receive on the cost of each camp. For instance, if three children are enrolled in Math camp, the first would cost $1100, and the second and third would cost $770 each (30% less). The Hours column is self-explanatory and the last two columns indicate whether or not that particular camp develops mental and physical abilities, respectively (a value of one = yes, zero=no).

The next table shows some of the child-specific requirements:

For example, the Joneses want Fred to attend at least 3 camps that develop mental abilities, and at least 1 camp that develops physical abilities. The last two columns in the above table indicate the minimum and maximum number of camp hours for each child over the 9-week summer break.

The next thing parents need to take into account are their children’s preferences. So here they are:

The smaller the number in the above table, the more desirable a particular camp is. For example, Amy is a bit of a math nerd, and if we were to flip David’s preference scores for Math and Tennis, he could be classified as a bit of a jock. Some conflicts exist, in the sense that not all camps are compatible with each other in terms of time schedules. In this particular case, let’s assume that no child can attend both the Soccer and Tennis camps, or both the Nature and Soccer camps. Here’s how we are going to use this preference table to create a sense of fairness among the children: whenever a child that prefers camp X to camp Y goes to camp Y and doesn’t go to camp X, nobody else gets to go to camp X either. For example, if Amy goes to Nature camp and isn’t sent to either Math or Chess camp, none of her siblings are allowed to go to Math or Chess either. Conversely, if the Joneses decide to send Earl to Chess camp and Fred to Tennis camp, they must also send Earl to Tennis camp (because Earl prefers Tennis to Chess, and “Fred is going! Why can’t I go too!”). Clearly, there are other ways to use/interpret this table, such as trying to send everyone to at least one of their top N choices, but we won’t consider those alternatives here.

After taking all of the above issues and conditions into account, here’s a solution that satisfies all the requirements while resulting in the minimum cost of $22,180.00 (You guessed it…the Joneses are probably *not* among the 99%):

Amy goes to Math, Crafts, Cooking, and Tennis; Beth goes to Math, Cooking, Tennis, and Fishing; Cathy goes to Math, Crafts, Tennis, and Fishing; David goes to Math, Cooking, and Fishing; Earl goes to Math, Tennis, and Fishing; and Fred goes to Math, Crafts, Cooking, and Tennis. Mmm…interestingly, everyone goes to Math camp. I think the Joneses are on to something…

Depending on your own requirements, preferences, and costs your solution may differ, of course. But this should give you an idea of how this simple problem can easily become very complicated to solve. No need to fear, though! Operations Research is here!

Food for Thought: Here’s an interesting question that helps illustrate how high-quality solutions can be counterintuitive: by looking at the preferences table, we see that everyone prefers Soccer to Tennis. In addition, Soccer camp is less expensive than Tennis camp. So how come we send almost everyone to Tennis camp? Isn’t that strange? Let me know what you think in the comments below! That’s one of the advantages of using an analytical approach to decision making: it helps us find solutions we wouldn’t even consider otherwise because they don’t seem to make sense (at least not at first).

If you’re curious about how I managed to find the optimal solution, read on!

Details of the Analysis:

To find the minimum-cost solution, we can create a mathematical representation of the problem, a.k.a. a model, and then solve this model with the help of a computer. Let’s see how.

The first obvious decision to make is who goes where. So let the binary variable equal when child goes to camp , and equal to otherwise. We’ll also need another binary variable that is equal to when at least one child goes to camp and equal to when none of the children go to camp . We are now ready to write our objective function and constraints. I’ll refer to the problem data using the column headings of the tables above. The subscript will always refer to a child, and the subscript will always refer to a camp.

To minimize the total cost, we write the following objective function:

Note how we are using the variable to handle the discount for sending more than one child to camp : we charge every child the discounted price in the double summation and add the discount back in only once if .

Now we have to deal with the four requirements: minimum and maximum hours, mental activity, and physical activity. For every child , we have to write the following four constraints:

Next, we enforce the preference rules. Let’s recall the example involving Earl and Fred: if Earl goes to Chess camp and someone else (it doesn’t matter who) goes to Tennis camp, then Earl has to go to Tennis camp as well. Here’s what this constraint would look like:

Of course, we have to repeat this constraint for every child and every pair of camps and such that child prefers to in the following way:

The camp compatibility constraints say that no child can attend both Soccer and Tennis, or both Nature and Soccer, therefore:

Finally, we need to relate the and variables by stating that unless , no can be equal to . So we write the following constraint for all values of and :

Although I tend to agree with Paul that an outsider probably does not have enough information to decide whether or not the actions he/she sees are reasonably good given the situation (especially when it comes to the incredibly complex world or airline operations), I like Matthew’s general idea of an experiment to identify whether or not the outcome of a black-box decision making process is “good”.

Can that be done? Can we observe a black-box situation (or process) long enough to be able to tell whether the analytic machine inside the box could do better?

A large number of people carry smart phones these days, with constant connectivity to the internet. Twitter, Facebook, and FourSquare (to name a few) can determine our location, and there are other Apps that tell us which of our friends (and even non-friends) are close by. With all of this connectivity and location awareness, we can think of human beings as sophisticated sensors that collect and share information. We see a fire, a car accident, a traffic jam, an arrest, a fight, and immediately share that information with our network. In addition, human sensors are much better than electronic sensors because they can detect and interpret many other things, such as: the mood in a room (after the airline changes your gate for the third time), the meaning of an image, and so on.

Consider a hypothetical situation in which a crowded venue has to be evacuated for whatever reason. Perhaps some exits will be blocked and people will be directed to go certain places, or act a certain way. Human observers may notice a problem with the way security is handling the situation from multiple locations inside the venue, and from multiple points of view. The collection of such impressions (be they tweets, Facebook status updates, or something else) may contain clues to what’s wrong with the black-box evacuation procedure devised for that venue. For example, “avoid using the south exit because people exiting through there bump into those coming down the stairs from the second floor and everyone has to slow down quite a bit.”

In a world where Analytics and OR specialists struggle to convince companies to try new ideas, could this kind of evidence/data be used to foster collaboration? “I noticed that you did X when Y happened. It turns out that if you had done Z, you’d have achieved a better outcome, and here’s why…”

Is the airline example really too complicated to be amenable to this kind of analysis? I’m not sure. But even if it is, there may be other situations in which a social network of human sensors can collect enough information to motivate someone to open that black box and tinker with its inner workings a little bit. Those of you working in the area of social networks might be aware of something along the lines of what I (with inspiration from Matthew) have proposed above. If that’s the case, I’d love to read more about it. Please let me know in the comments.

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 (in percentage terms; for example, for the White House is pretty close to 0%), and when a security guard is on duty that likelihood is . Unless , 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 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 () by more than, 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 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 ; what matters is how great the improvement to 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 , in which case we incur an additional cost of $2500, and the house will be safe with probability , in which case we incur no additional expense. Therefore, the expected monetary value of hiring security, which we call , is to spend $720+$2500 with probability , and to spend $720 with probability . Hence

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

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

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

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 and . 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) < . 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.

I’ve had a number of people tell me that they like my Valentine’s Day post, but many of them did not solve the Excel Spreadsheet. That’s the most important part of the post! You have to see what happens to Mr. Lovr! There’s no set-up necessary; just open Excel Solver (it’s an add-in you have to enable in Windows and a separate program in the Mac), and click on the “Solve” button. You’ll be glad you did.