Saturday, September 22, 2012

Socha hai, a scientific inquiry


Time and again, i come back to this wonderful song penned by Javed Akhtar saahab and composed by awesome trio Shankar–Ehsaan–Loy :) This is one of the songs which, as Javed saahab himself puts it "Exuberance or any human feeling can also be expressed well and with depth.", and this one is of a genuine inquiry.

I will use Science (referencing Wikipedia mostly :) to answer the queries raised in the song. Why Science? Well as the http://www.guardian.co.uk/science/video/2012/sep/21/why-science-important puts it, it is one of the coolest ways of disciplined inquiry and since we all live in a technology driven world based on Science which works, probably it is a good idea to use it to explain things around ;) So lets get going:

आसमान है नीला क्यों ?
[why the sky is blue?]

Well it is not Blue all the time! The color of sky depends on what is the scattered and what remains :)

"Scattering is significant for light at all visible wavelengths, but it is stronger at the shorter (bluer) end of the visible spectrum, meaning that that the scattered light is more blue than its source, the sun. The remaining sunlight, having lost some of its short wavelength components, appears slightly less blue."
http://en.wikipedia.org/wiki/Sky

पानी गिला गिला क्यों?
[why the water feels wet?]

Well it is not just water, it is property possessed by the things in their liquid state.

"Wetting is the ability of a liquid to maintain contact with a solid surface, resulting from intermolecular interactions when the two are brought together. The degree of wetting (wettability) is determined by a force balance between adhesive and cohesive forces."
http://en.wikipedia.org/wiki/Wetting

गोल क्यों है ज़मीन?
[why earth is round?]

In general, a rotating body, wears and tears down to a spherical in shape because any rotating body in order to conserve energy takes the shape involving least tension [http://lasp.colorado.edu/education/outerplanets/giantplanets_whatandwhere.php#rotation]. But that said, Earth is not really round, it s more like an egg :)

"The shape of the Earth approximates an oblate spheroid, a sphere flattened along the axis from pole to pole such that there is a bulge around the equator.[66] This bulge results from the rotation of the Earth, and causes the diameter at the equator to be 43 km (kilometer) larger than the pole-to-pole diameter.[67] "
http://en.wikipedia.org/wiki/Earth#Shape


सिल्क मैं है नरमी क्यों?
[why silk feels soft?]

In general β-pleated sheets have this softy feeling to them and then it also textured in a way to give this nice feeling :) Silk is also used for making surgical sutures after chemically removing the irritant protein of silk, sericin .
http://en.wikipedia.org/wiki/Silk#Physical_properties


आग मैं हैं गर्मीं क्यों?
[why fire feels hot?]

Temperature  of a substance depends on this amazing property of their molecular vibration. This accidental insight led to the invention of microwave oven which probably most of us use everyday :) Now coming to Fire, a rapid oxidation of a material in the exothermic chemical process, bound to feel hot.


दो और दो पांच क्यों नहीं?
[why 2 + 2 ≠ 5?]

Well this was proposed in Orwell's 1984 as an example of dogma one must believe.
Now coming to the why part, short answer is that it is based on the way addition operator is defined. More formally, http://tachyos.org/godel/1+1=2.html and if you are really into this, then check out http://quod.lib.umich.edu/cgi/t/text/text-idx?c=umhistmath;idno=AAT3201.0001.001 as proposed in the former link ;)


पेड़ हो गए क्यों कम?
[why the number of trees have decreased?]

If http://www.grida.no/graphicslib/detail/number-of-trees-planted-world-map-unep-billion-tree-campaign-may-2008_1110 is to be believed, i guess sheer number may not be decreasing? But i feel this question is more about deforestation, well that is dude to human lust, for space, food and money...
http://en.wikipedia.org/wiki/Deforestation#Causes

तीन  हैं ये मौसम क्यों?
[why there are three seasons]

I am not sure about this number, i mean India is suppose to have four, anyway the reason of having this phenomena is Earth's tilt, shape(as discussed in a previous question:) and ellipitical orbit.

http://en.wikipedia.org/wiki/Season#Causes_and_effects

