Snapple Fact 804: How Many Ways to Make Change for a Dollar?

220px-LineartPresRevI went camping this past weekend (my first time) and my neighbor (who’s actually my neighbor in real life and was my neighbor at the camp site) was drinking a Snapple and read the following fact back to me:

Snapple Real Fact #804: There are 293 ways to make change for a dollar.

My first reaction was “Mmm…interesting”, but I couldn’t help wondering whether the Snapple folks did their math correctly. So after I got home and unpacked the car, I wrote a little Constraint Programming code in Comet to check this fact. It turns out that the number is indeed 293 if the following two things are allowed: (i) returning a 1-dollar coin in exchange for a dollar bill, and (ii) using half-dollar coins which, in my opinion, are rare these days. Here’s a list of the 292 ways that do not include using a 1-dollar coin which, in my opinion, isn’t really “giving change”.

If you’re wondering how many ways there are when you’re not allowed to use 1-dollar or half-dollar coins, the answer is 242. Here’s a list of all such possible ways.

Update: A friend asked me what the number would be if we considered the quarters from each of the 50 states as a different coin. In that case the number of possible ways increases to 515,184 (including the 1-dollar coin).

Leave a Comment

Filed under Constraint Programming, Modeling

What Do Locker Rooms, Airplanes, and Urinals Have in Common?

If you go (or have ever gone) to a reasonably large gym, you might have encountered the typical locker room changing area. It looks like this:

locker

If you go to the gym regularly (or have been a regular gym goer at some point in your life), you might have noticed an issue that arises with some frequency: the locker you’re trying to access is very close to one in front of which someone else is standing (because their locker is right next to yours). I’ll refer to this phenomenon as interference. Interference is annoying because it creates that awkward situation in which you stand there trying to be polite and wait for the other person to finish, while at the same time getting upset because you’re wasting your precious time: “Man, I was hoping to be finished with my workout in 45 minutes. I gotta go back to the office and work on that integer programming model. Why does this guy take so long to tie his shoes?”

Interference occurs in other places, of course; hence the title of this post. When boarding planes, airlines try to be as efficient as possible, that is, they try to get everyone in their seats and ready to go in the shortest possible time. What is interference during the boarding of a plane? It’s when passengers that are standing in the aisle (e.g., because they’re still trying to put their carry-on in the overhead bin) block the passage of other passengers whose seats are further down the aisle. You might think that the obvious solution is to board everyone starting from the back of the plane towards the front, right? Well, maybe. Back-to-front boarding is intuitively good, but there are other issues at play: some passengers have priority, not everyone is there when boarding starts, etc. Another strategy that seems to work well is a hybrid of back-to-front with window-to-aisle. As you might have guessed, people have used optimization and simulation to try and come up with good boarding strategies. One of these studies was published in the journal Interfaces in 2005: “America West Airlines Develops Efficient Boarding Strategies”. This is an interesting read, and I recommend it.

Where else does interference occur? This XKCD blog post talks about the International Choice of Urinal Protocol:

…the basic premise is that the first guy picks an end urinal, and every subsequent guy chooses the urinal which puts him furthest from anyone else peeing.  At least one buffer urinal is required between any two guys or Awkwardness ensues.

Randall then proceeds to analyze this protocol and concludes that it suffers from a problem of underutilization of the available urinals, depending on how many of them there are. However, if guys are smart when picking urinals, they can achieve the optimal utilization (50%).

Now back to the locker room interference problem (which is the one that bothers me most lately). Let’s try to figure out the source of the problem and propose a solution to it. When you arrive at the University of Miami gym (known as the Wellness Center), you hand in your ID to an attendant who, in return, hands you a key that’s taken from a set of drawers that look like this (men’s lockers on the left, women’s on the right):

keydrawers

A key comes out of the drawer and your ID goes in. Interference is created because the attendants do not (and cannot) remember which keys they have handed out recently and what the layout of the locker room looks like. (By the way, locker numbers are not in perfect sequence in the Wellness Center; numbers jump around and you frequently see people who are lost looking for their lockers.) Ideally, what we’d like to happen is for keys to be handed out in such a way that they send the next person to a locker that is far away from the last few lockers that were given away. There are other complicating issues, of course, such as the fact that you cannot control the people who are returning from their workouts, but at least you can reduce interference among new arrivals.

We don’t need to write a mathematical model for this (or do we?). Why not pre-calculate an optimal sequence of locker hand-outs (based on the locker room layout), sort the drawers in that sequence (left to right, top to bottom), and have the attendants hand out keys in this order, cycling back to the top after they reach the last drawer? It won’t be perfect, but it sure will be better than the current system.

5 Comments

Filed under Applications, Heuristics, Modeling

2012 in Review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 56,000 views in 2012. If each view were a film, this blog would power 13 Film Festivals

Click here to see the complete report.

Leave a Comment

Filed under Uncategorized

Promote O.R. by Taking Folks by Surprise

Due to a number of things that have been keeping me busy, including a 20-day fight against a kidney stone that is now finally over, I haven’t had much time to post. I have two ideas that I plan to turn into posts soon, but in the meantime I’d like to suggest that everyone write a post about “santa claus” and “reindeer” (and properly tag it with those words). As the picture below indicates, I’ve been getting a lot of hits lately (way above average) and, digging deeper, I see that my post entitled “How Should Santa Pair Up His Reindeer?” has had 2,209 views this past week. Yay for Christmas!

Screen Shot 2012-12-04 at 10.27.15 AMAs a matter of fact, I suggest that everyone write a post about each special date of the year (Easter, Fourth of July, Valentine’s Day, Summer Camp, etc.). Those will keep bringing you recurring visits, without any extra effort, year after year. Of course not all (in fact, most) of those visits will be here for O.R. But that’s the point! If we want to spread the word about O.R. we’ve got to take people by surprise. “I was just looking for a cute reindeer picture and this guy blew my mind by showing me that math and reindeer have something to do with each other! How cool is that!”

BTW, I just realized I do not have an Easter post. I need to take care of this…

Leave a Comment

Filed under Holidays, Promoting OR

Tuesday’s Treasures, Wednesday’s Winner, and Final Farewells

Here’s my last post for this year’s INFORMS conference. Miami, here I come!

Leave a Comment

Filed under Conferences and Events, INFORMS

Monday Monday, So Good To Me

Here’s my second entry to the INFORMS Conference blog in Phoenix. Enjoy!

Leave a Comment

Filed under Conferences and Events, INFORMS

Some Cool Things I Learned on Sunday

I’m blogging for the INFORMS conference in Phoenix this year (as I did last year in Charlotte). Check out my (late-night) Sunday post.

Leave a Comment

Filed under Conferences and Events, INFORMS