Sunday, August 31, 2008

Factoring dice

Required reading for this post: Generating functions

We have two normal six-sided dice. We roll both of them, and sum the number of pips. There is a certain probability that we get a 2, or a 3, or a 4, and so on all the way to 12. What we want is a new pair of six-sided dice with the exact same probabilities as the normal dice, but with different numbers of pips on the faces. Each side must have a positive integer number of pips. Can you create such a pair of dice?
To solve this problem, we must have a better understanding of generating functions. Each sequence generates a unique function. Each function corresponds to a unique sequence. If we add two generating functions together, the resulting function corresponds to the sum of their respective sequences. But what happens if we multiply generating functions together?

Let's say we have some arbitrary sequence {a0, a1, a2, a3, a4, a5, ...} and another arbitrary sequence {b0, b1, b2, b3, b4, b5, ...}. Let's see what happens when we multiply them together.
F = a0 + a1*x + a2*x2 + a3*x3 + a4*x4 + a5*x5 + ...
G = b0 + b1*x + b2*x2 + b3*x3 + b4*x4 + b5*x5 + ...
F*G = a0*b0 + (a0*b1 + a1*b0)*x + (a0*b2 + a1*b1 + a2*b0)*x2 + ...
It might be a little difficult to make sense out of what's going on here. It's important to pay attention to the subscripts. Pay attention to the sum of the subscripts. I'll make this a bit more explicit.

All the sums in the first box add up to zero. All the sums in the next box add up to 1. The sums in the next box add up to 2. Note that every possible way sum to 2 with two non-negative integers is represented in that box. This pattern will continue. The next box would contain every possible way to sum to 3. The next box contains all the sums to 4. And so on.

Have you figured out yet how this might relate to the dice? The answer follows.

We can say that each sequence represents some sort of generalized dice. aj represents the number of ways for dice "a" to roll the number j, and bk represents the number of ways for dice "b" to roll the number k. If we multiply the functions generated by each sequence, then we get a new sequence {c0, c1, c2, c3, c4, c5, ...}. cn represents the number of ways for dice "a" and "b" to have a sum of n.

We can prove that this is the case. If we take any term cn, it can be represented by the following sum:

cn = an*b0 + an-1*b1 + ... + a1*bn-1 + a0*bn

If we recall the definition of aj and bk, the proof becomes obvious. The first term "an*b0" represents the number of ways to roll n on dice "a" and 0 on dice "b". The next term represents the number of ways to roll n-1 on dice "a" and 1 on dice "b". And so on.

So let's try it with normal six-sided dice!

We can easily get the generating function D for a normal six-sided dice, and the generating function D*D for two normal dice.
Sequence for normal dice: {0, 1, 1, 1, 1, 1, 1, 0, 0, 0, ...}
Let D = generating function for normal dice
D = x + x2 + x3 + x4 + x5 + x6
D = x * (1 + x) * (1 + x2 + x4)
D = x * (1 + x) * (1 + x + x2) * (1 - x + x2)
D*D = x2 * (1 + x)2 * (1 + x + x2)2 * (1 - x + x2)2
Now what we want are two new six-sided dice with generating functions A and B such that A*B = D*D. So what we have to do is split D*D into two groups of factors, one for A and one for B. Each group must have the factor x, because that ensures that each side has a nonzero number of pips. Each group must also have (1 + x) * (1 + x + x2), to ensure that they have exactly six sides. However, we can split the factor (1 - x + x2)2 in any way we want.
A = x * (1 + x) * (1 + x + x2) * (1 - x + x2)2
B = x * (1 + x) * (1 + x + x2)
A = x + x3 + x4 + x5 + x6 + x8
B = x + 2x2 + 2x3 + x4
These correspond to dice with sides {1, 3, 4, 5, 6, 8} and {1, 2, 2, 3, 3, 4}. There's your solution, right there.

Well, that was quite a mathematical adventure! I've been having fun factoring other kinds of dice as well.

Thursday, August 28, 2008

Generating functions

It's time for some math! No, wait, come back!

Here's the teaser:
We have two normal six-sided dice. We roll both of them, and sum the number of pips. There is a certain probability that we get a 2, or a 3, or a 4, and so on all the way to 12. What we want is a new pair of six-sided dice with the exact same probabilities as the normal dice, but with different numbers of pips on the faces. Each side must have a positive integer number of pips. Can you create such a pair of dice?
I would not pose this as a lone puzzle, because it is rather difficult, and requires a specialized trick. That specialized trick is called generating functions. A generating function is a function that is related to a sequence of numbers. For example, consider the following sequence:

1, 1, 1, 1, 1, 1, ...

The above sequence generates the following function:

1 + x + x2 + x3 + x4 + x5 + ...

Here's a slightly more complicated sequence and its generating function

1, 2, 3, 4, 5, 6, ...
1 + 2x + 3x2 + 4x3 + 5x4 + 6x5 + ...

Essentially, you turn the sequence into the coefficients of an infinite polynomial.

