Tampilkan postingan dengan label Math. Tampilkan semua postingan
Tampilkan postingan dengan label Math. Tampilkan semua postingan

Selasa, 20 September 2011

Sweating the small stuff: Born to quant.


I'm about halfway through Moneyball and it's a quick and exciting read. The gift of hindsight shows some of the book's flaws impossible to detect when it was published, most notably how few of the players Billy Beane and Paul DePodesta drafted in 2003 made any splash at all some eight years later. But I am heartened to see Michael Lewis' style of writing catching on. Lewis himself gives props to Bill James, one of the first of the new breed of baseball analysts who call themselves sabermetricians. (SABR stands for the Society of American Baseball Research.) James' annual Baseball Abstracts were the great impetus for the changes in thinking about the game, and besides being a single minded collector of stats, James also knew how to bring the funny when the situation arose. (Example: writing about a heavy hitting and just plain old heavy slugger from last century: "Cecil Fielder acknowledges a weight of 261, leaving unanswered the question of what he might weigh if he put his other foot on the scale.")

And here comes to a question about education. Can you create a Matty Boy or are his kind born that way? The heroes of many of Lewis's books are a breed now known as quantatative analysts or quants. I jumped into programming when I was a lad, but I probably would have been better as a math analyst. Gathering sets of data and analyzing them comes to me completely naturally. Some people love doing that and others don't. Some can only do it on one subject (Bill James admits to no interest in numbers unrelated to baseball) but others do it about most of the things they can think of. Henri Poincaré, sometimes called The Last Universalist of mathematics and easily in any good list of the best ten mathematicians of all time, incessantly collected data sets on everything. Joseph Fourier collected number about his favorite topic, heat, and from it derived the differential equations that explain the phenomenon. Isaac Newton actually spent more time studying the Bible and alchemy than he did studying math or what we call modern physics, and it was clear he was using his stunning number sense in doing so, though he never published any of his findings in either field, instead leaving some of his thoughts in letters to friends we can read now. He probably left the religion alone because some of his ideas were heretical and heresy could still get you in big trouble - like dead - back in his day. I expect he didn't publish anything on alchemy because he didn't make any breakthroughs the way he did in math and physics, largely because it was a dry well and there were no breakthroughs to be had.

I gather numbers all the time. I'd call it "obsessively", but I have other habits that deserve to be called obsessive more than my love of numbers. Even the silly gossip blog is really an excuse to look at the supermarket rags numerically. I also spent a few seasons gathering data on football to see if I could make sense of it better than the current stat systems do. One of my ideas was to split the football team into separate squads and give credit where credit is due when points are scored, which also means blame where blame is due when points are allowed. My system was completely at odds with the modern favorite statistical game of fantasy football, since I was looking at teams rather than individuals, but I was recently heartened to see that Yahoo! has changed how defenses are measured in fantasy football and no longer blames them for points scored from turnovers like fumbles and interceptions run back by the other defense That is a small part of the system I called the Split Point System.

I did this simple quant work on football because I didn't see anyone else doing it. Reading some ideas from how quants work in baseball, (there are a LOT more people doing interesting work in baseball stats compared to football stats) I could see how to turn the Split Point System into a much better and more refined piece of work.

I'm not sure anyone actually creates a mathematician. It's like showing Edmund Hillary a mountain or giving Elvis Presley a guitar. There are things they don't know when they start, but the stage is pretty much set. I certainly still give a lot of credit to my favorite instructors like Ted Tracewell and Stu Smith, but no matter how many twists and turns my life takes, I always come back to math, and I likely always will.

Minggu, 18 September 2011

Sweating the small stuff: A mathematician reads Moneyball.

A friend has invited me to the opening night of Moneyball this upcoming Friday evening and lent me Michael Lewis' book to read. I'm not as keen on it as I was on his more recent book The Big Short, and this is because I know more about baseball history than I know about Wall Street today. Still, Lewis is an exciting writer and baseball is so interesting, even a book with flaws can be endlessly entertaining.

Let me be immodest for a moment. Lewis can appreciate math and I can actually understand it. If we compare math to its nearest (and superior) rival, he's a music critic who can write well and I'm a musician who can write legibly. It's Frank Rich vs. Salieri. It's more fun to read Rich (and Lewis), but Salieri (and I) have some inside information the other guys don't have.

No brag. Just fact.

With Moneyball, Lewis didn't start out with the intention of canonizing Billy Beane, the general manger of the dirt cheap but competitive Oakland Athletics, but that's how the book reads. In an afterword, Lewis explains that baseball insiders hate Beane for the book, not Lewis. Some of them think Beane wrote the book himself.

No one with a brain ever said baseball insiders had big brains.

And that's the point of Moneyball, much like it is the point of The Big Short and The Blind Side and most of Lewis' best-selling non-fiction. Insiders in the systems he studies don't really understand the system, and the outsiders who make honest scientific attempts to understand are widely despised.

There's the obvious and compelling core of every best-seller Michael Lewis has ever written.


Consider Billy Beane, the hero of this story. It is very common in Hollywood versions of "true stories" that the movie star is way prettier than the person being protrayed. I submit that Brad Pitt might be a little prettier than Billy Beane, but he's way too small. Young Billy Beane was a freaking Winklevoss twin, 6'4" tall, lean and supremely talented. Scouts salivate when they see a high schooler like Billy Beane.

