Birthday&Exams

Posted: April 13, 2012 in General

It would have been Hitch’s birthday today.

Image

Unfortunately, the exams are rather soon and I need time to prepare. I have already failed to publish several times, and I won’t be posting anything of my own for a while. I’ll probably post an interesting image on the Facebook page and a video from YouTube which I find interesting. I hope I’ll continue with the blog this summer.

I naturally dislike it

Posted: March 25, 2012 in General

Shortlink: http://wp.me/p26zC5-5E

In the last post I hinted that I am not interested in any point using the word “natural” unless they use it in a strict sense I approve of. I felt I have to broaden it a little bit.

When you hear “natural”, you might think of “something not made by humans”. Unfortunately, this leads to a very serious problem: human actions and creation are “unnatural”.  That word has a bad connotation. Unnatural is wrong, evil. And humans are the cancer on the face of the Earth, for everything they do, pushes the life to extinction. After all, didn’t we create the nuclear bomb, which could eradicate all life we know of?

This pessimism isn’t the only way this can go about. After all, humans weren’t always abhorrent. At some great point in the history of mankind (according to some reliable sources, probably around 4004 BCE), everything was great, but everything made after that is wrong and evil. Except maybe a few things which aren’t, but every rule has exceptions, right?

And obviously, if unnatural is evil, natural must be good. That’s how logic works. That’s how logic leads to many exploitations. You know, if I claim something is natural, it’s got to be good for you! So really, radiation and cancer and rubella are all good for you because they definitely existed in 4004 BCE and they aren’t made by humans (except… just forget it), but Beethoven’s 9th symphony is evil because it’s a human invention, and so are vaccines!

None of this lines of reasoning is satisfactory. That’s why I prefer a different view on what “nature” is. It’s similar to what Spinoza would describe as god (though I wouldn’t call it that way): the totality of all that exists. “Natural” would than be anything that could possibly exist.

By now you could be expecting “stop using the word natural, use some other substitute that only partially does the trick, while seeming plausible at the first glance”. I don’t think that is necessary. We can communicate like this just fine, but I’m suspicious of anyone who doesn’t use “natural” in this sense. There is no reason to be inflexible with language.

If you think that my remark in the previous post doesn’t stand, I still think it is wrong to describe in vitro fertilization as “unnatural”. It is done to invoke the negative connotations of the word and thus discredit the opposite point of view.

In short, I dislike “natural” because it is a trump card, seemingly winning over a debate while offering nothing of value, and it is far too often used to mislead. It is a tool nonetheless, and it can be used for good purposes as well. At this point I think the negative side prevails, so it will be avoided.

Shortlink: http://wp.me/p26zC5-4B

After criticizing the entire Church by one of its members last Friday, and knowingly conflating one preacher’s voice with that of the whole institution, I decided to raise the game. This time I’m going to discuss three issues regarding conception, and an issue from the world of work, and why I think the Church fails miserably when confronting them. Please bear in mind that I don’t intend to discuss the morality behind them because I’m not brave enough to entangle myself in such a debate, at least not right now.

Contraception saves lives

Contraception doesn’t save lives per se. Most contraception is about temporarily avoiding getting pregnant. It comes in many varieties, each with its own benefits and drawbacks.

A major benefit of condoms, for instance, is their ability to prevent sexually transmitted infections/diseases. The Vatican had some theoretical issues with them a while ago (they don’t actually experiment, but are mainly concerned with theoretical issues; so not theological), but these are nothing compared to vast amounts of evidence in the favour of condoms. Using them for prevention of diseases like, say, AIDS, seems sensible. But no, Ratzi doesn’t like them, and doesn’t approve even in that case.

Contraception, like abortion, reduces the number of unwanted children. This is beneficial to the society in several ways. Firstly, it doesn’t oblige anyone to become a parent, even if they wish to pursue corporeal pleasures. Secondly, a pregnancy can ruin many a life, because it entails the cost for the child which the parent has to pay, including necessities like food and clothes, commitment, emotional support, and many others. It is nonsensical to claim that reducing the odds of getting pregnant is unnatural just as it is ludicrous to think that if every woman was less likely to get impregnated if she wished so would be the end of human race. Finally, the society has to pay a price as well, because unwanted babies are sadly less likely to become productive members of it.

The main concern raised here is that contraception might increase promiscuity. This is most likely at odds with reality, though I’m uncertain about it. Premarital sex is as likely between practicing Catholics who subscribe to “no sex before marriage” as it is among other groups. This isn’t the only thing considered promiscuous, so I’m reluctant to jump to conclusions. However, even if there was more promiscuity when contraception (and/or abortion) was introduced, to me it seems like a fair trade-off for the above mentioned  benefits.

Abortion saves lives

This subtitle is at the first glance paradoxical, but the reality is quite different. Childbirth causes 14 times more deaths of women than abortion in the US. This statistic is similar in most developed countries. However, it’s very different in the rest of the world, where almost all illegal abortions happen. It is interesting that, following the legalization of abortions in South Africa in 1996, there was a significant drop in number of deaths and infections caused by abortion, and the same thing happened six years prior to that in Romania.

It might then be the case that restricting abortions makes it rare and eventually nonexistent. It also might be the case that prohibiting marijuana completely prevents everybody from smoking it. It seems a clear-cut logic, but it’s confronted with reality. There is no correlation between fewer abortions and more restrictive laws, except that in countries with less restrictive laws contraception is generally more available. It isn’t too difficult to see how more available contraception is linked to fewer abortions.

All of that aside, what about the lives of poor embryos and fetuses? Since they don’t have the ability to chose whether they want to be born, someone else  has to make that decision for them. No individual has the right to determine this on their own as it doesn’t affect just them, but the society at large. Taking above into the account, I’d suggest that having liberal laws on abortion purely on those grounds is reasonable. Personal opinions on morality of abortion would be respected, and nobody would be forced to adhere to anyone else’s opinion on the matter. Like whether or not life begins at conception, a question the Church considers important. Not that they’re capable of properly phrasing it.

In vitro fertilization is not evil

According to the pope, in vitro fertilization is a form of arrogance. He thinks this way because if a baby didn’t originate from sex, it is not our place to intervene because that would mean we want to play his god’s part. Philosophically, this fails on so many levels. For starters, it is invoking the “natural versus man-made (and thus unnatural, and thus evil) argument”, one I’m not interested in unless I agree with the person pushing this argument on what is natural. It helps to keep myself from listening to many a flawed logic because “natural” is often used as a joker capable of supporting any assertion. Secondly, I don’t think any scientist and/or doctor is at this point capable of creating an entire universe in under a week, and then flood a planet with the sentient species he created in his own image, so I’m not sure what does the pope mean when he says that. Oh, maybe he just doesn’t want the pesky doctors to intervene in matters that should be strictly between his god and the parents. There appears to be no reason for this other than “that’s not how it was intended”, and if you fall for that, read this paragraph again.

