Reading the Comics, May 17, 2016: Again, No Pictures Edition


Last week’s Reading The Comics was a bunch of Gocomics.com strips. And I don’t feel the need to post the images for those, since they’re reasonably stable links. Today’s is also a bunch of Gocomics.com strips. I know how every how-to-bring-in-readers post ever says you should include images. Maybe I will commission someone to do some icons. It couldn’t hurt.

Someone looking close at the title, with responsible eye protection, might notice it’s dated the 17th, a day this is not. There haven’t been many mathematically-themed comic strips since the 17th is all. And I’m thinking to try out, at least for a while, making the day on which a Reading the Comics post is issued regular. Maybe Monday. This might mean there are some long and some short posts, but being a bit more scheduled might help my writing.

Mark Anderson’s Andertoons for the 14th is the charting joke for this essay. Also the Mark Anderson joke for this essay. I was all ready to start explaining ways that the entropy of something can decrease. The easiest way is by expending energy, which we can see as just increasing entropy somewhere else in the universe. The one requiring the most patience is simply waiting: entropy almost always increases, or at least doesn’t decrease. But “almost always” isn’t the same as “always”. But I have to pass. I suspect Anderson drew the chart going down because of the sense of entropy being a winding-down of useful stuff. Or because of down having connotations of failure, and the increase of entropy suggesting the failing of the universe. And we can also read this as a further joke: things are falling apart so badly that even entropy isn’t working like it ought. Anderson might not have meant for a joke that sophisticated, but if he wants to say he did I won’t argue it.

Scott Adams’s Dilbert Classics for the 14th reprinted the comic of the 20th of March, 1993. I admit I do this sort of compulsive “change-simplifying” paying myself. It’s easy to do if you have committed to memory pairs of numbers separated by five: 0 and 5, 1 and 6, 2 and 7, and so on. So if I get a bill for (say) $4.18, I would look for whether I have three cents in change. If I have, have I got 23 cents? That would give me back a nickel. 43 cents would give me back a quarter in change. And a quarter is great because I can use that for pinball.

Sometimes the person at the cash register doesn’t want a ridiculous bunch of change. I don’t blame them. It’s easy to suppose that someone who’s given you $5.03 for a $4.18 charge misunderstood what the bill was. Some folks will take this as a chance to complain mightily about how kids don’t learn even the basics of mathematics anymore and the world is doomed because the young will follow their job training and let machines that are vastly better at arithmetic than they are do arithmetic. This is probably what Adams was thinking, since, well, look at the clerk’s thought balloon in the final panel.

But consider this: why would Dilbert have handed over $7.14? Or, specifically, how could he give $7.14 to the clerk but not have been able to give $2.14, which would make things easier on everybody? There’s no combination of bills — in United States or, so far as I’m aware, any major world currency — in which you can give seven dollars but not two dollars. He had to be handing over five dollars he was getting right back. The clerk would be right to suspect this. It looks like the start of a change scam, begun by giving a confusing amount of money.

Had Adams written it so that the charge was $6.89, and Dilbert “helpfully” gave $12.14, then Dilbert wouldn’t be needlessly confusing things.

Dave Whamond’s Reality Check for the 15th is that pirate-based find-x joke that feels like it should be going around Facebook, even though I don’t think it has been. I can’t say the combination of jokes quite makes logical sense, but I’m amused. It might be from the Reality Check squirrel in the corner.

Nate Fakes’s Break of Day for the 16th is the anthropomorphized shapes joke for this essay. It’s not the only shapes joke, though.

Doug Bratton’s Pop Culture Shock Therapy for the 16th is the Einstein joke for this essay.

Rick Detorie’s One Big Happy rerun for the 17th is another shapes joke. Ruthie has strong ideas about what distinguishes a pyramid from a triangle. In this context I can’t say she’s wrong to assert what a pyramid is.

Advertisements

Making Lots Of Change


