Friday, September 22, 2006

Bible and Number Theory


The first three verses from the Bible (KJV)

1:1 In the beginning God created the heaven and the earth.

1:2 And the earth was without form, and void; and darkness was upon
the face of the deep. And the Spirit of God moved upon the face of the
waters.

1:3 And God said, Let there be light: and there was light.


Now we have 10 words in the first verse. Start at any of the 10 words. Now count the letters in that word. If it is N go to the Nth word from that. Count the letters again and repeat the procedure. When you reach the third verse you will always end up in the word God, no matter from where you started!

eg. Let's begin from  (the word) "beginning"  itself.

it has 9 letters, so i move to the 9 th word from there which is "the" ( second word in the second verse). Now it has 3 letters so i go to the third word from there which is "without" which has seven letters
now repeating the procedure : beginning--the--without--upon--the--God!

Does this imply that God exists and the Bible is the ultimate proof for it? ;)

The Game of Four Fours

The rules of the game are like this

Make any positive integer from 1 to inifinity using four fours.

1) you can use four 4s
2)you should always use four fours.
3)you can use any mathematical operators any number of times
4) you can use brackets
5)you can use the factorial symbol any number of times (4!!!!!!!!!!!!!!!!!!!!!!!!)
6)you can use constructs like four raised to four; four raised to four raised to four
7)you can use the square root symbol any number fo times
8)you can use the decimal point (4.4 or .4 etc )
9)you can use dot above four ( eg: 0.44444444444444444444444444444..... can be represented by .4 with a dot above the four )


Some  samples below.

1= 44/44
2=(4*4)/(4*sqrt (4))
3= 4/4+ 4/(sqrt (4)) =(4+4+4)/4
..........................................................

9 = 4/.444 with a dot above the last four

now try making the numbers upto 100 (provided you have time) and especially 37,39,53,57, and 59.

This has been my favorite pass-time once.

Thursday, September 14, 2006

Programmer's day special

Hi all,

Today being programmer's day (I dont know whether there is actually such a day :but what they tell is today is the 256th day of the year and 256 is the number of values representable by a byte of data ) let me post two good C -puzzles I have seen.

Q1) The first question is write code in the change function so that the printf in main prints 5.You should not modify the main function and u shud not use printf in the change function

#include
void change()
{

/*write code here*/

}
int main()
{
int i;
i=5;
change();
i=10;
printf("%d",i);/* this should print 5*/
}



the solution is

void change()
{
#define i i=5,j
}

so whenever u see "i" it will be replaced by thepreprocessor as
i=5,j that is

int i; becomes int i=5,j;
similarly

i=10 becomes i=5,j=10; //the comma operator

and printf('%d",i ) becomes printf("%d", i=5,j);and printf ignores the second argument.


Q2)WAP in C to print ur name 1000 times without using semi colonsolution

void main (int argc, char **argv)
{
while (printf ("Babu Kalyanam\n") && ( argc++ <=1000)) { } } or you can use rather awkward solution 
void main()
{
if ( printf("Babu Kalyanam\n"))
if ( printf("Babu Kalyanam\n"))
if ( printf("Babu Kalyanam\n"))

/*repeat this 1000 times */

if ( printf("Babu Kalyanam\n"))
{}
}

Sunday, September 10, 2006

Will you marry me

*********************************************
When I saw your name next to mine,
In our wedding card,I felt blessed.

When I saw you smile,
Seeing me in the traditional bride groom dress,
I felt teased.

When I held your hand,
During the marriage rituals,
I felt responsible.

When you entered my lonely bachelor life,
And changed it into a heavenly abode,
I felt lucky.

When you showed the same love as I did,
Towards my parents,I felt proud.

When you scolded me,
For neglecting my heath amidst my hectic work,
I felt pampered.

When I saw you scream,
Crying out of labor pains,
I felt helpless.

When I saw tears of happiness in your eyes,
As you looked at our kid,
I felt blessed once again.

All these feeling have bloomed in my heart,
But are yet to blossom in reality.

As these are feelings I long to feel,
For these are still unfelt.

Will you marry me?
*********************************************
PS:
I got it from somewhere, and was kept unpublished till now. Credit belongs to whoever wrote it.
But I like this one very much!!!!

Tuesday, August 29, 2006

On number theory - Perfect Numbers

This post is about perfect numbers which is a very interesting concept in number theory. 

According to bible God created everything including man in six days.

"And God saw every thing that he had made, and, behold, it was
very good. And the evening and the morning were the sixth day." (genesis 1:31 (KJV) )

But why he took six days for doing that??? He could have done all these in a fraction of a second right???

The reason is that six is the smallest perfect number.

By definition perfect numbers are those numbers that are equal to the sum of it's distinct proper factors.

for example 6= 1+2+3

the next perfect number is 28 =1+2+4+7+14

the third one is 496 and the fourth being 8128

All the known perfect numbers are even. But it is not yet proved that odd perfect numbers does not exist.

There is one theorem on even perfect numbers ie.

If (2^n -1 ) is prime, then (2^n -1 )* ( 2^ (n-1)) is a perfect number.



Friday, August 18, 2006

Universe and Electrical Control Systems


Assume an automatic control system

an automatic control system can rectify minor problems in it and hence work smoothily by using the feedback mechanism in the system. Minor problems means changes in certain parameters due to temparature variation etc
The system itself can correct all these without any external intervention.

But if some bigger problems arise (some component out of order)
the designer can replace it, but the system itself cannot do anything. And since the designer is external to the system, the system does not know that a designer exists. So when suddenly a component is replaced the system will think a miracle has happened, where according to the designer everything works as expected.

The problem with we human beings is that we are part of a big system (the universe) and we can understand only that, and nothing external to that. Surely there exists something external to the universe which has its own laws and rules. But we cant comprehend the laws and hence we can just hope that if some problem occurs the external agent will intervene and correct it.


The external agent being superior to man can think and act in better ways and we may call him God.

So God is not different from us except that he lives in a super universe.And there may be super super universes where super super Gods may be maintaining super universes and so ad infinitum.

Wednesday, August 09, 2006