We could leave the generating function in the form of a polynomial, but there's often a simpler way to express it. For example, take the generating function of the sequence {1, 1, 1, 1, 1, ...} We can simplify it with a bit of math.
Let H be the generating function of {1, 1, 1, 1, ...}
H = 1 + x + x2 + x3 + x4 + x5 + ...
H*x = x + x2 + x3 + x4 + x5 + x6 + ...
H - H*x = 1
H*(1-x) = 1
H = 1/(1-x)
Thus the sequence {1, 1, 1, 1, 1, ...} generates the function 1/(1-x).

Let's try the same for the sequence {1, 2, 4, 8, 16, ...}
Let G be the generating function of the sequence {1, 2, 4, 8, 16, ...}
G = 1 + 2x + 4x2 + 8x3 + 16x4 + ...
G*2x = 2x + 4x2 + 8x3 + 16x4 + 32x5 + ...
G - G*2x = 1
G*(1-2x) = 1
G = 1/(1-2x)
Thus the sequence {1, 2, 4, 8, 16, ...} generates the function 1/(1-2x).

You may be thinking, "That's nice, but what does that do for me?" Honestly, not a whole lot. But here's one problem you can solve.
Find an expression for the nth term of the Fibonacci sequence. In the Fibonacci sequence, the first two terms are {1,1}, and each term thereafter is the sum of the previous two terms.
We should first try to find the generating function of the Fibonacci sequence.
Let F be the generating function of the Fibonacci sequence {1, 1, 2, 3, 5, 8, 13, 21, ...}
F = 1 + x + 2x2 + 3x3 + 5x4 + 8x5 + 13x6 + ...
F*x = x + x2 + 2x3 + 3x4 +5x5 + 8x6 + ...
F*x2 = x2 + x3 + 2x4 +3x5 + 5x6 + ...
1 + F*x + F*x2 = 1 + x + 2x2 + 3x3 + 5x4 + 8x5 + 13x6 + ...
1 + F*x + F*x2 = F
F = 1/(1-x-x2)
Good, now we've got the generating function: 1/(1-x-x2). We can actually simplify this a bit further. But to do this, we'll need some irrational numbers, which I'll just call A, B, and C. [See footnote for the actual values]*

1/(1-x-x2) = A/(1-Bx) - A/(1-Cx)

If I'm able to express the generating function as the sum of two other functions, that means I can also express the sequence as the sum of two other sequences. Makes sense? If you recall, the sequence {1, 2, 4, 8, 16, ...} generates the function 1/(1-2x). Similarly, we can prove that the sequence {1, B, B2, B3, B4, ...} generates the function 1/(1-Bx). The fibonacci sequence is the sum of the following two sequences:

{1, 1, 2, 3, 5, 8, 13, 21, ...} = A*{1, B, B2, B3, B4, ...} - A*{1, C, C2, C3, C4, ...}

Thus, the nth term of the Fibonacci sequence is A*(Bn-1 - Cn-1). This is called Binet's formula for the Fibonacci sequence. Pretty cool?

Now, there are lots of other ways to find Binet's formula, and some of them are easier than this. But next time, we'll try to solve the dice problem, which is extremely difficult by any other method.

See the next page

[This is one of the things I learned at math camp. Well, *I* thought it was fascinating. My regards to the professor.]

*A is sqrt(1/5). B is the golden ratio, or 1/2 + sqrt(5)/2. C is
1/2 - sqrt(5)/2.

Wednesday, August 27, 2008

Painted Plane II solution

See the original puzzle

For the first problem, I will first assume that no monochromatic equilateral triangle exists. We start with two points A and B which are the same color (call that color red).

By forming equilateral triangles, we can deduce the colors of the following points:
1. Triangle ABC: C is blue
2. Triangle ABD: D is blue
3. Triangle CDE: E is red
4. Triangle BEF: F is blue
5. Triangle AEG: G is blue

Triangle CFG is all blue, contradicting our original assumption. Therefore, there must exist a monochromatic equilateral triangle. QED

For the second problem, I will first assume that there are no singly- or triply-colored equilateral triangles. We start with two points A and B which are the same color (call that color red). Because ABC is an equilateral triangle, C must be a new color, which we will call blue.

At this point, we have to split into several cases:

Case 1: D is green. E is either blue or green, but we can assume without loss of generality that E is green.

Case 2: D is blue. E is green.

Case 3: D is blue. E is red.

For the proof of each case, see this diagram. In each case, the steps go in alphabetical order. In each case you will find a red monochromatic triangle. This contradicts our original assumption. Therefore, there must exist a singly- or triply-colored equilateral triangle. QED

It may interest the reader to know that we can prove a much stronger case of this problem. That is, no matter how many colors we use (as long as there are a finite number of colors), there must always exist a monochromatic equilateral triangle. This is a much harder problem, and it requires a different approach. If you are interested in seeing the proof, stick around and I will eventually post it.

