Showing posts with label VIEW. Show all posts
Showing posts with label VIEW. Show all posts

Computer Science's Math

There is nothing wrong if you apply your calculus to say (a+b)/2 = a + (b-a)/2. However, computer science says (a+b)/2 is NOT always equals to a + (b-a)/2. But why ? Think for a while.

Here is the answer: To compute (a+b) /2, one has to add two numbers first and then divide the sum by 2. Let's say we have a computer with 32 bit register size and both a and b are integers. If the sum of a and b i.e. a+b is bigger than the number it can be represented by 32 bit integer, then there will be an overflow. Thus, even if the actual result of (a+b)/2 can be represented by 32 bits, the intermediate calculation can be larger than it is supported by 32 bits.

On the other hand, when you compute a + (b-a)/2 , you are adding a, and (b-a)/2. obviously, (b-a) / 2 can be supported by 32 bits. Since we know that the final sum is also an integer of 32 bits, a+ (b-a)/2 will never be suffered from the overflow problem. Hence, (a+b)/2 may not always be equal to a + (b-a)/2!

An algorithm that is explained after decades !

What happens if you propose an algorithm that nobody understands ? Folks might say that your algorithm is silly. Don't be sad. It could be possible that folks are not capable enough to understand what you meant. Your algorithm could be explained even after your death.

Physicist J. W. Gibbs has similar story. He proposed Gibbs sampling but nobody could describe the algorithm for more than eight decades. Here is a paragraph from Wikipedia regarding Gibbs sampling:

"Gibbs sampling is an example of a Markov chain Monte Carlo algorithm. The algorithm is named after the physicist J. W. Gibbs, in reference to an analogy between thesampling algorithm and statistical physics. The algorithm was described by brothers Stuart and Donald Geman in 1984, some eight decades after the passing of Gibbs."


So conclusion here is not to be sad even though people do not understand you and your idea now. They'll understand after years and years of your death !

Ideas are simple but powerful !

Ideas are simple but they are powerful. Here is a story of a such idea, the idea of using "Captcha". If you don't know what a Captcha is, don't be worried. I'll explain it later in this article.
I'd heard this story from a radio about "WHAT IT DOES" but didn't know "HOW IT DOES". Today I read the HOW part and thus want to share to everyone.

What is a CAPTCHA ?
A CAPTCHA is a program that can tell whether its user is a human or a computer. You've probably seen them — colorful images with distorted text at the bottom of Web registration forms. CAPTCHAs are used by many websites to prevent abuse from "bots," or automated programs usually written to generate spam. No computer program can read distorted text as well as humans can, so bots cannot navigate sites protected by CAPTCHAs.

What is RECAPTA ?
It is a free CAPTCHA service used to digitize books, news paper etc.

How does RECAPTA help in digitizating documents ?
OCR is a device used to digitize a document. The problem is that the device cannot digitize all the words in the document correctly. It informs if it cannot digitize the words. A word which is not digitized by OCR is mixed with a known word and a new captcha is formed. The new captcha is challenged to human. Those who type the known word correctly are believed to type the word to be digitized correctly. To make it perfect, the new captcha is challenged against many people. By this way the confidence of the word to be digitized is improved.

Therefore, the idea is simple but powerful !

Reference:
Recapta

Why did I donate to Wikipedia ?

Support Wikipedia
Very few things are free in this world. Wikipedia is one of the free websites. You can increase your knowledge or write articles to share with others for FREE.

Most of the websites you visit contain advertisement by which they receive money and survive. Have you ever noticed such ads in Wikipedia ? Absolutely not ! It's ads free and totally free. Then, how come the website is surviving ? The answer is here:
To do this without resorting to advertising, we need you. It is you who keep this dream alive. It is you who have created Wikipedia. It is you who believe that a place of calm reflection and learning is worth having. - Wikipedia Founder Jimmy Wales

It is worth-mentioning to tell you that Wikipedia is in top 10 MOST VISITED WEBSITES in this world. In average, I visit this website 5 times a day. You can even download all the Wikipedia in your computer if you wish. My friend did it and he said it was 28 Gb as of Nov, 2010.

I love this so much coz I receive a lot of information from it. I want to protect it. Thus, I donated $10 to keep it surviving. Here is the email I got once I donated to the Wikipedia Foundation:

Dear NOBAL BIKRAM NIRAULA,

