## Thursday, July 31, 2008

### Math kitty

Photo by Dave Hogg

Apparently cats love studying math, only they are rarely caught doing so...

### Kde4 with Compiz

According to the video, the plugin used to achieve this effect is called the fish eye plugin. I never heard about this one before, but it looks very impressive. The things that computers can do...

### Using kde4

The first part of this post is a general rant about Kde4. The second part is a simple how-to for making kde4 look better and be more usable.

Every month or so I have an urge to try new things... Usually this means installing new (preferably beta) software on my computer. The program that got installed this time is kde4. I am using Linux, so if you are using windows this post will probably be of little interest to to you.

To make the story short, using kde is a horrible experience. The only reason I am doing this is stubbornness. The first thing I noticed after logging to kde4 is that the desktop looks very beautiful. Whoever designed it did an excellent job. However after doing this he let some other people turn the rest of it into a designer nightmare.

Firstly, the Firefox looks horrible. You can use another browser, konquer, but I wouldn't recommend doing so. A lot of sites (including Google and Yahoo) claim that this browser is unknown or very old.
The same is true for many other applications. However, this is possible to fix partially. All you need to do is to install the package gtk-qt-engine-kde4:

`sudo apt-get install gtk-qt-engine-kde4`

You’ll need to log out of KDE for the new options to appear. Once you’re logged back in, open System Settings and select and then GTK Styles and Fonts. Select the Use my KDE style in GTK applications option. Click Apply, and log out to make the changes take effect. I found this tip here. This is not a perfect solution, but it is significantly better than what was before.

After this rant, I guess I should say something positive. The file manager, Dolphin, while being a designer nightmare, works well and faster than Nautilus. The plasma widgets are also nice, but I never used widgets and I doubt I ever will, so this is of minor importance for me. The start menu also looks very good, but some of the icons are missing. Also, the desktop manager (at least I think this is what it is called) crashes sometimes. Well it happens I lose the panel, the widgets and the desktop background but all the rest works fine. Since I am using kiba-dock and Gnome-do, I don't really care about this, but I feel somewhat uncomfortable without the panel. I am writing this post from Kde4, and the desktop manager crashed a few minutes ago. I didn't yet find a way to get it back to work without restarting the X server.

In the next days I hope I will manage to solve at least some of the problems I am having with Kde4. If it will happen, I will update this post with some extra tips.

Splash-Screen:
If you installed kde4 using the Kubuntu package, you will also get your Upsplash changed to say "Kubuntu" instead of "Ubuntu". If you care (I do), the simplest way to get it back is to use the start up manager: System->Administartion->StartUp-Manager. Go to the Appearence tab and change the upsplash theme to th one you want.

Remove games:
I don't play games, so I decided to remove all of them except for sudoku. This turned out to be extremely difficult. Firstly I attempted to use synaptic to remove them. By doing so I discovered that some programmer thought it would be nice to make the package kde4 depend on the package kdegames, which depends on every single game. The result was that an attempt to uninstal any game using aptitude ended with Kde4 being removed, and this set all the other packages connected to kde4 to auto removable. And since aptitude automatically removes such packages, by removing one game I removed all of kde4. To solve this I used adept package manager to uninstall all the games I could, and then I used synaptic to mark all the packages that were set to auto removable as manually installed. After this I finally got rid of the rest of the games.

Make Firefox look better:
The first thing to do after installing kde4 is to make gnome applications look normal in it. See above for instructions. However, this fix doesn't completely solve the problem with Firefox. It still doesn't render well. One possible solution is to install a theme for Firefox which was designed for Kde4. It is still experimental, so you will need to register an account on the Mozilla addons site.

## Wednesday, July 30, 2008

### Warp Drive Engine

I didn't intend to write any more about faster than light travel, but I was sent a link which is too good not to write about. I am not going to comment on the science involved, I am not qualified to talk about anything that concerns 11 dimensions. However, this article raises an interesting point which I didn't mention in my posts about faster than light travel. If you read those post, you know that I started this topic with a simple proof of the impossibility of faster than light travel. I also showed that there are exceptions to this rule because quantum mechanics and relativity doesn't play well together. But what about large objects? Is there a way for them to somehow escape relativity?