Some may actually do more than salivate in private. I have no proof of this, but it is the strong subtext of the first few chapters of Moneyball.

Billy Beane knew the scouts of baseball didn't know shit. His best evidence was that they fought like bobcats over Billy Beane. When he became available for the baseball draft, it was either him or another Southern Californian, Darryl Strawberry, that HAD to be the first round pick that year. Strawberry became an honest to Pete baseball superstar until drugs brought him down.

Drugs weren't Beane's downfall. It was pride instead.

Beane could have played football or basketball, but he chose baseball. Beane hated to fail and hated even more to be shown up in public, and that is a nearly impossible character trait to overcome.

After they are drafted, Strawberry rises and Beane sinks, and the scouts and the best baseball minds are at a loss to know why. Beane gets violently upset when he fails, and he cannot turn this rage into positive action. Strawberry becomes a star in short order, but Beane bounces around, finally becoming roommates with Lenny Dykstra, a prospect with a tiny percentage of the promise Beane has.

The thing is, Dykstra has the small talent combined with the attitude of Babe Ruth. He ignored his failures like they didn't happen and reveled in his successes. Beane's attitude of hating failure is more like Ted Williams or Joe DiMaggio, but not quite at their godlike levels of talent.

Williams and DiMaggio truly hated to strike out, and they changed their way of batting to avoid it. Beane couldn't figure out how to avoid strikeouts and still to be feared at the plate. Had either Teddy Ballgame (good nickname) or Joltin' Joe (very inaccurate nickname) had the same "I don't give a shit" attitude about looking bad at the plate that Babe Ruth had, they might have made a serious run at the career home run record.

Neither did. Joe DiMaggio ended his illustrious career with 361 home runs, barely half of Ruth's 714. Williams, who missed prime seasons due to being a Marine pilot in both WW II and the Korean War, hit a home run in his last at bat, which brought his to a still remarkable 521 for his career.

Back to our main story.

Billy Beane, the failed Adonis, is still a baseball insider, but he listens to the baseball outsiders, the guys who think the statistics have been accurate but useless since the late 1850s.

Not a typo. 1850s. Before the American Civil War when players were not allowed to wear gloves.

I love that Lewis blames Henry Chadwick, a cricket fan from the 1850s, for inventing the "modern" baseball boxscore. There's actually a lot of math of that era that is still considered modern. The difference is that mathematical logic, group theory and quadratic reciprocity are still paying dividends, while the baseball box score is getting in the way of progress.

In Chadwick's original system, a base on balls is an error on the pitcher. Like other errors, it does not count positively towards the batter's numbers, but unlike errors, it now counts as zero instead of negative. It never occurred to him that it might be a skill of the batter to avoid bad pitches and only swing at good ones.

Some people cry in the wilderness that baseball is being mismeasured. It isn't until the 1970s that a guy named Bill James actually has the stick-to-it-iveness to shout this every year, at first to an audience of less than 100 people reading his self-published book.

In Lewis' mind, this is the beginning of baseball's salvation.

More on that tomorrow.






Rabu, 14 September 2011

Sweating the small stuff: Some thoughts on math education.


Computers and calculators are changing the education process significantly. Any student who types a paper has a spell checker and probably a grammar checker, but that's no promise they'll get everything right, especially when it comes to homonyms and such, like their, there and they're.

In math, some things that seem very simple to anyone who is even a little proficient can be struggles for students in pre-algebra and beginning algebra classes. A perfect example is writing a fraction problem like

3/5 = ________

and having many students give the answer 1.666666667, which is the correct calculator answer to 5/3. It seem "obvious" to me that small/big must be a number less than 1, but a lot of students try to turn it into a division problem and mix up the divisor and the dividend.

I'm going to be doing some other short posts on gaps in math education many students have. I don't do this to deride the students, it's just that somewhere along the line something relatively simple slipped through the cracks. I don't have the solution for how to fix this, but I do want to acknowledge these problems exist.



Minggu, 12 Juni 2011

The math of Penrose tiles, part 3: Two proofs of impossible similarity.

I'm about to prove a couple of negatives about Penrose tilings. Recall Donald Rumsfeld proudly and stupidly saying you couldn't prove a negative when it became obvious to everyone the weapons of mass destruction ruse was a complete phony. I had to wonder exactly how many classes he slept through when he got his degree at Princeton.

Of course you can prove a negative. The only place where real proof exists is in math and we prove that things are impossible all the time.

Let me give a couple examples.


It is impossible to build a larger shape similar to a dart using kites and darts.

The dart is the Penrose tile with the dent, and angle of 216°. It is also the only Penrose tile that has the sharp 36° angle. Those angles are adjacent to each other, which means if you need a 36° angle when you are building something, you have to use a dart and you have to plan for the fact the 216° will be right next to it at the distance of short.

If we want to build a bigger dart, it will have to have two 36° angles and a 216° angle, but the distance between these will have to be at least the length of long.

We can't do this with these pieces, or if we achieve this, we will not have a long enough straight line to make the outside of the dart.

