online advertising

Saturday, November 26, 2016

Exercise from 9gag.com?

Problem:


http://9gag.com/gag/aVDxn1O

Solution:

Denote bottle by $ b $

$ b + b + b = 30 $, therefore $ b = 10 $.

Denote the hamburger by $ h $

$ b + h + h = 20 $, therefore $ h = 5 $

Denote the beer by $ e $

$ h + e + e = 9 $, therefore $ e = 2 $.

Now here is the fun

$ \int\limits_{2h - b}^{\infty}{\frac{b\sin x}{ex}dx} = \int\limits_{0}^{\infty}{\frac{10\sin x}{2x}dx} = 5\int\limits_{0}^{\infty}{\frac{\sin x}{x}dx} = \frac{5\pi}{2} $

The last integral is well known, for example, see:
http://math.stackexchange.com/questions/5248/solving-the-integral-int-0-infty-frac-sinxx-dx-frac-pi2

This video explains the Feynman trick!
https://www.youtube.com/watch?v=3LsXWPzlOhQ

Have fun!

Wednesday, November 23, 2016

Mathematical Analysis - Exercise 1.3

Problem:


Solution:

Suppose $ n = ab $ is not prime, then we can write $ 2^{ab} = (2^{a})^b $. Applying the identity we just proved in the previous problem, we have:

$ 2^{ab} - 1 =  (2^{a})^b - 1 =  (2^{a})^b - 1^b = (2^a - 1)(\cdots) $.

Therefore if $ a \ne 1 $, we have a non-trivial factor for $ 2^{ab} - 1 $.

The contradiction show $ n $ has to be prime.

Tuesday, November 22, 2016

Mathematical Analysis - Exercise 1.2

Problem:

Solution:

The right hand side sounds like something we can telescope, let's see:

$ \begin{eqnarray*} & & (a - b)\sum\limits_{k = 0}^{n-1}{a^{k}b^{n-1-k}} \\ &=& a\sum\limits_{k = 0}^{n-1}{a^{k}b^{n-1-k}} - b\sum\limits_{k = 0}^{n-1}{a^{k}b^{n-1-k}} \\ &=& \sum\limits_{k = 0}^{n-1}{a^{k+1}b^{n-1-k}} - \sum\limits_{k = 0}^{n-1}{a^{k}b^{n-k}} \\ &=& (a^n + \sum\limits_{k = 0}^{n-2}{a^{k+1}b^{n-1-k}}) - (\sum\limits_{k = 1}^{n-1}{a^{k}b^{n-k}} + b^n ) \\ &=& (a^n + \sum\limits_{k = 1}^{n-1}{a^{k}b^{n-k}}) - (\sum\limits_{k = 1}^{n-1}{a^{k}b^{n-k}} + b^n ) \\ &=& a^n - b^n \end{eqnarray*} $

Mathematical Analysis - Exercise 1.1

Problem:


Solution:

Suppose there exists a largest prime, that means there is only finite number of primes. Consider the product of them plus 1. This number cannot be a prime number because it is larger than the largest prime.

Now consider its prime factorization. Note that when this number is divided by any prime, the remainder 1, therefore, there is just no way of prime factorizing it, contradicting the fundamental theorem of arithmetic, therefore there is no largest prime!

Monday, November 14, 2016

An exercise about Lagrange mean value theorem

Problem:


Solution:

This is a really bored after lunch hour, so I decided let's do a simple calculus exercise to wake my brain up.

The $ \frac{1}{1 + u^2} $ reminded me this has something to do with $ \tan $. So let's do this simple integration.

$ \int{\frac{du}{1+u^2}} = \int{\frac{\sec^2\theta d\theta}{1+\tan^2 \theta}} = \int{d\theta} = \theta = \tan^{-1}u $.

That's refresh my memory! $ \frac{1}{1 + u^2} $ is the derivative of $ \tan^{-1} u $.

Now we apply the Lagrange's mean value theorem to get:

$ \frac{\tan^{-1}v - \tan^{-1}u}{v - u} = \frac{1}{1 + \delta^2} $.

Where $ u < \delta < v $.

$ \tan^{-1}v - \tan^{-1}u= \frac{v - u}{1 + \delta^2} $.

Therefore we conclude (remember when you increase the denominator, the value decrease, and vice versa):

$ \frac{v-u}{1 + v^2} < \tan^{-1}v - \tan^{-1}u< \frac{v - u}{1 + u^2} $.

Last but not least, set $ u = 1 $ and $ v = \frac{4}{3} $ gives