Tuesday, August 26, 2008

Uh oh

I may have gotten myself a case of the pharynguloids. PZ's minions are descending upon my blog. Ahem...

Hi everyone! I blog about skepticism, physics, puzzles, math, as well as atheism. Yeah, I'm an atheist. I'm just this guy, you know? I'm happy to talk about anything you like. Stay a while, consider some of my better essays on atheism, you know, if you're into that sort of thing. Or consider my thoughts on crackergate (also, a short followup) if you are so obsessed with my views.

Hmmm... I think I will push my science/math drafts to the front.

Monday, August 25, 2008

An intuitive thinker

One of the students at the math camp is very clearly an intuitive thinker. I'm not exactly sure how I know this; I just know. Listening to him speak--and he speaks a lot--is like listening to a stream of consciousness. A lot of it is nonsense. As if he is thinking out loud, not really expecting anyone to understand.

But more tellingly is the way he solves math puzzles. It is so very hard to describe, especially to those who haven't had much experience with math or puzzles themselves. I will try.

So some of our lectures were about number theory. The following warm-up problem was given:

Prove that any common divisor of x and y is also a divisor of the greatest common divisor of x and y.

If you're like me, you first wonder why this needs proof. It's so obvious. At least to me. It has to do with the prime factorization, and the gcd function, and the... but darn it, this is no proof! Such is the problem with intuitive thought. You can look at many problems and think they're so obvious, but that doesn't always help you with proof. Who knows what underlying assumptions our intuition makes. It could be using circular reasoning, for all we know. Sometimes a flash of intuition lights the way, but other times it's so bright that it blinds us.

The above question is an example of very basic number theory. This kind of question gives even non-intuitive thinkers problems, because it asks us to prove something we are so used to assuming. For a highly intuitive thinker, this occurs all the time, even for math that is less basic. Everything seems so obvious, but it is difficult to say why.

And so it was, intuition was often an obstacle for this student. And sometimes, his intuition not only prevented him from finding a proper proof, but also gave him the wrong final answer. Such is the peril of intuition; it cannot always be trusted.

Not to say that the student was the worse because of it. He was a star student, one of the youngest and brightest.

I, too am a bit of an intuitive thinker, and I intend to defend intuition, even praise it.

Intuition is not some innate knowledge, gained at birth. It's not encoded into our ancient genes. At least, not always (I think phobias are pretty amazing myself). Carl Jung would have you believe that intuition is opposed to sensation, that intuition comes from within and sensation comes from without. But I don't put much stock into the MBTI, so I don't see why "within" and "without" should be necessarily opposed. I think that intuition is a skill that can be acquired from the outside. It can practiced and improved. It can be a learning tool, a way of internalizing new knowledge.

If I'm learning something, say special relativity, I find it useful to visualize. As we boost spacetime, the axes scissor together such that the determinant is conserved. If we go near the speed of light, objects will flatten. Distances will shorten. Clocks will slow down, but the plane of simultaneity tilts as you accelerate. Sorry if none of this makes any sense--but this is how I do it. I can easily visualize the resolution to the twin paradox, as if there were no paradox at all.

I use special relativity as an example, because it's so often thought to be counterintuitive. But it really can be intuitive, if you work on it hard enough. I worked on it for a long time myself, looking at relativity from all sorts of viewpoints. I try to do the same for other "counterintuitive" concepts (quantum mechanics, anyone?). It's possible, but it takes work. Intuition doesn't start out as a reliable way of knowing, after all. (Spiders aren't that dangerous.)

Equally importantly, you have to work on other skills to support intuition. You must be able to translate intuition into reasoning. You must be able to break down your intuition into its constituent parts, and examine them if needed. Without these supporting skills, intuition is impossible to verify. Some intuition is bad, and some is good. If we have the skills to distinguish between the two, it becomes a powerful tool.

Saturday, August 23, 2008

Misplaced pluralism

Via EvolutionBlog, I found this article in American Scientist covering the Monty Hall problem. Good coverage, but I disagree with this last paragraph:
Making progress in the sciences requires that we reach agreement about answers to questions, and then move on. Endless debate (think of global warming) is fruitless debate. In the Monty Hall case, this social process has actually worked quite well. A consensus has indeed been reached; the mathematical community at large has made up its mind and considers the matter settled. But consensus is not the same as unanimity, and dissenters should not be stifled. The fact is, when it comes to matters like Monty Hall, I'm not sufficiently skeptical. I know what answer I'm supposed to get, and I allow that to bias my thinking. It should be welcome news that a few others are willing to think for themselves and challenge the received doctrine. Even though they're wrong.
No, dissenters shouldn't be stifled. But in this case I can't think of any way in which dissent is a good thing. The Monty Hall problem isn't just considered settled, it is settled, with deductive certainty. Oh, sure, the principle of pluralism says it's healthy to have a diversity of views, but you have to think about why we value pluralism. I think pluralism is good because of the possibility that the consensus is wrong. That possibility simply doesn't exist here. Pluralism is bad in this case. It's okay, I'm sure we can find other things to disagree about.