All along the pope completely disregards the actual infertility care. It begins with a lot of sex for quite some time and then, if the couple (not necessarily married) wasn’t able to conceive, they can ask for treatment. In vitro fertilization is usually used when other techniques fail. The couple is interested in getting the child, otherwise they wouldn’t go through costly and painful procedures, and I seriously doubt they will love their baby less if they didn’t conceive it the usual way.

I have to admit I agree with the pope on one point. He stated that the love (presumably sex) should be “not only biological but also spiritual”. I know, I know. We don’t agree that conception has to arise from a “not only biological but also spiritual” sex, we don’t agree that it should always be between spouses, and we don’t agree on what spiritual means. There, I didn’t take it out of context. I’m of the opinion that sex shouldn’t be just for pleasure’s sake, and insofar as the pope means that while using the word “spiritual”, we agree.  That’s not very significant compared to the vast chasm of disagreement, but I don’t want this piece to seem like me vs the pope, but rather me vs bad policies. Bad policy supporters are irrelevant.

Working on Sundays doesn’t break the commandment

I don’t know if this is limited only to Croatia or more widespread, but the Church wants to ban work on Sundays. Well, that’s not exactly true. It’s more the case that they want to prevent all shops from working on Sundays. They don’t mind priests, museum guards, theatre actors and other involved in cultural or spiritual work, but they can’t stand to see shops open on Sundays. So they have launched a so far hugely unsuccessful campaign of pleading people not to go shopping on Sundays in March. I’m guilty of thwarting their efforts.

The rationale behind this hinges on two basic points. Firstly, there is a big problem of not being paid enough for the work. This is true for shop assistants working on Sunday, though I heard rumors that in some places they quarrel about who gets to work then because it’s paid extra. This is also true for shop assistants on other days of the week, because they are people who have to feed their families, and they barely manage to. This is also true for other people, but the main preoccupation is whether shops work on Sundays. Secondly, all people should be present at spiritual and cultural events at the same time other people are, which means Sundays. As previously stated, this excludes those who have to provide services related to the events in question. Or do you think the museum guard is there to enjoy artwork?

A more obvious solution to the first point is forcing the employers to either pay equally for every day or forcing them to employ more people. Though this has problems of its own, it’s not difficult to see why banning work on certain days of the week isn’t the most productive solution, especially since work is abundant these days and just about nobody has a problem getting a job. On the second point, shop assistants provide a very useful service, too. It would be nice to know what the criteria are for determining whether something can be done on Sunday, because neither cultural nor spiritual don’t seem to be linked exclusively to that day. I suppose we should go back to the old days and stone all who pick firewood during the most holy day of the week. Oh how I miss that!

In conclusion

The Church is blatantly disregarding reality, and has a heavy promotion machine, exclusive rights to indoctrinate many children, and receives large sums of money with which it can do both. Unfortunately, this has enormous potential to shift the balance of power in Church’s favour, but doesn’t always work. I don’t think they’re evil, but rather misguided. This doesn’t and won’t stop me from opposing them.

I don’t expect the Church to change its opinions on these subjects any time soon. But I do expect Catholics to oppose those opinions even more than they do now. The Church doesn’t work as a democracy, so their voices are often drowned in the flood of other, opposing ones, supported by the clergy. But this can’t always remain to be so. The voice of public has changed opinions of the Church before, and it will do so again. It’s merely a matter of time, so why not sooner rather than later?

I’m not going to agree with any Catholic about their god, but I will support those who wish to change the Church to at least somewhat more tolerable. Why? Because I care. I see it as a way of making world a better place. How misguided you think I am?

Shortlink: http://wp.me/p26zC5-4A

One of my hobbies is watching videos on YouTube. The day I first started is probably the most important moment in my life, and had it not happened, I doubt I’d be writing this now. I usually watch them when there is nothing better to do, or at times I used to watch TV, so I don’t dig all that deep into the videos offered. There is a lot of quality content offered there, but I rarely find an exceptional piece. I think I have found one yesterday.

“Every divisive religion is on the path of tyranny. Every extreme political view point has embraced the path to tyranny. None of us is immune. All of us must be watchful of ourselves as well as others. We should all stand up against it or stand by and allow it to take hold.”

I’ve shared it on the Facebook page yesterday and I decided to share it here as well. Also, I’d like to thank The Living Dinosaur for pointing me to this channel. His style is particular and you might not like it, but he knows how to find good videos.

I was thinking of making a page with my favourite YouTube videos. Do you have any suggestions?

I didn’t post any of my content today because I have a major exam tomorrow. I was planning to raise the game and write about non-solutions by the Catholic Church (and other similar organizations).

Shortlink: http://wp.me/p26zC5-4u

Some time ago I went to church for a lecture which was presented as a lecture in theology by a famous theologian for young people. Since I’m usually interested in the nonsense they spew nice and well-reasoned arguments for the existence of a god, hopefully giving me something to write.

Theologians

Nice and well-reasoned.

As it turns out, he didn’t come to teach us anything about theology. The lecture started with a real long version of that old joke, so I was fortunately just on time to skip it. I heard the end so I suspect it went something like this (in brief): a Christian missionary went on a mission in the jungle. He ran into a tiger who wanted to eat him, so he prayed to god: “Please let this tiger’s Christian feelings come out”. The tiger rose saying “God bless me and this meal I’m about to have.”

Apparently this was a prelude to a 25 minute introduction to the 35 minutes long lesson. And it contained some symbolism. Translated from theologian: it contained some irrefutable logic. Then we had some falsehoods ingenious pieces which should exist somewhere in the Bible, but if they don’t, it must be faulty memory and rhetorical tricks which persuade audiences not really interested in the truth. You know, things like Moses (and his parents?) fleeing to Egypt because Pharaoh was killing babies in Egypt in order to kill Moses. There were more, but luckily I have faulty memory so I don’t remember every falsehood ingenious piece which should exist somewhere in the Bible, but if it doesn’t, it must be faulty memory and rhetorical tricks which persuade audiences not really interested in the truth. And I don’t spend time thinking how to tell it to my friends who were so impressed with the presentation they didn’t seem to notice.

The point of the whole thing was to spread the word that satan wants to stop you from being fertile because he hates life. He isn’t going to force, I don’t know, vasectomies on all men, instead he’s going to make you take the pill. It seems that satan isn’t really a fan of permanent solutions, much like his counterpart. He compared the pill to aspirin, putting forward a poor analogy that we treat fertility as if it was a disease. I liked the most the genetic fallacy he gave (and I’m not entirely certain it’s backed up with the truth). The pill was initially tried on Puerto Rican  women, and apparently there is some controversy surrounding the ethics of the trial, but it sounded much worse than anything on the Internet,so I suspect exaggeration. The fallacy is in that the first trial was unethical, therefore the pill is unethical, and WAKE UP!!! By the way, there will be a pill for men soon, so men beware!

