Thursday, December 04, 2008

Science, experiments, predictions, determinism

The initial few paragraphs are amazingly simple but after the Schrödinger wave function things get abstract. But the conclusion is a must read.

summary: Science and experiments are supposed to help us predict things more accurately and take advantage but quantum mechanics is doing the exact opposite...the more we understand the more we realize how clueless we are.

Wednesday, November 26, 2008

Life - lecture by Stephen Hawking

"Anthropic principle"

"the development of language, and particularly written language. It meant that information can be passed on, from generation to generation, other than genetically, through DNA."

"We may be no stronger, or inherently more intelligent, than our cave man ancestors. But what distinguishes us from them, is the knowledge that we have accumulated over the last ten thousand years"

"I think it is legitimate to take a broader view, and include externally transmitted information, as well as DNA, in the evolution of the human race"

"limitation and danger for future generations, is that we still have the instincts, and in particular, the aggressive impulses, that we had in cave man days. "

"There is no time, to wait for Darwinian evolution, to make us more intelligent, and better natured."

Friday, October 31, 2008

In the mood for some poems...
Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,

And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.

I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I—
I took the one less traveled by,
And that has made all the difference.

I met a traveller from an antique land
Who said: Two vast and trunkless legs of stone
Stand in the desert. Near them on the sand,
Half sunk, a shatter'd visage lies, whose frown
And wrinkled lip and sneer of cold command
Tell that its sculptor well those passions read
Which yet survive, stamp'd on these lifeless things,
The hand that mock'd them and the heart that fed.
And on the pedestal these words appear:
"My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!"
Nothing beside remains: round the decay
Of that colossal wreck, boundless and bare,
The lone and level sands stretch far away

Wednesday, December 05, 2007

Google and mobile phones

Some time in summer this year Vint Cerf came to bangalore and addressed the public.

People distributed small white cards to the audience who wanted to ask any questions to Vinton. I too wrote my question. In the end when Vinton finished his presentation and started to listen to the first question from the audience being read out by his assistant...I started asking the same question in way that made the assitant's voice my echo, loud enough so that some of my neighbours could hear it....but not louder, and with a big smile on my face.
"The world is flat today because of the internet(read as Vinton). But still in a country like india, there is a huge digital divide...what can we do?"

Vint said something to the effect of "Mobiles can reach more people than computers".

Google efforts reflect this...Android

Monday, November 05, 2007

Bharat Ek Khoj

Copy-pasted from Wikipedia, below is the title track translation

Truth/Good did not exist before the Universe came to be
Neither did Untruth/Evil
Neither did Space
Neither did the sky
What was hidden? Where?
Who had covered it?
At that moment
Unmoving, strong ocean was not there either

Who created the Universe
Is That a creator or destroyer?
Lives in the high skies
Always plays the part of the leader
That only knows the truth
Or maybe not
No one knows really
No one knows
No one knows really
No one knows really

That was wise before being born to Hiranya
That is the lord of all consciousness
That has the presence bearing the land and the skies

The skies are lit with it's strength
The earty prosperous, established, stationary
Heavens and Sun also stationary

Born with fire in it's womb
There was ocean here and there and up and below
Woken as the first and only life

Om! (Incantation) Creator of the Universe and heavens, ancestor watch over us
Immense ocean, savior of truth and religion watch over us
The vastness of directions are stretched like it's arms in all and over all

Wednesday, July 05, 2006

Hash table lengths and prime numbers

This has been bugging me for some time now...
The first thing you do when inserting/retreiving from hash table is to calculate the hashCode for the given key and then find the correct bucket by trimming the hashCode to the size of the hashTable by doing hashCode % table_length. Here are 2 statements that you most probably have read somewhere
  • If you use a power of 2 for table_length, finding (hashCode(key) % 2^n ) is as simple and quick as (hashCode(key) & (2^n -1)). But if your function to calculate hashCode for a given key isn't good, you will suffer from clustering of many keys in a few hash buckets.
  • If you use prime numbers for table_length, hashCodes calculated could map into the different hash buckets even if you have a slightly stupid hashCode function.
Ok, but why? Today I think I found out why...if u think I'm wrong put in a comment, at least for the sake of others reading this blog.

If suppose your hashCode function results in the following hashCodes among others {x , 2x, 3x, 4x, 5x, 6x...}, then all these are going to be clustered in just m number of buckets, where m = table_length/GreatestCommonFactor(table_length, x). (It is trivial to verify/derive this). Now you can do one of the following to avoid clustering
  • Make sure that you don't generate too many hashCodes that are multiples of another hashCode like in {x, 2x, 3x, 4x, 5x, 6x...}.But this may be kind of difficult because you have to come up with a perfect hashCode function.
  • Or simply make m equal to the table_length by making GreatestCommonFactor(table_length, x) equal to 1, i.e by making table_length coprime with x. And if x can be just about any number then make sure that table_length is a prime number.
"Wangchun Li" pointed outed out in the comments to "CLRS theorem 31.20". I approached it with a Ramanujan style proof, will look at the Hardy style proof in a bit.

Saturday, June 10, 2006

Marc Anthony

I need to know
They say around the way Youve asked for me
Theres even talk about You wanting me
I must admit thats what I want to hear
But thats just talk Until you take me there

If its true dont leave me All alone out here
Wondering if youre ever Gonna take me there
Tell me what youre feeling

cause I need to know
Girl you gotta let me know Which way to go
cause I need to know I need to know
Tell me baby girl cause I need to know
I need to know I need to know
Tell me baby girl cause I need to know

My every thought Is of this being true
Its getting harder Not to think of you
Girl Im exactly Where I want to be
The only things I need you here with me

you sang to me
i just wanted you to comfort me
when I called you late last night you see
i was fallin' into love
oh yes, i was crashin' into love
oh of all the words you sang to me
about life, the truth and bein' free yea
you sang to me, oh how you sang to me
girl i live off how you make me feel
so i question all this bein' real
cuz i'm not afraid to love
for the first time i'm not afraid of love
oh, this day seems made for you and me
and you showed me what life needs to be
yea you sang to me, oh you sang to me
all the while you were in front of me i never realized
i jus' can't believe i didn't see it in your eyes
i didn't see it, i can't believe it
oh but i feel it
when you sing to me
how i long to hear you sing beneath the clear blue skies
and i promise you this time i'll see it in your eyes
i didn't see it, i can't believe it
oh but i feel it
when you sing to me
just to think you live inside of me
i had no idea how this could be
now i'm crazy for your love
can't believe i'm crazy for your love
the words you said you sang to me
and you showed me where i wanna be
yea you sang to me, oh you sang to me

when i dream at night
I have been in love
and been alone
I have traveled over many miles
to find a home
there's that little place
inside of me
that I never thought could
take control of everything
but now I just spend all my time
with anyone
who makes me feel
the way she does

'Cause I only feel alive
when I dream at night
even though she's not real
it's all right
'cause I only feel alive
when I dream at night
every move that she makes
holds my eyes
and I fall for her every time

I've so many things I want to say
I'll be ready when
the perfect moment
comes my way
I had never known
what's right for me
'til the night
she opened up my heart
and set it free
But now I just spend all my time
with anyone
who makes me feel
the way she does

Now I just spend all my time
with anyone
who makes me feel
the way she does

More of Marc's songs