Tuesday 26 November 2013

Seeing complex numbers

A number line is a picture that represents numbers as points on a straight horizontal line. As can be seen in the image, the numbers increase as you move to the right along the line and decrease as you move to the left. Zero is represented in the middle of the line, bisecting the positive and negative numbers. Fractions and irrational numbers are also representable on this line between the whole number points.

Operations such as addition, subtraction, multiplication and division are simply transformations of a number on this line. For example, to add 2 to the number 3 means to start at the number three point and then move two positions to the right along the line (in geometrical terms, this is called translation). To multiply 5 by 2 is to start at the number five point and then move right until you are twice the distance from the origin (geometrically, this is called scaling).

In the sixteenth century, a new kind of number called a complex number was introduced by Italian mathematician Gerolamo Cardano. It is expressed as a + bi where a and b are real numbers and i is termed the imaginary unit which satisfies the equation i 2 = -1. As negative numbers have applications in areas such as temperature measurement and finance, so complex numbers apply in areas such as physics and fractal geometry.

But is it possible to have an intuitive understanding of complex numbers? Didn't we learn in school that any number (including a negative number) multiplied by itself is always a positive number? So how can i 2 = -1 make any sense? What could i be?

The first step to understanding complex numbers is to extend our concept of the number line to a number plane by adding a second dimension that cuts through the number line origin. As shown in the image, this is called the imaginary dimension with i as the unit and it is perpendicular to the real dimension.

The second step is to introduce rotation around the origin as a new transformation operation. When we rotate a number on the real number line by 90o in an anti-clockwise direction, we can see that it ends up on the imaginary number line. This operation is what it means to multiply by i. If we rotate a further 90o in an anti-clockwise direction (that is, multiply by i again), then we end up back on the real number line. But we are now on the opposite side of the origin. That is, if we start at 3, multiply by i, then multiply by i again, we end up at -3. That is, 3i 2 = -3. The effect of multiplying by i 2 is simply to negate our original number by rotating 180o to the other side of the origin. If we multiply by i 2 again, then we pass through -3i and end up back where we started at 3.

Transforming a negative number into a positive number requires translation on the real number line. Transforming a complex number into a real number requires rotation on the real-imaginary plane. So what is i? The real number one rotated by 90o onto the imaginary number line. That's all it means.

Monday 25 November 2013

Seeing negative numbers

When I lived in New York City, I had the opportunity to tutor neighborhood children in subjects such as math and reading. On one occasion, the boy I was tutoring was struggling with adding negative numbers. The problem was that he lacked an intuitive grasp of what the operation meant.

The concept of adding positive numbers is easy to understand. We can take three apples, add two apples and see that we end up with five apples. We can also subtract two apples and end up with three again. But what happens if you subtract ten apples from five apples? Or add negative two apples? This no longer makes intuitive sense.

The solution is to find practical applications where the concept of negative numbers does make sense. I noticed that the floor was constructed of tiles. So I got my student to stand on a tile which we marked as the starting point (this was our number line origin). Taking a step forward to the next tile corresponded to adding the number one. Taking a step backward corresponded to subtracting the number one. It was then possible to step backwards until he was one or more tiles behind the starting point. Unlike with the apples scenario, it was now possible to "see" a negative number and meaningfully add and subtract with them.

Other practical applications of negative numbers include calculating budget deficits (as against surpluses) and measuring temperatures below freezing point. Essentially, negative numbers are applicable whenever the subject matter can be considered in terms of opposite magnitudes.

Interestingly, up until the eighteenth century, negative numbers were often considered absurd or meaningless. But as the above examples show, it is just a matter of applying them appropriately and any absurdity goes away.

Monday 11 November 2013

One trillion dollars!

You may be able to just make out a person in the bottom left corner of the image standing next to 10,000 double-stacked standard pallets each holding a million $100 bills. That's what one trillion dollars looks like.

Humans have trouble intuitively conceptualizing large numbers. A billion or a trillion can seem incomprehensibly large when you only have ten fingers. This means that any analysis involving large figures will often just confuse us rather than inform us. So, for example, when we hear that the public debt of the United States is $12 trillion, or the deficit is almost $1 trillion, it sounds both overwhelming and unsustainable. And maybe it is. But drawing that conclusion without knowing the yearly GDP figures or the historical record is unjustified.

So I thought I'd show two charts that help provide a basis for drawing conclusions. Both charts provide information as percentages instead of large dollar amounts which makes any analysis easier to understand.