It just wouldn’t be me if I didn’t make a connection between this and something completely random at first glance. The Pope recently made a comment on infertility treatment. Considering satan is against life, and the Catholic church stands for it, it seems obvious that they should be pro medical treatment of infertility. But no, that stuff is just showing off our arrogance. I wouldn’t be surprised if he said that too was devil’s work.

In my eyes, this statement looks like this: we accept only those discoveries of the modern medicine that make it likely women who use them are going to get pregnant anyway (which makes it questionable what they should be alternative to; I don’t wish to suggest that ‘natural’ methods of contraception aren’t useful, ) and many techniques for assisted pregnancies, except freezing the embryos, but if they use any products of medicine (as opposed to, I don’t know, herbal remedies or homeopathy or something else that isn’t backed up by evidence?), that’s just arrogant. We don’t really want to solve problems like overpopulation or poverty, but we want more babies, save for those who didn’t pop out the usual way.

The lecture also included a call to arms. You know, it’s tough to be a Catholic nowadays, they’re just the majority and the dictatorship of relativism has somehow more influence than them. This is also known as “we’re unable to take criticism, so we’re prosecuted by it”. I’m fed up with immaturity. Please grow a thicker skin. It’s a cold world out there.

There is no point in accepting the apology for Galileo, no matter how much overdue it was. It is commendable that the Church is no longer interested in killing people because of its dogma of the Earth as the centre of all things. But that’s not the only thing Galileo stands for. The Church still stubbornly refuses to prove that they mean what they said. So long as they don’t feel the need to demonstrate they are serious, there is no reason to accept the apology.

Put in American terms, this moves of the Church and its representatives (the lecturer) are a war on medicine. A war they are losing, or else they wouldn’t be making such a fuss about it. It is an indirect attack on the whole of science. It mustn’t be accepted.

I don’t want to end with a call to arms. Just stay vigilant.

Atheism: the Religion

Posted: February 19, 2012 in Atheism
Tags: , ,

Shortlink: http://wp.me/p26zC5-3J

I am sometimes reminded of the incredible fact that atheism is, in fact, a religion. I’m baffled at how someone concludes that I worship Satan or Science or something like that. When I didn’t return a book, someone told I burned it to appease my gods of atheism.

There are many reasons for this tactic. It seems offensive, because Atheists hate religion and couldn’t bear the fact that they are, in fact religious. This backfires incredibly because the word religion is used as an insult, and it’s questionable who should be offended. However, there are similarities between the groups. Both seem to have some sort of prophets (even though Dawkins is lame, he never does any of the cool stuff like summoning bears, resurrecting the dead, or better yet raising zombies seeing how he is the devil’s servant) and they are stubborn about what evidence qualifies as proof of a god.

There are some things that Atheists could use from religious people, like their vocabulary. You know, words like soul and spiritual which have a meaning usually connected to the supernatural. I don’t think that Graham’s number is something “godlike”, yet when I think about it, there’s only one word to describe that experience: spiritual. I feel the same whenever I contemplate the vastness of the universe, the intricacy of life, the beauty of some aspect of nature.

I wonder why the society still ignores the jaw-dropping and incredible part of science. We leave awe to religion and other made-up stories which aren’t always true, though it seems so, and think of science as a bunch of boring equations and people in lab coats doing something that will doom us all. I think we need fundamental changes in our perception. These aren’t going to happen immediately, and I’m going to write some thoughts on what should be done soon. So much for now.

What are your thoughts? Am I wrong, too harsh a critic? Have you got any suggestions, something religion has and you think Atheists lack? Also, check out this video by the fabulous YouTuber ZOMGitscriss with a few funny tips on making Atheism a religion:

These few posts are shorter than usual. Should I write more of these or go back to the longer ones?

If you like the blog, share it with your friends. To receive updates, subscribe via e-mail (above, on the left side), like the Facebook page and/or follow on Twitter (at the bottom).

Quantum Jumping

Posted: February 17, 2012 in General

Shortlink: http://wp.me/p26zC5-3D

If you have a Facebook account, you couldn’t have missed the Quantum Jumping advertisement. It’s “a unique method of tapping into the power of your subconscious mind and stepping into a new reality”, as they put it on their website. What they say is outrageous, and I desire to counter their assertions. This one is in line with my previous post about evidence. I’m going to divide it in two parts: what is wrong and why I bother.

What is wrong with Quantum Jumping?

Quantum Jumping invokes the multiple universes interpretation. Quantum mechanics involves probability. Usually we think of electrons as tiny particles orbiting the nucleus.

Electrons around a nucleus

Something like this.

The problem with this is that it isn’t what scientists observed. It’s much closer to something like this. Choose a point somewhere near the nucleus and for that point you can say: “There is 2% probability that I will find an electron here.” According to multiple universes interpretation, for each possible location of an electron, a separate history is created.

There is an analogy to this, and many movies have exploited it. For every decision you make, there is a separate universe in which you didn’t make that decision. There is a universe in which you are successful, famous and rich, and there is one in which you aren’t. There are also many more universes in which you are some of those things, and in different ratios (you are surely more famous somewhere). The problem with this analogy is that it anthropomorphises the universe: from it, you could conclude that humans are the centre of the universe. In reality, it is the particles who create more universes, not what you chose for breakfast this morning.

Quantum mechanics is not intuitive, and analogies like this are necessary to make sense of it. It’s also susceptible to many different interpretations, all of which have their own flaws and virtues. We need further investigation to find out which one is better, and that’s what physicists are for these days. Mostly. It’s therefore ludicrous to claim that “The only explanation for this is that particles don’t only exist in our universe – They can spark into existence in an infinite number of parallel universes as well.” Even Wikipedia knows that.

As well as this, there is one more error I find important. In these other universes everything possible could happen, but that doesn’t mean anything could happen. That’s an important distinction. Apparently, using your mind you can tap into these infinite possibilities which don’t exist.

Why I bother writing about such things which are clearly nonsensical?

There are a lot of reasons why I chose to fight this nonsense. For starters, it is nonsense only if you know a bit about science, and many don’t. Many might fall prey to the nonsense, and that would be a shame. Reality is amazing without being distorted like this. These inaccuracies undermine our understanding of science as a society and may lead to bad decisions.

If we don’t fight nonsense back, it will overwhelm our world. We are walking on thin ice as is, seeing how in recent years fewer people outside science community care about the truth behind what they say, and they are mainly based on pseudoscience and/or faith. Carl Sagan famously said that we live in a civilization dependent on science and technology, yet almost nobody knows much about science and technology. Ann Druyan, his wife, expressed a similar sentiment. That is why I started this.

What do you think? Should I have gone more in depth with my analysis? Do you want me to write about another pseudoscientific topic?