In the article I linked, you can read about a simple (but nearly impossible to do) idea - expanding the space behind the object and shrinking it in front of the object. Thus you will create a bubble that slides in space. Inside the bubble the object will move slower than light, but the bubble itself can move faster, because it is not even matter but space itself. This is called a wrap drive.
This sounds possible, but it is easy to see that the method I used to show to show the impossibility of time travel, still works for this example.

However, in this particular case my prove doesn't apply. The reason for this is very simple - while it is bot obvious the proof is build on a simplistic assumption that the universe is the same on large scales. Unfortunately, this is not true. This is only a simplification used for ease of calculations, although it is very close to being correct. If you allow universe to be extended and contracted (and this is exactly what ruins this assumption), there is nothing that forbids faster than light travel.

To finish this post - a little joke:
An experimental physicist finished running a very complex experiment. After plotting the data on a graph, he got to the conclusion that he doesn't understand why the graph looks the way it does. So he went to a theoretical physicist, showed him graph and asked to explain the very high peak in one of the points. The theoretical physicist looked on the graph for a second and said "Oh, there is a perfectly good reason for this peak". And started talking. During the explanation the experimental physicist suddenly looked on the graph and said" Wait a a second it is with the wrong side up". The theoretical physicist looked on it, and said "Oh, there is a perfectly good reason why there is this very law value in this point" And started talking.....

## Tuesday, July 29, 2008

This post is a little follow up for the series of posts I wrote about faster than light travel. In one of the posts on this subject I brought a simple example of how in Quantum mechanics faster than light travel is possible, despite it being impossible according to relativity. The example I talked about in that post was very simple, and it was easy to explain why this is indeed what happens. But this example talked only about faster than light travel on a very small scale. In this post I want to talk about another example, which is far more complex but it shows that faster than light travel is possible also on large, even cosmic distances.

Lets consider the following situation. Suppose you have two balls, one is pink and the other is green. However, the color property of the balls is quantum - both of the colors are in superposition, so both of the balls are pink and green in the same time. But if you will measure one of them, the superposition will collapse to one of the options. What is interesting is that if you will measure one, you will cause the other one also to collapse, because you now know its color as well so it is no longer in superposition.
There are no such balls in the real world, however it is possible to create particles with all the required properties. I don't want to talk about a specific example in this post so we will agree that the balls stand for some object that have a quantum property which we will call color.

Now, lets suppose that you create two such ball in the laboratory and give one of these balls to your friend. Lets label this ball A. You friend happens to be an astronaut and he flies to the moon with this ball. When he gets there, you measure your ball (B) and discovery that it is pink. This measurement causes your ball to collapse - it is no longer in superposition of ping and green, but it also causes the second ball to collapse, in the exact same instance.But even light travel to the moon in over a second. So, something changed in the second ball, A, without a reason to this being in its "Cone of light". This again means that the information of the measurement traveled faster than the speed of light.

This is known as the Einstein paradox. He originally presented it in an attempt to prove that quantum mechanics is incomplete. He claimed that it is not correct that quantum processes are probabilistic - "God doesn't play dice". In this mind experiment there is nothing impossible from the position of quantum mechanics, but allowing faster than light travel we allow time travel, and give place to a lot of other paradoxes. He offered a solution, to add a unknown property lambda which we cannot yet measure but that decides the outcome of the measurement. This works because quantum mechanics says that from all the properties of the object we now about we cannot deduct its state (in our example the ball color) so until we measure it, the object is in superposition. But if we allow for such lambda to exist we get that there is no superposition the balls are always the same color - there is no longer probability involved, all is determent from the beginning.

Interestingly, Einstein was wrong. It took some time but eventually a test that checks if such lambda exist was performed. The test was an experiment that returned a value, we will cal it S. If S is less or equal to two, then there is lambda. If S is bigger there might be lambda, but faster than light travel (in the case of the Einshtein paradox) is possible. To be even more specific, if quantum mechanics is correct $S=2\sqrt{2}$. However, in physics to show that something is equal exactly is nearly impossible, so the main point here is to check if S is less than two or not. This experiment was performed a lot of times. In the beginning the equipment wasn't sensitive enough, but after a few decades the result was that $S=2.5\pm0.35$. Since this is large than two, the case was closed, faster than light travel is possible. It is still unknown if there is lambda. It turned out that we can design a theory with lambda and without it, and they both will work always. They both manage to explain all the results of all the experiments conducted until now.