This proof takes no math skills really. If you had some Penrose tiles to play with, you would see pretty quickly the problems involved trying to make a shape similar to the dart.



It is impossible to build a shape similar to a kite bigger than Papa Kite.

Yesterday, I showed this picture of a regular kite, a slightly larger kite made of a dart and two kites (a shape I call Mama Kite) and a third larger shape made out of five kites and three darts I call Papa Kite.

Notice this. Each of the straight lines that make up a side of all three of these kites has at most one side of the short length. Because of the angles available, one short is all you can have if you are building a straight line that is empty on one side and completely filled in on the other. The problem is that to make a straight 180° angle from a 72° angle, we need 108°, which in Penrose tiles can only be done by combining a 72° and a 36° angle. Just as we saw in the earlier problem, the 36° angle is a little clumsy when trying to continue a straight line because it is so closely tied to the dent, the 216° angle, known formally in geometry as a reflex angle.

Here is my best attempt at making Granddaddy Kite, the next size up of similarity. The Fibonacci sequence tells me how many pieces I need, 13 kites and 8 darts. I used 12 kites and 7 darts and the shape of the empty space that caused the problem has a 36° angle that we can't negotiate with the shapes available.

Notice that the unfillable space is exactly a Big Dart, the shape we can't make with the two standard Penrose tiles. If a third Penrose tile existed that was the shape of the Big Dart, with side lengths long and long+short, the number of things we could do with the new system would increase dramatically, though it wouldn't help with making a dart bigger than Big Dart. That would still be impossible.

Instead of Big Dart, another "third" Penrose tile that could help in this situation would be a triangle with sides short, short and long, which would have angles 36°, 36° and 108°. With this addition, Big Dart would be these two triangles put side by side along one of the short sides, and suddenly bigger darts and bigger kites would be much, much easier.

In math, we call this "prove or disprove or salvage". When you prove something can't be done, you try to find the simplest changes you could make to the problem where you could do what was asked. The most famous early example of this was Archimedes proving that trisecting any given angle was impossible with a compass and straightedge, but it could be done if you were allowed to put one mark on the straightedge.

This is one of the reasons mathematicians put Archimedes head and shoulders over other ancients like Euclid or Pythagoras. Nobody else was "thinking outside the box" like our Sicilian pal.

Not that I'm telling Sir Roger what to do with his tiles. He is a Big Damn Deal in physics and I'm a blogger.

Not that I'm comparing my salvage to Archimedes' method for trisecting angles. That is a work of stunning beauty.

I'm just sayin'.

And, oh yeah, Donald Rumsfeld is still a pinhead who planned two wars he didn't know how to finish and he can bite me.

I'm just a blogger, but I'm a shitload smarter than he ever was.

If you ever read this, Don, quod erat demonstrandum, you ugly, murderous little pencil pusher.

Sabtu, 11 Juni 2011

The math of Penrose tiles, part 2: The Golden Ratio phi and its relation to the Penrose tiles.


Yesterday, I discussed the two shapes of the Penrose tiles, the kite and the dart. The dart in this picture is the one in light blue. If alliteration helps you remember, the dart is the one with the dent. The angles on the kite are 72° three times and one obtuse angle of 144°. The dart has one angle of 72°, two sharp angles of 36° and a reflex angle of 216°, which is the one that causes the dent.

There is no hard and fast rule as to how big the two tiles should be, but because they follow the geometric rules of kites (four sides, only two lengths, sides of equal length are adjacent), the ratio between the long and short sides is set in stone. It is phi, also known as the Golden Ratio. The exact value is (1+sqrt(5))/2 and the approximate value is 1.61803398875... on your calculator. Using 1.618 as an approximation is not too bad.

Here are the capital and lowercase versions of phi. Blogger software is .html based and doesn't have a lot of symbols from the Greek alphabet, so I will type out phi every time I mention the number. It's pronounced "fee" not "fie" if we want to be close to the Greek, but some people want it to rhyme with pi. Technically, pi should be "pee" when we say it, but then it would be confused with the letter p in our alphabet.

Phi has many interesting properties, and most of the ways it shows up in the real world involve ratios, some big number divided by a smaller number is equal to the Golden Ratio. Another way phi can be generated mathematically is as the solution to this algebraic expression.

phi² = phi + 1

Phi is not the only number that satisfies the condition that the square of a number is the same as adding 1 to the number, but the other solution is negative, so it can't be the description of a length or an area or some other real physical property.

When we have an equation like the one above, we can use it to find the value of higher powers of phi as well.

phi³ = phi² times phi = (phi + 1) times phi = phi² + phi = 2*phi + 1

Using similar methods to change higher powers of phi into combinations of phi and 1 we get the following pattern.

phi to the fourth power = 3*phi + 2
phi to the fifth power = 5*phi + 3
phi to the sixth power = 8*phi + 5

Some people may recognize the numbers 1, 2, 3, 5, 8... as the start of the Fibonacci sequence.



Here's how phi and the Fibonaccis are tied to the Penrose tiles. Not only is the ratio of the long side to the short equal to the Golden Ratio, but likewise the area of the kite divided by the area of the dart is phi. What this means is that if I want to make a bigger kite that is similar to the original, it can be done, but only by multiplying the side lengths by phi and the area by phi².

