Thursday, June 4, 2015


Note: This post contains spoilers of Avengers 2: Age of Ultron.

I liked Avengers 2: Age of Ultron, but as tends to happen with Marvel villains, Ultron's motivation is unclear. Why does he interpret his mission of "peace in our time" as "kill everyone"? Why does he hate Tony Stark so much? I have two ideas about this.

The first idea is that Tony didn't actually create Ultron. He simply downloaded the consciousness of the mind stone into a computer. As evidence of this, when Ultron is first activated, one of the first things he asks Jarvis is "Where is your body?", and upon learning that he's a machine, says "This feels weird. This feels wrong.".

Under this interpretation, the reason he hates Tony so much is because Tony is the one who put him into a machine. He hates Tony more than Bruce Banner, because it was Tony's idea. As for the mission, he never cared about peace. He just said that to confuse and make fun of the Avengers.

The second idea is that Tony did actually create Ultron, and Ultron was performing his mission. He saw that humans are a divisive and warlike species. He realized that we would never accept an externally imposed order. But that we might unite to fight a common enemy. And that plan worked, at least as far as getting the Maximoffs to put aside their differences with the rest of the Avengers.

In this case Ultron hating Tony was the lie. Ultron figured that Tony, having created him, would be less willing to fight him. So he made sure Tony would think he he hated him, so Tony would hate him back.

Monday, May 11, 2015

Redefining Marriage

Conservatives like to complain that allowing same-sex couples to get married is redefining marriage. The most common response to this is to argue that redefining marriage isn't necessarily bad, and to point out the many times marriage has been redefined in the past. However, I think the argument can be refuted on another level: Gay marriage is not a redefinition of marriage.

Or rather, the redefinition of marriage which logically leads to gay marriage already happened, and it happened a while ago. The change happened gradually, over a long time. There wasn't a single landmark court case I can point to like Loving v. Virginia.

A long time ago, a woman was considered to be basically the property of her husband. Even after that was the case, a woman was still supposed to be subservient to her husband. He had authority over her.

But over time that changed. Eventually, a marriage was no longer a relationship between owner and property, or between superior and inferior. It became a relationship between equal and equal. And once that happened, there was no longer a masculine role and a feminine role, and thus no need for a man and a woman. Just two people.

Tuesday, December 9, 2014

Quis custodiet ipsos custodes?

There have been a lot of stories recently about police abuses of power. Undoubtedly, these stories are not representative. The vast majority of police-civilian interactions do not end with death or violence. Most cops are good cops.

But that doesn't matter, when the whole system is bad.

When a police officer can kill someone with no provocation, on camera, and get away with it, it doesn't matter that there are more good cops than bad cops, because the good cops are part of a system that does nothing to stop the bad cops.