## Sunday, July 27, 2008

### The weirdest "Hello" ever

Today in the morning I was just entering the Einstein Institute Building in the Hebrew University when another student was going outside. I talked with him a few time before, he is also studying mathematics, and is a really nice person. We both were in a hurry, because it was almost the time for our lectures to begin, so we just said "Hello" and went on. Well, almost. I just said "hello". He said" Oh! Hello professor, how are you doing?". I am not a professor, and nobody was standing behind me. Since it was totally unexpected, and I was in a hurry I even didn't react in any way to this. That was a weird morning... While I want to do an advanced degree in math, I am sure I never told him about it, so I really fail to see why he would joke like this.. Well, it might be prophetic. :)

On a more serious note, the semester ends on 4/9. Oh should I say, the exam month begins on 4/9. Anyway you put it, it is good news actually. I feel that I really want to start learning new courses, that is I want to start the next semester. I need to study a lot for two of the exams, I don't feel that I know these courses material well enough. But I am sure I will manage.

## Saturday, July 26, 2008

### Mersenne prime search

This post is about the Mersenne primes. Mersenne primes are prime numbers of the form $2^n-1$. A bit of trivia: This formula for generating prime numbers is known for a few centuries, however it continues to be interesting even today. It is easy to see that this formula generates primes, for example for n=2 we get 2, n=3 we get 7. However, for n=4 we get 16-1=15 and this number is composite. Generally, the result might be prime only if n is prime.

I am not going to write much about the properties of the Mersenne primes, it is easy to find this information on the net. What I want is to write why those primes are interesting to me and perhaps I will manage to interest you as well.

Firstly, it was proven by Euclid that all the numbers of the form $2^{n-1}(2^n-1)$ are perfect if $2^n-1$ is prime. Later is was proven that all the even perfect numbers are of this form. It is still unknown if there exists an odd perfect number. Despite all the attempts to solve this problem it stands for over 2000 years.... The Mersenne formula therefore can be seen as an connection between two fascinating problems in modern mathematics - the Riemann Hypothesis and the odd perfect number problem.

Secondly, there is a project on the internet whose goal is to find large Mersenne primes. This project is a typical example of distributed computer network - you download their program, and it uses your computer idle cycles to try and factor numbers produced by the formula. They even have a prize offered, but it is pointless to participate only to try and win the prize in my opinion. The last prime they found was found in 2006... However if you want to put your computer idle cycles to some use, this is the place to go to. Since my computer is now staying idle most of the time so I am starting to consider this use.

Thirdly, there is an interesting theorem which happens to concern them. This theorem (proven by Gauss) says that it is possible to divide a circle into p equal segments using square roots (that is, only square roots are required to find the solution - points in a plane), only and only if p is a Merssene prime. To be precise, Gauss grooved only one part of this theorem - he showed that if p is Merssene prime than the construction is possible. The second part was proofed latter. From this we see that there is also a connection between these primes and geometry.

I am sure it is possible to think about more interesting properties of Mersenne primes, but those are the properties I know about and find interesting. What do you find interesting in them?

## Thursday, July 24, 2008

### Formula for Primes

I stumbled on two interesting formulas for primes today. The first formulas allows to check if a certain number is prime or not, and the second formulas gives you the Nth prime. They both use factorials, so neither of them is efficient for large numbers. And since n! becomes large rather rapidly, it means that without a computer it would be a problem to use this formula even for n=20 for example.

Both of the formulas were invented by C.P Willans. The | | stands for the floor function.

If x is prime, the result will be 1 else it will be zero.

As you can see both of them are higly ineficcient - the numbers becomes laege extremely fast.

## Wednesday, July 23, 2008

### How people react when they discover you are strudying math?

The main reason I am writing this post is because of an interesting post I recently read. Beans at Me Or My Maths recently wrote about the different reactions he got from people who heard that he studies math. To sum it up, the reactions he gets are of the type "you are crazy". He is not the only blogger from the UK who says he gets this type of reaction, so apparently it is a rather usual thing in that part of the world....

