tag:blogger.com,1999:blog-66538824194202684562017-08-15T19:59:47.838-04:00Slithy Toves and BorogovesAlex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.comBlogger124125tag:blogger.com,1999:blog-6653882419420268456.post-6170167585964777732017-06-29T01:03:00.001-04:002017-06-29T01:03:31.024-04:00Something You Believe Is WrongNo one is omniscient. No one knows everything. That means everyone believes something that is wrong (at least everyone who's not in a state of radical doubt). That includes me and you.<br /><br />There is something I believe that is wrong. There is something you believe that is wrong. The problem is false beliefs feel just the same as true beliefs. Even something you <i>know </i>is true, might still be false.<br /><br />And the only way to improve the situation, is to be willing to change your mind. Keep that in mind when you interact with someone who disagrees with you. They're probably not evil. They might not be stupid. They may not even be wrong. They have reasons for believing what they believe, just like you do. They might not be good reasons, but you can't determine that until you know what they are.<br /><br />Note that I'm not saying you should blindly accept what someone who disagrees with you says. But nor should you blindly reject them either. You should be willing to listen to their arguments, and honestly evaluate them. Even for things you're absolutely sure are true, because those are the things you're least likely to question on your own.<br /><br />So, always be willing to keep an open mind. Someone who disagrees with you might know something you don't.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-11662101613955425972016-05-30T18:12:00.000-04:002016-05-30T18:12:10.543-04:00Socially Subjective Facts<a href="https://en.wikipedia.org/wiki/Philosophical_realism">Philosophical realism</a> is the idea that there is an objective reality that exists independently of our beliefs. I think philosophical realism is <a href="http://slithytovesandborogoves.blogspot.com/2012/01/reality-is-objective.html">obviously true</a>, and it always surprises me to find out there are people who don't (which includes nearly 20% of <a href="http://philpapers.org/surveys/results.pl">professional philosophers</a>).<br /><br />However, there is a sense in which non-realism actually makes sense.<br /><br />For example, money. There is almost nothing useful you can do with a dollar bill. What few things you can do with it (like burning it for heat) can be better achieved with other, more readily available materials (like wood). The only reason money is valuable, is because people believe it's valuable. We're willing to trade useful items for money, because we know everyone else is also willing to trade useful items for money, not because the money itself is useful.<br /><br />Many things in society are like that. The leader of a organization is the person whose orders are followed, and people follow the orders of the person they believe is the leader of the organization. Laws are what police and judges enforce, and police and judges enforce what they believe the laws are. Art is whatever people believe art is.<br /><br />I'd go so far as to say that most people's experiences are shaped more by these socially subjective facts, than by physically objective facts. Maybe that has something to do with some people's rejection of even physical realism.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com2tag:blogger.com,1999:blog-6653882419420268456.post-11138454665444022352016-01-27T00:51:00.001-05:002016-01-27T00:51:22.305-05:00Binary Subtraction and Two's Complement<a href="http://slithytovesandborogoves.blogspot.com/2014/11/binary-addition.html">A while ago</a>, I talked about how to use <a href="http://slithytovesandborogoves.blogspot.com/2013/11/boolean-algebra.html">Boolean algebra</a> to add two binary numbers. Now I'm going to show you how you can do subtraction in a similar way.<br /><br />To start with, I'm going to ignore negative numbers. I'll get to those later, but for now, for simplicity's sake, I'm going to assume the first number will always be larger than the second, so the answer will always be positive.<br /><br />Let's start again with 1-bit numbers. 1-1=0, 1-0=1, 0-0=0, so we have this truth table:<br /><br /><table><tbody><tr><th>X</th><th>Y</th><th></th><th>Z</th></tr><tr><td>0</td><td>0</td><td></td><td>0</td></tr><tr><td>0</td><td>1</td><td></td><td>?</td></tr><tr><td>1</td><td>0</td><td></td><td>1</td></tr><tr><td>1</td><td>1</td><td></td><td>0</td></tr></tbody></table><br />The question mark is to denote a value that can be either 1 or 0. We don't care about that particular value, because it would be negative. Because of that value, there are two functions that satisfy this truth table: X XOR Y, and X AND ¬Y.<br /><br />Extending this to multiple digits is similar to extending addition to multiple bits, but instead of sometimes needing to carry, we'll sometimes need to borrow. The difference between carrying and borrowing is that instead of adding one to the next digit to the left, you subtract one from the next digit to the left, and you borrow in cases where the result would be less than 0, instead of greater than 1.<br /><br /><table><tbody><tr><th>X</th><th>Y</th><th>B<sub>N-1</sub></th><th></th><th>Z</th><th>B<sub>N</sub></th></tr><tr><td>0</td><td>0</td><td>0</td><td></td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>1</td><td></td><td>1</td><td>1</td></tr><tr><td>0</td><td>1</td><td>0</td><td></td><td>1</td><td>1</td></tr><tr><td>0</td><td>1</td><td>1</td><td></td><td>0</td><td>1</td></tr><tr><td>1</td><td>0</td><td>0</td><td></td><td>1</td><td>0</td></tr><tr><td>1</td><td>0</td><td>1</td><td></td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td><td>0</td><td></td><td>0</td><td>0</td></tr><tr><td>1</td><td>1</td><td>1</td><td></td><td>1</td><td>1</td></tr></tbody></table><br /><br />B<sub>N-1</sub> indicates whether a borrow was required for the digit to the right of the current one, and B<sub>N</sub> indicates whether the current digit requires a borrow. For the rightmost digit, B<sub>N-1</sub> is 0.<br /><br />So, Z = X XOR Y XOR B<sub>N-1</sub>, and B<sub>N</sub> = (¬X AND Y) OR (¬X AND B<sub>N-1</sub>) OR (Y AND B<sub>N-1</sub>)<br /><br />Now, what about negative numbers? For that matter, how do we even represent negative numbers? Computers only have 1 and 0, there's no -.<br /><br />Well, there are a number of ways you could do that. You could for example designate one bit to be a sign bit, where one value indicates positive, and the other negative. Normally, the sign bit is the leftmost digit, and normally 0 indicates positive. So, 0101 would be 5, while 1101 would be -5.<br /><br />This particular method has the disadvantage of wasting a number, because 000 and 100 represent 0 and -0, which are equal. It also requires different algorithms for adding and subtracting negative numbers.<br /><br />Wouldn't it be nice if there were a representation of negative numbers that allowed the use of the same algorithms for both positive and negative numbers? Well, there is one, it's called <a href="https://en.wikipedia.org/wiki/Two%27s_complement">two's complement</a>.<br /><br />It's not very intuitive, but it's very convenient for doing these bitwise functions. Like the method I just described, the leftmost digit is a sign bit, and 0 represents positive. But instead of the rest of the bits being the same as the positive representation, you flip all the bits, and then add 1.<br /><br />0101 would still be 5. To get the bits for -5, first start by replacing every 1 with a 0, and every 0 with a 1, so we get 1010. Then add 1, so we get 1011. If the rightmost digit is 1, it carries the way you would expect, so -3 ⇒ 0100 ⇒ 1011 ⇒ 1100.<br /><br />Notice what happens when you try to represent -0 like before. 0000 ⇒ 1111 ⇒ 0000. So, there's only one possible representation of 0. 1000 would represent -8. In general, with N bits, the highest number you can represent is 2<sup>N-1</sup>-1, and the lowest is -2<sup>N-1</sup><br /><br />When you use two's complement, you can use exactly the same algorithm I described above to subtract with both positive and negative numbers. You can also add using the same algorithm I described in my previous post.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-84067317602807391202015-09-25T00:31:00.000-04:002015-09-25T00:31:31.942-04:00Very UniqueSome people object to using a modifier like "very" or "a little" with the adjective "unique". They say that "unique" means "one of a kind", and that is a strict binary.<br /><br />Well, they're wrong. "Unique" is not a strict binary. As with most other things, it's a continuum, and things can be more or less unique.<br /><br />For example, consider the Wright brothers. They built bicycles. At first, their bicycles we made using the same designs as any other bicycle. It would be safe to say they weren't unique. But the Wright brothers were inventive fellows, and they came up with ways to improve the design of their bicycles. At that point, their bicycles were unique. There were no other bicycles like them. Then they built an even more unique machine. A machine that did something no previous machine had done. The bicycles were unique, but they were still bicycles. The airplane was a whole new thing.<br /><br />Another example. Consider two books. One is full of old tropes and tired clichés. Utterly predictable, but not plagiarized. It's not unique in that it mimics other books, but it is unique in that it consists of a sequence of words that had never been written before. The other book is more original. It's unique in that no other book has a similar plot, but it's not unique in that it still consists of words printed on paper. The latter book is more unique than the first.<br /><br />There are many ways something can be one of kind, and the more ways that apply, the more unique a thing is.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-4476678947765885102015-09-18T00:53:00.001-04:002015-09-18T00:53:36.840-04:00The Sun of GodDo you believe in the sun? Do you think that the sun exists?<br /><br />I certainly do. I've never doubted the sun's existence, even when it was out of sight. And I don't think anyone else has either. Certainly, I've never heard of anyone who claimed that the sun doesn't exist. Even solipsists, I'd be willing to bet, would admit that they perceive the sun, even if they deny that their perceptions are indicative of reality.<br /><br />People even agree on details about the sun, even when those details change, and vary from place to place. Someone in China will say the sun is up at the same time someone in America will say the sun is down, but both will agree that the other is correct for their location.<br /><br />Why are people in such unanimous agreement about the sun? Is a supernatural entity using telepathy to mind-control us? No, the reason we agree about it, is because we can <i>see</i> it. The evidence for its existence is right there, clear as day.<br /><br />Some people say that the evidence for god is clear and obvious, but it's clearly not as obvious as the evidence for the sun. If it were, there wouldn't be such disparate religions. Christians, Muslims, Hindus, Buddhists... People can't even agree on whether god exists, let alone specific details about him.<br /><br />Some people say that god wants us to believe in him. But surely an omnipotent would be capable of performing a feat that an inanimate object has managed. If god wants us to believe in him, he must not want it very much.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-34579675808748903562015-06-04T00:17:00.000-04:002015-06-04T00:17:57.002-04:00UltronNote: This post contains spoilers of Avengers 2: Age of Ultron.<br /><br />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.<br /><br />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.".<br /><br />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.<br /><br />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.<br /><br />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.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-72810308455642425612015-05-11T22:33:00.000-04:002015-05-11T22:35:48.829-04:00Redefining MarriageConservatives 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 <a href="http://www.patheos.com/blogs/wwjtd/2015/01/when-christians-say-we-cant-redefine-marriage/">to point out the many times marriage</a> <a href="http://sites.duke.edu/peghelminski/redefining-marriage/">has been redefined in the past</a>. However, I think the argument can be refuted on another level: Gay marriage is not a redefinition of marriage.<br /><br />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.<br /><br />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.<br /><br />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.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-42122413959841115172014-12-09T15:15:00.001-05:002014-12-09T15:16:45.599-05:00Quis 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.<br /><br />But that doesn't matter, when the whole system is bad.<br /><br />When a police officer can <a href="http://en.wikipedia.org/wiki/Death_of_Eric_Garner">kill someone with no provocation, on camera, and get away with it</a>, 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.<br /><br />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.<br /><br />"With great power comes great responsibility." Unless you're a cop.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-27035100410342175592014-11-24T21:28:00.001-05:002014-11-24T21:28:31.637-05:00Binary AdditionBefore, I talked about how to use <a href="http://slithytovesandborogoves.blogspot.com/2014/10/binary.html">binary</a> to represent a number using only <a href="http://slithytovesandborogoves.blogspot.com/2013/11/boolean-algebra.html">two</a> <a href="http://slithytovesandborogoves.blogspot.com/2013/12/de-morgans-law-and-duality.html">values</a>. But what if you want to actually do something with those numbers? How do you add numbers using Boolean operations?<br /><br />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 <b>b</b>inary dig<b>it</b> 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.<br /><br />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.<br /><br />So, the function for the rightmost digit has to satisfy this truth table:<br /><table><tbody><tr><th>X</th><th>Y</th><th></th><th>Z<sub>0</sub></th></tr><tr><td>0</td><td>0</td><td></td><td>0</td></tr><tr><td>0</td><td>1</td><td></td><td>1</td></tr><tr><td>1</td><td>0</td><td></td><td>1</td></tr><tr><td>1</td><td>1</td><td></td><td>0</td></tr></tbody></table>What Boolean operation does that look like? <a href="http://en.wikipedia.org/wiki/Exclusive_or">XOR</a>.<br /><br />The function for the next digit will have to satisfy this truth table:<br /><table><tbody><tr><th>X</th><th>Y</th><th></th><th>Z<sub>1</sub></th></tr><tr><td>0</td><td>0</td><td></td><td>0</td></tr><tr><td>0</td><td>1</td><td></td><td>0</td></tr><tr><td>1</td><td>0</td><td></td><td>0</td></tr><tr><td>1</td><td>1</td><td></td><td>1</td></tr></tbody></table>That's the same as the AND operation.<br /><br />I'm using the subscripts here to indicate which digit in the overall number. So our two bit answer Z has the individual bits Z<sub>1</sub>Z<sub>0</sub>, where Z<sub>1</sub> = X AND Y, and Z<sub>0</sub> = X XOR Y;<br /><br />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.<br />So, now we have these two truth tables:<br /><table><tbody><tr><th>X<sub>1</sub></th><th>Y<sub>1</sub></th><th>C</th><th></th><th>Z<sub>1</sub></th></tr><tr><td>0</td><td>0</td><td>0</td><td></td><td>0</td></tr><tr><td>0</td><td>1</td><td>0</td><td></td><td>1</td></tr><tr><td>1</td><td>0</td><td>0</td><td></td><td>1</td></tr><tr><td>1</td><td>1</td><td>0</td><td></td><td>0</td></tr><tr><td>0</td><td>0</td><td>1</td><td></td><td>1</td></tr><tr><td>0</td><td>1</td><td>1</td><td></td><td>0</td></tr><tr><td>1</td><td>0</td><td>1</td><td></td><td>0</td></tr><tr><td>1</td><td>1</td><td>1</td><td></td><td>1</td></tr></tbody></table><table><tbody><tr><th>X<sub>1</sub></th><th>Y<sub>1</sub></th><th>C</th><th></th><th>Z<sub>2</sub></th></tr><tr><td>0</td><td>0</td><td>0</td><td></td><td>0</td></tr><tr><td>0</td><td>1</td><td>0</td><td></td><td>0</td></tr><tr><td>1</td><td>0</td><td>0</td><td></td><td>0</td></tr><tr><td>1</td><td>1</td><td>0</td><td></td><td>1</td></tr><tr><td>0</td><td>0</td><td>1</td><td></td><td>0</td></tr><tr><td>0</td><td>1</td><td>1</td><td></td><td>1</td></tr><tr><td>1</td><td>0</td><td>1</td><td></td><td>1</td></tr><tr><td>1</td><td>1</td><td>1</td><td></td><td>1</td></tr></tbody></table>So, Z<sub>1</sub> = X<sub>1</sub> XOR Y<sub>1</sub> XOR C and Z<sub>2</sub> = (X<sub>1</sub> AND Y<sub>1</sub>) OR (X<sub>1</sub> AND C) OR (Y<sub>1</sub> 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 = X<sub>0</sub> AND Y<sub>0</sub>.<br /><br />Each subsequent bit works just like the second, with the second bit of the previous result being carried over. Generally, and Z<sub>n</sub> = (X<sub>n</sub> AND Y<sub>n</sub>) OR (X<sub>n</sub> AND C<sub>n-1</sub>) OR (Y<sub>n</sub> AND C<sub>n-1</sub>), and C<sub>n</sub> = X<sub>n</sub> XOR Y<sub>n</sub> XOR C<sub>n-1</sub>.<br /><br />Here's another challenge for you: How do you do subtraction in a similar manner?Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-51016997232894730832014-11-02T18:21:00.000-05:002014-11-02T18:21:12.529-05:00Utilitarianism, Capitalism and Utility MonstersA common criticism of utilitarianism is the idea of a <a href="http://en.wikipedia.org/wiki/Utility_monster">utility monster</a>. 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 <i>everything</i> more than Bob does? <a href="http://www.smbc-comics.com/?id=2569">Then you should take Bob's stuff and give it to Alice, because that will maximize total utility</a>.<br /><br />On a separate note, utilitarianism and capitalism go really well together.<br /><br />Utilitarianism says you should try to maximize <a href="http://en.wikipedia.org/wiki/Utility">utility</a>. 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.<br /><br />Before, I talked about the <a href="http://slithytovesandborogoves.blogspot.com/2013/12/the-spherical-cows-of-economics.html">spherical cows of economics</a>, that is, the conditions under which the free market is maximally efficient. One of those spherical cows in <a href="http://atheistethicist.blogspot.com/2012/10/failures-in-romneys-economic-proposals_25.html">economic equality</a>. 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.<br /><br />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.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-45573350780195653932014-10-26T22:07:00.000-04:002014-10-26T22:09:40.510-04:00BinaryBefore, I talked about some of the things computers can do using only <a href="http://slithytovesandborogoves.blogspot.com/2013/11/boolean-algebra.html">two</a> <a href="http://slithytovesandborogoves.blogspot.com/2013/12/de-morgans-law-and-duality.html">values</a>. 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.<br /><br />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?<br /><br />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.<br /><br />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 <i>again</i>, but with a 3 this time.<br /><br />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.<br /><br />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.<br /><br />First, you have to memorize a sequence of symbols: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].<br />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.<br /><br />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...<br /><br />Or you could use this sequence: [0, 1]. Then you would count 0, 1, 10, 11, 100, 101, 110, 111, 1000...<br /><br />And that's what binary is. Counting, with only 0 and 1.<br /><br />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?<br /><br />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.<br /><br /><table style="text-align: right;"> <tbody><tr><td>Base ten</td><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td><td>9</td><td>10</td><td>11</td><td>12</td></tr><tr><td>Binary</td><td>0</td><td>1</td><td>10</td><td>11</td><td>100</td><td>101</td><td>110</td><td>111</td><td>1000</td><td>1001</td><td>1010</td><td>1011</td><td>1100</td></tr></tbody></table><br />But that's going to be cumbersome for large numbers. Is there an easier way? <br /><br />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.<br /><br />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.<br /><br />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 <i>again</i>. So in binary, you get the ones place, the twos place, the fours place, the eights place, and so on.<br /><br />So, for example, let's try that on this binary number: 101011<br />The rightmost digit is 1, and it's in the ones place, so it's equal to 1.<br />The next digit is 1, and it's in the twos place so it's 1*2 = 2.<br />The next digit is in the fours place, but it's 0, and 0 times anything is still 0, so it's 0.<br />The next digit is 1, and it's in the eights place, so it's 8.<br />The next digit is in the sixteens place, but it's 0.<br />The next digit is in the thirty-twos place, so it's 32.<br />So, the value is 32 + 8 + 2 + 1 = 43.<br /><br />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.<br />To continue we need to divide 28. 28 / 2 = 14 remainder 0. The next digit in our binary number is 0.<br />14 / 2 = 7 remainder 0.<br />7 / 2 = 3 remainder 1.<br />3 / 2 = 1 remainder 1.<br />1 / 2 = 0 remainder 1.<br />So our binary number is 111001.<br /><br />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.<br /><br />And that is how you can represent numbers, using only 0 and 1.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-75928079585961835572014-08-18T20:48:00.000-04:002014-08-18T20:48:44.215-04:00Can't Touch ThisA surprisingly common notion that comes up in science popularization is that nothing ever touches. This comes up things from <a href="https://www.youtube.com/watch?v=yE8rkG9Dw4s">youtube videos</a> 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.<br /><br />But I wouldn't say that means nothing ever touches. Rather, it's a microscopic description of the macroscopic phenomenon of touch.<br /><br />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.<br /><br />But that doesn't mean that temperature doesn't exist. Rather, that's what temperature <i>is</i>. 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.<br /><br />I would argue the same applies to touch. Electrons repelling each other is what touching <i>is</i>.<br /><br />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.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-46188050697986913552014-08-07T00:00:00.000-04:002014-08-07T00:00:50.592-04:00The Monty Hall ProblemSuppose you're on a game show, and you're presented with three closed doors. Behind one of the doors is a car, and behind the other two are goats. You pick a door, let's say door 1. Before opening that door, the host, Monty Hall, opens a different door, let's say door 2, revealing a goat, and asks you if you want to switch which door you choose. Should you switch?<br /><br />Counter-intuitively, the standard answer is yes. There is a 2/3 probability that the car is behind door 3, and only a 1/3 probability that the car is behind door 1. I'll prove it with math.<br /><br />Bayes theorem says<a href="http://1.bp.blogspot.com/-TsZzcPBeSQ0/U-L303UrHbI/AAAAAAAACOE/17AHsRkiJTI/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://1.bp.blogspot.com/-TsZzcPBeSQ0/U-L303UrHbI/AAAAAAAACOE/17AHsRkiJTI/s1600/1.png" /></a><span style="text-align: center;">. In English, the probability of a hypothesis H given a piece of evidence E is equal to the probability of the evidence given the hypothesis times the prior probability of the hypothesis divided by the prior probability of the evidence</span><br /><br />Let's define a few variables. We'll say C1, C2 and C3 stand for the car being behind door 1, 2 or 3, respectively. We'll also say O1, O2 and O3 stand for Monty opening door 1, 2 or 3, revealing a goat.<br /><br />So, what we're interested in finding is P(C3|O2) or P(C1|O2). So, let's plug our variables into the equation.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-VIMTzCqG_nI/U-L4FkdsacI/AAAAAAAACOM/jmBO398t3Ws/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-VIMTzCqG_nI/U-L4FkdsacI/AAAAAAAACOM/jmBO398t3Ws/s1600/2.png" /></a></div><br />Ok, so what are each of those terms? Well, P(O2|C3) = 1. Monty can't open the door you chose, and he's not going to open the door with the car. That only leaves one option. P(C3) = 1/3. With no information, we have to assume there's equal probability for the car to be behind each door.<br /><br />By the <a href="http://en.wikipedia.org/wiki/Law_of_total_probability">law of total probability</a>,<a href="http://2.bp.blogspot.com/-vpE1WlhaaHs/U-L4M2RoewI/AAAAAAAACOU/sSyeuRCeVww/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-vpE1WlhaaHs/U-L4M2RoewI/AAAAAAAACOU/sSyeuRCeVww/s1600/3.png" height="15" width="400" /></a>, since Monty can choose either door 2 or door 3. P(O2|C2) = 0, since Monty won't open the door with the car behind it. Thus<a href="http://2.bp.blogspot.com/-e7FUCuWnejA/U-L4VZkVa0I/AAAAAAAACOc/S5tP-5ntWSs/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-e7FUCuWnejA/U-L4VZkVa0I/AAAAAAAACOc/S5tP-5ntWSs/s1600/4.png" /></a><br /><br />Plugging those numbers back into the equation, we get<a href="http://2.bp.blogspot.com/-JAsYGLpwKso/U-L4gRnAExI/AAAAAAAACOk/fFoVKUusRG0/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://2.bp.blogspot.com/-JAsYGLpwKso/U-L4gRnAExI/AAAAAAAACOk/fFoVKUusRG0/s1600/5.png" /></a>. By the same logic,<a href="http://4.bp.blogspot.com/-yxVpFQ3ymMg/U-L4mHXU5OI/AAAAAAAACOs/DtQ-KKVDPmM/s1600/6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://4.bp.blogspot.com/-yxVpFQ3ymMg/U-L4mHXU5OI/AAAAAAAACOs/DtQ-KKVDPmM/s1600/6.png" /></a><span style="text-align: center;">.</span><br /><br />Here's another way to think about it. When you pick door 1, it either has the car behind it (probability 1/3) or it doesn't (probability 2/3). When Monty opens door 2, it doesn't change those probabilities. There's still a 1/3 probability your door has the car, and a 2/3 probability your door doesn't have the car. Since door 2 now has a probability 0 of having the car, that means door 3 must have the whole 2/3rds.<br /><br />But what's really interesting to me about the Monty Hall problem is that it's not just dependent on what Monty does, it's also dependent on why he does it. Everything I've said is true for the standard problem, in which Monty <i>always </i>opens a door, and <i>always</i> reveals a goat. But if those things change, Monty can perform exactly the same actions, and get exactly the same results, but we'll still get different probabilities.<br /><br />For example, suppose Monty only opens another door if you picked the door with the car. You pick door 1, and Monty opens door 2, revealing a goat. Should you switch? In that case, you definitely don't want to switch, because Monty wouldn't have opened a door at all if you had guessed incorrectly the first time. In this case, P(O2|C3) = 0, so P(C3|O2) = 0, and P(O2) = P(O2|C1)*P(C1), so P(C1|O2) = 1.<br /><br />Alternatively, suppose Monty always opens a door, but opens one of the two you didn't pick at random. Again, you pick door 1, and Monty opens door 2, revealing a goat. It's possible Monty could have opened door 2 and revealed the car, but not this time. In this case, the probability that the car is behind door 1 and the probability that the car is behind door 3 are both 1/2. The reason is that he's twice as likely to open a goat door if you've chosen the car door than if you had not chosen the car door, so you do get information about the door you chose.<br /><br />You can also find that using Bayes' theorem as before. P(O2|C2) = 0, since the goat can't be behind the door with the car. P(O2|C1) = P(O2|C3) = 1/2, since there's a 1/2 probability that Monty will open door 2, regardless of which door the car is behind.<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-n-m7o9bTRHg/U-L4wBAMCNI/AAAAAAAACO0/1_PvLvRLSxA/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-n-m7o9bTRHg/U-L4wBAMCNI/AAAAAAAACO0/1_PvLvRLSxA/s1600/7.png" height="32" width="400" /></a></div><br /><br />But what if you don't know what strategy Monty is following? What if all you know is that there's a car behind one of the three doors, you picked door 1 and Monty opened door 2, revealing a goat. Maybe he's making a decision based on one of the three strategies I just described. Maybe he's using some other strategy. How do you calculate the probabilities then? What decision should you make?<br /><br />I honestly have no idea.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-16713146854894658942014-08-03T00:55:00.000-04:002014-08-03T00:55:15.319-04:00A Defense of the Free MarketI've written before in <a href="http://slithytovesandborogoves.blogspot.com/2012/02/defense-of-government.html">defense</a> of <a href="http://slithytovesandborogoves.blogspot.com/2012/09/reclaim-socialism.html">socialism</a>, but that doesn't mean I'm opposed to the free market. Quite the opposite, in fact. The free market is a very powerful tool, and under the <a href="http://slithytovesandborogoves.blogspot.com/2013/12/the-spherical-cows-of-economics.html">right conditions</a> it's maximally efficient.<br /><br />However, like any tool, it can be misused and abused. But that doesn't mean it should be completely banned, just that it should be used in a carefully controlled manner. There are those who think that regulating a market makes it non-free, but they're wrong. Regulations can help establish the conditions a free market needs to work efficiently.<br /><br />One of the best uses for the free market is the production of luxuries, for example, video games. They're not a necessity, like medical care, so no will die if they can't afford them. They're not a natural monopoly, like electrical transmission, so lots of people can make them and drive competition. They don't have significant externalities, like pollution, so the costs and benefits are primarily borne by the buyers and sellers. And the free market environment is great for the spurring greater innovation and variety.<br /><br />That is exactly the kind of thing for which the free market should be used.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-65676305731398215272014-06-30T23:53:00.000-04:002014-06-30T23:53:45.691-04:00Religious ExemptionsToday, the Supreme Court <a href="http://www.scotusblog.com/case-files/cases/sebelius-v-hobby-lobby-stores-inc/">ruled</a> that Hobby Lobby doesn't have to provide its employees with insurance that covers contraception, because that would violate Hobby Lobby's religious freedom. Legally speaking, the Supreme Court probably made the right decision. The Affordable Care Act has a religious exemption written into it.<br /><br />That's the problem. Laws shouldn't have religious exemptions. I'm not just talking about this law, I'm talking about any law. Or rather, no law should have a specifically religious exemption. Laws can have exemptions that include religious reasons, but they shouldn't be exclusive to religious reasons.<br /><br />There are two reasons for this. One is that <a href="http://slithytovesandborogoves.blogspot.com/2012/09/blasphemy-day-freedom-of-belief.html">religious belief shouldn't be treated any differently than any other belief</a>. If a religious conviction is enough to exempt you from a law, then a secular conviction should be as well. Otherwise you would be elevating religious beliefs above secular beliefs.<br /><br />The second reason is that it violates the separation of church and state. You might not think so, since usually religious exemptions are intended to prevent laws from hindering the free exercise of religion. But that's the problem. It forces the government to decide what is or is not a valid religious belief to qualify for an exemption.<br /><br />Not only does that violate separation of church and state, it does so in a way that is biased against minority religions. Members of major religions generally won't have any problems convincing a judge that their belief is sincere. Only members of small religions will have to worry about not being allowed to practice their religion freely, which seems like exactly the kind of thing that freedom of religion is supposed to prevent.<br /><br />But what about free exercise of religion then? Well, generally laws are passed for reasons. If those reasons are good, they probably apply to everyone, religious and non. You can't murder people, even if you really truly believe that the god Huitzilopochtli needs them to make the sun rise.<br /><br />If a religious exemption is really necessary, it can probably be rephrased to be secular, and still apply to the religious. For example, non-profit organizations are tax-exempt, whether they're churches or not. (Though current law more or less automatically gives religious organizations non-profit status, which is the kind of thing I'm arguing against here.)<br /><br />And if that's not possible, maybe the law shouldn't be a law in the first place. If "I really truly believe in <insert deity="" here="" name="">" is a good enough reason to be exempt from a law, then "I really truly believe in <insert here="" secular="" value="">" should be as well, based on religious beliefs not being treated differently than secular beliefs. And if that's good enough, then pretty much anyone who doesn't want to follow the law doesn't have to, which completely defeats the purpose of it being a law in the first place.</insert></insert>Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-83219492357864439312014-05-22T20:56:00.000-04:002014-05-22T20:56:17.131-04:00Prescriptivism and DescriptivismOn the internet and in newspapers, it's not uncommon to see rants about how our language is deteriorating. Words that meant one thing fifty years ago are used completely differently today. New words are made up and used as if they were cromulent. Kids these days speak grammatically uncorrectly.<br /><div><br /></div><div>And generally there will be responses to those about how that's a <a href="http://en.wikipedia.org/wiki/Linguistic_prescription">prescriptivist</a> way of thinking, and prescriptivism is linguistically incorrect. <a href="http://en.wikipedia.org/wiki/Linguistic_description">Descriptivism</a> is the only correct way of talking about language. Language is always changing, and words have no inherent meaning.</div><div><br /></div><div>While in this context, the prescriptivists are usually completely wrong, I can't completely agree with descriptivists.</div><div><br /></div><div>It's true that linguistics is descriptive. As a science, it has to be. The goal of linguistics is to study language to learn about how it works, and you can't learn about how something works by telling it to work differently. Kepler didn't discover the <a href="http://en.wikipedia.org/wiki/Kepler's_laws_of_planetary_motion">laws of planetary motion</a> by insisting that they <i>ought</i> to orbit the sun in perfect circles.</div><div><br /></div><div>But the scientific study of language is not the only way to interact with it. It's not even the most common way. The most common way of using language is the way we're using it right now - to communicate. Reading, writing, speaking, listening. And when you actually use a language, not just to study, but to communicate, you can't avoid being at least a little bit prescriptivist.<br /><br />If you're trying to use words to communicate, you have to ascribe meaning to them. And if the meanings you ascribe to your words are different than the meanings the people you're trying to communicate with do, then you'll have a very hard time communicating. If you want to communicate with a large group of people, you have to get them to all use the same meanings for the same words. Words don't have inherent meaning, but it's a very useful fiction.<br /><br /><br /></div><div><br /></div>Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-24036926261361461172014-02-18T00:56:00.000-05:002014-02-18T00:56:25.920-05:00Ken Ham and EvidenceA couple weeks ago Bill Nye and Ken Ham had a debate about creationism. Of course, nearly every point Ham made was factually inaccurate. But beyond having the simple facts wrong, Ham also had a fundamental misunderstanding about the nature of evidence.<br /><br />This was highlighted most clearly in Ham's answer to the question "What could change your mind?". His answer was, summarized, "Nothing". Now, this answer in and of itself is a serious strike against Ham's rationality. The point of changing your mind is to make your beliefs more accurate. If you don't even admit the possibility of changing your mind, you're saying that your beliefs cannot possibly be wrong, which is, well, arrogant to say the least.<br /><br />But it's worse than just that. Ham also said that the Bible makes testable predictions. Alone, that's not a bad thing, quite the opposite. But when combined with his statement that nothing could change his mind, it shows that he doesn't understand the point of predictions. The point of predictions is to provide evidence, but the thing is, that evidence can go either way.<br /><br />If you make a prediction and perform a test, and the results of the test match the prediction, then that is evidence that supports your beliefs. On the other hand, if you make a prediction, and perform a test, and the results don't match the prediction, then that is evidence that opposes your beliefs. If there is no such outcome that would go against your prediction, then it's not a prediction at all.<br /><br />For example, suppose I held a rock, and based on my beliefs about the material it's made of, and the laws of physics, I predicted that when I let it go, it would fall down. Then, if I dropped it, and it fell down, that would be evidence in support of my beliefs. But, if I dropped it, and it didn't fall down, either falling up, or hovering in place, or anything else, that would be evidence opposing my beliefs. If I had predicted that when I let it go, either it would fall down, or it wouldn't, then I haven't actually made a prediction. I haven't, in any way, specified what the result of a test would be, which means no outcome can oppose my beliefs, but no outcome can support them either.<br /><br />If Ham thinks the Bible really does make predictions, then those predictions failing to come true should change his mind. If nothing could change his mind, then his predictions can't actually provide evidence.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-27377279008906964842014-01-20T19:38:00.000-05:002014-01-20T19:38:55.835-05:00Folk Morality<a href="http://www.scientificamerican.com/article/folk-science/">Folk science</a> is pre-scientific ideas about how the world works. For example, a common idea in folk physics is that an object in motion requires a constant force to stay in motion, and if the force stops being applied, the object will soon come to a halt.<br /><br />Now, folk science is not always wrong. It actually tends to be very good at predicting what happens in everyday circumstances. If you're pushing a cart, the carts stops moving when you stop pushing. It's when you leave everyday circumstances that folk science fails.<br /><br />I think the same idea applies to morality. Folk morality is what people generally use when making moral decisions. It doesn't have any kind of rigor or theory behind it, but in everyday circumstances, it works alright. Don't lie, don't steal, don't kill.<br /><br />The biggest problem with this idea is that folk science is based on things that can be directly observed. Folk morality doesn't seem to be. As a result, it's much more prone to differ between cultures and eras. For example, two hundred years ago, slavery was common and accepted, but it isn't today.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-70912373304098679192013-12-13T19:58:00.001-05:002013-12-13T19:58:53.708-05:00The Spherical Cows of EconomicsSome conservative oppose all regulations by appealing to the free market. They say the free market is the best way of distributing goods, and any regulation makes it less free. Therefore regulations make the market less efficient, which is bad.<br /><br />However, the free market is only efficient under certain conditions. For example, everyone involved has to have perfect information about the costs and benefits of their decisions. Another is that there must be no externalities, that is, all the costs and benefits of a decision must be borne by the people making the decision, not by third party bystanders.<br /><br />The thing is, these conditions rarely, if ever, actually hold. They're the <a href="http://en.wikipedia.org/wiki/Spherical_cow">spherical cows</a> of economics. And the free market is inefficient to the extent that these conditions are false.<br /><br />But government regulations can help improve these conditions, and thus make the market more efficient. For example, by requiring drug manufacturers to disclose their drugs' side effects, they can help lessen information imbalance, allowing people to make more rational decisions. Further, they can use taxes and subsidies to internalize the costs and benefits of externalities.<br /><br />So regulations do not make the free market less free. In fact, the free market needs regulations to be free.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1tag:blogger.com,1999:blog-6653882419420268456.post-84363329401578929892013-12-06T18:02:00.000-05:002013-12-06T18:03:29.754-05:00De Morgan's Law and Duality<a href="http://slithytovesandborogoves.blogspot.com/2013/11/boolean-algebra.html">Before</a>, I gave the challenge of replicating the boolean OR function using only NANDs (and replicating AND using only NORs). I'm going to show you the solution, using truth tables. A truth table is a table where you list out every possible combination of values of the inputs, and the corresponding value of the output. Here's a truth table showing the AND, OR, NAND and NOR functions.<br /><table><tbody><tr><th>X</th><th>Y</th><th></th><th>X∧Y</th><th>X∨Y</th><th>X NAND Y</th><th>X NOR Y</th></tr><tr><td>F</td><td>F</td><td></td><td>F</td><td>F</td><td>T</td><td>T</td></tr><tr><td>F</td><td>T</td><td></td><td>F</td><td>T</td><td>T</td><td>F</td></tr><tr><td>T</td><td>F</td><td></td><td>F</td><td>T</td><td>T</td><td>F</td></tr><tr><td>T</td><td>T</td><td></td><td>T</td><td>T</td><td>F</td><td>F</td></tr></tbody></table><br />You can show that two functions are equivalent by showing that they have the same output as each other for every possible combination of inputs. Here's a simple example to show that ¬X = X NAND X. <br /><br /><table><tbody><tr><th>X</th><th></th><th>¬X</th><th>X NAND X</th></tr><tr><td>F</td><td></td><td>T</td><td>T</td></tr><tr><td>T</td><td></td><td>F</td><td>F</td></tr></tbody></table><br />If you're not sure what one of the outputs should be, plug in the input values and evaluate it. F NAND F = T, and T NAND T = F, which you can see from the first truth table.<br /><br />So, here's the solution to the first part of the challenge: X∨Y = (X NAND X) NAND (Y NAND). Here's the truth table.<br /><br /><table><tbody><tr><th>X</th><th>Y</th><th></th><th>X NAND X</th><th>Y NAND Y</th><th>(X NAND X) NAND (Y NAND Y)</th></tr><tr><td>F</td><td>F</td><td></td><td>F NAND F = T</td><td>F NAND F = T</td><td>T NAND T = F</td></tr><tr><td>F</td><td>T</td><td></td><td>F NAND F = T</td><td>T NAND T = F</td><td>T NAND F = T</td></tr><tr><td>T</td><td>F</td><td></td><td>T NAND T = F</td><td>F NAND F = T</td><td>F NAND T = T</td></tr><tr><td>T</td><td>T</td><td></td><td>T NAND T = F</td><td>T NAND T = F</td><td>F NAND F = T</td></tr></tbody></table><br />Try to figure out the second part of the challenge (That is replicate the AND function using only NOR) using a truth table now. I'll wait.<br /><br />.<br /><br />.<br /><br />.<br /><br />.<br /><br />.<br /><br />.<br /><br />.<br /><br />.<br /><br />The solution to the second part is X∧Y = (X NOR X) NOR (Y NOR Y). Interestingly, it's exactly the same as the first part, except with ∨ replaced by ∧ and NAND replaced by NOR. I'll talk about that more in a bit, but first notice that since (X NAND X) = ¬X, the solution to the first part can be rewritten as X∨Y = ¬X NAND ¬Y. Also, since (X NAND Y) = ¬(X∧Y), it can be further changed to X∨Y = ¬(¬X∧¬Y). The same way, the solution to the second part can be rewritten as X∧Y = ¬(¬X∨¬Y).<br /><br />This is an example of De Morgan's Law, which says that ¬(X∧Y) = ¬X∨¬Y and ¬(X∨Y) = ¬X∧¬Y. De Morgan's Law is a very important thing to remember when doing Boolean algebra. It's a useful way of simplifying expressions, and it's vital for programmers to know.<br /><br />De Morgan's Law also ties back into the other point I made. Notice that the two forms of De Morgan's Law are the same, except with ∧ and ∨ swapped? In fact, you can take any boolean expression, swap ∧ and ∨, and swap T and F, and the expression will mean the same thing.* For example, X∧T=X, swapped X∨F=X. Also, X∧F=F, swapped X∨T=T. This property is called duality.<br /><br />Why does this happen? Keep in mind that the labels we use are arbitrary. It doesn't matter if we use T and F or 1 and 0, or if we use ∧ and ∨ or AND and OR. What matters is the relationships that hold between the symbols. And the way we've defined them, the relationships between T and ∧ are exactly the same as the relationships between F and ∨. That is, X AND Y is true if and only if both X and Y are true. X OR Y is false if and only if both X and Y are false. Those say exactly the same things, just with the names changed.<br /><br />*If the expression contains XOR, or other functions besides ∧, ∨ and ¬, those need to be rewritten to use only ∧, ∨ and ¬. Or they can be swapped with their own dual, for example, the dual of XOR is XNOR. ¬ is it's own dual.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-3606031768130943302013-12-02T22:12:00.000-05:002013-12-02T22:12:24.666-05:00What Goals Should You Have?<a href="http://slithytovesandborogoves.blogspot.com/2013/11/the-fundamental-question-of-morality.html">Last time</a>, I ended with the question, "What goals should we have?". <a href="http://slithytovesandborogoves.blogspot.com/2013/10/hypothetical-imperatives.html">Before</a>, I said that "should" only makes sense in reference to goals, so how can this question be answered?<br /><br />Obviously, using a goal to justify itself is circular reasoning. But you could justify a goal using other goals. If a goal helps you achieve your other goals, you should have it, in the same way you should do anything else that furthers your goals. Conversely, if a goal hinders your other goals, you shouldn't have it, in the same way you shouldn't do anything else that hinders your goals.<br /><br />But then, what about the other goals? How do you determine whether or not you should have them? In the same way, referring to each other. This will form an infinite regress of self-reference, but that's not necessarily insurmountable. It could probably be represented similarly to Google's <a href="http://en.wikipedia.org/wiki/PageRank">PageRank</a> algorithm, which determines the importance of a website based on the number and importance of websites that link to it.<br /><br />But doesn't that end up being just as circular as before? Well... Yes. And given two or more sets of goals which support each other equally well, and the unlimited ability to modify your goals, I don't know how you could determine which set of goals you "should" adopt. For that matter, I don't know what "should" means in that context.<br /><br />But as it happens, I don't think we do have the unlimited ability to modify our goals. I think our goals are at least partially constrained by our biological nature. We need to eat. You can deliberately refrain from doing so, but I think that's more acting on a conflicting goal rather than not having the goal to eat.<br /><br />And if that is the case, then the goals you can't change give you a starting point to base the goals you can change around.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-72224996931887457052013-11-21T23:34:00.000-05:002013-11-24T23:26:23.840-05:00Boolean AlgebraYou may have heard that computers only use the numbers 0 and 1. It's true. Everything computers do is done using electronic switches, and those switches can only be either on or off. (That's not strictly necessary. It's possible to make an electronic switch that has in-between states, but on/off is the simplest and easiest way to make a switch.) But how can computers calculate larger numbers or do all the cool things computers do, if they can only use 0 and 1? Well, one of the fundamental ideas behind how computers work is <a href="http://en.wikipedia.org/wiki/Boolean_algebra">Boolean algebra</a>.<br /><br /><a href="http://en.wikipedia.org/wiki/George_Boole">Boole</a>an algebra is a type of math that only uses two values. These two values are usually called true and false, or 1 and 0. There are three basic operations of Boolean algebra.<br /><br />NOT X, also written as ¬X is simply the opposite of X. If X is true, ¬X is false. If X is false ¬X is true. Unsurprisingly, ¬¬X=X.<br /><br />X AND Y, also written as X∧Y is true if both X and Y are true. Otherwise, it's false. The AND operation is also sometimes written as multiplication, because it works the same way. 0*0=0, 0*1=0 and 1*1=1. And just as with multiplication X*0=0 and X*1=X, no matter what X is, X∧F=F and X∧T=X, no matter what X is.<br /><br />X OR Y, also written as X∨Y is true if X is true, Y is true or both are true. The OR function is sometimes written as addition. Similar to normal addition, 0+0=0, 0+1=1 and 1+1=... Well, there's no 2, so 1+1=1. This has the properties that X∨F=X, just like X+0=X, and X∨T=T, unlike normal addition.<br /><br />You can put these operations together to get more complicated operations. For example X XOR Y, also written as X⊕Y, is true if X is true, or Y is true, but not both. It can be built out of the other operations like this (X∨Y)∧¬(X∧Y). Similarly, NAND, NOR and XNOR are made by putting a NOT in front of an AND, OR and XOR, respectively.<br /><br />Although I said there are three basic operations of Boolean algebra, there really only needs to be one. You can make every single Boolean operation out of just NAND or just NOR. For example, ¬X = X NAND X. X∧Y = ¬(X NAND Y) = (X NAND Y) NAND (X NAND Y).<br /><br />Here's a challenge for you: How can you make the OR operation, using or NAND, or complementarily, how can you make AND using only NOR?Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com2tag:blogger.com,1999:blog-6653882419420268456.post-79281649012747076182013-11-13T21:33:00.000-05:002013-11-13T21:33:28.583-05:00The Fundamental Question of MoralityThe more I think about my <a href="http://slithytovesandborogoves.blogspot.com/">last post</a>, the more I think that "What should we do?" is the most fundamental question of morality. Should you kill one person to save five? Should you ever lie under any circumstance? It seems all moral dilemmas boil down to questions of action and decision.<br /><br />But this alone doesn't really clarify matters much. It just pushes the ambiguity onto the word "should". What does it mean to say that you "should" do something?<br /><br />Well, <a href="http://slithytovesandborogoves.blogspot.com/2013/10/hypothetical-imperatives.html">I came up with a partial answer here</a>. As far as I can tell, for a "should" question to make sense, a goal is required. And I think in practice, whenever you make a decision, you do so for reasons, which can be described as goals.<br /><br />But morality isn't just about how to achieve your goals. I think most people would say it's immoral for a sociopath to kill, even if that's his goal. In fact, I think most people would say it's immoral for someone to have such a goal.<br /><br />So, maybe the most fundamental question of morality isn't "What should we do?" but rather, "What goals should we have?". But I just said "should" requires goals. How can you say what goals you should have without referring to goals? Is it even possible? If not, how can you answer the question?Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com0tag:blogger.com,1999:blog-6653882419420268456.post-76662291665601265992013-11-09T09:14:00.001-05:002013-11-09T09:14:37.596-05:00Wait, What's This Morality Stuff Again?It turns out that <a href="http://slithytovesandborogoves.blogspot.com/2013/10/does-morality-exist.html">building meta-ethics</a> <a href="http://slithytovesandborogoves.blogspot.com/2013/10/the-is-ought-problem.html">from the</a> <a href="http://slithytovesandborogoves.blogspot.com/2013/10/hypothetical-imperatives.html">ground up</a> is somewhat difficult. So I'm going to take a step back, and explicitly describe some fundamental ideas about what morality is. Hopefully this will help point in the right direction to look.<br /><br />Morality is about answering the question, "What should we do?"<br /><br />This implies that morality is about willful actions. Morality doesn't apply to things that can't act, and can't make choices.<br /><br />But morality isn't just about how to achieve your goals. It has more to do with what your goals <i>should</i> be.<br /><br />Who is left unspecified. Usually, that's interpreted to mean that the answer should be universal, that it should apply to everyone in the same way. I'm not so sure about that. Maybe it just means the question needs more detail to have an answer.<br /><br />However, morality does seem to be concerned with controlling others' actions. It's frequently used to justify doing something "bad" to someone else if they did something "bad" to you. But then again maybe that's a misapplication...<br /><br />So, that's not a lot, but it's something. Maybe it will be helpful.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com2tag:blogger.com,1999:blog-6653882419420268456.post-54030612381365604532013-10-28T22:37:00.000-04:002013-10-28T22:37:45.985-04:00Viewer's Guide to the ISSDid you know the <a href="http://slithytovesandborogoves.blogspot.com/2013/10/ode-to-iss.html">International Space Station</a> is easily visible to the naked eye? In fact, at it's brightest, it can outshine Venus! The problem is that it moves very fast (17,130 mph) so you need to know when to look, or you'll miss it.<br /><br />So, how do you know when the ISS will be overhead? One great resource is <a href="http://www.heavens-above.com/">Heavens-Above</a>. It will tell you exactly when the ISS will be visible, how long it will be visible for, and where in the sky it will be. It also has information on lots of other satellites and other things of astronomical interest.<br /><br />But sometimes it will be months before the ISS passes over your location at night. You'll need some kind of reminder after that long. That's the purpose of <a href="http://spotthestation.nasa.gov/">Spot The Station</a>. Sign up for it, and it will send you an email 12 hours before the next sighting.<br /><br />There are also apps for mobile devices that are very useful. A good one I just got is <a href="http://issdetector.com/">ISS Detector</a>.<br /><br />Also worth mentioning is <a href="http://www.wolframalpha.com/">Wolfram|Alpha</a>. It's less practical for finding good viewings, but it has lots of interesting information. Not just about <a href="http://www.wolframalpha.com/input/?i=iss">the ISS</a>, not just about <a href="http://www.wolframalpha.com/input/?i=satellites">satellites</a>, not just about <a href="http://www.wolframalpha.com/input/?i=astronomy">astronomy</a>, it knows about <a href="http://www.wolframalpha.com/examples/">pretty much everything</a>.<br /><br />So, go out and look at the sky. It's an awesome place.Alex Strinkahttps://plus.google.com/113430375687951606100noreply@blogger.com1