$ \frac{\frac{4}{3}-1}{1 + \left(\frac{4}{3}\right)^2} < \tan^{-1}\frac{4}{3} - \tan^{-1}1< \frac{\frac{4}{3}-1}{1 + 1^2} $.

$ \frac{3}{25} < \tan^{-1}\frac{4}{3} - \tan^{-1}1< \frac{1}{6} $.

$ \frac{\pi}{4} + \frac{3}{25} < \tan^{-1}\frac{4}{3} < \frac{\pi}{4} + \frac{1}{6} $.

Friday, November 11, 2016

Minimizing sum of distances

Problem:

Find $ m $ such that $ \sum_{i = 1}^{n}{\left|x_i - n\right|} $ is minimized.

Solution:

The reaction is that the mean is going to minimize it, but it isn't true. The median will.

Consider a random $ m $, suppose there are $ a $ numbers in $ x_i $ are less than $ m $ and $ b $ numbers of $ x_i $ are larger than $ m $.

If we decrease $ m $ by 1, we change the sum by $ b - a $.
If we increase $ m $ by 1, we change the sum by $ a - b $.

Therefore, as long as $ a \ne b $, we can always reduce the sum, therefore, the only reasonable answer is the median.

This is for the case of odd number of elements, in case we have even number of element, any number between the two center elements would give the same minimal distance sum.

Thanks Sven for generalizing the problem, and Noah for the idea about median.

Tuesday, November 8, 2016

Some learning in algebraic number theory

Recently I have been reading about proving the algebraic integers form a ring, so let me get started about some simple definitions.

A field is called a number field if it contains $ \mathbf{Q} $.

A number if called an algebraic integer for a number field $ A $ if it can be written as a root of a monic polynomial in $ A $ with coefficient in $ \mathbf{Z} $.

The fact that the algebraic integer form a ring is surprising (to me), it is obvious that $ \sqrt{2} $ and $ \sqrt{3} $ are algebraic integer in $ Q(\sqrt{2}, \sqrt{3}) $, but why $ \sqrt{2} + \sqrt{3} $ an algebraic integer, or in other words, what is the monic polynomial that give root $ \sqrt{2} + \sqrt{3} $?

Turn out the key idea is this polynomial:

$ (x - \sqrt{2} - \sqrt{3})(x - \sqrt{2} + \sqrt{3})(x + \sqrt{2} - \sqrt{3})(x + \sqrt{2} + \sqrt{3}) $.

Obviously, this polynomial is monic and has $ \sqrt{2} + \sqrt{3} $ as a root, but is it in integer, the answer is YES! If we expand this thing, it becomes:

$ x^4 - 10x + 1 $

To verify that, we can put this in wolfram, and wolfram solve the solution as $ \pm\sqrt{5 \pm \sqrt{6}} $, does this value sound familiar. If you read my post about denesting the radical you can just recognize this is basically $ \pm \sqrt{2} \pm \sqrt{3} $

So we have some luck? No, turn out this trick will ALWAYS work because of the theory of symmetric polynomial.

Consider for a moment that we replace square root by variables instead, we have something like this.

$ (x - a_1 - b_1)(x - a_1 - b_2)(x - a_2 - b_1)(x - a_2 - b_2) $

Expanding this thing is messy, so we will not do that, the key idea is that we can consider this as a multi-variable polynomial in $ a_1 $ and $ a_2 $, and more importantly, it is symmetric, such that swapping $ a_1 $ and $ a_2 $ does not change the polynomial itself. Notice the $ x $ and the $ b $ are not going away, we are simply considering them as coefficients by now.

By the theorem of symmetric polynomial, we can rewrite this polynomial as a polynomial of the elementary symmetric polynomial, and viola, because the value of elementary symmetric polynomial is basically the coefficients of the minimal polynomial, they are integers. After substituting the equation with the value of $ a $, we get an expression with integer coefficients of $ X $ and $ b $.

We do the same thing to the $ b $ and finally we get an integer polynomial equation in $ X $ containing the root we wanted!

Monday, November 7, 2016

Conditional Probability

Problem:

Suppose a family has 2 children, one of which is a boy. What is the probability that both children are boys?

Solution:

The reaction is $ \frac{1}{2} $, but that is wrong.

Let the event $ A $ be the event that we have one boy, that event should be $ { BB, BG, GB } $, this event has probability $ \frac{3}{4} $.

Let the event $ B $ be the event that we have two boy, that event should be $ { BB } $, this event has probability $ \frac{1}{4} $.

By the definition of conditional probability, we have:

$ P(B|A) = \frac{P(AB)}{P(A)} =  \frac{P(B)}{P(A)} = \frac{\frac{1}{4}}{\frac{3}{4}} = \frac{1}{3} $.