Monday, August 23, 2010

Mathematics behind Tick-Tack-Toe


I am pretty sure almost everyone would have played this game. It either ends up in a draw or the person who is a stupid loses. The winner need not be intelligent,but, the loser has played the game very badly indeed. What is the logic behind winning ?

1. You make the first move
2. The person on the other side is dumb. (Yeah !!!)

This is a game where one can never lose. Since, this is a game where one can never lose, it is not a game at all.

When will the person win you ask ?

When the 'O' is in the centre and the 'X' is in any position other than diagonals. If the second move of X is in any position other than the diagonals, he is bound to lose.










You can never lose .... You can call a draw when the second move is on diagonals....


I had played this game endlessly when we were in school trying to prove the opponent that I was smarter than him. A few times I used to win and a few times the person on the other side used to win. Now, i realized that we weren't trying to prove who is smarter, but , we were trying to prove who was dumb. 

The Logic :

There are initially 9 places you are allowed to choose. 8 lines totally available to both the players to complete.




Step 1 :
The player1 (Green) who goes first chooses the center point, because he has the possibility of completing at least one of the 8 lines. Any other point he chooses he would be giving himself a lower probability of winning.

Step 2:
The second player(Red) has the remaining 8 points at his disposal. The move that he makes decides the fate of the game. If he chooses any point other than the diagonal he will lose. By choosing the point on the diagonal what the player2 is doing is undoing 3 of the winning lines.

Smarter move
dumb move

choosing any other point not on the diagonal would eliminate not 3 but only 2.






Step 3: Assuming player2 has made a smart move., now the player 1 has only 4 lines left to be completed. His next move will most obviously be directed towards making two straights so that he can finish off the game. But, unfortunately those moves can easily be blocked by the opponent.



 : Target Win :







Step 4: Easily these moves can blocked leaving the player1 with no option but a draw. But, the dumb move always presents the player1 with an opportunity to win for sure. 



The figures show the steps that will be followed by the player1 to actually win the game. Now after the last step, player2 is left with one move but to block 2 of the winning lines of player1. This would never come into the picture if the player1 had chosen the diagonal point as the first move. The game of tick-tack-toe is NOT A FAIR GAME. Every game, any move of any two players, for the first two moves can be such that the game results in a draw and not a win. 



Now, are other games too similar to the ticktacktoe.Can the result of the game be determined even before the game is played. Are all games such that, it's not the smartness of a person is measured but, the dumbness of the opponent. If the opponent is aware of the symmetry of the game, he could never lose. 

One version of complete stupidity is given here :


I really can't believe people think of this game as A REAL MATHEMATICAL PUZZLE. It is something of no practical importance and is a waste of time spending more time that the time required to read this blog entry. 
:-D .. Hahaha 


Friday, August 20, 2010

Prime due to a reason

---------------------------------------------- From the past ---------------------------------------------

Before starting off with another beautiful topic of "Prime" numbers let me try and convince myself why does table of 9 exhibit symmetry.....

9 X 5 = 45   - 9 X 6 = 54
9 X 4 = 36  -  9 X 7 = 63
9 X 3 = 27  -  9 X 8 = 72 
9 X 2 = 18   - 9 X 9 = 81
9 X 1 = 09   - 9 X 10 = 90


a two digit number can be expressed as (10x + y). Since, 10x+y is divisible by 9 as in the case above, so is (10y+x).

Ex : (Representation of a 2 digit number xy as 1x + y)
xy = 10 * x +  y
45 = 10 * 4 + 5
36 = 10 * 3 + 6
72 = 10 * 7 + 2

In table of 9, 45 and 54 both are divisible by 9 . similarly 72 and 27 .... etc

Now, 10x + y, i.e 27, 45, 54 , 72 is divisible by 9.
Since it is symmetrical 10y + x is also divisible by 9.

Observe that the sum of the digits is always 9. (Proof of which will be given in subsequent posts)

=> x + y = 9

=> 10x + y = 9x + (x + y)
=> 9x + 9 = 9(x+1)