The same goes for the following claims:

Thursday, August 21, 2008

The skeptic's dilemma

For the skeptic, there is an ever-present dilemma. It is not enough to merely discern and rebut false claims. We must also seek to understand what causes people to believe weird things. If we understand the causes, we can better recognize it and halt its progress.

There are essentially two different ways of explaining a wrong belief. Either the person really does have a wrong belief, or is lying about it.

Yes, it's like the Liar, Lunatic, or Lord trilemma, only without Jesus. Also, "lunatic" is way too strong of a word when we really want something more like "mistaken".

There are two reasons the distinction is important. One is in how we treat the person. Most obviously, it's best to call a liar a liar, and an honest believer an honest believer. We're supposed to be the side that's concerned with factual accuracy, so we ought to call it like it is. I also believe that an honest believer should be given more respect than a liar. This is for the simple fact anyone can honestly have wrong beliefs. Even me. Even you.

The other reason the distinction is important is in how we prevent it. To prevent hoaxes from being perpetrated, there's always legal action. But in absence of that, we can target the kind of reasoning that leads people to believe the hoaxer. Always question authority, and ask for evidence. Beware of attempts to use scientific language in order to look authentic. To prevent people from fooling themselves, we must warn them of the dangers of cognitive biases. Anecdotal evidence is weaker than it seems. We often remember the hits and forget the misses. The brain is wired to recognize patterns even when there aren't any. And so on.

Which of the two, lying vs wrong belief, is most common? The answer is actually quite obvious. Wrong beliefs are most common. Given any of the factions that skeptics fight--9/11 truthers, psychics, antivaxxers, Scientologists, Intelligent Design, you name it--only a small fraction of the people could possibly be liars. That is, only the people on top. The people on bottom have nothing to gain from lying, and are often risking something for their beliefs. If there's no one on top, if it's structured without any sort of hierarchy, then obviously no one is lying. If there's no one on bottom, what is there to worry about?

But even among the leaders, I would still lean more towards honest belief rather than lies. But it must be decided on a case-by-case basis. So I'm going to go down a list of weird beliefs and comment on the leaders of each one. I am not particularly well informed about most of these topics, so feel free to disagree.

Psychics - It is entirely possible to honestly think oneself a psychic. A lot of it has to do with remembering hits and forgetting misses. It is also possible to use the cold reading technique without knowing it. Cold reading techniques involve educated guesswork, and using the subject's responses to help. This might be done intuitively, giving the impression of real psychic powers. On the other hand, hot reading (googling the subject beforehand) requires preparation and a conscious effort. Spoon bending too. That's how we know Uri Geller must be a liar.

Homeopathy - I'm guessing most homeopaths honestly believe it works. After all, the homeopaths themselves are subjected to many more anecdotes than their customers are. On the other hand, they stand to profit if they lie.

Physics crackpots - They are probably honest. It is not too hard to navigate the mess that is popularized science, and get hopelessly lost. Anyways, being a crackpot is a thankless job. Especially if you're one of those who spends decades perfecting a book because you fear the criticism you'll get in a scientific journal.

Water dowsing - You can sell to gullible people what is essentially a very expensive stick. Obviously, this business is extremely attractive to scammers. But it's certainly not impossible that the seller believes it too.

Holocaust denial - The root cause of holocaust denial is primarily anti-semitism. You might think that the leaders (people who publish "research" that questions various aspects of the holocaust) might be lying in order to serve their agenda, but I don't think that's how it works. It's much more likely that anti-semitism is biasing their judgment in pretty severe ways.

Scientology - L. Ron Hubbard was probably either a liar or literally insane, maybe both. I wouldn't be surprised if the same were true of Scientology's current leaders. Anyways, the church of Scientology is filthy, filthy rich, and runs like a business (did you know that the Cult Awareness Network is run by Scientology?). I bet corruption lurks in every corner.

Intelligent Design - Is the Discovery Institute rife with liars? We catch them in their lies all the time, but this is not necessarily purposeful. Maybe they're just incompetent, with huge gaping blind spots. Quote mining, for instance, might just be the result of really strong confirmation bias--seeing only what you want to see, and conveniently forgetting the context. I'm betting that they all at least honestly believe that Religion should come ahead in the culture war between Science and Religion. Do they lie in service of this agenda? I can't tell.

So now that we've had some practice, I encourage you all to try this on all weird beliefs you encounter. I can't say it's completely necessary to know who's lying and who's not, but it can be instructive.

Tuesday, August 19, 2008

Of waves, sounds, and solar wind

I've got a bunch of links here: sounds generated from scientific data from space! I have a long explanation afterwards, but first take a glance at some of these links so you know which direction I'm going.

Selected Sounds of Space
The Lion Roars
The Music of the Spheres
Sounds of the Magnetosphere
Radio Jove