If you like the blog, share it with your friends. To receive updates, subscribe via e-mail (above, on the left side), like the Facebook page and/or follow on Twitter (at the bottom).

What isn’t evidence?

Posted: February 14, 2012 in General
Tags:

Shortlink: http://wp.me/p26zC5-2m

Imagine a box. A regular, small, cardboard box. What can be inside the box? It could contain nothing, or just some boring dust. There could be a glass water in there, or a bottle of your favourite alcoholic beverage. The list of possibilities is infinite, yet without opening the box there is no way to tell what is inside. We can, however, tell what isn’t inside: a dead-end street, Justin Bieber’s voice, the library of Alexandria or Jupiter, because the box is too small for them. We don’t need to open it to know this: those objects just can’t fit in.

This short ‘parable’ has a few analogies: the box is the universe, nature, and the things are particular objects in reality. There is now way other than looking in the box/universe to find out what really is there, but there are ways to tell what is not there. Also, you could assess probability of something that might be in the box without opening it. Shake it and listen: do an experiment. You will get some evidence. Based on them you can say what is more likely to be in the box, but alas not what is in it.

What is evidence? Basically anything that changes the probability that a certain claim is true. Put in terms of the ‘parable’, hearing some noise when shaking the box changes the probability that the claim “There’s nothing in the box” is true. It makes it improbable, of course, while making the opposite claim, “There is something in the box”, plausible. That’s why I have such high regard for actual evidence: it and it alone can be used to determine the truth. Without it, we could discuss infinitely and never get anywhere.

So, what doesn’t count as evidence? Things like this:

Claims. When science can’t explain something, my Catholic friends quickly jump to God of the gaps. Surprisingly, it’s never Allah or Thor of the gaps. While Allah can be ‘assimilated’ into their faith by using ecumenical tricks, it’s more difficult with Thor because they have to account for other gods, and that’s a bit tricky. One god isn’t a society nor is it a hierarchy. Simply claiming your god explains what science can’t is useless: if he/she/it/they does/do, there should be evidence for that.

Beliefs. Staying on the same subject, scientists are unlikely to find out what happened before Big Bang. Or so some people believe. And because this is impossible, we should believe in their god, because that would explain Big Bang perfectly. This is wrong on so many levels, starting from the fact that while science can’t find the answer, religion already has it, and there is no need to reveal how it (they?) got the answer. If you thought “Well, the Bible/Koran/… claims…”, read the previous paragraph one more time.

Statistical improbability. If you believe something is impossible because it’s highly unlikely, you don’t understand probability. Unlikely things happen quite often because the more opportunities they have, the more often they happen. I recently read a book with quite a lot of quackery, including the statement that our universe was perfectly created just for us because the probability that life was created on any planet is one to the number of planets. He came to that conclusion by theoretical inference (two paragraphs below), and it’s really, really flawed. For one, it would be likely to more planets with life somewhere out there even with this probability. By comparison, Richard Dawkins made a similar hypothetical statement: if the researchers could find a way for life to emerge out of previously non-living matter with a probability of once per billion planets, there would be plenty of life everywhere. And if you aren’t satisfied, think of the anthropic principle: if the conditions weren’t set for us, you wouldn’t be asking the question, would you now?

Pure logic. There is a great example of this: the ontological argument for a god. It goes as following: (1) God is the greatest being ever. (2) We can think of god. (3) A being is greater if it exists in reality than if it can only be thought of. (C) God exists. There are two more premises of the Anselm’s argument, but they are not relevant. The logic is impeccable, but that doesn’t mean this god exists. If nothing else, there is no evidence for (1). Remember how you were taught that two plus two equals four? You were given evidence: you counted two apples, then two more, and you concluded that adding two apples to other two apples makes four apples. However, we could make two plus two equal five and have a ‘parallel universe’ where it is so. The only problem is that this is useless when describing our universe.

Theoretical inference. Let’s jump to bad science. I attended a public lecture on which the lecturer said that mobile phones significantly heat up tissue. He came to this conclusion by doing some calculations. I don’t want to suggest that his calculations were erroneous or that we shouldn’t be concerned because they were just calculations, but they need to be backed up with something more concrete, like, I don’t know, actual medical studies because our bodies are a tad more complicated than that. Which brings me to my second point.

Over-extrapolation. You can only infer so many things from certain data. For instance, if a study concludes that a cell culture has smaller risk of tumors if you add a lot of some ingredient, you might think that you should eat more food containing it. The reality might not be simple like that. You see, a cell culture isn’t quite the same as a human body. Something that has positive effects on it may have negative effects on the body, or it might not be assimilated, or you need higher doses than available in the foods… All of this can be solved by not claiming the ridiculous.

“Scientists said/are researching…” Yes, they are. They are researching chemtrails and telepathy and a bunch of other paranormal stuff. This is a devious claim because it implies that because scientists are looking into it, it must be true. It’s a simple, yet effective evasion tactic.

There is plenty more, but these are a few favourites of mine. If you have suggestions, please comment.

 

If you like the blog, share it with your friends. To receive updates, subscribe via e-mail (above, on the left side), like the Facebook page and/or follow on Twitter (at the bottom).

Dual Core Neanderthal

Posted: February 12, 2012 in Biology, Programming

Shortlink: http://wp.me/p26zC5-3r