9(x+1) is obviously divisible by 9, which leaves quotient as x+1. This result is also very interesting. But, we will leave table of 9 here ............. Let move to the most interesting of all .... The prime numbers

-----------------------------------------End--------------------------------------------------------------

1. Introduction to prime numbers and very interesting fact about 11,13,17 and 19...

Prime numbers are some numbers which have factors as 1 and the number itself. (Text book definition)

I never quite understood the concept of factors. I looked at it this way .... Prime numbers are those annoying numbers which never get divided.

There are some interesting thing to observe about prime numbers. They always end with 1 or 3 or 7 or 9 .

it can't end with even numbers and 0 because it would certainly get divided by 2. It can't end with 5 because it would get divided by 5. Remaining are 3,5,7 and 9.

Proof you ask ??
Proof : 11,13,17 and 19. (Isn't it weird that these are the continuous primes with same digit in 10's place. Does any sequence exist with same 10's place yet there exist 4 primes.)

2. Why are they prime or at least called so? (If I were to name them ... I would have named annoying numbers or freaks )

Ans : Definition of prime number by Euclid (Tougher than text book ones)



or
Prôtos arithmos estin ho monadi monêi metroumenos.
or 
Prime numbers are that unit alone measured.
or
A prime number is that which is measured by an unit alone.
 (Souce : primes.utm.edu/notes/faq/WhyCalledPrimes.html)

well, it is pretty simple :

Every number always have least mulitples as prime numbers : 

Ex: 
1> 64 = 2*2*2*2*2*2 (Well, 2 is the only even prime number... you knew it already !!!)
2> 33 = 11 * 3 
3> 96 = 3*2*2*2*2*2

All numbers have least mulitples as prime. (They call these as factors. Least divisible factors are prime numbers. Hence it is prime.)

3.Story about prime numbers

There is one puzzle which many mathematicians are trying to break. It has so much significance that, any person who solves it can get 1 million dollars. It is P vs NP problem. The mathematicians all over the world are trying to prove whether 
P == NP (Is P equal to NP) or P != NP (P not equal to NP)
If N =1, then  P == NP !!! Right ? Where the hell is my 1 million dollar?? (?????????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I may get killed if any P vs NP enthusiast reads this)
Jokes apart ,

Actually it is too complex to even understand. P is one class of problems and NP is another class of problems. They are trying to see if they can actually be segregated that way. I will try to explain in common man's language (as much as I have understood ... I might be wrong .. Who cares !!!)

P Problems :: These are the problems which we can solve easily following some algorithm. 
Ex: go on a date, add two numbers, multiply two numbers, sing a song etc ...

NP problems :: These are the set of problems which are too difficult or nearly impossible to solve. But, given the solution it can be verified whether it is correct or not.
Ex:  will she accept my proposal?, find the factors of a number which is a product of two very huge prime numbers(one which matters here !!), did people like my song ? etc ..
They are trying to see whether P == NP or not. (Don't take the examples seriously .. It was just to give an idea)

Given 14160, it is easy to find the factors (since it is obvious that it gets divided by 2 and find the subsequent smaller numbers)

But, Is it easy to find factors of 14161 ? Difficult right ?
 Now i say :
It is actually 119 * 119 .
You can verify the result easily. 

A system similar to this is used in many bank security systems. This is thought to be a NP problem. If they prove that, it is infact P ... then I can follow a few steps of some algorithm and break all security systems in the world. There will be chaos.... Sadists are trying to prove that P != NP ... If P == NP, there will be so many new things ... (Recent proof by Vinay deolalikar of HP labs has given a proof that P != NP and mathematicians say that the proof is not too legitimate... I have no idea about their arguments .. So, lets just stick to prime numbers.)

4. Are there infinitely many prime numbers ?

The answer is yes. The solution is very simple. 

Assume that there are finite number of prime numbers.

Let me state 2 facts (That should automatically prove the silly question): 
1 - there are infinite numbers. 
2 - All numbers have the lowest factors as prime numbers. (Or all numbers are product of prime numbers and 1)

If there are only finite set of prime numbers, that would mean that the set of numbers is in fact finite, which is false.
Ex : Lets assume there are only 4 prime numbers i.e 2,3,5 and 7
The numbers 26, 91 wouldn't exist because 13 and 17 do not exist ... Get the logic ??

5. Is there a formula to check whether a number is prime or not ? 
 Ans : No
If there existed a formula, then scientists and maniacs wouldn't be using supercomputers to find new prime numbers everyday. They would simply use the formula to get new prime numbers. There would be no ATMs with ATM cards ... They exist .. so I can safely scream out that there is NO FORMULA.

I wrote this entry because I there is no good book or blog on mathematics without mentioning of prime numbers. Hope this blog becomes good now !!!! :-) (get the joke ??) :-P 


Thursday, August 19, 2010

My new blog :- Dedicated to the beautiful world of Mathematics

I was in my first grade, when I encountered my first horrible experience with mathematics. I was a wonderful memorizer. I prefer to memorize rather than work it out logically, mainly because recalling is faster than creating logical stuff. Remember, how we are taught math tables for the first time ? Most of us prefer to learn it by heart and not understand things logically. Same applies to things like multiplication, division, differentiation, integration etc... But, not learn things logically can create hell lot of problems. 

When I was in my first grade I was trying to learn tables of 9 by heart. 

9 X 1 = 9
9 X 2 = 18
9 X 3 = 27
9 X 4 = 36
9 X 5 = 45
9 X 6 = 54
9 X 7 = 63
9 X 8 = 72
9 X 9 = 81
9 X 10 = 90

is the tables. I was told multiplication is in fact nothing but addition. So, tables of two were very easy. Just keep adding two everytime. 2 x 1 = 2. For 2 x 2 just add 2 to previous number and so on. Learning tables this way was easy till the tables of 6. 7 was difficult but surprisingly I could memorize them. 8 was more difficult but my brain had more space. 9 was the most difficult of them all. I remember spending days together trying to learn the table of 9 by heart. It was impossible. My mom used to ask me what was 9 * 6 ... I couldn't answer. She asked for 6 * 9 ... I could answer.... It was then that I was introduced to commutative law. She asked me to remember all tables till 8. For table of 9, all I had to do was just recall all the table's 9th element. 9 * 10 was easy because all i had to do was just write 9 and append 0. 

Now, I became a little better. But, as I had told you, 7 and 8 tables were pretty difficult for me. So, my mom told me another tricky method. She asked me to remember table of 9 till 5. i.e 




9 X 1 =  09 (She added zero purposefully)
9 X 2 = 18
9 X 3 = 27
9 X 4 = 36
9 X 5 = 45


Then for the rest .. all I had to do was just reverse the number in the reverse direction ... 
i.e 

9 X 5 = 45   - 9 X 6 = 54  (Observe that the numbers are reversed .... )

9 X 4 = 36  -  9 X 7 = 63

9 X 3 = 27  -  9 X 8 = 72 

9 X 2 = 18   - 9 X 9 = 81

9 X 1 = 09   - 9 X 10 = 90 

It took more than a week to see and learn these things. I was amazed by this.

WOW !!!!!!! Was it same for other tables too ??? I tried ... but failed ..  The tables of 9 instantly became my favorite. But, for the exam we were asked to learn only till tables of 8. ..... Murphy's law ??!!!!


As time passed, I still remembered my first encounter with table of 9. It was in my college that I actually learnt that this property of number reversal is actually due to a reason. 

Try to prove ::: if 9 | (10x  + y) then 9 | (10y + x) when x,y belong to set of integers. 

Prime numbers exist and their properties are so very important. They are used in infinitely many places. I could get the essence of the very famous P vs NP problem from these prime numbers. These prime numbers have made the heads of greatest brains in the world spin. 

I am reading a few scriptures on number theory and probability theory. The more I read , more I want to ... 


This blog is a dedication to the beautiful world of mathematics and a small device which was originally created to make life of mathematicians easier and has now more takers than the subject of mathematics (Computers)....