One of the important parts in thinking like a physicist is understanding waves. Waves appear everywhere. The music I'm currently listening to is a wave. The light coming from my computer screen is a wave. And thanks to quantum theory, we can consider the entire universe to be a many-dimensional wave of sorts.

Making a wave is really not all that difficult. If you have a system that is stable, like a pendulum, for instance, that means that a small push and it will just come swing back towards equilibrium. In some systems, it won't just go straight to equilibrium, but will swing back forth for a little while first. We call this an oscillator. If we have a bunch of oscillators linked together, then one oscillator will cause the next oscillator to move, which causes the next one to move, and so forth. Thus we have a traveling wave.

Nearly anything can be an oscillator. Each individual particle is an oscillator. If you knock a bunch of particles forward, they'll hit another bunch of particles, which will hit another bunch of particles, and so forth. These are sound waves. If you drop a pebble into some water, it will cause a small excess of water in that location, and this will push up the water in the surrounding area, which will push up even more water. This is a ripple, a water wave. If you run a bit of electricity through a wire, it creates electric and magnetic fields. Because of the peculiarities of Maxwell's equations, which govern electric and magnetic fields, the fields will spread outwards. This is an electromagnetic wave (aka light, though not necessarily visible light).

A more mundane example is traffic. Let's say we have a freeway full of cars, and one of them slows down to get a better look at an accident. The car behind it has to slow down too, and then the one behind that one, and then the next car. This wave can propagate backwards through the traffic a long way. This just goes to show, even when we look at non-physical laws (ie traffic laws), waves still appear as an emergent pattern.

In my research, I study yet another kind of wave that travels through something called a plasma. A plasma is basically ionized gas. By ionized, we mean that the gas is energetic enough that most of the atoms have been separated from one of their electrons. As a result, most of the particles in a plasma either have a positive charge (the ions) or a negative charge (the electrons). This gives plasma many electromagnetic properties, since electricity is basically the movement of charges. And recall that sound waves are basically made of moving particles. Thus, you might expect a combination of sound waves and electromagnetic waves to travel through plasma. These plasma waves come in all sorts, depending on the pressure of the plasma, the direction of the fields, the frequency of the wave, and so forth.

Pretty much all of interplanetary space is filled with plasma. I'm talking extremely low density, better than the artificial vacuums we can create down here on earth, but the plasma is still there. I often joke that I study invisible fields and fluids that exist within vacuums (and I must say, the invisible and the non-existent do not look alike). Most of this plasma comes from the sun. The sun ejects a constant stream of particles called the solar wind. The solar wind would be quite deadly for life on earth if it hit us, but luckily it is deflected around the Earth by Earth's magnetic field. It's sort of like a river being deflected by a rock. But let's not take the analogy too far--Earth's magnetic field is a bit squishier than a rock; it is shaped by the solar wind. And this wind is not entirely constant. You can see the temperature, speed, density, and magnetic field change in these graphs of live data. These changes interact with the Earth's field, and create all sorts of plasma waves.

Since plasma waves and sound waves are both waves, it is possible to convert between the two. You can't hear plasma waves, but you can use a special device or some simple software. A radio, for instance, converts radio waves (light waves) into sound waves. And your speaker converts electrical signals (also a wave) into sound. You can do the same with plasma waves, usually by converting it to data, and then into an electrical signal that goes through your speakers.

And these sounds aren't meaningless. If the pitch is higher, that means the wave has a higher frequency. If it's lower, the wave has a lower frequency. If the pitch is descending or ascending, that means the frequency is slowing down or speeding up. If we hear a sound that is pitchless, that means that there are waves of all different frequencies happening all at once. All of these indicate different kinds of important events in the magnetic field.

There are also plenty of waves that are so low frequency that the human ear cannot detect them. Luckily, there are ways to artificially speed up the waves. Some of the links at the top use waves that we can hear; others use slow waves that have been artificially sped up. And there's no reason to confine ourselves to plasma waves near Earth. Some of the links have sounds from Jupiter too.

One of the characteristics of this field is that we have a ton of data. Tens of thousands of numbers every day, from each of the many devices and satellites we have out there all over and above the world. But as anyone intuitively knows, having ten thousand numbers is useless because it's just an information overload. We need to find overall patterns so we can better understand the physics behind it, or even make predictions. Computers tend to be very inefficient at finding patterns, whereas the human mind is hardwired to find patterns (often even when there aren't any). In order to take advantage of this pattern-seeking superpower, we just need to reduce the data to something we can wrap our minds around. One way to do this is with a graph or a visual. Another way is by converting the data to sound. So if you listened to any of the space sounds, you may congratulate yourself for exercising one of the few scientific powers that is inborn.

Monday, August 18, 2008

Carnival of the Godless #98

The Carnival of the Godless #98 is up at Letters from a broad. The Carnival of the Godless is a biweekly blogging carnival that features the best new posts in the atheist blogosphere. My "No molecule of love" is in there.

Sunday, August 17, 2008

Scratch paper art