As you probably understood from the last part of the previous paragraph, such reaction is not common in Israel. I remember very clearly how when I had to study math for 4 hours straight in school (with one half hour brake) some other pupils said that they cannot believe that I do this, but there reaction was surprised but not negative. Perhaps they were just glad that they don't have to do this. Also, when asked about this I answered were simply "I enjoy studying math". I guess after this they preferred not to talk to me... Not much of a loss. I am not cynical, it is simply that my interests were very different from theirs.

Unlike Beans I don't do my homework in trains, and I don't speak with random people about my math, but from time to time I share my enthusiasm for math with someone who has no clue of what I am talking about. By sharing enthusiasm I mean that I start talking and I don't really care if I am understood. However, they usually don't faint or run away. They either remain polite or just ignore what I say. Writing this blog helps to control such bursts of enthusiasm, but sometimes I feel the desire to speak with someone....

The above doesn't mean that Israelis love math. However, it might mean that they really don't care. Most of the people here study as little math as possible in school, and then even if they go to college they are likely to never hear about it again. Also, just today I talked with someone who said that he can hardly wait until the end of the semester - unless he will fail in something, he will not have to study any math next year. But even he didn't say anything negative about math, or about those who study it.

Now, to the more mathematical part of the post. I have been thinking about a certain integral in the past few days, but I am still unable to show that it converges (or not). I am probably missing something simple here, this shouldn't be a hard problem:

$\int (sin(x^2))^3$$dx$

The limits are zero and plus infinity. If you have the solution you are welcomed to post it, if no solutions will be posted before I will solve this thing, I will write the solution here (unless I will forget about this). Good luck...

## Tuesday, July 22, 2008

### The genius of Newton

This is just a short joke I found today:

Archimedes, Pascal, and Newton are playing hide-and-seek.
Archimedes covers his eyes and starts counting.
Pascal looks around and hides behind a bush.
Newton grabs a stick and scrapes a one meter by one meter square in the dirt and stands in it. Otherwise he does not hide at all.
Archimedes opens his eyes and looks around. Of course, he immediately sees Newton and calls "I see Newton" Newton calmly says "But hang on, one Newton in a square meter is a Pascal!"

It is handy when you have physical units named after you......

## Monday, July 21, 2008

### Formulas for third and forth degree polynomials

In a previous post, the hunt for the roots, I showed how to develop the formula for the second degree polynomial. In this post I want to develop the formulas for the third and forth degree. Unfortunately this means that this whole post will be algebra and nothing else. This formulas were originally developed in the 16 century - you can read more about this in the post linked above.
A little warning - in this post I don't solve numerical examples, so I use letters to denote numbers that would be known in a numerical example, but I freely move them around. This means that if in one line I wrote bx, in the next line I will also write bx even if I should write (b+4)x instead, and the same with the sign of b. To use the formulas you will need to follow the simplification process, and then to aplly the final formula to the result.

Lets start. The idea is to get the general formula for the equation of the form:

$ax^3+bx^2+cx+d=0$

Firstly, lets get rid of as many parts as we can. By dividing it by a (it cannot be zero, because then we have a second degree equation) we will get a simpler equation. But it is possible to make it even simpler. To do this lets suppose that x=y-b/3 (b is not the original b, but the original b divided by a). After dividing by a, and writing y-b/3 instead of x we will get an equation of the form:

$y^3+by+c=0$

Writing this step fully requires too much typing, so it is skipped. You can easily verify it yourself. Now we will write this equation in a slightly different way:

$x^3+bx=c$

Lets suppose that x=u-v (this step is called uglification):

$(u-v)^3+b(u-v)=c$
$u^3-v^3-3u^2v+3uv^2+b(u-v)=c$
$u^3-v^3+(u-v)(-3uv)+b(u-v)=c$
$u^3-v^3+(u-v)(b-3uv)=c$

We can choose u,v so that b-3uv=0. Now we get two equations:

$u^3-v^3=c$ ,

But those are simple second degree equations, to see this just substitute u^3=t, v^3=s. It is easy to solve and get that:

v^3=

u^3=

Now all we need is to get the solution, x=u-v, is to take the third root. After this we get a rather unpleasing formula, which is however the solution. It might seems surprising that it took so much time to get to this formula (over 1000 years), but lets not forget that it seems relatively simple because of the modern notation. In the ancient world they were without symbols, all they had were words. For us the process is visual, but it wasn't so for them. Note that this formula should be used only after you did the previous steps - that is after you have simplified the equation to the form before the uglification step.