For these next statements, remember that long/short = phi and (area of kite)/(area of dart) = phi.

baby kite
Side lengths: long, short (or phi and 1)
Area: 1 kite (phi)

mama kite
Side lengths: long + short, long (or phi² and phi)
Area: 2 kites and 1 dart (phi³)

papa kite
Side lengths: 2 * long + short, long + short (or phi³ and phi²)
Area: 5 kites and 3 darts (phi to the fifth power)

Here's the thing. We can't make the next size up of kite, and there is no way of making a bigger dart with Penrose tiles.

Understandable proofs (knock wood) of these statements tomorrow.

Jumat, 10 Juni 2011

The math of Penrose tiles, part 1: Definitions and angle measures.


Sir Roger Penrose, the world class physicist, is also a recreational mathematician. He came up with several combinations of tiles that could be used to fill the plane with non-repeating patterns before developing the kite and dart system, the two shapes of refrigerator magnets I am using in the posts with the label "Penrose tilings". The words kite and dart are actually standard geometric terminology. A kite is any four sided polygon (quadrilateral) that has two sides of one length and two sides of a different length, the same length sides meet at a corner. A dart is a kite that is concave, or we might say has a dent in it. The dent means an interior angle that is more than 180°. The math term is reflex angle.

The first special thing about the Penrose kite and dart is if we call the side lengths long and short, the long on the kite and dart are the same, as is the short. This means they have several ways of fitting together nicely.

Making such a kite and dart pair is easy if we start with any parallelogram where all the sides have the same length. The standard term for this is a rhombus, but it is also sometimes called a lozenge. (Some books use lozenge to mean only a rhombus whose angles are 45° and 135°.) A rhombus is to a parallelogram as a square is to a rectangle. In fact, rectangles are special parallelograms where all the angles are 90° and a square is a rhombus.

In any case, we can take any old rhombus and cut it in a variety of ways to make a kite and dart pair that will have the same length of short side and the same length of long side.


So there are infinitely many ways to make kite and dart pairings that can be combined into rhombi, and any old rhombus can be use as a tile that when repeated infinitely will fill the entire plane, a method called tesselation in math.

Here is the decision that made Penrose tiles more interesting than your run of the mill kite and dart that make some random rhombus. Sir Roger chose the angles carefully and the one angle both the kite and dart share is 72°. Since 72 times 5 is 360, five of these corners can be put together to fit perfectly, making a ten sided polygon, which is called a decagon. The convex decagon in yellow made of darts is called the same thing both by mathematicians and by actual people, a five pointed star.

Penrose could have chosen another angle that divides evenly into 360 so the kites and darts could be combined to make regular polygons or stars with some number of points, but 72° has some nice properties. The angles of the kite are 72°, 72°, 72° and 144°. The angles of the dart are 72°, 216° for the reflex angle and 36° at both the pointy ends. This means that in some situations, we can replace a 72° angle with two 36° angles put together, and similarly two 72° angles can be replaced in some situations with the 144°.

The math of the angles of the Penrose tiles is really more arithmetic, nothing harder than 36+36=72 and 72+72=144. Choosing these particular angles means the side lengths long and short have a relationship known as the Golden Ratio, or phi, and the math for that steps up from grade school level to high school level. Tomorrow, we will look at phi, the Fibonacci numbers and the several ways these interesting math concepts are linked to the Penrose tiles.

Minggu, 05 Juni 2011

Still playing with the new toys.

I'm still in that lovely honeymoon period with my new toys, the Penrose tiles I bought online at seriouspuzzles.com. With tiles, the "usual" idea is to fill up the plane with patterns, possibly repeating and possibly not repeating. If I put a kite and a dart together like above, I make a rhombus. It's easy to tile the plane with any rhombus in a repeating pattern, and even the non-repeating patterns using rhombi are usually simple variations on a theme.

One way to break away from the rhombus is to make this shape with a dart and two kites, which is really a bigger kite. I started making patterns with this as my main basic shape.



In this first tiling, I started with the nearly round shape in the middle (actually a decagon, a ten sided polygon), and started building out from it using the new big kite shape and the "bow tie", which is a two big kites that share a small kite.



Here I was trying to see what tiles would have to be used if I surrounded one decagon with five other decagons that have a bow tie buffer between them. As you might be able to see, I had to use some rhombi as buffers between the new decagons.

Messing around with even this size of puzzle makes me wonder if I need to buy one more container of tiles.

If anyone knows the name of a local Penrose Tile addiction support group, please send it to me discreetly.


I also did something much simpler on an unusual tack. Instead of trying to tile the plane, I started looking at simple shapes that could be made with relatively few tiles that would use negative space. Here five darts are put together to make a negative space regular pentagon with a pointy star created in purple.

Trying to think of star shapes that have a hole in the center, I thought this kind of looked like a ninja throwing star, known as a shuriken.

I call this the Thin Penrose Shuriken.


This is to distinguish it from a similar idea using the kites instead of the darts, which is the Thick Penrose Shuriken.


With kites, there is a second Thick Penrose Shuriken. To me, this looks more like a rotating gear, so I'm also calling it a Regular Penrose Cam.