John D Cook’s Algebra Fact of the Day points to a pair of algorithms about making change. Specifically these are about how many ways there are to provide a certain amount of change using United States coins. By that he, and the algorithms, mean 1, 5, 10, 25, and 50 cent pieces. I’m not sure if 50 cent coins really count, since they don’t circulate any more than dollar coins do. Anyway, if you want to include or rule out particular coins it’s clear enough how to adapt things.

What surprised me was a simple algorithm, taken from Ronald L Graham, Donald E Knuth, and Oren Patashnik’s Concrete Mathematics: A Foundation For Computer Science to count the number of ways to make a certain amount of change. You start with the power series that’s equivalent to this fraction:

\frac{1}{\left(1 - z\right)\cdot\left(1 - z^{5}\right)\cdot\left(1 - z^{10}\right)\cdot\left(1 - z^{25}\right)\cdot\left(1 - z^{50}\right)}

A power series is a polynomial. The power series for \frac{1}{1 - z} , for example, is 1 + z + z^2 + z^3 + z^4 + \cdots ... and carries on forever like that. But if you choose a number between minus one and positive one, and put that in for z in either \frac{1}{1 - z} or in that series 1 + z + z^2 + z^3 + z^4 + \cdots ... you’ll get the same number. (If z is not between minus one and positive one, it doesn’t. Don’t worry about it. For what we’re doing we will never need any z.)

The power series for that big fraction with all the kinds of change in it is more tedious to work out. You’d need the power series for \frac{1}{1 - z} and \frac{1}{1 - z^5} and \frac{1}{1 - z^{10}} and so on, and to multiply all those series together. And yes, that’s multiplying infinitely long polynomials together, which you might reasonably expect will take some time.

You don’t need to, though. All you really want is a single term in this series. To tell how many ways there are to make n cents of change, look at the coefficient, the number, in front of the zn term. That’s the number of ways. So while this may be a lot of work, it’s not going to be hard work, and it’s going to be finite. You only have to work out the products that give you a zn power. That will take planning and preparation to do correctly, but that’s all.

Reading the Comics, May 14, 2015: At The Cash Register Edition


This might not be the most exciting week of mathematically-themed comic strips. But it gives me the chance to be more autobiographical than usual. And it’s got more reruns than average, too.

Also, I’m trying out a new WordPress Theme. I’m a little suspicious of it myself, but will see what I think of it a week from now. Don’t worry, I remember the name of the old one in case I want to go back. Also, WordPress Master Command: stop hiding the option to live-preview themes instead of switching to them right away.

Epic Customer Fails: a customer insists a product, Regular $50.00, now 40% off, is ten bucks, not thirty.
Norm Feuti’s Retail For the 11th of May, 2015.

Norm Feuti’s Retail (May 11) led off a week of “Epic Customer Fails” with an arithmetic problem. My own work in retail was so long ago and for so short a time I don’t remember this happening. But I can believe in a customer being confused this way. I think there is a tendency to teach arithmetic problems as a matter of “pick out the numbers, pick out the operation, compute that”. This puts an emphasis placed on computing quickly. That seems to invite too-quick calculation of not-quite the right things. That percentages are a faintly exotic construct to many people doesn’t help either.

My own retail customers-with-percentages story is duller. A customer asked about a book, I believe an SAT preparation book, which had a 20 percent (or whatever) off sticker. He specifically wanted to know whether 20 percent was taken off the price before the sales tax (6 percent) was calculated, or whether the registers added the sales tax and then took 20 percent off that total. I tried to reassure him that it didn’t matter, the resulting price would be the same. He tried to reassure me that it did matter because the sales tax should be calculated on the price paid, not reduced afterward. I believed, then and now, that he was right legally, but for the practical point of how much he had to pay it made no difference.

He judged me warily, but I worked out what the price paid would be, and he let me ring the book up. And the price came out about a dollar too high. The bar code had a higher price for the book than the plain-english corner said. He snorted “Ha!” and may have told me so. I explained the problem, showing the bar code version of the price (it’s in the upper-right corner of the bar code on books) and the price I’d used to calculate. He repeated that this was why he had asked, while I removed the wrong price and entered the thing manually so I could put in the lower price. And took the 20 percent off, and added sales tax, which came out to what I had said the price was.