US public debt as a percentage of GDP
The first chart shows the US public debt as a percentage of GDP. While the debt continually increases (and is therefore larger than it ever has been), GDP also increases and is currently $17 trillion. The current US public debt as a percentage of GDP is 73% and the 1945 high was 113%.

For comparison, the UK public debt stands at 76% of GDP with a 1947 figure of 238%. Japan's public debt is currently 220% of GDP.


US federal deficit as a percentage of GDP
The second chart shows the US federal deficit as a percentage of GDP. The current US deficit is $680 million - about 4.1% of GDP. It was $1.4 trillion in 2009 or about 10% of GDP.

The US deficit was 30% of GDP in 1945.

 

Wednesday 6 November 2013

A brief guide to US monetary policy

When demand for goods is falling (such as during a recession), a central bank can respond by lowering the short-term interest rate. This results in more borrowing and spending and higher employment. Stocks go up, investment increases, the dollar goes down and exports go up. Good times!

However a special problem with the 2008 global economic crisis was that interest rates in areas like the US and Europe were close to 0%. Unable to reduce short-term rates further, the Federal Reserve has resorted to unconventional monetary policy to reduce long term interest rates. The Fed achieves this by declaring that it will keep short-term rates low, which helps lower bond yields. And it also buys bonds on the open market which further lowers bond yields.

For example, with Quantitative Easing, the Fed credits its own account (the digital equivalent of printing money) and then uses that money to purchase government bonds on the open market from financial firms such as banks and insurance companies. This procedure increases the price of the bonds which makes them a less attractive investment. The money that firms make from the bond sales can then be invested in other companies or lent to individuals, usually at a lower interest rate to attract borrowers.

Once the US economy is in good shape, the Fed will tighten (decrease) the money supply to prevent high inflation. It will do this by selling the originally purchased bonds and then debiting its account (thus destroying the money it originally created).

Wednesday 23 October 2013

Programming fault-tolerant babies

One of the things that many new parents share with new programmers is a lack of experience with how their charges (babies or software) should best adapt to the world around them. When I became a father for the first time, one crucial goal was to ensure that my new son was getting enough sleep. So that meant making sure that his room was quiet and that people tiptoed around and spoke quietly when he was sleeping.

New programmers are often given tasks such as writing a program to read a list of numbers and calculate their average. So the programmer creates a list of ten numbers which he uses to test his program. After a while, he has a program that works perfectly. He even tries a list of five numbers and a list of twenty numbers and it continues to work perfectly.

However as soon as he releases the program into the public domain, he receives reports that it isn't working. Confused, he investigates the reports and finds out that people have lists that contain letters as well as numbers. Or they are using commas instead of spaces to separate the numbers. Or the list is empty and the program crashes with a divide-by-zero error. Or the list can't be found. The naïve programmer's first response is to tell the users that they're doing it wrong. The program expects a list of numbers so give it a list of numbers! Sheesh.

The more experienced programmer realizes that programs shouldn't crash and burn just because they can't handle the input correctly. They should give advice to the user to help them provide appropriate input and be nice about it.

Similarly with parenting young children. It is sometimes possible to create a perfectly quiet environment when you have only one child. Though it can still require a lot of effort by the parents to keep it that way. But what happens when you have visitors, or have more kids, or have noisy cars in the street? At some point it becomes easier for everyone if the baby can sleep despite the background noise or the ambient light and feed happily despite the odd location or the precise milk temperature.

Although having siblings banging loudly on the baby's door might still be input that it is better to try to prevent!

Monday 21 October 2013

Calvin and Pink

As part of a discussion on Calvinism and free will, I read A.W. Pink's 1928 essay titled "God's Sovereignty and the Human Will". He defended three theses, one of which seems sensible and two that don't.

1. People's beliefs and actions have their cause in their nature and motivations (Pink gives his examples of motivations such as "the logic of reason, the voice of conscience, the impulse of the emotions, the whisper of the tempter, the power of the Holy Spirit"). I think his basic point is right. We don't make our choices in a vacuum. You choose to open your umbrella because you don't want to get wet. You choose to tell the truth because you believe it is the right thing to do (or perhaps don't because you're trying to avoid getting in some trouble).

2. People do not choose the good and they lack any ability to do so. This denies the common experience of the good things that people often do. The Calvinist response is to either deny that those things are actually good or else state that they are outwardly good but lack any good motivation. Both responses seem to assume their conclusion by appealing to the agent's apparently unobservable "true" nature and motivation.

3. People have no ability to choose the good and they are morally responsible for not choosing the good. This also seems clearly wrong. Consider an analogous situation where you discover that a small child is drowning and that there is no way to save him except by swimming out to him. However, you can't swim and so he drowns. Can you be morally responsible for not saving him?