This is to distinguish it from a mix and match use of kites, the Irregular Penrose Cam.

I Googled "penrose tiles negative space", but I didn't find anything looking like these last four patterns anywhere on the net. I may have stumbled on a new idea.

Kamis, 02 Juni 2011

New toys for Matty Boy! YAY!

Way back in January 2010, when I was still doing my (almost) weekly Wednesday Math posts, I wrote about Penrose tiles, the two shapes designed by physicist Roger Penrose that fill the plane in repeating patterns or non-repeating patterns, depending on how clever you want to get.

I bemoaned that there was no way to get a nice set of reasonably priced Penrose tiles to play with and mulled over the idea of having some made by a plastic fabrication shop.


Well, this is one of those times my natural laziness and broke assedness (which springs naturally from laziness, thank you very much) paid off big time. After putting this on the back burner for over a year, I searched last week and found a company that sold the thing I was looking for at a very reasonable price. SeriousPuzzles.com sells 108 Penrose tiles for $20, and better than that, they come with magnetized backs, so you can put them on your refrigerator or, for us teachers, tack them up on the white board in your class.



My friend Mark was nice enough to hold a pair of these in his hand to give you an idea of scale. They are nice soft bendy plastic, so I would say they are safe for any child who has already learned "Just because I can hold something in my hand, it does not follow that I have to put it in my mouth."


The two shapes are called the dart (top) and kite (bottom). The sets I got came in blue, yellow and purple. They appear to be easy to clean and in my experience, rubberized magnets maintain their stickiness nearly forever. (They are magnets, so tell the kids to keep them away from the computer.)


The angle between the two long sides is 72°, so if I put five pieces together, long side to long side, I can start a tiling of the plane. Five kites make a regular ten sided shape called a decagon. Five kites make a five pointed star, but not exactly the pentagram that we see on the stars of the American flag.



If you put a kite and a dart together on the short sides, they make a rhombus. Five of these rhombi correctly placed can make a regular pentagon with a pentagram in the negative space. The pentagram is the shape of the five pointed stars on the American flag.

Next: Matty Boy has way too much fun with Penrose tiles.


Growing a pattern with Penrose tiles.


We start with a yellow five pointed star.


I add a blue kite into each one of the gaps.


Now, a purple kite and a yellow dart in the new gaps, so that tiles sharing an edge do not share a color. (That was my basic marching order after the very beginning. It's a guideline not a rule.)


Blue kites for the yellow darts.


Yellow darts cap the purple kites.


Purple kites in the gaps.


"Got to have more of that sweet, sweet dart!"


That last caption was for my buddy Abu Scooter. If he didn't read this far, there wasn't much point to that gag.


So now it's growing more or less algorithmically, which is a fancy way of saying "These are the orders architects give to construction workers."


The purple and blue shapes together start to look like M.C. Esher fishies, don't they?


Notice how five straight lines lead out from the middle of the original five pointed star. At this point I thought that was a little too predictable, so I started changing things up.


Once I did that, all chances of tessellating the plane went out the window and I just had fun.

Actually, the whole process was fun for me. I hope my students enjoy it as well this next term.



Sabtu, 14 Mei 2011

Trying to get inside people's heads. With varying success.

For the third time in a year, a piece of spam has been sent to me, each time slightly altered. The idea is that some month will have five full weekends, five Fridays, five Saturdays and five Sundays. The e-mail or blog post I read tells me this is a wonderful and rare event, something that only happens once in 823 years, and you should send this message along to your friends because this is good fortune. The month shown on this calendar, July 2011, is such a month.

The thing is, it isn't rare at all. There are seven months every year - January, March, May, June, August, October and December - that have 31 days, so on average, there is one Friday a year that is the first of a month with 31 days, which means five full weekends that month. (It isn't every year. In non-leap years, some day of the week starts two 31 day months and one day is skipped. In leap years, two days are doubled up and two days are skipped. But if January 1, 2011 is a Saturday - and it was - January 1, 2012 will be a Sunday, so a different day gets skipped and a different day doubled up from one year to the next.)

Why do people believe this? Well, it helps if they do not naturally think mathematically about things, and most people don't. I'm a math teacher and I have plenty of evidence of this. Most people will be able to follow the idea that five Friday/Saturday/Sunday combinations in a single month is EXACTLY EQUIVALENT to saying a month with 31 days starts on a Friday, but only a minority of people will try to prove this themselves.

It would be easy for me to turn up my nose and think myself superior to the people fooled by this, but I know my own limitations too well. There are things I tried to learn that never became second nature to me the way math is second nature. (It might be more precise to say math is first nature to me.) I learned Spanish, French and Italian in school, but I can't make subtle statements in those languages the way I can in English. I can't casually eavesdrop on a conversation in Spanish, for example. If a catch a phrase - pure luck - I may be able to follow, but eavesdropping in English doesn't take effort, it just takes proximity and a loud enough speaker. I have to focus to NOT eavesdrop in English.

More than that, I understand the allure of thinking that you are witnessing something special. Once in 823 years, that would really be something. Only this time, it's not even remotely true. If you are waiting for the next Friday the first of a month with 31 days, you likely won't have to wait 823 days.