My last post was about mathematics, so let’s start there. How much is 35 times 120? You can surely do that in your head if you take some time. How about 4.8 times 1.25? This sounds a bit tricky. If you can do that calculation in one second, your performance is 1 FLOPS – 1 floating point (decimal) operation per second. How many of these can supercomputers do? Well, the current leader, K-computer, is rather slow. It’s maximum performance is only 10 510 000 000 000 FLOPS, or 10 510 teraFLOPS. (Data from http://top500.org/)

Supercomputer Comparison Graph

Graphs are great. Darker red is speed of the supercomputer in TFLOPS. Lighter red is theoretical speed. Note that the five slower ones have almost the same speed.

You’ve heard of Search For Extraterrestrial Intelligence. I suspect it might be worthwhile to search for intelligence in Congress as well, but it just might be a bit too much to ask for. At any rate, when SETI couldn’t use supercomputers because it was thought a useless endeavour, they created a virtual supercomputer with the assistance of the university of Berkeley.

Supercomputers and @home Projects

There are three virtual supercomputers here: Folding@home, BOINC (all Berkeley projects) and MilkyWay@Home (one of Berkeley projects). SETI is absent because its speed is about 75% of the lowest supercomputer here.

How is it possible that of the first three supercomputers, two are virtual? There are two factors involved. The first is willingness of many to let these projects run while their computers and game consoles aren’t doing anything useful. The other is (parallel) programming algorithms, the same thing supercomputers use.

Let’s return to a decade ago, when single core processors were prevalent. If you wanted to invert colours on an image, a fairly simple task, you would have to do W x H changes, where W and H are, quite obviously width and height of the image. If you wanted to invert a whole bunch of images, say 316 of them you took on your holidays on Hawaii (they are inverted because you didn’t pay attention), your computer would have to do 316 x W x H operations. Because those images are large, you need, say, 732 seconds, or 10 minutes. You told your friend that you are going to bring her the photos in 5 minutes, so you are going to be fashionably late.

If that happened today, when most processors have two cores, you’d be in luck. Two cores can process two images simultaneously, so it would only take 5 minutes. But, there’s a catch. If you use the same program as ten years ago, you will be in trouble, because it doesn’t make use of the second core.

@home projects are similar to this example. Namely, the whole image (a protein database for Folding@home or radiotelescope data for SETI@home) is broken into pieces which are then distributed via the Internet. Individual computers then act as one processing core (or more, if there are more and if you wish to make them available), and the central computer(s) bind the processed data to get the inverted image – the data we want.

There is more to parallel programming. Just to name one, more human example: you are collaborating on a Google Docs document. You need to do your part of the job, say draw the graphs, while your two friends have to search for more recent and older data respectively, and put it in the same table for comparison. The difference between image processing and this is clear: there you had a bunch of the same operations, while here you have a lot of different ones. What is problematic about this is that anyone of you three could accidentally delete the work of others, which would be unfortunate.

By now you are probably scratching your head and wondering what does this have to do with neanderthals. If we wanted to compete with them, we wouldn’t be favoured: they had bigger brains and tougher bones, among other things. Yet they are no more. A post on EvoAnth suggest that there are differences in the brain makeup. Basically, because their brain areas were different, they were at a disadvantage, despite larger brain size. This isn’t dissimilar to the dual core processor running an old program which doesn’t support dual core: it would have been better if the program was better designed. I don’t want to repeat too much, so follow the link.

Before anyone jumps on this, I don’t want to suggest that Homo sapiens won over the Homo neanderthalensis just because they had different shaped brains. Far from it. Other things, like climate change – ice ages, played a significant role.

If you like the blog, share it with your friends. To receive updates, subscribe via e-mail (above, on the left side), like the Facebook page and/or follow on Twitter (at the bottom).

Faith In Tau

Posted: February 5, 2012 in Mathematics, Science

Shortlink: http://wp.me/p26zC5-2M

Here’s a circle.

Circle

From Wikipedia. Where else can you find this nice a circle?

How would you find the area of a circle? You might be wondering why would you wish to find out what the area is in the first place. It turns out the Greeks had a lot of time on their hand, so they tried to figure if they could do it with a compass and a straightedge. It turns out they can’t. They could if one number in the equation wasn’t transcendental.

π = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063...

Those are the first 314 digits of π. How many are there? If you are already bored with this post, go and count them all. You should be able to do it if you have an infinity of time to spare.

Where from did this number pop up? Well, let’s first consider what we need to find out circumference. It clearly has something to do with the diameter: the bigger the diameter, the bigger the circumference. Maybe we need to multiply the diameter with a constant, and we get the circumference.
C = 2pi * r
Yep, Wikipedia says. Circumference is diameter times π.

Let’s do the same thing with area. Area is, sure, measured in squares, so maybe we should square the radius. Maybe we can find a constant so that the constant times radius squared gives the area of the circle.
A = pi * r^2
And we have π yet again! Yes! π is definitely correct!

This is pretty much how I was taught about π and the circle. Don’t you find something odd here? In the first explanation, I used diameter, but I switched to radius in the second. I was puzzled by this ever since I learned it. It isn’t surprising that I welcomed Vihart’s video (below).

π is wrong. It isn’t incorrect – the number shown above is correct, and so are the equations. But using π complicates things a lot. Consider the following three equations:

Length of a pendulum

If you want to know what they mean and where they are used, click on them.

All of these formulas, and the circumference formula above, have one thing in common: they all use 2π or its square. It is, in fact, very difficult to think of a single instance where π, and not 2π, is used. But first, let’s go back to the circle. Not just any circle: the unit circle.

Picture a circle with a radius of one metre. Imagine yourself walking on its edge. When you return to the starting place, how much did you walk? Considering it’s a unit circle, and π is the circle constant, you must have walked π meters. Right? Nope.

Unit circle

You would walk 2π metres!

That’s why π makes no sense. It destroys elegance and simplicity. Just imagine how much easier would it be if the entire circle was one π. Fortunately, there’s an easy way around this. It’s called tau, and it is equal to 2π.

Tau unit circle

It also fixes up all those formulas. You no longer have to think something like: “Did I divide by two instead of multiply?” All you need to remember is that τ = 2π.

Tau Sine Wave

If you start moving around the unit circle and go a quarter of the circle, you are so obviously one metre away from the horizontal axis. That's the meaning of the sine wave. (click if you can't see the animation)

What about circle area? It would now have to be half a tau times radius squared. That isn’t so terrible, and it’s similar to some other formulas.

Formulae

Like, for instance, free fall, elastic and kinetic energy.

The holy Euler’s identity wouldn’t be killed by this. There would be no need for “tau over two”, because:

Euler's identity using tau instead of pi

The goal of education is to memorize things for longer than until the day after the exam. The current system fails spectacularly here. One of the reasons is stuff like π which complicate things which would otherwise be simple. The biggest benefit of τ is exactly that. In my opinion, if we want better education, we need a more intelligent approach. τ is one step in the right direction. So, how much is τ?

τ =
6.28318530717958647692528676655900576839433879875021164194988918461563281257241799725606965068423413596429617302656461329418768921910116446345071881625696223490056820540387704221111928924589790986076392885762195133186689225695129646757356633054240381829129713384692069722090865329642678721452049828254744917401321263117634976304184192565850818343072873578518072002266106109764093304276829390388302321886611454073151918390618437223476386522358621023709614892475992549913470377150544978245587636602389825966734672488131328617204278989279044947438140435972188740554107843435258635350476934963693533881026400113625429052712165557154268551557921834727435744293688180244990686029309917074210158455937851784708403991222425804392172806883631962725954954261992103741442269999999...

No, τ isn’t rational. It has a sequence of 7 consecutive nines from 761st to 718th digit. But this representation of τ is dull, right? I mean, there’s got to be something more interesting.

Graph of digits of τ

You can make a graph of the first 100 000 digits. Or a melody.

Many thanks to Vihart who converted me to τism. Her video:

If you want more, read the Tau Manifesto. You can find the first 100 000 digits there if you think the graph is wrong.

Update: two images containing tau have been replaced. The quarter of the circle is tau over four, not tau over two as was written before.

Shortlink: http://wp.me/p26zC5-2B

Everything you see is radiation. Light emitted from the Sun and other star is a form of electromagnetic radiation. We see things because the light reflects off of them, so in turn they all radiate. However, not all radiation is the same.