Thank you for your gift of USD 10.00 to the Wikimedia Foundation, received on December 22, 2010. I’m very grateful for your support.

Your donation celebrates everything Wikipedia and its sister sites stand for: the power of information to help people live better lives, and the importance of sharing, freedom, learning and discovery. Thank you so much for helping to keep these projects freely available for their more than 400 million monthly readers around the world.

Your money supports technology and people. The Wikimedia Foundation develops and improves the technology behind Wikipedia and nine other projects, and sustains the infrastructure that keeps them up and running. The Foundation has a staff of about fifty, which provides technical, administrative, legal and outreach support for the global community of volunteers who write and edit Wikipedia.

Many people love Wikipedia, but a surprising number don't know it's run by a non-profit. Please help us spread the word by telling a few of your friends.

And again, thank you for supporting free knowledge.

Sincerely Yours,
Sue Gardner
Executive Director

* To donate: http://donate.wikimedia.org/
* To visit our Blog: http://blog.wikimedia.org/
* To follow us on Twitter: http://twitter.com/wikimedia
* To follow us on Facebook: http://www.facebook.com/wikipedia

OWL API hasKey problem

OWL doesn't allow datatype properties to be inverse functional one. One can assume an inverse functional property as a unique key in database. OWL2 comes with the concept of hasKeys.