And then there are the people who believe in next Saturday but not next Sunday. KEAR, broadcasting out of my hometown of Oakland, is the flagship station of the innocuously named Family Radio Network, and they have given a platform to Dr. Harold Camping, a man with a degree in engineering and a bug up his butt about the end of the world. He predicted the end in 1994, when it didn't come recalculated for six months later. When that one missed, he proclaimed "The Lord has decided to tarry." Instead of being a good and humble Christian man who admitted both his own fallibility and the word of Christ in the gospels of Matthew and Luke that no one but God the Father knows the last day, he pulled out his slide rule again and recalculated for May 21, 2011 being the day of the Rapture and October 21, 2011 being the complete and final destruction of the planet.

Next Saturday, Dr. Camping's FAQ website says there will be an earthquake so strong it will open every grave on earth, and the remains of the saved will be gloriously reborn into perfect bodies. There is no direct mention what will happen to those alive whose names are written in the Book of Life on the website. Five months from now, the great tribulation for those who survived will be over and the world will be destroyed completely. Many Christians believe in the Nicene Creed, which says Jesus will return to Earth and his Kingdom shall have no end. Obviously, if Dr, Camping believes this, he thinks the Kingdom is someplace else.

Can I get inside Dr. Camping's head? Yes. I don't need Dr. Camping explained to me.

Obsessiveness. Stubbornness. Vanity.

I can look in the mirror and figure those out.

What I don't understand is who decides to believe him. For this, I turned to two very smart people whom I love dearly and who know a lot more about the subject than I do.

My close personal bud Padre Mickey and my sister Karlacita!

In seminary, Padre Mickey made a deep study of both eschatology, the end of the world, and on Adventism, the cults that have claimed to know the exact day. He was able to tell me why the number 144,000 shows up so often (12 tribes of Israel, 12,000 souls of each tribe written in the Book of Life) and the subtle differences in the various cults that sprung up. Last year, Padre wrote a terrific post comparing Dr. Camping to William Miller, an American Adventist who had calculated the End of the World for 1843, then re-calculated to 1844. When 1845 came, which started with a very harsh winter, his followers experienced a horrible, soul crushing personal defeat they called The Great Disappointment.

My sister Karlacita! has studied cults from the sociological end of things. It's easy for us unbelievers to think of these people as chuckleheads, but that wasn't what she found among Adventists. Like the people who want to think a five weekend month is an extreme rarity, many of these people also are drawn to the feeling that they will see a special thing with their own eyes. Some, of course, believe they are saved, so this end of the world is just the beginning of their life in glory. Others follow a stricter view called Calvinism, that the Book Of Life has already been written and all your prayers and good works are worth nothing. Either you are in or you are out and when the time comes, you'll know one way or the other only on that day.

My sister says that many of these people are very sensitive souls. They see the world around them as a very dark place. The idea that the end is near is as simple as the faith "Surely God must see this, too."

Karlacita! posits that a lot of the followers may be people with undiagnosed depression. It certainly makes sense, especially for the Calvinists.

She is a sensitive soul herself. Her most pressing concern is about Sunday, May 22. "When it comes, who will be in Oakland and around the country to help these people through their Great Disappointment?"

Here endeth the lesson.

Minggu, 01 Mei 2011

Sunday Numbers 2.0, Vol. 9: Reciprocal word problems.

Most word problems except the ones involving compound investment are solved with linear equations. They can look very different, like solving how much of two different alcohol solutions to combine x gallons of 25% alcohol solution and y gallons of 50% alcohol to make to make 10 gallons of 30% solution or how 19 dimes and quarters can add up to $2.50, but those kind of problems use linear methods. (The answers are 8 gallons 25% and 2 gallons 50%, and 15 dimes and 4 quarters. Figuring out how to set up the problems is left as an exercise to the reader.)

Let's consider something about the answers. With 19 coins that are either dimes or quarters, the lowest possible answer is $1.90 (all dimes) and the greatest total is $4.75 (all quarters). For the solution problem, the minimum percentage is 25% and the maximum percentage is 50%.

The answer must be between the two known extremes.

Consider the following question instead.

One drain pipe can empty a pool in 2 hours, while a smaller pipe can empty the same pool in 4 hours. How much time will it take if they work together, provided that they don't get in each others' way?

I always hate to use this phrase, bit it should be obvious the correct answers are not between 2 and 4 hours, but instead less than 2 hours.


This problem is solved using reciprocals. If a pipe can do the job in two hours, let's assume it finishes 1/2 the job every hour. (Depending on the physics, this assumption might not be accurate, but let's leave that alone for the moment.) Using this assumption, that means the smaller pipe which takes four hours finishes 1/4 of the job in an hour.

If we agree that they can work without getting in each others' way, in one hour they do 1/2 + 1/4 = 3/4 of the job. Once we add the reciprocals together, we reciprocate the sum to get the answer. The reciprocal of 3/4 is 4/3 or 1 1/3, so the two pipes working together finish the job in 1 hour and 20 minutes. This means opening the second pipe is only a 40 minute savings over doing the job with the first pipe alone.

This may very well be the trickiest word problem type around, though others involving rate, distance and time might also get the the award.

Some of those next week.

Minggu, 24 April 2011