चान दो क्यों नहीं?
[why don't we have two moons?]

Well some planets for have more than 1 natural sattelite / moons so to speak :) But why Earth does not have two moons, i guess the answer lies in its creation. Here http://www.nature.com/nature/journal/v412/n6848/full/412708a0.html is one proposal :)



दुनिया मैं है जंग क्यों, बहता लाल रंग क्यों?
[why there is war in the world and unnecessary bloodshed?]

There are many reasons behind this depending on which war we are talking about :)

In Why Nations Go to War, by John G. Stoessinger, the author points out that both sides will claim that morality justifies their fight. He also states that the rationale for beginning a war depends on an overly optimistic assessment of the outcome of hostilities (casualties and costs), and on misperceptions of the enemy's intentions.
http://en.wikipedia.org/wiki/War#Motivations


 सरहदें हैं क्यों कर कहीं?
[why there are boundaries every where]

Mostly it is about ownership, giving us this feeling of pride and security i feel. But "There has been a renaissance in the study of borders during the past two decades, partially from creation of a counter narrative to notions of a borderless world that have been advanced as part of globalization theory."
http://en.wikipedia.org/wiki/Border#Border_economics


सोच है? ये तुमने क्या कभी?
[have you ever thought of these things?]
सोचा है? की है ये क्या सभी?
[have you ever thought what is all this?]
सोचा है? सोचा नहीं तो सोचो अभी!
[have you ever thought? if not, then think now]

I have, many times, then asked people around me with no success... those were the days without internet. So glad that Internet happened while i am alive :)



बेहती है क्यों हैर नदी?
[why all the rivers flow?]

This try to take lower possible energy state. Now talking about flow or "A current, in a river or stream, is the flow of water influenced by gravity as the water moves downhill to reduce its potential energy."
http://en.wikipedia.org/wiki/Current_%28stream%29

but it may not necessarily be the shortest path. "Rivers flowing downhill, from river source to river mouth, do not necessarily take the shortest path. For alluvial streams, straight and braided rivers have very low sinuosity and flow directly down hill, while meandering rivers flow from side to side across a valley."
http://en.wikipedia.org/wiki/River#Flow

होती क्या है रौशनी?
[what is light?]


"Visible light (commonly referred to simply as light) is electromagnetic radiation that is visible to the human eye, and is responsible for the sense of sight."
http://en.wikipedia.org/wiki/Light


बर्फ गिरती है क्यों?
[why does the snow fall?]

I guess the reason is similar to one of the previous questions about river-flow. Under gravity, things tend to move towards lower potential energy state.
Now coming to why Snow occurs in mountains, "In mountainous areas, heavy snowfall accumulates when air is forced to ascend the mountains and squeeze out precipitation along their windward slopes, which in cold conditions, falls in the form of snow."
http://en.wikipedia.org/wiki/Snow#Cause

दोस्त क्यों हैं रूठते?
[why friends get angry?]

This will depend of the type of friendship i feel. In general, i feel it is due to http://en.wikipedia.org/wiki/Cognitive_dissonance .


तारे क्यों है टूटते?
[what are falling stars?]

It is not really a star,
just some heavenly mass,
trying to make its way into the earth's atmosphere,
and in the process,
burning itself up

http://starchild.gsfc.nasa.gov/docs/StarChild/questions/question12.html



बादलों मैं बिजली है क्यों?
[why there is lightning?]

"Lightning is a massive electrostatic discharge caused by unbalanced electric charge in the atmosphere. Lightning can be either inside clouds (IC), cloud to cloud (CC) or cloud to ground (CG) and is accompanied by the loud sound of thunder."
http://en.wikipedia.org/wiki/Lightning 

---paragraph repeated---

सन्नाटा सुनाई नहीं देता,
[we can not hear the silence,]

"Silence is the relative or total lack of audible sound.", probably that is why ;)
http://en.wikipedia.org/wiki/Silence

