Thursday, September 27, 2012

What is a number?

If you are in Hong Kong and you need help for university mathematics courses, please visit www.all-r-math.com.

What is a number?

In mathematics, there is no formal definition for "number".

Really?

We have definition for natural number, negative number, rational number, complex number, real number, p-adic number, hyperreal number, cardinal number, ordinal number, etc. We just don't have the definition for "number".

Isn't mathematics a subject of vigor? How come such an extensively used term have no formal definition?

Mathematics is a subject of vigor, but the use of language is not. Indeed, at the very beginning, "number" just refers to the counting number: 1,2,3,... Latter, the need to record different types of quantities force humans to extend the number system. Just as other branch of knowledge, we like to expand the meaning of the existing names, other than invent a new name-- we do this because we would have a ridiculous large dictionary otherwise.

Indeed, even if we don't mind to have an infinitely large dictionary, we still cannot afford to have one name for one mathematical object. There are much more real numbers than all possible finite combinations of alphabets!

Monday, September 24, 2012

Marriage Problem

If you are in Hong Kong and you need help for university mathematics courses, please visit www.all-r-math.com.

Girl: I want to know my future.
Fortuneteller: I see. You will meet ten men that want to marry you.
Girl: Who will be the best?
Fortuneteller: Oh, I just can't tell!
Girl: !!!

In many Hong Kong old films, there is a know-all who loves to do fortunetelling but hold back the most important bit, and hence tragedy happens.

As the story goes, several guys have proposed to the girl, but she refuses as she dreams to have a better one coming.  The latter are worse and worse. As the magical "ten" approaches, she panics and gets married, and it turns out the best is just around the corner.

Not really too tragic. However, if the girl knows some mathematics, she may have a higher chance to marry the best one: She should refuse the first three men and she must marry once she meet a guy who is better than the first three men.

Using this strategy, her chance of marrying the best one is $0.44$, whereas if she makes her decision randomly, her chance is just $0.10$.

In general, suppose the girl knows that there will be $N$ men and she marries the first one who is better than the first $k$ guys, then her chance of marrying the best one is $$\frac{k}{N}\sum_{i=k}^{N-1}\frac{1}{n}.$$
How do we come up with this probability?
Well, the probability that the $(i+1)$-th one is the best is $\frac{1}{N}$. In this case, the girl may marry him only if the best among the first $i$ guys is one of the first $k$ guys, and hence the probability is $\frac{k}{i}$.
To find the optimal $k$ is not easy for large $N$, but it is not that hard to see that (Can you do it?) $$(N-\frac34)^{1/2}-\frac14\le k\le \frac{N}{2}.$$ In our case, $N=10$ and the optimal $k$ is $3$.

The mathematics problem has a name: Marriage Problem. (Note there are other mathematics problems of the same name.) Its another name is Secretary Problem.

Lets end this with one very important point: The girl can achieve the highest probability only if she sticks with the strategy!

Thursday, September 20, 2012

Complex Number and Treasure Hunting

If you are in Hong Kong and you need help for university mathematics courses, please visit www.all-r-math.com.

It is a well-known story among mathematics lovers, but relative unknown to outsiders:

"A guy gets a map of a treasure island. On the map, it writes: There are an oak, a pine and a gallows. Walk from the gallows to the oak, counting the steps, turn 90 degrees right and walk the counted number of steps, then mark the position. Walk from the gallows to the pine, counting the steps, turn 90 degrees left and walk the counted number of steps, then again mark the position. The midpoint of the two marks is where the treasure buried.

The guy arrives at the island, he find the oak and the pine, but the gallows is already gone without a trace..."

Simply google "treasure and complex number" and you will find many websites on this question. The pure geometric solution is not hard but a bit complicated. The simplest solution involves using the complex numbers.

A complex number is an entity of the form $a+bi$, where $a$ and $b$ are the usual real numbers and $i=\sqrt{-1}$ is a square root of $-1$. Indeed, each complex number $a+bi$ can be identified with the point $(a,b)$ on the plane.