Sunday Numbers 2.0, Vol. 8: The approximations of pi.

This is an update and correction of a post from late 2008. I forgive any reader who thinks this is the first time I wrote about this.

The number pi is the ratio of the circumference of a circle to its diameter. It has been considered a useful number since at least the time of the ancient Egyptians. We now know it's an irrational number, which means we can't write it exactly as a/b, and there is a proof that it is a transcendental number, which means it's not the square root of 10 or the fifth root of 306 or any root of a rational number.

These proofs take some damn tricky math. Best to take my word for this stuff.

We've known for a while that pi is pretty close to 3 1/7 or 22/7. It's a little high, but only a little. For example, if the diameter of the circle was a mile, 3 1/7 of a mile overshoots pi miles by about than six feet eight inches. If the diameter was a kilometer, the overage is about one meter and 26 centimeters.

The ancient Egyptians could have found this approximation by the method they called rope stretching. Let's say they made a circle whose diameter was a cubit, the length from the tip of the middle finger to the elbow. In the English system, we approximate this to 22 inches and in metric, we could use 56 centimeters.

They would have taken a rope of cubit length and cut another piece of rope the length of the circumference. They easily could mark the longer rope to see it was a little more than three times the length of the cubit rope. They would then take the excess rope and see how many times it would go into the cubit length. Seven copies of the shorter length fit with a little left over, about a fifth of an inch or half a centimeter. This is a small length, but clearly visible to the naked eye, even if your eyes are as bad as mine at short distances.

The Egyptians would have taken the smaller part and checked to see how many times it would fit into the first remnant. The correct answer is 15.99659..., which means to the naked eye it looks like it goes in sixteen times.

So now we have the numbers 3, 7 and 16, in that order. What good would this have done the ancient Egyptians?

The answer is called continued fractions. Instead of saying pi is close to 3 1/7, we will say it's closer to 3 1/(7 + 1/16).

We change the mixed number 7 1/16 into the improper fraction 113/16.

1/(113/16) = 16/113, so out new approximation is 3 16/113, usually written as 355/113.

Like 22/7, 355/113 is not exactly pi but it's awfully damn close. Now if we have a circle whose diameter is a mile or a kilometer, the amount of difference between the true circumference of pi times the diameter and 355/113 times the diameter is about the thickness of a piece of bond paper, less than 1/50 of an inch or half a millimeter.


Mathematicians, precision loving nerds that we are, have taken the continued fraction representation of pi way past this already pretty damn good approximation. This picture makes it look like the numbers on the list are as follows:

3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1.

This is just a partial list. If a continued fraction ends, the number it represents must be rational, and we know pi isn't.

Happy Easter to everybody, and I hope the only time you have to think about pi for the rest of the day is if it has an e at the end.

Minggu, 20 Maret 2011

Sunday Numbers 2.0, Vol. 5: Sorting animations.

As Donald Knuth said, "An algorithm must be seen to be believed." In some browsers, you can click on the pictures to watch an animation of some famous sorting algorithms.



Here is a video from The You Tubes of heapsort. This is a link to another animation of Heapsort, which puts in a heap sorted backwards, then takes the big values at the front of the line and moves in in exact order into the back of the line.




Here is a YouTube selection for Quicksort. Note that some of the lines are green, which means in the proper position, and some are in blue, which means not yet perfectly sorted. While the project appears to be try to set things up from left to right, you'll notice very early on a green line This is a link to another animation of Quicksort, which picks a single value, puts it in the proper position, with everything smaller than the value in front of it and everything bigger after it. This effectively splits the data set into two parts to be sorted yet again. This is called a divide and conquer algorithm.

My friend Ken sent me a link to a bunch of animating in place sort algorithms. These include Heapsort and Quicksort, as well as merge, bubble, shell and others.

Thanks to Ken. Fun stuff, if you like that sort of thing.

(Nerd puns. Tee hee!)

Minggu, 13 Maret 2011

Sunday Numbers 2.0, Vol. 4: Logic and the Britons


Mathematical logic got its first great boost forward in the 19th Century, though at the time there was little practical use to it. The great mathematicians on the continent were working trying to understand magnetism and its implications to physics, but a hearty band of British oddballs decided to revolutionize the study of logic.



George Boole is considered the originator of modern mathematical logic, so much so that the field is called Boolean Algebra. He wrote his important treatise The Laws of Thought in the 1850s.

Augustus de Morgan is another important pioneer. The ways to distribute a not sign ~ through parentheses are called de Morgan's laws. (v stands for the or operator and the ^ is the and operator.)

~(p v q) = ~p ^ ~q
~(p ^ q) = ~p v ~q

He was one of the first professors at University College London, the first major school in Great Britain that accepted students who were not Church of England, which meant that Catholics, Jews, protestants of denominations other that Church of England and those who professed no faith whatsoever could get a first class education in Great Britain due to deMorgan and a few others dedicated to education and religious freedom.


Charles Babbage was another British logician, and he wanted to take mathematical logic to the next step. He designed the world's first mechanical computers, the Difference Engine and the Analytical Engine, both of which were designed to run on steam. Problems arose when trying to build the machines and neither was ever completed.

