February 23, 2011
How Scrollable ResultSets Work?
February 22, 2011
How JVM handles thread synchronization?
Story of a Java Program from start to end
February 4, 2011
Time Complexity of Algorithms
If you feel like reading this post slowly and carefully, it will describe what this notation _really_ means.
All functions have some kind of behavior as n grows towards infinity. For example, if f(n) = 1/n, then as n grows towards infinity, f(n) gets closer and closer to zero. Whereas if f(n) = n*n, then as n grows towards infinity, f(n) grows too.
Functions can grow at different speeds. If two functions are equal, then they obviously grow at the same speed. But wait, there's more! Two functions are deemed to grow at the same speed if they're separated by a constant multiple! For example, if f(n) = n*n and g(n) = 3*n*n, then f and g are deemed to grow at the same pace, because g(n) = 3*f(n), so they are only a constant multiple apart. That is, g(n) / f(n) = 3, as n grows arbitrarily large.
But consider the scenario where f(n) = n * n, and g(n) = n. Then what is the behavior of f(n) and g(n) as n grows arbitrarily large? Well, f(n) / g(n) = (n * n) / (n). Which simplifies to f(n) / g(n) = n. Which means that as n grows large, f(n) = n * g(n). What does this mean? f and g are in this case not separated by a constant multiple. The multiple between f and g grows larger and larger as time progresses, without stopping. We say that "f grows faster than g" when this happens. Or "g grows slower than f". Just try some sample values of n: Try 10, 100, and 1000. First, f(10) / g(10) = 100 / 10 = 10. f(100) / g(100) = 10000 / 100 = 100. f(1000) / g(1000) = 1000000 / 1000 = 1000. We can easily see, hopefully, that the ratio between f and g is not constant.
Now consider the scenario where f(n) = 2 * n * n + 1, and g(n) = n * n. In this case, our functions have the ratio f(n) / g(n) = (2 * n * n + 1) / (n * n). What is the value of this ratio as n grows towards infinity? The answer is 2. Let's simplify the expression:
(2 * n * n + 1) / (n * n) =
(2 * n * n) / (n * n) + 1 / (n * n) =
2 + 1 / (n * n).
So f(n) / g(n) = 2 + 1 / (n * n).
So as n grows large, the term 1 / (n * n) gets arbitrarily (or rediculously) small. As n grows large, then, the value of (2 + 1 / n * n) gets closer and closer to 2.
We could plug in some values -- let's try 10, 100, and 1000 again.
f(10) / g(10) = (2 * 10 * 10 + 1) / (10 * 10) = 201 / 100 = 2.01
f(100) / g(100) = (2 * 100 * 100 + 1) / (100 * 100) = 20001 / 10000 = 2.0001
f(1000) / g(1000) = (2 * 1000 * 1000 + 1) / (1000 * 1000) = 2000001 / 1000000 = 2.0000001.
So the ratio between these two functions approaches a constant value as n grows large. Hence, f and g are said to grow at the same pace.
In comparing the growth rates of functions, we have these rules:
1. If f(n) / g(n) grows out of control, getting larger and larger as n gets larger, then f is said to grow faster than g.
2. If f(n) / g(n) settles towards some constant positive value, then f is said to grow at the same pace as g.
3. If f(n) / g(n) gets closer and closer to zero, then this means that its reciprocal, g(n) / f(n), is growing out of control, so g is said to grow faster than f. (Or f is said to grow slower than g.)
Now on to big O notation!
Big O notation actually refers to an entire _set_ of functions. The notation O(expression) represents the entire set of functions that grow slower than or at the same pace as expression. For example, O(n^2) represents the entire set of functions that grow slower than or at the same pace as n^2.
In other words, if g(n) = n, then since n grows slower than n^2, it follows that g lies in the set O(n^2). Likewise, if h(n) = 2 * n * n + 1, then since h grows at the same pace as n^2, it follows that h lies in the set O(n^2).
It's also true that h lies in the set O(n^3), because h grows slower than n^3. (Assuming the leading term is positive, quadratic functions always grow slower than cubic polynomials, which always grow slower than fourth-degree polynomials, which always grow slower than fifth-degree polynomials, and so on.)
Because O(expression) represents all the functions that grow _slower_ than or equal to expression, it is used to represent upper bounds.
The other notations refer to different sets of functions. For example, o(expression) represents all the functions that grow slower than expression (and not at the same speed.) f(n) = n^2 + n - 1 lies in the set O(n^2), but it doesn't lie in o(n^2). g(n) = n lies in both.
Theta(expression) represents all the functions that grow at the same rate as expression.
Omega(expression) represents all the functions that grow faster than or equal to expression.
In computer programs, we are of course interested in how much time it takes programs to run, and these forms of notation are useful for representing that, so that's why we use them. When you say an algorithm runs in O(expression) time, you're just saying that the algorithm's runtime is no worse than some multiple of expression. When you use Theta, you're saying that the algorithm's runtime is some multiple of expression. And Omega is used to say that the amount of time an algorithm takes to run grows at a rate that is larger than or equal to some expression's rate of growth.
Please feel free to post any comment or suggestions ...
Cheers!!!
November 21, 2010
Review on credit score
Consumers can receive this information from many lenders, financial institutes, and other entities that deal with similar topics. As the free american credit score online is reviewed, the consumer has the ability to determine the best ways to remedy any problems or maintain a good status. The most important information that is available through a free credit score on line is the actual rating or score. Consumers can also view debts, loans, and other charges that have been assessed over a period of time. This information shows the consumer this financial information and allows them the opportunity to know how credit score decisions in the past have affected credit ratings.
Lenders will have the opportunity to increase business as consumers review their information. As consumers learn of where they stand as far as their rating is concerned, many will want to find a way to increase the number. One of the most effective methods of improving credit is to receive a loan to repay debts, loans, or other charges that have been assessed. Lenders that offer the consumer a chance to review a free credit score online and then offer services to help improve that score can gain customers and increase profits. The ability for consumers to receive a free credit score on line will make lenders much more attractive to consumers in search of a way to improve scores or maintain a high rating.
September 6, 2010
Digambar & Shwetambar
It is not necessary to go into the differences of the two sections of Jains- the Swetambars and the Digambars. Briefly speaking, the Swetambars believe in Sabastra Mukti, that women can attain salvation, recognize Sabastra Guru and hold that in the Kaivalya condition Mahavira had illness. The Swetambar Jains holds that Mahavira Swami married and ruled and had a daughter. They are also of the view that the 19th Tirthankara was a lady Mallahkumari.
But the Digambars believe in Diganibar Mukti and they do not admit that because of certain deformities peculiar to their sex, women call attain Mukti in the present life, but can do so in a future birth. However, they can, at the same time, observe the great vows and lead a true Jain life. The Digambar Jains does not recognize Sabastra Guru. They hold that Mahavira Swami was a Bal Brahmachari and he had never married, nor did he have any raj. They do not believe that in the Kaivalya condition Mahavira Swami had any illness. They hold that the 19th Tirthankara was a male and his name was Mallinath. The two sects also differ as to the birth-place of Mahavira Swami.
According to the Swetambars,Kundaligram in Monghyr district is the birth-place of Mahavira. According to the Digambars, Kundalipur near Nalanda is his birth-place. There is a third school of Jains who now claim Vaishali in Muzaffarpur district as the birth-place of Mahavira Swami. It appears that certain sections of both theSwetambar and the Digambar sects accept Vaishali to he the birth-place of Mahavira Swami. Incidentally, all these three places that are taken to be the birth-place of Mahavira, are in Bihar.
Many Jain images ill different parts of India are mistaken to be Buddhist images. It has been observed: "The Jain images are mostly either in padmasan or khadgasan mudras. They are also characterized by nasagrahadrishti and by veetaraga mudra. The gaze is fixed to the top of the nose and there is an air of sublime detachment. The Digambar Jain images are characterized by their nudity and the left palm is on right palm and no offerings of jewels or ornaments are made. The Swetambar Jain images are conspicuous by loin-cloth, the right palm being on left palm and offerings of jewels and ornaments are made.
Remarkable feature of Jainism is that, while the later orthodox Hindu preachers had assailed Buddhism and its philosophy, Jainism was hardly ever touched. Despite internal schism, the creed never died. Jainism is still a living cult in India and has its devotees in other countries as well. Probably, the sources of the strength and persistence of Jainism are in a continuous flow of active laity that has formed into a harmonious relationship with the preaching order.
June 24, 2010
Anti oxidants for free radicals
Endurance exercise can increase oxygen utilization from 10 to 20 times over the resting state. This greatly increases the generation of free radicals, prompting concern about enhanced damage to muscles and other tissues. The question that arises is, how effectively can athletes defend against the increased free radicals resulting from exercise? Do athletes need to take extra antioxidants?
Because it is not possible to directly measure free radicals in the body, scientists have approached this question by measuring the by-products that result from free radical reactions. If the generation of free radicals exceeds the antioxidant defenses then one would expect to see more of these by-products. These measurements have been performed in athletes under a variety of conditions.
Glutathione (gamma-glutamyl-cysteinyl-glycine; GSH) is the most abundant low-molecular-weight thiol, and GSH/glutathione disulfide is the major redox couple in animal cells. The synthesis of GSH from glutamate, cysteine, and glycine is catalyzed sequentially by two cytosolic enzymes, gamma-glutamylcysteine synthetase and GSH synthetase. Compelling evidence shows that GSH synthesis is regulated primarily by gamma-glutamylcysteine synthetase activity, cysteine availability, and GSH feedback inhibition. Animal and human studies demonstrate that adequate protein nutrition is crucial for the maintenance of GSH homeostasis. In addition, enteral or parenteral cystine, methionine, N-acetyl-cysteine, and L-2-oxothiazolidine-4-carboxylate are effective precursors of cysteine for tissue GSH synthesis.
These initial products position OXIS for a feasible entry into the wellness market with a lot of room for expansion. This paves the way for solid partnerships with leaders in the industry with an established customer base or those with the capacity to build one. The ultimate goal is to be regarded as a health partner. For now, it may be penny stocks for OXIS, but with more nutraceutical products lined up (including functional foods like nutrition bars and energy beverages sold over the Internet and through multi-level marketing, infomercials, direct mail, and retail outlets), the future of OXIS is secure and will benefit people all over, allowing them to be healthy and young.
http://www.oxis.com
Oxis on Twitter
Oxis on facebook