If $Z=a+bi$ is a complex number, then $Zi=-b+ai$ is the complex number obtained by rotating $Z$ with 90 degrees left about the origin, whereas $Z(-i)=b-ai$ is the complex number obtained by rotating $Z$ with 90 degrees right about the origin.
If $Y=c+di$ is another complex number, then $W=Z+Y=(a+c)+(b+d)i$ is the complex number obtained by moving $ZO$ to $WY$.
Now, we take the midpoint between the oak and the pine as the origin, and take the oak and the pine as the $1$ and $-1$ respectively on the complex plane. Now, we let $G$ to be the gallows. The first mark is therefore $-i(G-1)+1$ and the second mark is $i(G+1)-1$ (Check them yourself!), and so the treasure is at $((-i(G-1)+1)+i(G+1)-1))/2=i$, independent of the position of the gallows. The solution!

Sunday, September 16, 2012

The amazing NAND

If you are in Hong Kong and you need help for university mathematics courses, please visit www.all-r-math.com.

In daily language and mathematical articles, we frequently use the four basic logical operations: "not", "and", "or", "if-then". However, in electronics, the most fundamental logical operation is "nand" -- the NAND ("not and") operation can be used to implement other logical operations.

The symbol for NAND gate.

The truth table of NAND is $$\begin{array}{c|c|c} p&q&p|q \\ T & T & F \\ T & F & F \\ F & T & F \\ F & F & T \end{array}$$ In other words, the output is false only if both $p$ and $q$ are true. (Note that apart from $p|q$, there are other symbols for NAND, for example $p\bar{\wedge}q$, see here.)

From NAND we can construct the four basic logical operations, which are the building blocks of the symbolic logic:

• Negation: Not $p$. $$\begin{array}{c|c} p&\neg p\\ T & F\\ F & T \end{array}$$ By comparing its truth table with the truth table of $p|p$, we see that $$\neg p = p|p.$$
• Conjunction: $p$ and $q$. $$\begin{array}{c|c|c} p&q&p\wedge q \\ T & T & T \\ T & F & F \\ F & T & F \\ F & F & F \end{array}$$ The output is true only if both $p$ and $q$ are true. It turns out that $$p \wedge q = (p|q)|(p|q).$$ Note also that $p|q = \neg (p\wedge q)$, i.e. "$p$ NAND $q$" is indeed "Not ($p$ AND $q$)".
• Disjunction: $p$ or $q$. $$\begin{array}{c|c|c} p&q&p\vee q \\ T & T & T \\ T & F & T \\ F & T & T \\ F & F & F \end{array}$$ The output is false only if both $p$ and $q$ are false. It turns out that $$p \vee q = (p|p)|(q|q).$$
• Conditional: If $p$ then $q$. $$\begin{array}{c|c|c} p&q&p\rightarrow q \\ T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \end{array}$$ The output is false only if $p$ is true but $q$ is false. It turns out that $$p \rightarrow q = p|(q|q).$$
It is also possible to build all the logical operations from the NOR ("not or") operation.

Tuesday, September 11, 2012

Triangle Centroid and Position Vectors

If you are in Hong Kong and you need help for university mathematics courses, please visit www.all-r-math.com.

We can treat points in a plane as position vectors (or simply vectors). If you have not heard about vectors before, they are mathematical objects that we can perform addition and scalar multiplication (i.e. scaling).

For instance, given two points A and B, the point X which lies on the line joining A and B such that AX:XB=r:1-r can be written as

X=(1-r)A+rB

Note that r can be any number. If r<0 then X lies on the BA extended; if 0 then X lies on the line segment AB; if r>1 then X lies on the AB extended.

In particular, 0.5A+0.5B is the mid-point of AB.

Now, given three points A, B and C. Consider

M=1/3 A+1/3 B+1/3 C

Now M=1/3 A+(2/3)(0.5B+0.5C), and so M indeed lies on the median joining A and the mid-point of BC. Likewise, it lies on the other two medians.

Therefore M is the centroid of the triangle ABC. Moreover, from the formula, we can tell that it always divides the medians in the ratio 2:1.