The Electromagnetic Spectrum

Radiowaves are electromagnetic. They have very low energy and behave like waves (which is why they are, surprisingly, called waves). Just about everything emits them. Radioastronomy, for instance, looks at radiowaves emitted by stars. Microwaves are also part of the spectrum. They heat other molecules. Because of that, they are used in microwave ovens. Astronomers look for them as well. The famous COBE and WMAP pictures of the early universe were taken by measuring microwaves. Infrared follow the microwaves. Most emissions from the Sun are infrared waves. They are used in night vision goggles and to see farther into the universe without being stopped by interstellar dust. After them, visible and ultraviolet come along. UV is used for tanning, and our skin uses it to produce vitamin D. X-rays are used in medical diagnostic and to find out the structure of crystals. Now, this was just the short introduction to the common, well known parts of the EM spectrum.

The rest of the post is going to be devoted to the last category: gamma rays. It is going to be not just about them, but about three other types of radiation which are emitted after a nuclear reaction: alpha, beta and neutron radiation.

Questions

I always thought some concepts about the way radiation is described is odd. So I decided to explain them upfront.

Why are different types of radiation called alpha, beta and gamma, even though the only thing that binds them is that they are radiation? It just doesn’t make sense. Alpha is a positively charged helium nucleus (a particle), beta is a negatively charged electron (also a particle) and gamma is an EM wave (a wave, obviously). When they were discovered, nobody knew what they were, and the labels stuck until this day. Kind of like the pi.

What is a nuclear reaction? Those two words sound like doomsday. But they aren’t. They are a bit more complicated than the “usual” chemical reactions in that you have to balance two numbers per atom/particle instead of just one. But it’s as similar to a chemical reaction as it gets. Compare “two hydrogen atoms combine and make a deuterium atom” with “sodium and chlorine gas combine to make sodium chloride”. Yes, I know. The first releases much more energy: that’s frightening.

Differences

Alpha, beta and gamma are very different, and there are two common ways to observe them.

Suppose I have a source of alpha particles pointed directly at me. What could I do to defend myself? I need a piece of paper, or my clothes. That’s more than enough to stop alpha. In fact, even if they fall on the skin, they won’t do much damage. What about beta? Well, some more protection is needed. An aluminum sheet will do it. They aren’t so bad on the skin, either. The gamma, however, are a problem. A very effective way of blocking them is a led brick. This makes them dangerous because they can penetrate your skin and hit your, say, bone marrow DNA  or an useful protein in the brain. But there is no need to worry if you aren’t exposed for long and if the dose is small. Sort of like poison: you don’t need to worry if you take too little of it. Fortunately, alpha are more damaging than both beta and gamma.

You may be wondering if all that protection is necessary against gamma rays, and alpha and beta won’t harm you, why bother having a radiation suit in the first place. It turns out that alpha and beta will harm you if you inhale them. Our insides, particularly lungs, aren’t resistant. They aren’t protected with skin. An inhaled alpha source could do much damage.

What is (probably) the easiest way to check which type of radiation are you dealing with? Take a magnet. Alpha particles, helium nuclei, are positively charged, attracted to the magnetic south. Beta particles, electrons, are attracted to the magnetic north, while gamma rays aren’t attracted to either. There is a catch about this, and I’ll explain it later.

Equations

You may wish to skip this part, but it is probably the most interesting one. It includes a lot of technical detail which you don’t need to get into to understand the big picture. The images of equations will be uploaded asap.

Nuclear decay if one of the three most common ways we think of radioactivity. Over a period of time unstable nuclei fall apart or change. There is something fascinating about this. After that period of time called the halflife, half of the unstable nuclei will decay. And after another halflife, half of the remaining nuclei will decay. The curious part is that this is true for both the nuclei created today and those created twenty years ago (or twenty million): they all decay at exactly the same rate. Let’s explore two nuclear decays: alpha and beta minus.

Nuclei are composed of many protons with positive charge. They should fly apart, right? Well, strong nuclear force keeps them checked. But it sometimes isn’t enough, and a small piece of it, two protons and two neutrons, start feeling so much repulsion that they go away. Or rather, they run away quickly. This, for instance, happens when thorium slowly decays into radium. How slowly? Well, just about now half of the thorium created at the Big Bang would decay. But alas none was created back then.

Here’s the most technical part of this piece. Beta decay is a quantum phenomenon. Protons and neutrons both consist of quarks. Protons consist of two up and one down quark (uud), while neutrons consist of two down and one up quark (udd). If you convert and up quark into a down quark, you can get a neutron from a proton, and vice versa. The reactions are as follows:
d (neutron) -> u (proton)  + electron + antineutrino d (neutron) + antielectron + neutrino Notice the symmetry of the emitted particles. This is the catch I’ve mentioned before. An antielectron is positive, so it would be, just like an alpha particle, attracted to the magnetic south, only to different degree.
There is no particularly interesting example of a beta minus decay I managed to find.

There are two more nuclear reactions: fusion and fission. Fission is the separation of an atomic nucleus which creates two new nuclei heavier than helium. It is what drives nuclear power plants and A-bombs. In this process, a lot of neutron radiation is emitted. Neutron radiation are just neutrons that fly out. If they hit a certain nucleus, they might trigger another nuclear reaction. Fusion, on the other hand, combines two nuclei and makes a heavier one, and possibly a few smaller ones. For beta plus and gamma we are going to explore a common fusion reaction cycle.

First, two hydrogen nuclei collide. A helium-2 nucleus is formed, which quickly decays (a proton to a neutron – beta plus), which creates deuterium. Then, a hydrogen and a deuterium nucleus combine to make tritium, the ultra-heavy hydrogen. A gamma ray is emitted in this process. Two of these then react and create a helium-4 nucleus and two hydrogen nuclei. Then those two hydrogen nuclei can begin anew. There is a graphic representation of this.

The Sun

Without that complex process you wouldn't be reading this.

Measuring Radiation

When measuring radiation, we typically think of a Geiger-Mueller detector. It determines how much Radioactivity there is. This is expressed in becquerels. However, this number is not all that useful, because it tells us how much radiation is emitted, not how much there is in the air. That is determined by Exposure, but that isn’t the end of story. We need to know how much energy was Absorbed by us. This is expressed in grays (Gy).

And now we compute some other values, which we express in sieverts (Sv). As I said earlier, an alpha particle is very damaging compared to a gamma ray. To make compraison easy, we convert measured exposure into Dose equivalent (those four make a nice mnemonic, READ), in which we basically multiply Gy with a factor based on the type of radiation, and get sieverts. Finally, not all tissues are equally sensitive to radiation, so we multiply with one more number to get the exact value called the effective dose.

Uses