Oh, so I never really said how the math camp went. It was really cool. Some of the lessons were really interesting. The kids were a lot of fun, most of the time anyways.

And now, I have a large stack of used scratch paper.

I think scratch paper is an art. It is very chaotic, yet there are hidden patterns everywhere. It is at once simple yet complex. It is a glimpse of the human mind, frozen in time.

Let me show you some scraps.

If you look closely, you might see the puppies and kittens. Also, base Fibonacci.

Exactly what it looks like: a bunch of random circles.

I am not actually sure that having an ellipsis full of sigmas is proper notation.

If you try to guess what this is, you are doomed to fail. I think I was trying to draw a polyhedron?

This one is actually very straightforward. It has to do with quadratic residues.

Base Fibonacci returns! Now with arithmetic.

This is an abstract drawing of something more concrete--namely, a cyclic string of binary digits.

And that's it for now. Hope you've enjoyed it.

Friday, August 15, 2008

A painted plane II

Your fears have been realized: I am presenting more painted plane problems!

Let's say I've painted each point on an infinite, continuous plane. Each point is either painted red or blue. Prove that there must exist three points of the same color which form the corners of an equilateral triangle.

I've painted the plane again, this time with three colors. Each point is either red, blue, or green. Prove that there must either exist three points of the same color, or of three different colors, such that the points form the corners of an equilateral triangle.

The solution has now been posted! see here

Oh, and yes, there will be even more painted plane puzzles in the future.

Wednesday, August 13, 2008

Liar, Lunatic, or Lord

There is an argument for Christianity called the Trilemma argument or the "Liar, Lunatic, or Lord" argument. It was popularized by C. S. Lewis. This makes me think very poorly of Lewis, because it is the very model of a bad argument. To apologists' credit, I hardly ever see it in use. Let's keep it that way.

Here is a formal statement of the argument:
  1. Premise: Jesus claimed to be Lord.
  2. Conclusion: Either Jesus is a liar, a lunatic, or Lord.
  3. Premise: Jesus was not a liar.
  4. Premise: Jesus was not a lunatic.
  5. Conclusion: Jesus is Lord.
With the exception of number 5, every single one of these steps is problematic. 1 out of 5 is pretty bad when you're shooting for a 5 out of 5. Let's break it down, out of order.
2. Conclusion: Either Jesus is a liar, a lunatic, or Lord.
This is meant to be an exhaustive list of possibilities, but it isn't. If we want to create an exhaustive list of possibilities, we must start with a logical tautology, such as "Either P or not P". Here we can say, "Either Jesus is Lord or he isn't." If Jesus isn't Lord, we can further subdivide the possibility by saying, "Either Jesus was lying or was not lying." This is the underlying reasoning behind this conclusion, but there is a glaring mistake! If Jesus is not Lord, nor was he lying, does that really imply that Jesus was a lunatic?

Here's a lesson that belongs in the first few minutes of Skepticism 101: There are quite a number of ways for a sane person to have a wrong belief! We even have names for them: confirmation bias, logical fallacies, post hoc reasoning, cognitive dissonance, general ignorance, etc. But even if you didn't know what all those were, you would still know that everyone makes mistakes, has wrong beliefs, and sometimes changes their mind about said beliefs.

If you think that being Lord is too wild a belief for anyone to fool themselves about, you obviously haven't had much experience with skepticism. Ever heard of homeopathy? Listened to physics crackpots? Encountered 9/11 truthers? These are smart people, large groups of people, people who are every bit sane, and they believe in junk. I am no longer surprised. I am especially unsurprised that someone can honestly believe they are God. After all, here we are, only a few mistakes away from thinking that Jesus must be God, so how hard could it be? It only needed to happen to one person in two millenia, but I'm sure it's happened to plenty of people in that time.
4. Premise: Jesus was not a lunatic.
This premise essentially relies on an emotional appeal. No one wants to think anyone is a loony. Least of all does anyone want to think Jesus is a loony. I for one, would want to be absolutely sure before even considering the possibility that someone is mentally handicapped. But I would also hesitate to insult the mentally handicapped by making assumptions about what they can and cannot do. We must face the logical possibility.

But recall that I said that "lunatic" is not an exhaustive possibility. Jesus could easily have been honestly mistaken. This possibility is easier to swallow, and is also much, much more likely. The only reason "lunatic" is used in the argument rather than "mistaken" is because it has much more emotional punch. In other words, the trilemma argument uses flawed reasoning in order to better play with people's emotions. Shameful.
3. Premise: Jesus was not a liar.
This premise is also based on emotional appeal. It's usually accompanied by exhortations to spit upon liars and so forth. I happen to think this possibility is far less likely than the "honestly mistaken" one, but it must nevertheless be considered a possibility. I'm not sure how you would tell if he was a liar anyways. Liars can be nice, you know. They can be hypocrites. Out of billions of people, there only need be one. And no, entertaining the mere possibility that someone is lying doesn't mean you have to spit at them. That's a little extreme, and in poor taste.
1. Premise: Jesus claimed to be Lord.
The trilemma is still not exhaustive, because there is a whole other category of possibilities in which this premise is false. Maybe Jesus never claimed to be Lord. Maybe they only added that part in later. Maybe we've misinterpreted his claim. Maybe Jesus never existed at all. I'd prefer go with the "mistaken" possibility myself, but these new ones are very serious considerations. And I didn't even make an exhaustive list yet. The trilemma argument merely dismisses all these possibilities with hardly an argument. The phrase for this is "begging the question."

