Sunday, 20 January 2013

R-code for Showing Two Overlapping Normal Distributions

This is the code that I use to show how normal distributions overlap and how to find the right sample size to be able to distinguish the two alternatives.



dat <- read.table(text="info mean sd
                   HYP1 10 0.2
                   HYP2 12 0.2", header =T)
dat <- transform(dat, lower=mean-4*sd, upper=mean+4*sd) #create upper and lower bounds for the plot
plot(x=c(min(dat$lower)-2, max(dat$upper)+2), y=c(0, 2), ylab="", 
     xlim=c(min(dat$lower)-2, max(dat$upper)+2),xlab="",
     axes=FALSE, xaxs="i", type="n")
box()
FUN <- function(rownum){
  par(new=TRUE)
  curve(dnorm(x,dat[rownum,2], dat[rownum, 3]),
        xlim=c(c(min(dat$lower)-2, max(dat$upper)+2)),
        ylim=c(0, 2),
        ylab="", xlab="")
}
lapply(seq_len(nrow(dat)), function(i) FUN(i))


Tuesday, 15 January 2013

Emergence of the Social

This is why Dawkins and his reductionism fails, not because he does not think of the system but because he forgets that random processes can produce ordered results. S.J. Gould criticised him for not thinking about the system and that was a valid criticism, but Dawkins thought that he could answer that. What he has never dealt with is the physical property of emergence.

Emergence is when a random system spontaneously becomes ordered - at a higher level than the one in which it is disordered. This is a macro-phenomenon from a micro-effect and Dawkins regardless of saying he would include work by Eigen in his ideas about how life started has carefully ignored all of the literature on chaos and emergence in all of his books. He never cites anyone with that sort of view such as Ian Stewart and Jack Cohen. The core of the idea is actually present in Monod's book Chance and Necessity which shows a clear parallel to the Selfish Gene. Monod referred to this as "gratuity" that something else arises and the organism has access to other possibilities as an addition to the original effect. It is all about evolvability.

On another point I said a bit about politics yesterday and that Libertarians were wrong to think so much of the self when we are a social animal. But this also damns the socialists as emergence comes from the bottom. It is not a command and control effect and so existing socialist views are likely to fail. You need to harness movements from the ground upward and you have to let them evolve naturally.

Monday, 14 January 2013

Cooperation vs selfishness

The BBC had an article that kinder children are more popular. Social animals have evolved more than once (insects and mammals). As it is polyphyletic there must be an advantage to the social and altruism might not just be selfishness in disguise.

Why do all the bad guys lose in all the cartoon series and all the films? There is a saying that there is no honour amongst thieves and that is the key. That is why the bad guys never win. They lose because they always see evil in others and so they are waiting for the next betrayal. This is why the Deceptercons never win and why there are only ever two Sith. It seems that we understand the dangers of selfishness (and Libertarians fall into the same trap). The winners are the social and the collaborators and it is because humans have evolved into having to be a social animal.We cannot survive alone, we need others and that is why we can afford to have such a long time of helpless development before maturity.

The advantage we get from all this is escaping our genes and our environment. We can live in more climates and we can pass on our experience to our children. We do not have to have the hard coding of the gene.

Sunday, 13 January 2013

Problem Based Learning

I was having a discussion about the future of university education this morning and we were talking about problem based learning and "gamification". The person I was talking to is a lawyer and they felt that the best lawyers were not those that learnt in a problem based way, but those who were taught the old way in a very theoretical way that made them engage in depth with the law reports.

So is she right? I think mostly it was a confusion of ideas. When I mean problem based learning this can mean take away problems that are worked on over time and that could include in depth research and critical thinking. Her concern was the loss of deep analytical skills and an academic sense of law. So I want to see these deeper skills cultivated and old fashioned didactic teaching did nothing for this. You either arrived with critical skills and survived or you had a miserable university experience. The question is what are you doing a degree for? Expanding your view of the world and becoming this "academic" sage like being, or to get a job? Now as someone who is still in academia after over 20 years I picked the first answer but most (all my peers who are now well paid) pick the second. But I am well aware that a dictionary definition of academic is pointless and irrelevant.

For a lawyer this is also a slightly odd point to make as a generation before it was unusual for lawyers to have law degrees and they were encouraged to have broader interests. The final training for law happened at the vocational and practical law schools. There was no need to go to university at all to be a solicitor.

Do the "academic" skills have any place? They help you lose friends and alienate people by being that pompous supercilious know-it-all who bores everyone to death. You have a broad view of the world but you have the same naivities and stupidities as those without the academic skills. Does it make you a better lawyer, doctor, architect? I do not know if that insular world not focussed on the more mundane and practical does any good for anyone. That is the world of Laputa from Gulliver's travels. That is a travel that most people never read about, but it is the funniest story to me. That is the world of the old university, of Oxbridge, of the Russell group and of the Ivy League. Spending all your time obscuring the light from the world outside while you try to weigh rainbows. It is even funnier if you know a little Spanish.

Thursday, 20 December 2012

Selfish gene stupidity gets into my assignments

If I see another student who tells me that the function of a gene is to produce a protein then I think I might scream. So the function of those 30,000 protein coding genes is to produce a protein. Who would have thought it. This sort of tautological nonsense is inspired by a light reading of people like Richard Dawkins. Genes are self-serving, only the gene matters according to them.

Nonsense and garbage they forget that genotype and phenotype are not linearly associated. Gene space and phenotype space do not simply map to one another and the interactions are horrendously complex with many proteins having multiple functions that can depend on space and time. So when I ask what the function of a gene is I expect an inclusive answer not a trite one.

Sunday, 23 September 2012

Does the party system work?

All politics is based around a party system. Parties make it easier to fund-raise, they make it easier for people to make decisions and they make it easier to know what you are voting for. But do they?

With parties you have to take a whole bunch of policies you cannot chop and change and pick the ones you want. You wouldn't go to a shop and let them tell you that you can only buy the red bag or the blue bag and you have to take what is inside. Parties make selection of your true opinions impossible. Do they need to? Do policies have to be connected? There is a strong argument for spending and taxation policies as these have to be connected, but the devil is in the detail.

Parties also make it easier for lobby groups to interfere with government. If we got to pick and choose policies then the lobbyists would have to lobby all of us. They would have to get access to all of us and this is going to be incredibly difficult. It is much easier to lobby a party. So that is another good thing.

But most of all the world or the country run by a politician is a complex thing. So policies have to change. What you wanted to do might no longer be a possibility because things change. You have to be pragmatic and to know when to ditch ideology. The problem is that with parties the ideology trumps the pragmatism and we end up with failed policies and a triumph of ideology over reason and evidence. Rhetoric wins over reason.

So if we want good government we want politicians who are pragmatic, who are no dominated by ideology, who can talk across party lines and we need journalists who appreciate this without looking for splits. So what if Lib-Dems talk to Labour - we should be encouraging cross-party relations, Churchill did.

RT  Nick Clegg has had "lengthy discussions" with senior Labour figures - including Ed Miliband 

Wednesday, 19 September 2012

Death penalty for cop killers

Lord Tebbit suggests that the argument against the death penalty was always very thin. So lets have a little look at evidence and history.

What about Derek Bentley? - another cop killer. Is that a thin argument hanging someone who did not carry out the act and who was pardoned 45 years later.

Then if the death sentence had been around the Birmingham Six and Guildford Four would probably have all been hanged as well. But they were all innocent. Lord Denning had said when interviewed that if the Guildford Four had been hanged "They'd probably have hanged the right men". But the criminal law does not depend on probabilities it depends on beyond reasonable doubt.

So I don't see that there is a thin argument at all. The chance that you might execute someone who is innocent is all the argument we need.

The deaths of two unarmed police officers in Manchester yesterday was shocking and a terrible loss. But the actions of the suspect are unusual. Why hand yourself in straight after committing such a crime instead of continuing to run? It is going to be a complex case.