I feel more interesting aspect here is the relative part of above, for example, Auditory masking.
"If two sounds of two different frequencies are played at the same time, two separate sounds can often be heard rather than a combination tone. The ability to hear frequencies separately is known as frequency resolution or frequency selectivity. When signals are as a combination tone, they are said to reside in the same critical bandwidth. This effect is thought to occur due to filtering within the cochlea, the hearing organ in the inner ear. A complex sound is split into different frequency components and these components cause a peak in the pattern of vibration at a specific place on the cilia inside the basilar membrane within the cochlea. These components are then coded independently on the auditory nerve which transmits sound information to the brain. This individual coding only occurs if the frequency components are different enough in frequency, otherwise they are in the same critical band and are coded at the same place and are perceived as one sound instead of two.[3]"


और हवाएं दिखाई नहीं देती!
[and can not see the wind!]

"Air is the name given to atmosphere used in breathing and photosynthesis. Dry air contains roughly (by volume) 78.09% nitrogen, 20.95% oxygen, 0.93% argon, 0.039% carbon dioxide, and small amounts of other gases. Air also contains a variable amount of water vapor, on average around 1%."
http://en.wikipedia.org/wiki/Air 
These are colorless gases. "What distinguishes a gas from liquids and solids is the vast separation of the individual gas particles. This separation usually makes a colorless gas invisible to the human observer."
http://en.wikipedia.org/wiki/Gas#Real_gas

सोचा है ये क्या कभी? होता है ये क्यों?
[have you ever thought why all of this happens?]


Wednesday, August 29, 2012

Programming a vibrational alarm for Android, HourlyReminder App


I was looking for some cron like command in android to make google nexus 1 vibrate in certain pattern (GOD in Morse Code :) for certain time. After a lot of googling, i found many resources to make this happen :) But it was not as straight forward as i thought...

Basically one needs to use android's AlarmManager to make it all work. Difference being that cron executes a command, while AlarmManager broadcasts an Intent and it will make your code do the magic when the alarm goes off :). BroadcastReceiver registered in your manifest takes this and runs when you reboot the system. One tricky thing is that you have to make sure that AlarmManager wake up the device in anticipation of alarm... God knows why! But this can be done via the WakeLock using PowerManager system service (make sure to add it in manifest!). Also one other critical thing is to force the system not to use SD via manifest.

There are many threads on stackexchange talking about all this, from where i shamelessly mashed up my code. It is available in the src/xml files of http://code.google.com/p/clock-ticker/source/detail?r=e584bf27adc0b82ccbb89c30209dc949c48aed84. If you would like to check out the app, it has been loaded at https://play.google.com/store/apps/details?id=Clock.Reminder :)

Sunday, June 24, 2012

Social order and intellect

While watching a controversial Norwegian documentary i was wondering about the relation between intellect and social hierarchy. After going through Nisbett's and Lareau's chapters suggested by Prof. Duneier, it seems like:

1. Tacit difference in upbringing of children for different roles between high and low socio-economic-classes (SEC); low SEC tend to provide punitive and stressful environment damaging pre-frontal cortex, while high SEC providing discussion with better vocabulary and information content
2. Society's treatment towards different classes
3. Migration pattern of races
4. Medical care between classes
5. Nutritional differences (vitamins, breast-feeding amounts to ~ 6 point IQ difference) between food taken by different classes

Nisbett also points that probably hereditary arguments also address non-trivial part of genetics, things like gene linked to happiness and rewards. He writes about Moore's research "When the child was having trouble with a design, white adoptive mothers tended to diffuse tension by joking, grining, and laughing."

However i did get confused reading "The black adoptive mothers were more likely to frown and scowl. The white adoptive mothers encouraged the problem-solving efforts of their children (“Gee, that’s an interesting idea” or “You’re good at this”). Black mothers were more likely to express disapproval (“You know that does not look right” or “You could do better than this if you really tried”)." from Nisbett while Lareau writing "The working-class and poor parents viewed children's development as spontaneosly unfolding, as long as they were provided with comfort, food, shelter, and other basic support. This commitment, too, required ongoing effort; sustaining children's natural growth despite formidable life challenges is properly viewed as an accomplishment.".