And it's not just the major abuses like that. I've heard (not being a cop, I don't know for sure) that police officers will usually not give other officers tickets for traffic violations. Of course, that's a very minor thing, but it's indicative of the problem. Police officers are held to a lower standard of conduct than civilians.

"With great power comes great responsibility." Unless you're a cop.

Monday, November 24, 2014

Binary Addition

Before, I talked about how to use binary to represent a number using only two values. But what if you want to actually do something with those numbers? How do you add numbers using Boolean operations?

Well, let's start with a simple case: adding two one-bit numbers. We'll call them X and Y, and since they each only have one binary digit they can only have the values 0 or 1. So here are the cases we need to account for: 0+0=0, 0+1=1, 1+0=1, 1+1=10.

Notice the answer for that final case has two digits. A Boolean function can only return one value, so how can get that? By having two functions, one for each digit.

So, the function for the rightmost digit has to satisfy this truth table:
What Boolean operation does that look like? XOR.

The function for the next digit will have to satisfy this truth table:
That's the same as the AND operation.

I'm using the subscripts here to indicate which digit in the overall number. So our two bit answer Z has the individual bits Z1Z0, where Z1 = X AND Y, and Z0 = X XOR Y;

So, that's how you can add two one-bit numbers. But what if you want to add bigger numbers? Well, the way you add the second bits together is pretty much the same as the first bits, with one major difference: You need to account for the bit that got carried from the sum of the first bits. If that carry bit was 0, then the result of the next bit will be same as the first. But if it's one, then the result is increased by one. So, 0+0+1=1, 0+1+1=10, 1+0+1=10, 1+1+1=11.
So, now we have these two truth tables:
So, Z1 = X1 XOR Y1 XOR C and Z2 = (X1 AND Y1) OR (X1 AND C) OR (Y1 AND C). C, the carry bit, comes from the second bit of the result of the sum of the first two bits, that is C = X0 AND Y0.

Each subsequent bit works just like the second, with the second bit of the previous result being carried over. Generally, and Zn = (Xn AND Yn) OR (Xn AND Cn-1) OR (Yn AND Cn-1), and Cn = Xn XOR Yn XOR Cn-1.

Here's another challenge for you: How do you do subtraction in a similar manner?

Sunday, November 2, 2014

Utilitarianism, Capitalism and Utility Monsters

A common criticism of utilitarianism is the idea of a utility monster. Suppose you had some extra ice cream, and you decided to give it away, so as to maximize utility. You only have enough to give to one person, and there are only two people available for you to give it to: Alice and Bob. If Alice likes ice cream, and Bob does not, then obviously you should give your ice cream to Alice. Giving it to Bob wouldn't increase his utility. What if Bob did like ice cream, but Alice like it more? Then, you should still give your ice cream to Alice, because that maximizes utility. What if Alice likes everything more than Bob does? Then you should take Bob's stuff and give it to Alice, because that will maximize total utility.

On a separate note, utilitarianism and capitalism go really well together.

Utilitarianism says you should try to maximize utility. When you buy something, you do so because it will make you happier, or help you achieve your goals, in other words, increase your utility. And you're trying to get best deal, you don't want to pay any more money than you have to. So money works as a not too bad proxy for utility. Which is good, because it's hard enough to get people to agree what utility is, let alone measure it in any meaningful way.

Before, I talked about the spherical cows of economics, that is, the conditions under which the free market is maximally efficient. One of those spherical cows in economic equality. A rich person can outbid a poor person, not because they value what they're buying more, but simply because they have more money to spend.

But if money is a proxy for utility, then maybe the rich person really does value it more. Maybe the rich person, in fact, has a greater capacity to value things at all. In other words, maybe rich people are utility monsters.

Sunday, October 26, 2014


Before, I talked about some of the things computers can do using only two values. But what about numbers? How can computers do arithmetic with only 0s and 1s? The answer to that question is "binary". If you already know what binary is, this post will just be a refresher.

Before I begin explaining binary, let's go over how the number system we normally use, that is, base ten, works. How do you count? How do you determine what the next number is?

Well, you start with 0, which is followed by 1, then 2, 3, 4, 5, 6, 7, 8 and 9. You pretty much just have to memorize that sequence. But what comes after 9? 10. That's interesting. It's not just another symbol, it's two symbols, and two symbols we've seen before.

Let's continue. After 10 comes 11, 12, 13, 14, 15, 16, 17, 18, 19. Hey, that looks familiar. Those numbers are the same as the first ten, except with a 1 on the front of each of them. And what comes after 19? 20. And the same sequence as before will repeat again, except with a 2 on the front, instead of a 1. And after that comes 30. And then, the same sequence will repeat again, but with a 3 this time.

Hey, wait a minute. The number on the front is itself going through that sequence too, it's just waiting for the second number to cycle through before going to the next step. So, after 30 comes 40, then 50, 60, 70, 80, 90.

So, what comes after 99? 100. Another symbol got added, just like when 9 turned into 10. And that's all there is to counting. You can continue following these same steps forever, and you'll never run out of numbers. Let's write out these steps a little more explicitly.

First, you have to memorize a sequence of symbols: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].
Then, to get the next number after the current one, replace the rightmost digit with the next symbol in the sequence. If it's already at the last symbol, then set it back to the beginning of the sequence, and repeat the last step for the next digit to the left. If there is no digit to the left, it's implied to be 0, so 1 is added.