Thursday 17 October 2013

A Nobel effort

This year's Nobel Memorial Prize in Economic Sciences has been awarded to three path-breaking economists for their empirical analysis of asset prices.

Eugene Fama is the father of the Efficient Market Hypothesis (EMH) which states that financial markets instantly factor in all known information into asset prices. One implication of this hypothesis is that professional investors cannot outperform the market except by luck. Therefore the best strategy is to simply invest in an index fund.

Robert Shiller challenged the EMH with his findings that the volatility of stock prices is greater than would be expected by the changes in dividends. His work has been part of the behavioral revolution in economics which studies the psychological factors in economic decisions and their effect on markets.

Lars Peter Hansen developed statistical tools that greatly simplified the analysis of asset prices.

Of relevance to all this, in Thinking Fast and Slow, Daniel Kahnemen describes his statistical research that demonstrates the inability of professional investors (including fund managers) to consistently beat the market. As he puts it, "There is general agreement among researchers that nearly all stock pickers, whether they know it or not - and few of them do - are playing a game of chance. The subjective experience of traders is that they are making sensible educated guesses in a situation of great uncertainty. In highly efficient markets, however, educated guesses are no more accurate than blind guesses."

Monday 14 October 2013

A simple solution to the Gettier problem

Long ago, Plato proposed that knowledge is justified, true belief. That is, your beliefs count as knowledge if you have good evidence for them and they are actually true. Otherwise they are either mere opinions or false beliefs.

This definition seemed to reflect the common use of the term through history. However, in more recent times, Edmund Gettier provided counterexamples showing that if a belief relies on a false premise, then it won't commonly be regarded as knowledge. For example, you may believe the correct time by looking at the clock on your wall. But your belief doesn't count as knowledge if your tacit assumption that the clock is working is mistaken.

My amendment to Plato's definition is to recognize that for a conclusion to be known, any essential premises also need to be known. This is a slightly stronger formulation than William Lycan's excellent no-essential-false-assumptions analysis.

My proposal for the definition of knowledge: For S to know that P is true means that:
(1) P is justified
(2) P is true
(3) P is believed
(4) S knows that the essential premises of P (if any) are true

One intuition for this definition is that knowledge is constructed hierarchically like building blocks. If a low-level building block fails, then building blocks that sit on it are not supported and so also fail.

Thursday 10 October 2013

Plausible denial

Linda is 31 years old, single, outspoken, and very bright. She majored in philosophy. As a student, she was deeply concerned with issues of discrimination and social justice, and also participated in anti-nuclear demonstrations.

Which is more probable?
  1. Linda is a bank teller.
  2. Linda is a bank teller and is active in the feminist movement.

Also think about why you think the option you chose is more probable.

Cognitive psychologists Tversky and Kahneman posed this question in an experimental study and found that 90% of respondents chose the second option. However the correct answer is the first option. The reason it is correct is that two conditions occurring (being a bank teller and being a feminist) is less likely than for one of the conditions to occur (being a bank teller regardless of whether she is a feminist or not). Tversky and Kahneman coined this the Conjunction Fallacy.

What is true is that the second option is a more representative, more coherent and more plausible match with Linda's personality description. Linda doesn't really seem the bank teller type but being a feminist would certainly be in character. Thus, instead of making a judgment about probability, most people substitute a judgment about similarity instead.

Does this actually matter in practice? Yes, it matters when important life choices are made based on similarities rather than probabilities. For example, a doctor may diagnose a patient's illness due to symptoms being representative of a particular disease (or even of having no disease at all) when in fact other diseases are more likely.

Tuesday 8 October 2013

Conditioned thinking

Steve is a shy and tidy man. Is Steve more likely to be a librarian or a farmer?
 
With a few facts about librarians and farmers, it is possible to calculate the exact likelihood. In the US, there are twenty times more male farmers than male librarians. If four out of five librarians are shy and tidy and only one in five farmers have both those personality traits, then how likely is it that Steve is a librarian rather than a farmer?
 
Bayes' Theorem enables us to calculate the precise figure. The answer, perhaps surprisingly, is that Steve has only a seventeen percent chance of being a librarian rather than a farmer.
 
How can this be? If you guessed that Steve was more likely to be a librarian than a farmer then why does this intuitive answer contradict the calculated answer? The reason is that while we readily recognize the stereotypical personalities of librarians and farmers, we tend to ignore the general population sizes of the groups we are analyzing. The population sizes complicate the calculation, so we use a representative heuristic instead that neglects the relevant base rates.
 