Few days ago I tried to parse the owl file having hasKey using Jena. Unfortunately, I found that Jena doesn't have the parser for OWL2 yet. Next, I found that The OWL API supports OWL2. Today, I spent my whole day to use the hasKey feature of OWL2 specification. I tried to parse the owl file using this parser. It parses the owl. But when I print the hasKey axioms after parsing, I get only output in forms of genid* i.e. no property names that are used in hasKey are obtained.  To me it seems like a bug of the parser ... couldn't manage to get the keys :(. If anyone of you let me know how we get the properties specified in hasKey, I will give you a BIG thank you.

The portion of the owl is given below:
<owl:class rdf:about="#Conference">
<rdfs:subclassof rdf:resource="&amp;owl;Thing">
<owl:haskey rdf:parsetype="Collection">
<owl:datatypeproperty rdf:resource="#confName">
<owl:datatypeproperty rdf:resource="#confYear">
<owl:datatypeproperty rdf:resource="#confType">
</owl:datatypeproperty></owl:datatypeproperty>
</owl:datatypeproperty></owl:haskey>
</rdfs:subclassof></owl:class>

Code to print the hasKey :
private void printHasKeyAxioms(OWLOntology ontology, OWLClass cls) {
Set keySet=ontology.getHasKeyAxioms(cls);
System.out.println("\t Total hasKey: "+keySet.size());
if(keySet.size()>0)
{
Iterator
keyIter=keySet.iterator();
while(keyIter.hasNext()){
OWLHasKeyAxiom key=keyIter.next();
Set
exp=key.getPropertyExpressions();
for(OWLPropertyExpression p:exp){
System.out.println("\t - "+p+" ");
}
}
}


Output (for cls=Conference): (Some info. is correct: Conference class has a key which has has three properties ) 
Total hasKey: 1
- <http://leo.inria.fr/publication.owl#genid7>
- <http://leo.inria.fr/publication.owl#genid9>
- <http://leo.inria.fr/publication.owl#genid11>


However, I expect names of properties instead of genid* in the output ...

Well-Educated- My definition

Well-Educated : "Some see just water in river, others see electricity; some see nothing in air, others see power; some see just pollution in waste, others see energy; some see frustration in failures, others see vehicles to the success; some see Facebook, Twitter, YouTube, Email and Chat in Internet, others see the possibilities and future. If you belong to 'others' you are well-educated." :)

View: Why institutions are corrupt?

Today I read an opinion entitled "Why Nepali institutions are corrupt? ". The article is written by Dr. Ananda Jha where he presents reasons behind the corruption that is going on in our institutions. He has presented very interesting thesis and supporting examples.

Dr. Jha writes, "A person accepting bribes compares the benefits of taking bribes with its costs. If the benefits exceed the costs, he accepts it; if it does not, he rejects it. Regardless of his race, place of residence, education, and his level of income, it is this cost and benefit analysis that determines whether he accepts bribes." In other words, a person tries to analyse the possible negative consequences of taking bribes as well as the benefits. For example, he considers whether there is a chance of doing investigation on it and so on. And benefits of course in terms of the amount of money he is going to receive. Based on this analysis, he determines whether to take bribe or not. To illustrate more, Dr. Jha presents an example: "Try giving 5,000 rupees to the police chief of Kathmandu to hush a murder, and he will throw you out of the room. Try giving him 5 million, and maybe he will think twice before being impolite to you. Try giving 50 rupees to motorcycle license granting operator to bend the rules for you, he will get offended. Try giving him 5,000 rupees, and he might actually bend the rules for you." Moreover, he says that the same rule i.e. cost and benefit analysis applies to the one who is offering bribes. If he has to pay more cost, he doesn't offer else he does.

Dr. Jha tries to focus on the rules in Nepali institutions. I admit that if the laws are strong and they are enforced properly, costs of taking and offering bribes are high. Developed country also have corruption cases though the cost is higher compared to the developing and poor countries because the benefits offered are comparable with the corresponding costs and they are higher compared to that of the developing and poor countries.

In conclusion, I agree with the cost and benefit model of corruption mentioned by Dr. Jha. The rules are equally applicable to any institutions in the world.

View: Free Banana VS Paid Mango

Tell me, what do you do when you have to study or know about something. Most probably you ask your friends unless you don't have Internet facility. Otherwise, the de facto means of getting any information is the web. For example, imagine a person wants to know about Nepal. No doubt, he uses his favourite search engine, such as Google, Yahoo or Bing, and queries the term Nepal. If he doesn't like the articles in the result set provided by the search engine, he tries with other sources. This is what happenes to me. Last year, when I wanted to study 'French Revolution', I asked Google which offered me Wikipedia as the first source. Actually, I didn't like the article in Wikipedia and tried in MSN Encarta. The article in Encarta about French Revolution was awesome.

Recently, I wanted to refreshed the French Revolution. This time I tried 'French Revolution Encarta' in Google because I already knew that the article there was very good. Unfortunately, I was offered an error page with this information: "The MSN Encarta page you are trying to visit has been discontinued...". I was unhappy to know that the good article is no more available other than in Google's cache.

This raised me a few questions : why the article is not accessible ? May be I need to pay now because MSN Encarta is not free unlike Wikipedia. I again went to Wikipedia to know more about MSN Encarta and found that it is DEAD JUST A WEEK AGO. Wikipedia says, "In March 2009, Microsoft announced it was discontinuing the Encarta disc and online versions. The MSN Encarta site in all countries except Japan was closed on October 31, 2009. Japan's Encarta site will close on December 31, 2009".

The point I want to express is not about my way of accessing information. Rather, it is about the way people consume information. On one hand, Wikipedia, which is a outcome of freelancers' contribution, is gaining momentum. On the other hand, MSN Encarta, which is a commercial product of Microsoft, is vanishing. What does this indicate ? This is the crux of this article.

My answer is simple: the former one is the 'Free Banana' and the later one is the 'Paid Mango'. In my view, given Free Bananas and Paid Mangoes, even a person, who is a fan of Mango, takes Banana simply because of the tag: FREE. That is to say, very few people are willing to pay for a service leaving a similar free service behind.

In conclusion, the way people consume information has changed. People choose free services not the paid services which is tantamount to choosing between Free Bananas and Paid Mangoes. No matter how sweet mangoes are, no one wants to buy them when bananas are readily available for free.

Freedom: Fall of Berlin Wall

Guns can do nothing; barriers can do nothing - they just intimidate people for days or may be for few years; they may claim few lives. No weapons are needed to counter-attack junta and dictators. Just need to make people aware of their RIGHTS and FREEDOMS. Look at the "Fall of Berlin Wall" in 9th Nov 1989. Anybody who has visited Berlin must have a bag of words at this moment: November 9, 1989; Berlin Wall; East and West Germany; Brandenburg Gate; Checkpoint Charlie; People's Freedom.

Identity Crisis

I read in some newspapers that China will have the largest economy in the world by two decades now. Remember that two decades is not a long period to wait for that achievement. It is the time when a recently born child will be 20 years old ! I'm very happy for China's astonishing achievements.

I'm a citizen of its neighboring country, Nepal. Having richer and successful neighbors not only make us happy but also provide some ways of identification. For example, we can say that Nepal is near to CHINA. Even these days, I NEED to say my friends that Nepal is a small country that is situated in between China and India. Then, they understand the location.

However, I don't want to introduce my country referring to my neighbors. I want our own identity. However, current situation in my country doesn't show a single hope for that. If the ambient continues, I will not have any other options to introduce my country other than referring to the neighbors. I fear that we may get another identity, "the failed state" :(.

Why don't our politicians learn from the past? Why don't they study JUST the neighbors? Why don't they understand that current China is not the Maoist country?...I have thousands of such WHYs in mind. Sometimes, I think I should be a leader because I know something. But I also know that having knowledge and skills don't work to become a successful leader in my country. Take an example, a father recommends (appoints) his daughter a vice-president not because of her skills but to keep his family's influence on the politics. What a stupid leader! What a shameful situation! These are the few facts that actually hinder to get our own identity and, therefore, creating the identity crisis.

Discussion: Where is my Nobel Prize ?

Recently, I read a very good article in Times of India whose title is Where is my Nobel Prize?. The author tries to explain why Indians lack to get such prizes though their population is so high. He has analyzed many possible reasons. However, I liked following paragraph the most:

"Talent is rare, and randomly distributed across the human population, irrespective of pedigree, connections or wealth. Some may call talent an unfair gift. However, it is talent that allows ordinary people to come up in life. Otherwise. rich people would stay rich and poor people poor. Thus, this unfair talent actually makes the world fairer"

Many friends gave their views. Here are the views :

Vijay: I think, it is bit complex.To become successful in life people need talent, hard-work, opportunities, etc.While talent is an asset distributed across the human population, opportunities are more open towards the rich.

Deepak:I think talent isn't unfair gift, because everyone got an unique talent, its just matter of recognizing and mastering it to make some productive outcome, so there are two kind of people winners and losers...hope i made some sense :)

Me:
@Vijayalyan: I totally agree with you. I think, that is the reason why 'talent' people of developing countries, even though they are 'industrious', either don't get 'Novel Prize' (coz of few opportunities) or receive once they moved to developed countries.

@Deepak: I don't think only 'trying to master' makes a person talent. For example, one may fail to become a popular singer though he really wants to become so and practices a lot, a lot & a lot, possibly taking courses from experts. Why, then, he can't get success eventhough he works with several 'famous musicians' etc..???

What I think here is that he doesn't have gifts (vocals) i.e. talents and therefore cannot master and produce productive outcomes :).

Bishnu: TALENT: To Achieve in Life with Enough Number of Tries....

Krishna: absolutely true...

Mandip: nobal le sarai thik kura garyo...............

Me: @Bishnu: khai ta mero singer wala example le timro TALENT ko defn lai support gardaina ni...

Surendra: I also believe in the stochastic distribution of talent, but I think that every people has talent. So, if somebody has not a good voice he may not be a successful singer but he may have good painting skill or ...So, Identification of owns skill is important.

Bishnu: Everything is not universal ni ta....tai pani timro singer ko example ma...talent and success are two different things in life...tara if some one practice then it is nothing that he/she cannot get...kun level ma pauney it depends and also kati time ma pauney also depends....tara it does not mean ki u saga talent nai chaina....How we see the world ...

Me: @Surendra: u think that "everybody has" talent but you also think that it has "stochastic distribution"--seems contradiction hehe. I think u mean to say one cannot predict who can identify his skills and who can't. Thus, the talent is random. If so, I agree :)

Surendra:Different people has different talents. its distribution is random irrespective of cast creed, economical status and geographical location. Every one is equally likely to be a successful man. However, commitment, dedication & passion is essential to identify hidden talents

Me: @Bishnu: My assumption is that a talent guy gets at least a success ... You made me talent in singing coz I can sing better compared to sb hehe... thnx :)

Life - an optimization problem

"Life is a complex optimization problem. We need to think the matching values of its variables, which may not be the best values for themselves, in order for maximizing the life's objective function" - Me.

Bloggers are the sensors

I prefer to say: "BLOGGERS ARE THE SENSORS". Sensors are triggered as soon as they sense the changes in the environment; bloggers are triggered as soon as they sense popular news or stories in the society. Similarly, sensors help humankind by providing their services. A number of BLOGGERS can easily direct the society by providing their views. Think from another angle, what if sensors of a machine don't work ? Answer is simple: the machine may not work properly. Similarly, if bloggers don't blog and don't raise social issues and views, society may not be directed the way it should be.