Some 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.

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.

The thing is, these conditions rarely, if ever, actually hold. They're the spherical cows of economics. And the free market is inefficient to the extent that these conditions are false.

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.

So regulations do not make the free market less free. In fact, the free market needs regulations to be free.

## Friday, December 13, 2013

## Friday, December 6, 2013

### De Morgan's Law and Duality

Before, 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.

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.

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.

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.

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.

.

.

.

.

.

.

.

.

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).

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.

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.

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.

*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.

X | Y | X∧Y | X∨Y | X NAND Y | X NOR Y | |
---|---|---|---|---|---|---|

F | F | F | F | T | T | |

F | T | F | T | T | F | |

T | F | F | T | T | F | |

T | T | T | T | F | F |

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.

X | ¬X | X NAND X | |
---|---|---|---|

F | T | T | |

T | F | F |

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.

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.

X | Y | X NAND X | Y NAND Y | (X NAND X) NAND (Y NAND Y) | |
---|---|---|---|---|---|

F | F | F NAND F = T | F NAND F = T | T NAND T = F | |

F | T | F NAND F = T | T NAND T = F | T NAND F = T | |

T | F | T NAND T = F | F NAND F = T | F NAND T = T | |

T | T | T NAND T = F | T NAND T = F | F NAND F = T |

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.

.

.

.

.

.

.

.

.

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).

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.

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.

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.

*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.

## Monday, December 2, 2013

### What Goals Should You Have?

Last time, I ended with the question, "What goals should we have?". Before, I said that "should" only makes sense in reference to goals, so how can this question be answered?

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.

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 PageRank algorithm, which determines the importance of a website based on the number and importance of websites that link to it.

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.

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.

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.

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.

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 PageRank algorithm, which determines the importance of a website based on the number and importance of websites that link to it.

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.

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.

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.

Subscribe to:
Posts (Atom)