I would like to start by saying never follow people's advice, the greatest adventures in life come from disobeying.
But since this is an opinion article
The question you should first ask yourself is why?
Maybe you need these languages for code someone else wrote>
What Do you Mean by Efficient Code?
You need more efficient code
code which runs faster?
code which uses less memory?
code is easier to write?
I think the key lesson to remember is that your time is more precious than the computer's time.
Experimental Languages
Both C++ and Perl are ill designed languages which were both designed as "macro" languages to leverage existing programming languages.
I think we could call them experimental languages or maybe prototype languages in their design.
They are organic languages which have grown according to need and lack a grand design
This is precisely the key to their success, they have evolved like a genetic mess to fill in the niches of need.
The point of Perl was to avoid writing long shell and awk programs whereas C++ was at the time the best way to combine the efficiency of C and the object-oriented properties of slower language like Smalltalk.
There are many interesting ideas that came from these languages like templates in C++ and regular expressions in Perl but these have now been taken further.
Lessons Learned from These Languages
In my opinion the only practical reason one should learn these languages is to maintain existing code.
Studying these languages is also a lesson in what works and what doesn't and the principles one should adhere to in designing a language.
You can write your C code to work like C++ code.
You might also find that once you've learned these languages they don't stick in you memory.
The Ruby language was designed with the principle of least surprise or intuition.
You need only remember a few key points and then you can derive everything from first principles.
Which is why language which have an interpreter are much easier to pick up
My Advice for What It's Worth
If you think you need to learn C++, learn C first. Once you've learned C you will realise C++ is just a coverup for C.
If you think you need to learn Perl, learn Python first.
Thursday, 30 May 2013
"Power law: a universal pattern" or "why rare things are diverse" or "is new rare?"
Power law is as universal as the exponential function, you might have heard of 90-percent-10-percent-rule. Maybe that would be a better name for it. The negative exponential law.
An exponential decay process
This pattern arises naturally from count data.
First time I heard of it was in the context of software development whereby 10% of the code takes up 90% of the time to write. This tends to be the case because programming bugs can be very difficult to discover and when they are found it is usually that the error originates from a single line of code.
However I am now seeing a similar sort of pattern emerge in the context of biological diversity.
For example if we consider the cells in our blood, the great majority (maybe up to 99%) of them are as you would expect, red whereas a small percentage of them are white.
However there is much greater polymorphism (fancy way of saying diversity) in the minority of white blood cells than there is in the red blood cells. Red bloods cells pretty much all do the same thing whereas white blood cells, which are part the immune system, are incredibly functionally diverse.
Another example from biology is when looking at polymorphic regions of DNA across populations. If we consider a region across different people the majority of people will probably have the similar sequences but there is a small proportion which will account for most of the diversity.
This is why biology is getting more and more complicated because we are constantly opening small Pandora boxes of diversity as we dig deeper and deeper. New discoveries are always by definition rare. This is something that might be obvious to some of you but wasn't to me.
The logic here is they were not rare then we would have found them earlier.
Either there is some intrinsic property for rare events to be heterogeneous because they originate from diverse sources or maybe it's simply because patterns only emerge once you have a sufficient sample size.
And that is I believe a key insight:
Rare things will always seem more heterogeneous because patterns only emerge once you have a sufficient sample size. As an example if you generate number from a known distribution say the normal distribution you need a sufficient sample size before you ascertain with a certain degree of certitude what the nature of the distribution is (until then you will have competing models in your mind (think Bayesian)). Also groups can only formed once you have seen something substantial different.
For example if was to place points randomly on a plane you might no see any pattern but say i placed a point much further away from the center of group of points then suddenly because i have increased the scale (zoomed out) you would tend to want to cluster those original points and the new point might be classified as an outlier from the existing random generation process or become a cluster of its own if.
An example would be:
Say I was to generate random numbers from a normal distribution with a mean of 0 and a standard deviation of 1. Only once a sufficient number of points had been generated would you be able to assert whether there was any relationship between these points. A more visual example is say you had customer coming to sit at invisible tables in a restaurant. Only once you would have observed enough customers would you have any idea of the number, shape and capacity of these tables. In this particular context would probably want to make some assumptions about the tables.
In networks, the edge count distribution in scale-free networks follows a power-law. Which means that there are a few hubs of high connectivity and many nodes of low connectivity. The hubs can be thought of as clusters.
The distribution of wealth follows a negative exponential distribution. Or at least used to but is becoming now more multimodal.
The distribution of city size follows a power law.
The tail of the distribution will get longer as more cities pop up.
Mark McCarthy said at GCD2013: "taken individually variants are rare but genetic variation is common". This is perhaps a bit of a tautology but diversity implies that things are different in unique ways meaning that taken individually they are rare, much like the long tail of the negative exponential function.
Another impact of new allele discoveries is that they decrease the overall frequency of older alleles.
This decreases the MAF and consequently the odds ratio since the MAF in the cases stays the same but the OR in the controls decreases.
What about the diversity of alleles in common genes vs the allele diversity in rarer genes?
For example KIR3DL1 KIR3DS1?
The Gini index is measure of statistical dispersion.
And yes you will probably spend 90% of your time looking at the rarest 10%...
Stumpf, M. P. H., & Porter, M. A. (2012). Critical Truths About Power Laws. Science, 335(6069), 665–666. doi:10.1126/science.1216142
Where λ is the exponent of the power law.
An exponential decay process
This pattern arises naturally from count data.
First time I heard of it was in the context of software development whereby 10% of the code takes up 90% of the time to write. This tends to be the case because programming bugs can be very difficult to discover and when they are found it is usually that the error originates from a single line of code.
However I am now seeing a similar sort of pattern emerge in the context of biological diversity.
For example if we consider the cells in our blood, the great majority (maybe up to 99%) of them are as you would expect, red whereas a small percentage of them are white.
However there is much greater polymorphism (fancy way of saying diversity) in the minority of white blood cells than there is in the red blood cells. Red bloods cells pretty much all do the same thing whereas white blood cells, which are part the immune system, are incredibly functionally diverse.
Another example from biology is when looking at polymorphic regions of DNA across populations. If we consider a region across different people the majority of people will probably have the similar sequences but there is a small proportion which will account for most of the diversity.
This is why biology is getting more and more complicated because we are constantly opening small Pandora boxes of diversity as we dig deeper and deeper. New discoveries are always by definition rare. This is something that might be obvious to some of you but wasn't to me.
The logic here is they were not rare then we would have found them earlier.
Either there is some intrinsic property for rare events to be heterogeneous because they originate from diverse sources or maybe it's simply because patterns only emerge once you have a sufficient sample size.
And that is I believe a key insight:
Rare things will always seem more heterogeneous because patterns only emerge once you have a sufficient sample size. As an example if you generate number from a known distribution say the normal distribution you need a sufficient sample size before you ascertain with a certain degree of certitude what the nature of the distribution is (until then you will have competing models in your mind (think Bayesian)). Also groups can only formed once you have seen something substantial different.
For example if was to place points randomly on a plane you might no see any pattern but say i placed a point much further away from the center of group of points then suddenly because i have increased the scale (zoomed out) you would tend to want to cluster those original points and the new point might be classified as an outlier from the existing random generation process or become a cluster of its own if.
An example would be:
Say I was to generate random numbers from a normal distribution with a mean of 0 and a standard deviation of 1. Only once a sufficient number of points had been generated would you be able to assert whether there was any relationship between these points. A more visual example is say you had customer coming to sit at invisible tables in a restaurant. Only once you would have observed enough customers would you have any idea of the number, shape and capacity of these tables. In this particular context would probably want to make some assumptions about the tables.
In networks, the edge count distribution in scale-free networks follows a power-law. Which means that there are a few hubs of high connectivity and many nodes of low connectivity. The hubs can be thought of as clusters.
The distribution of wealth follows a negative exponential distribution. Or at least used to but is becoming now more multimodal.
The distribution of city size follows a power law.
The tail of the distribution will get longer as more cities pop up.
Mark McCarthy said at GCD2013: "taken individually variants are rare but genetic variation is common". This is perhaps a bit of a tautology but diversity implies that things are different in unique ways meaning that taken individually they are rare, much like the long tail of the negative exponential function.
Another impact of new allele discoveries is that they decrease the overall frequency of older alleles.
This decreases the MAF and consequently the odds ratio since the MAF in the cases stays the same but the OR in the controls decreases.
What about the diversity of alleles in common genes vs the allele diversity in rarer genes?
For example KIR3DL1 KIR3DS1?
The Gini index is measure of statistical dispersion.
And yes you will probably spend 90% of your time looking at the rarest 10%...
Stumpf, M. P. H., & Porter, M. A. (2012). Critical Truths About Power Laws. Science, 335(6069), 665–666. doi:10.1126/science.1216142
Does Less Privacy Promotes a More Trusting, Honest & Tolerant Society? Can intolerance be tolerated in a tolerant society?
You might have heard the quote "privacy is dead - deal with it", I first this heard back in 2004 when I was studying computer science at university.
Now days privacy is becoming less and less of a concern because people don't think it's a case for worry. But are we treading worryingly close to the ominous Big Brother society. Some Orwellian aspects of which are already real.
This raises the question of why do we wish to keep things private in first place?
Are we scared of being morally judged or even worse, persecuted?
Should we care if others are making a profit by selling our own private details?
How do deal with paranoia?
Should anything be private anymore?
From a philosophical standpoint one may argue that the need for secrecy stems from distrust and fear.
An open society is a fearless society and perhaps a more tolerant society?
Being quick to judge someone's character is something we should move away from, we want to move away from such biases and assess people for their worth. Give people the benefit of the doubt, or if we are to have a bias, then at least adopt an optimistic one.
If everyone was truly honest and considerate then they would be no need for privacy but then such a society would require everyone to hold the same faith in others - a sort of moral communism - a state of equilibrium which may easily be disrupted by the most minor glitch in trust or the minority who take advantage of this utopia to fulfil personal goals. If anything we know that true equilibrium is an illusion and is in fact a seeming state of stability can be achieved by a dynamic system on a lower scale. Much like how solid objects which follow deterministic trajectories at our scale are constituted of vibrating atoms at a lower scale which follow stochastic movement.
But in the end is it not in our nature to take the initiative and to lead? Provided we are given the illusion that we have free will and are following our selfish ideals we will be happy. Let people do as they wish but trust that they will do good.
I am not saying we should not have any strong views one way or another, it is important to stand up for some things that we hold dear. We all have our buttons. Ultimately, we need to believe in something to give a sense of purpose (at least I think most people need or are happier with a sense of purpose in their lives). Yes purpose is meaningless but it is useful to think that way to get things done. The only thing one should not tolerate is intolerance. But is the law intolerant? Why is it ok to ridicule some people and not others?
Perhaps this a naive view but I do feel we need to break the cycle of distrust somehow and not let it escalate...
In my view if everything is public then that's fine. If we are going to decide what is to be kept and what is to be made public then this may raise concerns.
It's even more of an ethical concern when some things are deceitfully labelled as private when in fact there are not. Might as well come clean and admit than nothing is fully private.
Disclaimer I have never been the victim of cyber bullying or defacing
A counter point "cyber bullying" for no apparent reason except for the stupidity of group mentality: https://thenib.com/the-internet-s-most-trolled-cartoonist-91a92d9b7585
Now days privacy is becoming less and less of a concern because people don't think it's a case for worry. But are we treading worryingly close to the ominous Big Brother society. Some Orwellian aspects of which are already real.
This raises the question of why do we wish to keep things private in first place?
Are we scared of being morally judged or even worse, persecuted?
Should we care if others are making a profit by selling our own private details?
How do deal with paranoia?
Should anything be private anymore?
From a philosophical standpoint one may argue that the need for secrecy stems from distrust and fear.
An open society is a fearless society and perhaps a more tolerant society?
Being quick to judge someone's character is something we should move away from, we want to move away from such biases and assess people for their worth. Give people the benefit of the doubt, or if we are to have a bias, then at least adopt an optimistic one.
If everyone was truly honest and considerate then they would be no need for privacy but then such a society would require everyone to hold the same faith in others - a sort of moral communism - a state of equilibrium which may easily be disrupted by the most minor glitch in trust or the minority who take advantage of this utopia to fulfil personal goals. If anything we know that true equilibrium is an illusion and is in fact a seeming state of stability can be achieved by a dynamic system on a lower scale. Much like how solid objects which follow deterministic trajectories at our scale are constituted of vibrating atoms at a lower scale which follow stochastic movement.
But in the end is it not in our nature to take the initiative and to lead? Provided we are given the illusion that we have free will and are following our selfish ideals we will be happy. Let people do as they wish but trust that they will do good.
I am not saying we should not have any strong views one way or another, it is important to stand up for some things that we hold dear. We all have our buttons. Ultimately, we need to believe in something to give a sense of purpose (at least I think most people need or are happier with a sense of purpose in their lives). Yes purpose is meaningless but it is useful to think that way to get things done. The only thing one should not tolerate is intolerance. But is the law intolerant? Why is it ok to ridicule some people and not others?
Perhaps this a naive view but I do feel we need to break the cycle of distrust somehow and not let it escalate...
In my view if everything is public then that's fine. If we are going to decide what is to be kept and what is to be made public then this may raise concerns.
It's even more of an ethical concern when some things are deceitfully labelled as private when in fact there are not. Might as well come clean and admit than nothing is fully private.
Disclaimer I have never been the victim of cyber bullying or defacing
A counter point "cyber bullying" for no apparent reason except for the stupidity of group mentality: https://thenib.com/the-internet-s-most-trolled-cartoonist-91a92d9b7585
Subscribe to:
Posts (Atom)