Showing posts with label money. Show all posts
Showing posts with label money. Show all posts

Monday, January 11, 2010

Cutting Your Losses

I was standing at the vending machine at work today, buying some chips with lots of small coins (nickels and dimes). And as I often do, I carefully inserted the nickels first, then the dimes; if I had used any quarters, they'd have come last.

You may—assuming you've read this far—wondered why this is. To be fair, having done this for a long time, I wondered myself for a moment. And then I remembered.

See, when I first started doing this, I was in college. I was living in the dorms. The dorms had vending machines, which were balky, much like anything in the dorms. They would, occasionally, find something objectionable about your change. They were even particular about the way you inserted your change; sometimes, it would take six or seven tries for you to get it to accept a specific dime. I would bring extra change just in case, if I had any, but sometimes even that would run out. So there I would be standing, with 45 cents that the machine was refusing to take, and more money back in the dorm room that I could try out on the Keeper of the Fizzies. But in order to get that money, I'd actually have to back to the dorm room. Away from the vending machine.

I'd run downstairs, get the change, run back upstairs, and hope that in the meantime, no dormitory Grinch had decided to get a 30-cent discount on his Coke.

Because, as it happens, sometimes they would. I'd get back and there would be no credit at all in the vending machine. You might suppose that Whoever It Was would at least leave the credit they had benefited from in change on the side, but noooooo.

That's when this business with inserting change in ascending order of value started. It was a way of cutting my losses. You might think that it would be simpler for me to just push the coin return and withdraw my change before heading downstairs, but in the first place, the coin return lever was balky, like everything else, and in the second place, it had often taken me lots of effort to get those coins in and I was reluctant to relinquish those hard-won gains.

Eventually, I managed to obtain a small dorm fridge and thereafter bought my drinks at the market. But this was before all that. Just the same, I continued my coin-sorting practice even to the present day, where (I daresay) my co-workers are far less likely to stiff me out of a handful of change than my dormmates were.

You know me, always looking for something mathy about the situation, so here's the question: Suppose that I only used n nickels and d dimes (no quarters), that I foolishly brought exact change, and that the vending machine refuses to take exactly one coin, randomly and uniformly selected from all the coins. On average, how much less money did I place at risk going nickels first than I did going dimes first?

The answer: The average reduction in risk was equal to the value of the nickels multiplied by the fraction of coins that were dimes.

I had thought to try to tie this story to something deeper, but I just can't bring myself to do it.

Thursday, August 20, 2009

Coke, Currency, and Contagion

Recently, there was a report, from the American Chemical Society, that about 90 percent of U.S. currency in circulation has detectable traces of cocaine on it. Apparently, the middle currencies—from Lincoln on up through Jackson—are the most susceptible. I guess Washington and Franklin don't rate. Also, not surprisingly, the percentage varies according to the community. Rural areas are less hit by cocaine-laden dollar bills, but in major metropolitan centers, essentially every piece of currency has coke on it. What's more, the percentage appears to be rising. In 1985, a study found that anywhere from a third to a half of bills had cocaine on them; in 1995, the proportion was three in four; and in 1997, it rose to four in five. Now it's nine in ten.

No need to panic, though. First of all, the traces are generally tiny, much smaller than a grain of sand, and not enough to get any kind of buzz from. And secondly, probably much, though apparently not all, of this increase has to do with the improved sensitivity of the cocaine sniffing tools.

The question is, how does cocaine get on all these bills? Certainly not all of the bills get cocaine on them because they were directly around the stuff, either during deals or during use. A small number do, of course, but the vast majority get them through contamination. But is that really plausible? Can so many bills be contaminated so quickly?

Well, let's take a look at that. Suppose that, initially, some small fraction of all the dollar bills have detectable cocaine on them; these are the initial set that get cocaine on them through direct contact with bulk quantities of the drug. Let's call this proportion p. The money isn't discarded, generally; it's put back into circulation (let's not get into how they get put back into circulation). Once that happens, those bills come into contact with other bills, which pick up some proportion of the drug. Apparently, there's an attraction between the drug particles and the green ink used to print U.S. currency.

When I use a bill, and it goes somewhere else, it now comes into contact with, let's say, one new bill. If a contaminated bill comes into contact with another contaminated bill, nothing happens to p, of course; both bills were already contaminated. Same thing holds true if an uncontaminated bill comes into contact with another uncontaminated bill.

But if the bill I had was contaminated and its new companion wasn't, or vice versa, then one new bill gets contaminated. The probability of this happening depends on the current value of p; specifically, it must be proportional to p (1 - p), since we need a contaminated bill and an uncontaminated one. We can put this in terms of a differential equation:

dp / dt = kp (1 - p)

The constant of proportionality k indicates how quickly bills come into contact with one another, and can be eliminated by setting the unit of time equal to the mean time it takes for a bill to be used (and therefore find a new neighbor). I don't have any hard figures, but from my own, non-cocaine-related currency use, it seems to be about a week or so. We can then set k = 1 and solve this equation fairly straightforwardly to yield the formula

p = C e t / (1 + C e t )

where C is closely related to the initial proportion of contaminated bills. (To be exact, C = q / (1 - q), where q is the initial proportion. Where q is very small, as in most cases, the two are almost exactly the same.) As t increases, C e t gets large pretty quickly, and p very quickly approaches 1. If, for instance, q = 0.000001—that is, one bill in a million is contaminated directly by the drug—then it takes a bit more than three months for the fraction of contaminated bills to exceed one-half. But because of the rapid growth of the exponential function, it takes only one more week for the proportion to exceed three-fourths. By the end of the fourth month, the fraction of uncontaminated bills is less than one percent. (Click to enlarge.)

That exceeds even the ACS's report. Why? Well, for one thing, even today's instruments are not perfectly sensitive; there still remain bills with undetectable traces of cocaine, surely. And after a while, there just isn't enough cocaine to go around (for the bills, that is). If, for the sake of argument, we assume that the initial fraction is one in a million, then the ACS's estimate of 90 percent contamination indicates that that first direct contamination can only be split about twenty times before it drops below undetectability.

But a second reason is that bills don't stay in circulation forever. According to the U.S. Treasury, currency stays in circulation, on average, for about 20 months—about 85 to 90 weeks. This makes the dynamical solution to the differential equation a bit more complicated. Let's simplify matters and only look at the equilibrium solution. At equilibrium, the contaminated dollar bills being taken out of circulation each week equal those being contaminated by new contact each week. That is,

p (1 - p) = rp

which yields an equilibrium solution of p = 1 - r, where r is the fraction of bills being taken out of circulation each week (about 1/85 to 1/90). So even with this new influx of bills, if detection tools were perfect, they'd detect traces of cocaine on about 99 percent of bills. Apparently, we still have a few rounds of "alarming" reports about cocaine contamination of currency to look forward to.

OK, here's a less overblown concern. The same model can essentially be used to analyze long-lived infections (such as oral herpes, which infects about 60 to 70 percent of all people worldwide). Such infections are removed from the population only when a person dies. As the above models show, if people were immortal, they'd eventually all be infected with such diseases (and in fairly short order, too). Of course, such diseases couldn't incapacitate their hosts too much, because otherwise they'd fail to be transmitted.