Unstable nuclei are useful when dating rocks. You can find an unstable isotope of potassium in volcanic rocks. When the lava cools down, there is some potassium-40 in the newly formed rock, but no argon. Argon is a gas and it evaporates. A proton inside potassium changes into a neutron, thus creating argon-40. By comparing how much potassium and argon there is in a rock, one could easily date the rock. The funny thing about fossils is that they tend to be found in rocks between the volcanic ones, and those rocks aren’t suitable for this type of dating. Dating the rock above and below the fossil, however, can show how old the fossil is not.

There’s no need to mention that nuclear reactors use radioactive materials, but it might be worthwhile to point out that smoke detectors also use them. They work similar to an experiment: there is one closed americium container which serves as a reference, and an open one. When smoke particles enter the open container, electricity produced in it drops significantly compared to the referent container. At that point the alarm starts to ring.

Exposure to radiation causes mutations which make cancer, but they can also make new plant varieties. The idea is to expose seeds to radiation, then let them grow. Seeds from the best plants are then picked up and used for commercial use. The Chinese seem to be very interested in this. One more area of application is food irradiation. Food is exposed to radiation which kills bacteria, but doesn’t harm the nutrients. The dose in this process is prescribed and controlled to make sure food doesn’t become radioactive.

Ironically enough, cancer cells can be caused and treated by radiation exposure. A mutation in DNA, which can be caused by radiation, causes them to become more active, divide more quickly, and don’t control their division cycle. This is good for them, but bad for the rest of the body. However, they have to make a trade-off to get this. They become less resistant to radiation and cytotoxins (chemicals which kill cells). Chemotherapy and radiotherapy damage the body, but they damage the cancer more.

Conclusion

Radiation is like fire: it can be used to do many good things if controlled. Out of control it can do much harm. Exaggerating harm can be dangerous too: prohibit fire and risk freezing to death. Be smart about it: careful, but not panicky.

Images are still being searched for and processed. The presentation is on the way, too.

Blog Updates

Posted: January 26, 2012 in General

It turns out my time is more limited than I thought. Therefore I have made a decision to post twice a week: every Thursday and Sunday. This way you’ll know when to come back and check for new posts.

If you haven’t already noticed, there is a Facebook page on which I post updates on the blog. Aside from those, I post some more details there, like what the next post will be about. So if you want to know in advance and suggest topics, like it.  https://www.facebook.com/pages/Hitchenss-Razor/303237669712661

Now I know how SocialVibe works in more details. You need to watch a commercial and possibly fill in some forms. It usually takes two or three minutes. Doing so supports both this site and the fight against cancer.

And the last thing: if you like this blog and feel that others should read it too, please share!

Shortlink: http://wp.me/p26zC5-2c

In the first two parts, I described how science and religion seek to describe the world around us. If you missed them, read them first because I won’t be repeating the same points here. Instead, I’ll build upon those two posts to point to the differences in their method.

Just like in the first two posts, I’m going to treat both science and religion as Platonic ideas, eternal and perfect. This subtracts complexity  from the subject, but decreases unnecessary entanglement with each issue.

Common Sense And Logic

Both science and religion are starting off from common sense. Common sense behind the theory of evolution is that biological organisms come in different varieties, even those which are similar, and change over long periods of time, say years. Common sense behind absolute morality is that moral laws of all cultures show some similarities, and that they can be explained if someone else determined them, and if they are fixed and unchangeable. Bad science, or quackery, also promotes common sense. If 100 000 people are using it daily, the magnetic bracelet must work. How can so many people be wrong? It’s simply impossible to explain that otherwise. Oh, and look, here are testimonies of some people using it who felt better before they even saw it.

Religion thrives on common sense, just like bad science. Hitler was an Atheist and it’s impossible he was a Catholic. Catholics are good, therefore they don’t kill so many innocent people. Atheists are bad, therefore they do. Fortunately, Hitler’s religious views or lack thereof don’t hinge on the stereotypes, but on his words and actions. It would have devastating effects on the history of Catholicism, because many popes and priests, most notably those who fought in the Crusades and other “holy” wars, are also Atheists. Remember: those popes and priests may not have killed anyone, but they were supportive of it and lead others into killing, just like Hitler.

Without referring to Hitler’s words or pointing out obvious flaws in the standard of who the true Catholic is, one could be led astray by common sense.  Science, however, only begins its quest here. It isn’t satisfied with just words, it needs factual confirmation. Without it, any claims can be made, with no possibility of distinguishing the truth. After all, logic doesn’t intrinsically spawn truth, it only helps when trying to reach it.

Reality Check

Reality is the greatest impartial judge. It doesn’t care about your feelings or thoughts. It can’t be won over by more money, but by being in line with it. Science tries to do that to the extent possible, and tests everything against reality to see if it fits. If it doesn’t, nothing will make it fit. Just like you can’t put a cube through a circular aperture of the same diameter as the side of a cube. Scientists then adapt the cube to pass.

Religion usually tries two other things. Either it tries to change the perception of reality, saying that, for instance, child abuse isn’t such a big thing or carbon dating is inaccurate, hence the Earth is less than 6000 years old, or it asserts faith. Faith is the greatest nemesis of knowledge. It destroys the mere possibility of asking questions, effectively disabling the search for answers and more questions that arise along the way. Even in the face of reality. It throws scrutiny out of the window, embracing marketing instead. If a belief is more popular, and those on top like it, it will spread and become dominant. There is no need to market an idea in science: if it holds water, it will become mainstream.

If all bias was removed from the world, all religion would be gone with it. Bias helps us see what isn’t there, while simultaneously ignore what is. Religion wants that, it the cube pass through the hole without changing it. Science, on the other hand is constructed to reduce bias because it affects knowledge.

This, in short, is what I mean when I say that science and religion are in conflict. Their conflict is fundamental and inevitable. They are two things in conflict of interests. The conflict doesn’t arise always, but when it does, one side has to back down.

I’m thinking on writing a few more paragraphs soon. In the meantime, the first and the second part are available, while the fourth is still being planned. It’s going to be about how scientists are religious, a very common claim by the opponents of the conflict.

Stop SOPA

Posted: January 17, 2012 in General
Tags:

If you didn’t hear about SOPA before, you are probably not paying attention to US politics. SOPA is a bill which is, according to many, censor the Internet and make it unstable. They do this as trying to prevent piracy.

To me, the Internet represents more than just a bunch of connected computers. Using it, I’ve achieved things I couldn’t dream of without it: from connecting to people I’ve never seen, but with whom I share more than with people I see every day, to expanding knowledge, encountering new ideas, broadening views. And now trying to reach people with my message. I’m not the only one using the Internet for this: so are you. The Internet is a vital resource. It is the foundation of today’s world, its people, economy and culture.  Anything that damages it damages us, hinders our capacity to survive.

Censorship must not be tolerated. It disables free flow of ideas, and thus cripples our ability to make progress. It is a method of the weak who, when they can’t have it their way, stop everyone else from competing. Has the US really fallen so low? Are they admitting weakness?