Now to the forth degree. We need to solve an equation of the form:

$ax^4+bx^3+cx^2+dx+e=0$

The first step is to use the same method I used in solving the third degree polynomial, to reduce the problem to:

$x^4+bx^2+cx+d=0$

This reduction can always be done, it is easy to check but requires a lot of typing in latex to show it here, so I am skipping this. Lets complete the equation to a square, and move the rest to the second side (since c,d are unknown numbers, we can ignore the sign):

$x^4+2x^2+1=(2-b)x^2+cx+d$
$(x^2+1)^2=bx^2+cx+d$

Now, if only the left side was a square.... Well, it is again time for uglification. Lets look on:

$(x^2+1+y)^2$=
$(x^2+1)^2+y^2+2y(x^2+1)$=$bx^2+cx+d+y^2+2y(x^2+1)$=$(2y+b)x^2+cx+d+y^2+2y$

Now, when this will be a perfect square? The answer is simple. We need the discriminant to be equal zero. This means that:

$c^2=4(2y+b)(d+y^2+2y)$

This is a third degree equation. Now, isn't it great that we have a way to solve a general third degree equation? Without knowing a solution to the third degree polynomial we wouldn't be able to solve this... Now, lets suppose that (t) is a solution. Than we can write the original equation as:

We can now take the root and get the simple equation:

$x^2+1+t=x-t$ and $x^2+1+t=t-x$

This is second degree, so the solution is easy.

Now, this is the part where I apologize for the misleading title - as you can see, while I developed the general way of solving the third and forth degree equations, I didn't write down the formulas. This is because they are nether useful nor nice to write (the formula for the forth degree is huge). I once was told that solving second degree equation using the formula takes 5 minutes for the third degree it takes one day, and for the forth a week. This is not true but it is close. However, all you need to write the final formula is in the post, you just need to write it down. If you are interested in the formulas themselves here are links to them: Third degree, Forth degree.

## Sunday, July 20, 2008

### Multiplication using Vedic mathematics

I was sent this rather interesting video today. It claims to show how to multiply numbers with two and three digits. Probably the method will also work for numbers with four digits.

Since it is from Youtube, I have no idea if this is indeed Vedic mathematics or not. However, the trick used is very simple. What you do is use lines to represent numbers, and crossing lines represent multiplication - this is in fact a step back from the system we use. And it also takes more time that the methods for multiplication we are taught in school. Especially for numbers with a lot of digits....

## Saturday, July 19, 2008

### The Middle Value Theorem

I admit that this is strange, to write about integrals and then to start talking about the Middle value theorem without finishing the previous topic. However, there is a reason for this. Firstly, I intended to write about both, and secondly, to write about integrals means to use latex. Unfortunately, because of the fluctuations in the weather in Jerusalem my head hurts to much for the thought to write in Latex to enter it. So today I will write about the Middle value theorem.

The Middle value theorem:
Let f(x) be a continues function from [a,b] to R. Suppose that f(b)>f(a). Than for any f(b)>y>f(a) there are exists b>x>a such that f(x)=y.

The proof I am going to give is the historical proof, there are others way to get to this result. However, Bolzano who originally proved this theorem used this method. To prove the theorem we firstly need to proof another statement:
Suppose that M is a property which is correct for some, but not all, numbers. Also, there is a number u with the property that M is correct for all numbers strictly less than u. Than there exists a number U with the property that M is correct for all numbers less than U, but there are no numbers large than U with the property that M is correct for all numbers lesser than them.

This is how Bolzano formulated this - in modern notation:

A={u| for all x less than u M is correct}, U=supA

Now to the proof. Balzano proofed this by simple construction. From the problem he new that A is not empty, and that there is a number that is larger than all of the numbers in A (because otherwise M is true for all numbers) we will mark it b. Lets look on the series:

$a_{n}=u+\frac{b}{2^n}$

If U>u we will pass it on some step. If this doesn't happen than u=U. If however we passed U on the N step, we can now look on the series:

$b_{n}=u+\frac{b}{2^N}+\frac{b}{2^n}$