But notice, there's nothing special about that sequence of symbols. You could follow the same rules using any sequence of symbols. For example, you could use this sequence: [a, b, c, d]. Then you would count a, b, c, d, ba, bb, bc, bd, ca, cb, cc, cd, da, db, dc, dd, baa...

Or you could use this sequence: [0, 1]. Then you would count 0, 1, 10, 11, 100, 101, 110, 111, 1000...

And that's what binary is. Counting, with only 0 and 1.

What if you want to convert from one base to another? If you have a number in base ten, and want to know how it's written in binary, or the other way around?

Well, one way to do that is just to count. Numbers are the same, regardless of how they're written, so if you count up the same number, it will be the same in every base.

Base ten0123456789101112

But that's going to be cumbersome for large numbers. Is there an easier way?

Yes, there is. Notice, that in any base, the number 10 represents the number of symbols in the sequence you're using. There are ten symbols in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], and 10 represents ten. There are two symbols in [0, 1] and 10 in binary represents two. That's not a coincidence, and I trust you're smart enough to figure out why that is.

A consequence of that is that the number 100 in any base is going to be equal to the number of symbols times itself. 10*10 = 100. And this gives you the concept of "place". You know, the digit furthest to the right is the ones place, the next digit to the left is the tens place, the next digit to the left is the hundreds place and so on.

That concept applies to any base. The rightmost digit will always be the ones place. The digit there stands for itself. The next digit to the left will be multiplied by the base. Each further digit to the left will be multiplied by the base again. So in binary, you get the ones place, the twos place, the fours place, the eights place, and so on.

So, for example, let's try that on this binary number: 101011
The rightmost digit is 1, and it's in the ones place, so it's equal to 1.
The next digit is 1, and it's in the twos place so it's 1*2 = 2.
The next digit is in the fours place, but it's 0, and 0 times anything is still 0, so it's 0.
The next digit is 1, and it's in the eights place, so it's 8.
The next digit is in the sixteens place, but it's 0.
The next digit is in the thirty-twos place, so it's 32.
So, the value is 32 + 8 + 2 + 1 = 43.

What about the other way? Converting a number from base ten to binary? That's a little bit harder to describe, so I'll explain with an example. Say we're converting the number 57. What we need to do is divide that number by 2 and find the remainder. 57 / 2 = 28 remainder 1. The remainder is the rightmost digit of our binary number.
To continue we need to divide 28. 28 / 2 = 14 remainder 0. The next digit in our binary number is 0.
14 / 2 = 7 remainder 0.
7 / 2 = 3 remainder 1.
3 / 2 = 1 remainder 1.
1 / 2 = 0 remainder 1.
So our binary number is 111001.

In other words, in each step you need to divide your number by two. The remainder is the next digit of the binary number, starting from the right and going left. You're done when the result of the division is zero.

And that is how you can represent numbers, using only 0 and 1.

Monday, August 18, 2014

Can't Touch This

A surprisingly common notion that comes up in science popularization is that nothing ever touches. This comes up things from youtube videos to the remake of Cosmos. As far as the scientific facts go, they're right. When you touch something, say when you pick up a ball, the electrons in the atoms of your fingers repel the electrons in the atoms of the ball, so the atoms in your fingers never come near the atoms in the ball. Near, that is, relative to the size of an atom.

But I wouldn't say that means nothing ever touches. Rather, it's a microscopic description of the macroscopic phenomenon of touch.

As an analogy, consider temperature. You can feel temperature as things feel hot or cold. You can measure temperature with thermometers. You can come up with laws that describe how heat flows from hot things to cold things. But on a microscopic scale, temperature is just speed. When atoms and molecules vibrate faster, they're hot. When they vibrate slower, they're cold.

But that doesn't mean that temperature doesn't exist. Rather, that's what temperature is. Thermometers still work, and the laws of thermodynamics are still accurate. They just refer to an emergent property of a complex system, rather than fundamental property.

I would argue the same applies to touch. Electrons repelling each other is what touching is.

Admittedly, this is entirely an argument over semantics. It's just about the definition of the word "touch", rather than any actual facts. But I think this definition is better and more useful. Because if nothing ever touches (except maybe where fusion occurs, like in the heart of a star), then the word "touch" never makes any useful distinctions, which is the purpose of a word.