And what do we do?  It is our duty, just as well as the Government of the United States, to do something. That is how democracy works: everyone is responsible for the good and the bad. This is my part.

I’ve made private ALL posts except for this one and Part II of the conflict between science and religion. This is how it looks like censored: http://hitchenssrazor.wordpress.com/2012/01/10/the-conflict-between-science-and-religion-part-ii/

Take action!

UPDATE: Now that the blackout is over, the blog is restored to its original state. A ribbon has been added to the top right, courtesy of WordPress.com and it will stay there for as long as necessary. 30 more senators are publicly opposing SOPA, and 6 more votes are needed to stop it from passing. Take action and spread the word! Don’t let the Internet down, don’t let yourself down.

The blog returns to normal when the countdown ends. Until then, I’ll write part III and possibly something more, and publish all of it on Thursday.

Shortlink: http://wp.me/p26zC5-1n

Sorting is one of the most important simple problems in computer science. Just think of how many times you needed to put something in order, for instance a table by names, videos by category, or blog posts by date, or words in alphabetical order. Ideas for solving sorting algorithms can be used in other algorithms. Think about it, you might come up with an interesting idea. Sorting algorithms can help you when sorting things manually.

I’ll give two tasks in this post. The first is with unique numbers and four solutions in the first and the third section. The second is sorting a calendar, for which the two proposed solutions in the second part tend to work better.

Task 1: imagine you have 100 numbers from 1 to 10000, in random order, all unique. How would you sort them in incrementing order?

Simple algorithms

Bubblesort is probably the simplest sorting algorithm. You go through all numbers, compare every two neighbours, and swap them if the second is smaller than the first. Then you do it again and again, until all numbers are sorted. Let’s take a look at a shorter problem:

4 3  1  5 2
(4 3) 1 5 2
3 (4 1) 5 2
3 1 (4 5) 2
3 1 4 (5 2)
(3 1) 4 2 5
1 (3 4) 2 5
1 3 (4 2) 5
1 3 2 (4 5)
1 (3 2) 4 5
1 2  3  4 5

If the first line was already sorted (for example, if we wanted to make sure something our friend Alice sorted is actually sorted), we’d have to do 99 comparisons and 0 swaps. If it was sorted in reverse order, then we’d have to do 9901 comparisons and  4950 swaps. This is really, really slow and inefficient. Maybe something else?

Insertion sort. This is a very intuitive algorithm, and it’s used when playing card games. You take [the next card] card and insert it in an (already sorted sequence):

4 7 A 5 3 Q
(4) [7] A 5 3 Q
(4 7) [A] 5 3 Q
(A 4 7) [5] 3 Q
(A 4 5 7) [3] Q
(A 3 4 5 7) [Q]
A 3 4 5 7 Q

It has to do just as many actions as bubble sort, but it does that much faster. It usually beats faster algorithms if there are few numbers, so it’s used to make them faster.

Task 2: You wish to sort all blog entries by date. The blog in question started in June 2010. and published several posts each month.

Counting

Task 2 is slightly different. Here we have a lot of similar numbers, so we can use counting sort instead. Let’s take a look at how would we sort months.

Jan Jan Jul Feb Aug Sept May Mar Dec Jan Oct Oct  May Aug Apr Sept
1 1 7 2 8 9 5 3 12 10 10 5 8 4 9

We have:

[Jan] 3
[Feb] 1
[Mar] 1
[Apr] 1
[May] 2
[Jun] 0
[Jul] 1
[Aug] 2
[Sept] 2
[Oct] 2
[Nov] 0
[Dec] 1

Now we add the numbers:

[Jan] 3
[Feb] 4
[Mar] 5
[Apr] 6
[May] 8
[Jun] 8
[Jul] 9
[Aug] 11
[Sept] 13
[Oct] 15
[Nov] 15
[Dec] 16

We know from this that the first three places are January, 4th is February, 11th and 12th is August and so on. We can now use this in radix sort to sort the whole dates. Radix sort sorts the least significant number first. In this case, it first sorts the whole thing by date, then by month, and finally by year. It is counter-intuitive, but it works. You can try it on sorting words alphabetically, too.

Divide and conquer

This strategy is useful for both occupying land and developing algorithms. You can search a sorted sequence using it. Think of the sequence as a number line. If the number you are looking for is greater than the number in the middle, it’s on the right side. If it is smaller, it’s on the left. Instead of going through the sequence, you go through only one half of it.

We can do the same with merge sort: split the array into two and sort each individually.

3 1 8 6 5 4 2 7
(3 1 8 6) (5 4 2 7)
***************
(1 3 6 8) (2 4 5 7)

Now we can compare the first number of both sequences to merge them into one.

([1] 3 6 8) ([2] 4 5 7)
1 ([3] 6 8) ([2] 4 5 7)
1 2 ([3] 6 8) ([4] 5 7)
1 2 3 ([6] 8) ([4] 5 7)
1 2 3 4 ([6] 8) ([5] 7)
1 2 3 4 5 ([6] 8) ([7])
1 2 3 4 5 6 ([8]) ([7])
1 2 3 4 5 6 7 8

The row of asterisks stands for a missing step. In it we must sort the two smaller arrays. We can split them further, until we are left with single numbers. Then we merge those 1-number arrays into 2-number arrays, and then in 4-number arrays - (1 3 6 8) and (2 4 5 7).

Merge sort is faster than insertion sort because of splitting the problem. However, if you split it to small problems, it becomes slower. Combining them makes for a significant improvement.

The last sorting algorithm is quicksort. When it’s bad, it’s as bad as insertion sort, but when it’s good, it’s better than merge sort. It divides the array in two parts around an element usually called the pivot. All numbers to the left are smaller than, and all numbers to the right are greater than the [pivot]. The numbers aren’t sorted.

4 6 7 8 2 9 3 1 [5]
(4) 6 7 8 2 9 3 1 [5]
(4) (6) 7 8 2 9 3 1 [5]
(4) (6 7) 8 2 9 3 1 [5]
(4) (6 7 8) 2 9 3 1 [5]

So far we had  no problems, but now we have to put the number 2 in the smaller than part. So we swap 6 and 2:

(4 2) (7 8 6) 9 3 1 [5]
(4 2) (7 8 6 9) 3 1 [5]
(4 2 3) (8 6 9  7) 1 [5]
(4 2 3 1) (6 9  7 8) [5]

We insert 5 between the parts, swapping it with 6:

(4 2 3 1) [5] (9 7 8 6)

Now we  have two parts and we can repeat the same process at each of them. In this example I used the last number, but selecting at random is better because no particular original sequence will cause it to be really, really slow.

There are other algorithms available, like heapsort, or you could put them in a binary tree, but I think this is enough.

Next up: the third part of the conflict and (r)evolutionary programming.