In summary, this argument is just abysmal. It is painfully wrong in several distinct ways. It's essentially, "Either we're right or we're wrong. How dare you think we could be wrong! Therefore, we are right." I question the moral character of anyone who poses this as a serious argument.

Tuesday, August 12, 2008

Carnival of Math #38

Apparently, I was in the Carnival of Mathematics last week. My painted plane puzzle is there, along with Yoo's solution. Cool deal.

The Carnival of Mathematics is something I was only vaguely aware of before. I didn't realize they had puzzles. Maybe I will appear in it again some time.

Monday, August 11, 2008

Recent reading

I am currently wondering what books should I read. Any recommendations?

My last book was Good Omens, a book written by both Terry Pratchett and Neil Gaiman. It is a comedy about the apocalypse. I rather like how the main characters, an angel and demon, often have trouble telling the difference between good and evil, because the line is so blurry. Also, the humans are better at their jobs than they are. Also, one of the horsemen of the apocalypse runs a fast food chain--guess which one. Great book, in many respects.

Previous to Good Omens, I read The Color of Magic and Guards, Guards!, both Terry Pratchett Discworld novels. I was trying to get into Discworld, but I don't feel too enthusiastic about it.

I was told that Terry Pratchett is similar to Douglas Adams, only more prolific. Douglas Adams is my favorite author, but his problem is that he's dead. As if that weren't bad enough, he also writes extremely slowly. But I am finding similarities in writing style between Terry Pratchett and Douglas Adams. I love Douglas Adams' writing style, because it's hilarious all by itself, just the way he describes things. In his descriptions of common objects, he always includes contradictions, absurd metaphors, or things that would be impossible to know just from looks, leaving the reader's imagination to try to sort it all out. ("...four windows set in the front of a size and proportion which more or less exactly failed to please the eye"--page 1, H2G2) Terry Pratchett is a bit similar in this respect. But for whatever reason, I'm just not laughing as much. I am a little disappointed.

Maybe I am reading the wrong books. Are his later novels better? Or should I go for something completely different?

You may have gathered--correctly--that I like books that are funny.

Saturday, August 9, 2008

No molecule of love

It's true, I'm a reductionist. Everything can ultimately be explained by its constituent parts. We're all just a bunch of quarks and leptons, as they say.

But I'm told this leaves no room for love. I'm told that there is no molecule of love. I'm told that they sure got me there.

It also leaves no room for milk. There's no molecule of milk, you know. Sure, there's lactose, but that by itself isn't milk. How can a reductionist like me live without milk? They sure got me there. I better fix my philosophy up before I break my bones.

I'm also told about God. God is like a puppy that hasn't learned its name yet. Here I am, talking about reductionism and love, when God suddenly pokes his nose in, as if to say, "You called?" And then suddenly everyone acts like we were talking about God all along. Oh, obviously, he came because he heard the word "love". So cute! And isn't Love a good name for our puppy? Oh, but you don't believe in Love. Do you kick puppies too?

Only if I can't see them.

Incidentally, there is no puppy molecule. The particle zoo has no room for puppies. No room for molecules either for that matter. Molecules are made up of many quarks and leptons, interacting in an intricate quantum dance. Molecules aren't elementary particles at all. That's why molecules can't exist.

A paradox! I see reductionism collapsing around me, as if it were an electron spiraling into a nucleus. How could it ever have been stable in the first place? How did I ever believe the contradicting ideas of milk and reductionism? That's as incoherent as believing in both the brain and consciousness, or both pages and books.

A solution suggests itself. Or rather, someone suggests it to me, as if they had been reading my thoughts. There are no pages or books. There can only be libraries. Libraries, love, and God. These are all eternal cosmic forces, who only occasionally manifest themselves into the illusion of molecules. Pages are not constituent parts, but consequences of libraries. People and their feelings aren't constituent parts of love, but consequences. Spiritu-

But the suggestion dissipates, becoming as ethereal as a puppy. Realizing what just happened, I back away slowly. Carefully. But I still end up kicking it.

Thursday, August 7, 2008

Painted Plane solution

Congratulations to Yoo Chung of Stochastic Scribbles for solving the Painted Plane puzzle!

He has a very nice and illustrated explanation over here.

If I may add one more illustration, here is an equivalent way to think about it.

Click for spoiler diagram (I stole part of the diagram from Yoo)