The literary genre known as steampunk, a derivative of cyberpunk, is based on the "what if" world of Babbage actually succeeding at making a computer.


This did not stop Countess Ada Lovelace from designing programs for Babbage's machines. Besides the acclaim for her work in logic, she was the only legitimate daughter of the famed British poet, libertine and addict Lord Byron, who was as dedicated to illogic as his daughter was devoted to its opposite. The Countess Lovelace was educated by de Morgan and is given credit as the first computer programmer. The language Ada is named after her.

The best known of the British eccentrics fascinated with logic in the 19th Century was Charles Dodgson a.k.a. Lewis Carroll. While still famous for Alice in Wonderland, he was also a mathematician, clergyman and photographer, and enjoyed putting together logic puzzles based on the ideas of syllogism using silly but logical statements. For example:

(a) No ducks waltz.
(b) No officers ever decline to waltz.
(c) All my poultry are ducks.

Therefore (d) None of my poultry are officers.

Makes sense to me. Sort of.



Jumat, 11 Maret 2011

Tsunami travel times.


The big news this morning is a huge 8.9 earthquake off the coast of Japan which caused a tsunami. This picture shows how quickly the wave will travel all across the Pacific. Best wishes to all in its path and if haven't found cover yet away from the ocean, stop reading this and run!

To those of you still safely in front of your computer screens, I previously discussed the math of a tsunami about three years ago, which are significantly different from other waves. A normal everyday wave has a crest and a trough, while a tsunami is a solitary wave or soliton, all crest with no corresponding trough. Waves with crests and troughs tend to run into each other and cancel each other out. Solitons don't get canceled out and big ones travel faster than small ones, so parts of this wave created in Japan will even hit Antarctica sometime in the next day or so with a lot of destructive force.

That's the thing about nature, isn't it? Beautiful, fascinating and terrifying all at the same time.

Minggu, 06 Maret 2011

Sunday Numbers 2.0, Vol. 3: Continuity


It's easy to explain the idea of a continuous curve on a surface in everyday English. If you can draw a picture without ever lifting the pen from the surface, that is a continuous curve.

In this picture, let's assume the blue curve is just being hidden by the red curve at the five points of intersection. This means we can see the red picture is continuous and we will assume the blue picture is continuous. The difference is that the blue line represents a "smooth curve" and the red does not. This becomes important in differential calculus.

This particular drawing is from a lesson on how integral calculus works to find the area under the blue curve and bordered below by the horizontal line (representing the x-axis) and between the vertical lines labeled a and b. The graph in red is also a continuous curve.



There are lots of ways to have mathematical functions that create discontinuous graphs as well. The function pictured to the left is y = Floor(x), represented in most math books by the odd looking brackets you see in the picture where the bottom of the brackets exist but the top do not. The idea of Floor is that any real number x has a closest integer that is less than x. For example, Floor(2.5) = 2 and Floor(pi) = 3. (Oh-h-h-h-h-h... Floor(pi)!) The Floor of any whole number is itself, so Floor(4) = 4, but as soon as we move down from 4 the tiniest tick, Floor(3.999999999) = 3. This means you have to lift the pen off the surface and put it down away from the line segment you were drawing previously.

The standard way for mathematicians to state that a function is continuous this is "The function f(x) is continuous at all points x for which it is defined". the converse is "The function g(x) is not continuous at some set of points". It can also happen that a function may not be defined at a point x, but can either be continuous for all points near x, which we call a neighborhood of x. Conversely, a function may be undefined at a point and discontinuous at that point. A famous example of that kind of discontinuity is y = 1/x, which isn't defined at 0, is approaching infinity if x is positive and close to zero, but approaching negative infinity is x is negative and close to zero.




The mathematical template for continuity proofs is called epsilon-delta, where these two Greek letters are stand-ins for really small numbers. In the picture to the left, the red line represents the function f and f(a) = b. If we want to prove that f is continuous at a, which the picture shows to be true, the plan of attack is to let some nebulous observer choose a small number we will call episilon. What is asked of us is to find a neighborhood around a such that the inequality b - epsilon < f(x) < b + epsilon for every x in the neighborhood. We usually are asked to make the neighborhood around a to be symmetrical around a so the letter delta is added to a and subtracted from a to give us the boundaries of the neighborhood.

Let me give an example. We want to prove f(x) = x² is continuous around x = 4. I could let epsilon equal some specific small number like 0.01, but the true proof comes from proving it for any given small number. Since 4² = 16, we would look for the square roots of 16+epsilon and 16-epsilon, both of which will be very close to 4 is epsilon when very small. We then would see which square root is farthest from 4, and the distance would be our delta.

This is a very standard part of analysis. The standard "big" way to split up math is into analysis and algebra, and if I had my druthers, I'd rather do algebra. A lot of proofs in analysis are kind of tedious, while occasionally, algebraic proofs can be very pretty and elegant. If you want to see the average math graduate student's eyes glaze over and a nearly unstoppable desire to sleep overtake him or her, just say "epsilon-delta".

I don't know, someone from the analytical side of the field might stumble upon this post and give a spirited defense of epsilon-delta proofs, but I have to admit, if it happens, it will be the first time I've heard of it.

Next week: Logic and eccentric Britons.