I don’t believe I ever saw him again, but I would like the world to know that I was right. And the SAT prep book-maker needed to not screw up their bar codes.

Continue reading “Reading the Comics, May 14, 2015: At The Cash Register Edition”

Keep The Change


I’m sorry to have fallen quiet for so long; the week has been a busy one and I haven’t been able to write as much as I want. I did want to point everyone to Geoffrey Brent’s elegant solution of my puzzle about loose change, and whether one could have different types of coin without changing the total number of value of those coins. It’s a wonderful proof and one I can’t see a way to improve on, including an argument for the smallest number of coins that allow this ambiguity. I want to give it some attention.

The proof that there is some ambiguous change amount is a neat sort known as an existence proof, which you likely made it through mathematics class without seeing. In an existence proof one doesn’t particularly care whether one finds a solution to the problem, but instead bothers trying to show whether a solution exists. In mathematics classes for people who aren’t becoming majors, the existence of a solution is nearly guaranteed, except when a problem is poorly proofread (I recall accidentally forcing an introduction-to-multivariable-calculus class to step into elliptic integrals, one of the most viciously difficult fields you can step into without requiring grad school backgrounds), or when the instructor wants to see whether people are just plugging numbers into formulas without understanding them. (I mean the formulas, although the numbers can be a bit iffy too.) (Spoiler alert: they have no idea what the formulas are for, but using them seems to make the instructor happy.)

Continue reading “Keep The Change”

Lose the Change


My Dearly Beloved, a professional philosopher, had explained to me once a fine point in the theory of just what it means to know something. I wouldn’t presume to try explaining that point (though I think I have it), but a core part of it is the thought experiment of remembering having put some change — we used a dime and a nickel — in your pocket, and finding later that you did have that same amount of money although not necessarily the same change — say, that you had three nickels instead.

That spun off a cute little side question that I’ll give to any needy recreational mathematician. It’s easy to imagine this problem where you remember having 15 cents in your pocket, and you do indeed have them, but you have a different number of coins from what you remember: three nickels instead of a dime and a nickel. Or you could remember having two coins, and indeed have two, but you have a different amount from what you remember: two dimes instead of a dime and a nickel.

Is it possible to remember correctly both the total number of coins you have, and the total value of those coins, while being mistaken about the number of each type? That is, could you remember rightly you have six coins and how much they add up to, but have the count of pennies, nickels, dimes, and quarters wrong? (In the United States there are also 50-cent and dollar coins minted, but they’re novelties and can be pretty much ignored. It’s all 1, 5, 10, and 25-cent pieces.) And can you prove it?

The Best Thing About Polynomials


[ Curious: one of the search engine terms which brought people here yesterday was “inner obnoxious”. I can think of when I’d used the words together, eg, in a phrase like “your inner obnoxious twelve-year-old”, the person who makes any kind of attempt at instruction difficult. But who’s searching for that? I find also that “the gil blog by norm feuti” and “heavenly nostrils” brought me visitors so, good for everyone, I think. ]

So polynomials have a number of really nice properties. They’re easy to work with, which is a big one. We might work with difficult mathematical objects, but, rather as with people, we’ll only work with the difficult if they offer something worthwhile in trade, such as solving problems we otherwise can’t hope to tackle. Polynomials are nice and friendly, uncomplaining, and as mathematical objects go, quite un-difficult. Polynomials can be used to approximate any function, which is another big one, as long as we don’t take that “any function” too literally. We still have to think about it some. But here’s an advantage so big it’s almost invisible: to evaluate a polynomial we take some number x and raise it to a variety of powers, which we get by multiplying x by itself over and over again. We take each of those powers and multiply them by a corresponding number, a coefficient. We then add up the products of those coefficients with those powers of x. In all that time we’ve done something great.

Continue reading “The Best Thing About Polynomials”