We start with the same setup: assume that there are no two points of the same color which are one unit apart. If we start with any red point C, we can deduce that point D is red as well. We can use the same reasoning to show that there must be a red circle with center C and a radius of sqrt(3). There must be two points on this red circle which are exactly one unit apart. Contradiction, ergo our original assumption was incorrect. QED

Sorry if that was a bit dense, but Yoo already wrote a clear enough solution, so there you go.

I've always wondered whether it's possible to do it with 4 colors. But alas, I've never been able to figure it out, and there's no reason to assume the answer is accessible.

This is one of my favorite puzzles of all time. So guess what? I'm going to have some similar puzzles in the future! Mwahahahahaaa!

Things for Other People

In my mind, there is a large category of things that I call Things for Other People. These are things that I understand other people like, but I do not personally enjoy. Most of them just seem uninteresting to me, despite their (perhaps justified) popularity.

Prime Rib
School spirit
Most movies
Most television
Most music
Lord of the Rings
Star Wars
The Bible
Bible criticism
Motivational talk
Inspirational talk
Pre-modern art

Was there any particular point to this list? I guess not.

So, um, any thoughts? Off-topic is fine, too.

Tuesday, August 5, 2008

Bass Spore creature

Another small contribution to the BASS blog. I made a Spore Creature that looks like the BASS logo. You know you want to see it.

For those who weren't here when I first said it, I am a member of BASS at UCLA.

Monday, August 4, 2008

A painted plane

Let's say I've painted a plane--the flat kind, not the flying kind. Every single point on the plane is assigned the color red or blue. Prove that there must exist two points of the same color that are exactly one unit apart.

Every single point on the plane is assigned the color red, blue or green. Prove that there must exist two points of the same color that are exactly one unit apart.

Update: Yoo Chung has explained the solution here.
My additional comments are here.

Friday, August 1, 2008

The myth of the toilet drain

Can you tell if I've flipped this picture?

Have you ever heard that toilets in the northern hemisphere drain in one direction while those in the southern hemisphere drain in opposite direction? It's not true. Who knows why people think it is. It's sort of a harmless myth, a little science factoid that people enjoy perpetuating. I guess it just isn't terribly important to most people whether these science factoids are true or not. Though it's as harmless as they come, debunking this myth is fun, because I get to talk about some real science in the process.

The Coriolis Force

Supposedly, the reason that the water drains one way rather than the other is because of the Coriolis force. The Coriolis force is a "fictitious" force that appears when you consider a rotating reference frame, such as a point on Earth's rotating surface. By "fictitious", we don't mean it's not real. That just means that it appears in one reference frame, but not another. In more advanced theories, gravity is considered a fictitious force too, since it disappears when you consider a free-falling reference frame such as a space-station in orbit.

So what causes this Coriolis force? Usually, an object will move in a straight line unless there are some external forces changing its direction. But in a rotating reference frame, we would expect the direction to rotate along with the frame. Thus, when an object is moving, the Coriolis force causes it to slowly change its direction.* In the northern hemisphere, a moving object will slowly turn right. In the southern hemisphere, a moving object will slowly turn left. The further away from the equator, the more quickly it turns. This has to do with the orientation of earth's surface relative to the axis of rotation.

The reason the Coriolis force does not affect a toilet is because it's far too weak. Think about how slowly the Earth turns. That's right, it takes a whole day to make a complete rotation! Unless the toilet takes a whole day to drain, the Coriolis force can have hardly any effect at all. It will be extremely small in comparison to other effects like the shape of the toilet bowl, or the direction of the water as it comes in. On the other hand, the Coriolis force has a huge effect on ocean and air currents, as well as the direction of hurricanes, since all these phenomena last much longer than a day.

That said, it is possible for the Coriolis force to determine the direction that a sink drains. You just need to have a highly symmetrical basin, and make sure that the water is not moving initially or anything. And then you need to let it drain for maybe several hours. It's not an easy experiment.

*This is just the short, lying-to-children explanation. To get the full picture, you have to include another fictitious force that can also affect the direction, called the centrifugal force. Only together do these forces change the magnitude and direction of the velocity in the correct manner.

The Vortex Direction

Time for a quiz. If the Coriolis force did have a large effect on toilets, which way would they drain in the northern hemisphere?

Initially, I thought it would drain clockwise, because the Coriolis force makes the path turn right, creating clockwise circles. But I was wrong! As the water begins draining towards the center, its path is deflected to the right. Then the water goes counter-clockwise around the drain, because the Coriolis force is balanced by the force of water pressure. This really needs an illustration:
Image from Bad Science's Bad Coriolis FAQ. Cf (red) indicates the direction of the Coriolis force, while pgf (purple) indicates the direction of water pressure.

The direction actually depends on whether the center of the vortex is low pressure (such as a drain or a hurricane) or high pressure. In the absence of a vortex, I think the body of water or air will rotate clockwise according to my previous analysis.

As for the picture at the beginning, it's true, I flipped it. No, you can't tell which hemisphere it's from.