The moral of the story is that we should try to identify base rate information and allow it to moderate our intuitive conclusions. In this case, the knowledge that there are many more male farmers than male librarians means that the answer is likely to be much less than Steve's resemblance to librarians suggests.
 
--
 
I came across the librarian story in Thinking, Fast and Slow by Daniel Kahneman. Working through the problem, we have:
 
  L = Librarian, S = Shy and tidy, P(L|S) is the probability of L given S

  P(L) = 1/20 [ the probability of being a librarian (actually 1:20 which is 1/21, but rounded for simplicity) ]
  P(S|L) = 4/5 [ the probability that a male librarian is shy and tidy ]
  P(S|~L) = 1/5 [ the probability that a male farmer is shy and tidy ]
  P(S) = P(S|L) * P(L) + P(S|~L) * P(~L) = 4/5 * 1/20 + 1/5 * 19/20 = 23/100 [ the probability of being shy and tidy ]

  Now plug the above values into Bayes' Theorem:
  P(L|S) = P(S|L) * P(L) / P(S) = 4/5 * 1/20 / 23/100 = 4/23 (17%) [ the probability that a shy and tidy male is a librarian ]
 

Monday 7 October 2013

Square quotes

How would you measure, with a ruler, the square root of the number two?

One way to figure it out is by reading Plato. In Meno, Socrates shows how you can construct a square with an area of eight feet from a square with an area of four feet (that is, with two-foot sides). To do this, join four squares with four-foot areas together to make a larger square with a sixteen-foot area. Then draw a line between the midpoints of the adjacent sides of the sixteen-foot square to make a new interior square (see diagram). This cuts each four-foot square in half along the diagonal. Since you have cut each four-foot square in half, you now have eight two-foot triangles, with four of the triangles joining together to make a square with an eight-foot area.

You can follow a similar procedure to create a square with a two-foot area from a square with one-foot sides. Since the area of a square is equal to the side length squared, the side length of a square with an area of two feet is the square root of the number two, now easily measurable.

Or you could skip the philosophy and just read Pythagoras instead! The square of the hypotenuse is equal to the sum of the squares of the other two sides.

Wednesday 2 October 2013

Behavioral problems

The philosopher Gilbert Ryle is probably best known for his book The Concept of Mind which argues against Cartesian Dualism. This includes the proposition that much of what we consider private mental life is inextricably linked to perfectly ordinary and publicly observable behavior. For this reason he is usually considered to be a Behaviorist. However a more careful reading of his work shows that he rejects both the Dualist and Behaviorist extremes and instead adopts a common-sense position that rejects the errors of both sides.

To illustrate this, in Thinking and Saying, Ryle gives the example of two boys - one writing a letter and the other boy mimicking him. Both the Behaviorist and the Dualist agree that the boys actions would differ only if the mimic performs additional actions that his victim does not perform. Since no extra actions were witnessed, says the Behaviorist, their actions were therefore identical. Since no extra actions were witnessed, says the Dualist, the mimic was performing extra internal, unobservable actions.

Ryle's view, in contrast, is not that there were unobservable actions or that their actions were identical, but instead that the seemingly identical actions that we did observe were of different sorts. The broader context shows that their intentions and skills were different and so therefore their actions were different. This conclusion avoids both the "Nothing But ..." of Behavioral Reductionism and the "Something Else As Well ..." of Cartesian Dualism.
 

Tuesday 1 October 2013

Thinking about thinking

What is Rodin's The Thinker doing?

Ponder it for a while. Perhaps in trying to figure it out, you are doing what The Thinker is doing.

Presumably he is having thoughts. Perhaps talking to himself. Maybe, but is that all that he is doing? A greenback dollar is a piece of paper but also more than that. What exactly is he thinking about? What is he trying to achieve?

Suppose a teacher has set you a math problem. You are trying to figure out the answer - an answer that is already known by the teacher. But is The Thinker a student? If not, then who would know the answer to his problem?

Maybe the problem has no known answer, or is not well-defined or has never been posed before. If so, then The Thinker is more like an explorer. Perhaps he doesn't know what the hoped-for destination looks like. But maybe he's had some experience in this kind of territory in the past. He makes many wrong turns but also sees some promising avenues.

Either way, he has not yet reached his destination. The discovery of any new place first requires a journey.

--

A reflection on Gilbert Ryle's The Thinking of Thoughts: What Is 'Le Penseur' Doing? and Thinking and Self-Teaching.