Again, we repeat the previous step. If we will have to repeat it infinite number of times, we will have a series of numbers (which are all less than U) that is bounded (by U) and increases monotonically - and therefore it has a limit, which is clearly U. This part I am leaving without a proof - it is easy to show using elementary theorems. Bolzano proofed a statement which can be read as "Cauchy series converges" in order to proof this part, but this proof is omitted because it is identical to the proof given in first year Calculus - which means it requires epsilon and thus latex.
It is also interesting to note that as it was given by Bolzano the above proof is incorrect, because without the axiom of completeness he couldn't say that the limit of the Cauchy series is a real number.

Now it is time to use this to prove the Middle value theorem. The proof is very simple - let M be the property: y>f(x). Because this is not true for x=b, we get from the statement that we just proved that there exists U such that for all x less than U, M is true, and for all x greater than U M is false. Therefore f(U)=y.

This proof, unlike the previous one, if perfectly valid. It can be used on an exam today. A question to the reader: Where in the proof the property that f is continues is used?

## Friday, July 18, 2008

### Definite Integrals

Surprisingly, it is not easy to define what such an integral is. We want it to be equal to the area under the graph of a function - but to get it we need to define a specific algorithm that will produce it. One of such definitions is given by Riemann - it is called the Riemann Integral.
To properly define the Riemann Integral, we need to define a few other things firstly.

Lets suppose that we want a definition that will give us the area under the graph of some function f(x), which goes from the interval [a,b] to the real line (it is not necessary to assume that f is defined in all of [a,b], but it must be bounded in [a,b]). For this interval lets define:

P={a=$x_{0}}.

As you see from the definition P is a group that has n+1 different points and it includes both a and b. Note that according to the definition P is finite. Now for any such group lets define w=max|$x_{i}-x_{i-1}$|. Obviously w>0. Now we can write the following sum:

$^n_{i=1}\sum f(t_{i})$($x_{i}-x_{i-1}$)

In this sum $t_{i}$ is any number such that $x_{i-1}<=t_{i}<=x_{i}$.
The next step would be to define a limit "according to w". We will define it in the following way:
We will say that the limit =A if and only if:

$\forall\epsilon>0 \exists \delta>o$$\forall P$ $w(P)<\delta \rightarrow$|$^n_{i=1}\sum f(t_{i})$($x_{i}-x_{i-1}$)-A|<$\epsilon$ $\forall t$

Basically, it says that if for any division of the interval such that the maximum distance between two points in the division is less that delta, the difference between the sum and A is less than epsilon, and such delta exists for any given epsilon (and for any selections of the points $t_{i}$) , than the limit is A.
The limit, if it exists, is the integral according to Riemann. If the limit doesn't exists the function has no integral according to Riemann.

Since we have a definition, lets use it to calculate an integral. For example, lets calculate the integral of f(x)=2 in the interval [0,1]. f($t_{i}$)=2 for any part of the interval, so we can get it out of the sum. The rest of the sum is the length of the interval:

lim$^n_{i=1}\sum f(t_{i})$($x_{i}-x_{i-1}$)=2(0--1)=2

Unsurprisingly the answer is two. Notice that this is indeed the answer only because the calculation here is independent from both P and the points t we selected. But what if the function is slightly more complex, for example f(x)=x^2? It is still possible to calculate the integral using this definition, but it is better to use another definition.

The Riemann definition is a very good definition, but sometimes it is easier to use a different definition. There is more than one other definition, but I want to talk only about one of them - the definition according to Darbo.

In this definition we again make use of P, which is defined in exactly the same way as before. We also need to define two other things:

$m_{i}$=inf(f(x)) , $M_{i}$=sup(f(x)) , $x \in[x_{i-1},x_{i}]$

Using this we can define the Upper Darbo sum as following:

$^n_{i=1}\sum M_{i}(x_{i}-x_{i-1})$

And also the Lower Darbo sum:

$^n_{i=1}\sum m_{i}(x_{i}-x_{i-1})$

The next step is to define the lower and upper integral. The upper integral is the infimum of the group of the upper sums, and the lower integral is the supremum of the lower Darbo sums. If both of these integrals are equal, we will say that the function has an integral according to Darbo.

In the next posts I will show that these two ways to define the integral are equivalent, and will also discuss ways to calculate the integral.