Showing posts with label Notes. Show all posts
Showing posts with label Notes. Show all posts

March 19, 2016

How to write a technical paper

This is the evolving set of recommendations I share with my graduate students for technical writing...

  1. Empathy: This is the single most important principle of technical writing.  Try reading what you write from the perspective of somebody who has not spent the last few months working on your problem.  Better yet, find such a person and see if they understand everything you are talking about.  Don’t just take their word for it, ask them to tell you what they understand in their own words.  See where they struggle and debug your paper: Do they get lost in too much detail and miss the main point?  Do they get disoriented because you jump around too much?  Are there terms they do not understand?  Fix the paper using the following techniques until a dedicated freshman can understand all the important points.
  2. Winston’s Onion Rule: The document should state the most important points first, and expand on them gradually. It is a mistake to keep any important points until the end of the paper.  Only details and supporting material should be left to the end.  If I stop reading the document at any point, everything I haven't read so far should be less important than everything I have read up to this point:
    1. The title should be descriptive of the main point.
    2. The first sentence should state the main point.
    3. The first paragraph should expand on the first sentence.
    4. The first section should expand on the first paragraph.
    5. The first chapter should expand on the first section.
    6. The whole paper/thesis should expand on the first chapter, etc.
  3. Yuret’s Fractal Rule: Parts at every level of your document, down to each paragraph, should have their own introduction / conclusion to keep the reader oriented (i.e. stop them from asking “What is this person talking about now, and why?”):
    1. The first chapter of a paper/thesis should state the topic of the paper/thesis and the last chapter should summarize its point.
    2. The first section of a chapter should state the topic of the chapter and the last section should summarize its point.
    3. The first paragraph of a section should state the topic of the section and the last paragraph should summarize its point.
    4. The first sentence of a paragraph should state the topic of the paragraph and the last sentence should summarize its point.
  4. No undefined terms: Any technical term your nine year old niece would not understand should be defined before first use.  Any acronym should first be given in parentheses next to its long form before first use.  All variables in equations, all axes in graphs should be explained at the first opportunity.  Tables and Figures should have descriptive captions that can be understood stand-alone.  Technical terms and mathematical notation should be used consistently, no confusing variations allowed (i.e. calling the same thing context vector somewhere and word context vector elsewhere will confuse the reader into thinking these are two separate things).
  5. Replicability: Science is based on replicable results.   Your paper should provide enough detail (possibly in the appendices), and links to its code and data, to replicate each of its results.  In particular, for each set of experiments you should have:
    1. Data table: e.g. in a natural language processing experiment, things like number of words and sentences in train, dev, test; vocabulary size, tagset size, tag frequencies, out-of-vocabulary rate, average sentence length, i.e. any data statistic relevant to the task should go to a data table.
    2. Parameter table: things like the model structure, the training algorithm used, the hyperparameters used, number of training epochs, and any other details related to experimental replication should go to a table.
    3. Result table: the results (table or plot) should clearly indicate the evaluation metric, sensible lower bound baselines, upper bounds (e.g. inter-annotator agreement) if available, and current state of the art in published work to put your results in perspective.

Full post...

May 27, 2015

What is wrong with p-values?

Earlier this year, editors of the journal Basic and Applied Social Psychology announced that the journal would no longer publish papers containing p-values. The latest American Psychological Association Publication Manual states that researchers should "wherever possible, base discussion and interpretation of results on point and interval estimates," i.e. not p-values. FDA has been encouraging Bayesian analysis. What is wrong with p-values?

What is a p-value? In the classical statistical procedure known as "significance testing", we have a default hypothesis, usually called the null hypothesis and denoted by H0, and we wish to determine whether or not to reject H0 based on some observations X. We choose a statistic S=f(X) (a scalar function of X) that summarizes our data. The p-value is the probability of observing a value at least as extreme as S under H0. We reject H0 if the p-value is below some specified small threshold like α=0.05 and we say something like "H0 is rejected at 0.05 significance level." This threshold or significance level (α) upper bounds the probability of false rejection, i.e. rejecting H0 when it is correct.

Example: We toss a coin 1000 times and observe 532 heads, 468 tails. Is this a fair coin? In this example the null hypothesis H0 is that the coin is fair, observation X is the sequence of heads and tails, and the statistic S is the number of heads. The p-value, or probability of S ∉ [469,531] under H0, can be calculated as: \[ 1 - \sum_{k=469}^{531} {1000 \choose k} \left(\frac{1}{2}\right)^{1000} = 0.04629 \] We can reject the null hypothesis at 0.05 significance level and decide the coin is biased. But should we?

Objection 1: (MacKay 2003, pp.63) What we would actually like to know is the probability of H0 given that we observed 532 heads. Unfortunately the p-value 0.04629 is not that probability (although this is a common confusion). We can't calculate a probability for H0 unless we specify some alternatives. Come to think of it, how can we reject a hypothesis if we don't look at what the alternatives are? What if the alternatives are worse? So let's specify a "biased coin" alternative (H1) which assumes that the head probability of the coin (θ) is distributed uniformly between 0 and 1 (other ways of specifying H1 are possible and do not effect the conclusion). We have: \[ P(S=532 \mid H_0) = {1000 \choose 532} \left(\frac{1}{2}\right)^{1000} = 0.003256 \] \[ P(S=532 \mid H_1) = \int_0^1 {1000 \choose 532} \theta^{532} (1-\theta)^{468} d\theta = 0.001 \] So H0 makes our data 3.2 times more likely than H1! And here the p-value almost made us think the data was 1:20 in favor of the "biased" hypothesis.

Objection 2: (Berger 1982, pp.13) Well, now that we understand p-value is not the probability of H0, does it tell us anything useful? According to the definition it limits the false rejection rate, i.e. if we always use significance tests with a p-value threshold α=0.01, we can be assured of incorrectly rejecting only 1% of correct hypotheses in the long run. So does that mean when I reject a null hypothesis I am only mistaken 1% of the time? Of course not! P(reject|correct) is 1%, P(correct|reject) can be anything! Here is an example:

X=1X=2
H0.01.99
H1.01001.98999

The table gives the probabilities the two hypotheses H0 and H1 assign to different outcomes X=1 or X=2. Say we observe X=1. We reject H0 at α=0.01 significance level. But there is very little evidence against H0, the likelihood ratio P(X|H1)/P(X|H0) is very close to 1, so the chance of being in error is about 1/2 (assuming H0 and H1 are a-priori equally likely). Thus α=0.01 is providing a very misleading and false sense of security when rejection actually occurs.

Objection 3: (Murphy 2013, pp.213) Consider two experiments. In the first one we toss a coin 1000 times and observe 474 tails. Using T=474 as our statistic the one sided p-value is P(T≤474|H0): \[ \sum_{k=0}^{474} {1000 \choose k} \left(\frac{1}{2}\right)^{1000} = 0.05337 \] So at a significance level of α=0.05 we do not reject the null hypothesis of an unbiased coin.

In the second experiment we toss the coin until we observe 474 tails, and it happens to take us 1000 trials. Different intention, same data. This time N=1000 is the natural test statistic and the one sided p-value is P(N≥1000|H0): \[ \sum_{n=1000}^\infty {n-1 \choose 473} \left(\frac{1}{2}\right)^n = 0.04994 \] Suddenly we are below the magical α=0.05 threshold and we can reject the null hypothesis. The observed data, thus the likelihoods of any hypotheses for this data have not changed. The p-value is based not just on what actually happened, but what could have happened. This is clearly absurd.

Objection 4: (Cumming 2012) If we base the fate of our hypotheses on p-values computed from experiments, at the very least we should expect the p-values (thus our critical decisions) to change very little when we replicate the experiments. Unfortunately p-values do not even give us stability, as this wonderful video "Dance of the p values" by Geoff Cumming illustrates:

Conclusion: (Jaynes 2003, pp.524) expressed the absurdity of significance testing best:

In order to argue for an hypothesis H1 that some effect exists, one does it indirectly: invent a "null hypothesis" H0 that denies any such effect, then argue against H0 in a way that makes no reference to H1 at all (that is, using only probabilities conditional on H0). To see how far this procedure takes us from elementary logic, suppose we decide that the effect exists; that is, we reject H0. Surely, we must also reject probabilities conditional on H0; but then what was the logical justification for the decision? Orthodox logic saws off its own limb.
Harold Jeffreys (1939, p. 316) expressed his astonishment at such limb-sawing reasoning by looking at a different side of it: "An hypothesis that may be true is rejected because it has failed to predict observable results that have not occurred. This seems a remarkable procedure. On the face of it, the evidence might more reasonably be taken as evidence for the hypothesis, not against it."

Full post...

April 01, 2012

The wonderful xargs command

I finally found a way I like to run a whole bunch of commands N at a time on an N core machine (well maybe use N-1 to be polite):

1. Say you have a command rprun.pl that takes 4 arguments that you want to run with 1000 different argument combinations.

2. You write a script rprun-args.pl that generates all combinations you need.  Say its output looks like:

10      185364  25      0.166
12      92682   25      0.166
18      65536   32      0.166
12      65536   25      0.7071
14      16384   25      0.166
...

3. Now you can use xargs to run these 24 at a time as follows:

rprun-args.pl | xargs -n4 -P24 rprun.pl > rprun.out

-n4 is to feed the arguments 4 at a time.  So a typical command line will look like:

rprun.pl 14 16384 25 0.166

-P24 tells xargs to run through the list 24 at a time.  If you run ps you will see 24 copies of rprun running together.  As soon as the number drops to 23 another child is spawned.

Note that the command above combines the outputs of all runs (in the order they finish) in the same file, so make sure rprun.pl prints out its arguments as well as its result on its output.

Full post...

March 10, 2012

On skill acquisition

A couple of months ago, I ran into this video by the Japanese coin magician Ponta the Smith.  Its elegance awoke my long dormant interest in close-up sleight-of-hand magic which had started when I was a kid and had peaked in LA taking classes at the Magic Castle.  I am especially fond of coin magic because its effects are so simple and direct.  I started watching the masters and practicing again.  My hands started being able to do things that they were not able to do a few days ago.  It surprised me to remember how much fun it was to acquire a new physical skill, and that I had not done so in more than a decade!

Then my friend Alkan showed me a video of Terry Laughlin, a swim coach with a unique training style.  He compares dolphins at 80% efficiency with the best olympic athletes at 8% and claims there is a lot to gain from reducing drag compared to adding power to the strokes.  Ernest Maglischo's standard reference also has consistent advice on correct body alignment.  While scanning Maglischo's book I was shocked to discover that it was not clear whether Newtonian or Bernoulli forces dominate the analysis of the swim stroke!  (Hey physicists, when you take a break from looking for the Higgs boson maybe you can help out with this?)  I have been swimming all my life and no matter how hard I tried I could not break my efficiency barrier at 17 strokes for a 25m pool.  After watching a couple of Laughlin's videos I was able to do it in 13!

Continuing on a chain of skill-acquisition serendipities, I came across Moonwalking with Einstein by Joshua Foer.  I should cover it more fully in a separate blog post.  In addition to giving an excellent synopsis of our current understanding of memory, it introduced me to the work of Anders Ericsson on skill acquisition. Ericsson has achieved some recent fame thanks to his research showing that experts tend to require about ten thousand hours of training to achieve their word-class status.  However what got my attention was the finding that when ordinary skill acquisition hits a plateau and improvement stops, that is rarely the sign of an innate limit, but rather the result of the skill becoming compiled and autonomous.  The trick to going past your plateaus and improving further is to bring the activity back to consciousness in sessions of "deliberate practice" where you pay attention to your technique and get constant and immediate feedback on your performance.  This is consistent with my swimming experience: Laughlin's videos made me pay attention to every stroke, in effect made me re-learn how to swim, and the 25m stroke count feedback pointed me in the right direction.

I am currently debating whether I should continue my self experimentation in the domain of Go, using techniques championed for chess by my friend Michael de la Maza, or improve my Bridge game by deliberate practice on card memory.  This is just too much fun.

On a more serious note, all this shows how little we know about skill acquisition and education in general and how much room there might be for improvement.  It seems to me the only way out of this conundrum is to allow experimentation in the educational domain with proper feedback and reward for innovative educators.

(*) Some of my favorite coin masters: David Roth, Michael Rubinstein, Jay Sankey, Gregory Wilson, David Stone, Giacomo Bertini, Kainoa Harbottle, Curtis Kam, Homer Liwag, Apollo Robins, Shoot Ogawa.

Full post...

March 19, 2007

Drexler quote

It makes sense to think in terms of three levels of knowledge about a field:

  1. Knowing what a field is about—knowing what sorts of physical systems and phenomena it deals with, and what sorts of questions it asks and answers.
  2. Knowing the content of a field in a qualitative sense—having a good feel for what sorts of phenomena can be important in what circumstances, and knowing when you need answers from work in that field.
  3. Knowing how to get those answers yourself, based on personal mastery of enough of the field's subject matter.

If one has enough knowledge at levels (1) and (2) in enough fields, then one can steer clear of problems in those fields while doing work in a related field where you have knowledge at level (3). And this is a good thing, because knowledge at levels (1) and (2) takes far less time to acquire. But to make proper use of knowledge at levels (1) and (2) requires a harsh discipline: attempt to assume the worst about what you don't know. Don't assume that a poorly-understood physical effect will somehow save your design; do assume (until finding otherwise) that it may utterly ruin it. Without this discipline, you'll become an intellectual hazard. With it, you'll be able to make a real contribution.


Full post... Related link

March 11, 2007

Technology and society

Two interesting articles on technology and its impact on society. I received the first one from Ergun Bicici. The second one came from Emrah Çevik.

U.C. Berkeley Graduation Speech by Peter Norvig
Economic Possibilities for our Grandchildren by JM Keynes (1930)
Full post... Related link

October 30, 2006

Logical Fallacies and How to Spot Them

This should also be a requirement before somebody graduates from high school:
Logical Fallacies and How to Spot Them

In the Evolution vs. Creationism debate, it is important to be able to spot all the logical fallacies that Creationists tend to throw around. This essay covers many bare essentials of logical thinking, as well as ways to critically evaluate an argument. The logical fallacies listed here are the ones most often used by Creationists, although Creationists have, to date, used almost every single logical fallacy in existence to "prove" their case. Each fallacy will have its own little paragraph, describing it, why it is fallacious and how to counter it. Enjoy!

THE STRAWMAN ATTACK: The strawman is, perhaps, the most heavily-employed tactic used by Creationists. The strawman attack's name comes from the idea of setting up a strawman and knocking it down. The strawman is a false man, metaphorically representing a false argument. The strawman attack is a very dishonest one. Creationists ruthlessly use this tactic to win public support. In essence, the strawman attack is putting words in your opponent's mouth and then attacking the resulting position, while simultaenously evading the real argument.

EXAMPLE

"Evolution is a ridiculous theory! Macro-evolution says that a fish can just evolve into a bird! Clearly this is preposterous!"

This is an example of a strawman attack. Macro-evolution does not say that one species can "evolve" into another one. Macro-evolution is one species splitting into two species due to evolutionary changes. Clearly, this argument is a gross misrepresentation, at best, and a malicious lie, at worst.

HOW TO SPOT

Spotting a strawman attack isn't that hard. Just make sure that the opposition actually makes the claim that the attacker says he or she does. In evolution's case, just think to yourself: Would our foremost men and women of biology actually propose such a ridiculous concept? While you should always check to verify the attacker's statements about what the opposition is saying, you definitely do so when the attacker's statement begs such questions as, "How stupid can the opposition possibly be?" and arouses any kind of suspicion. For example, I read many web sites devoted to the Evolution vs. Creationism debate that displayed common Creationist arguments. I found it hard to believe that people were actually making the arguments I saw, because they were so easily shot down. So, I looked on Creationist websites and, lo and behold, they had, indeed, made such moronic claims as, "Evolution defies the Second Law of Thermodynamics!"

HOW TO COUNTER

Strawman attacks, once exposed for what they are, are not all that difficult to counter. SImply ask the attacker for a documented occasion in which his opposition made such a claim. If he cannot produce one, happily point out that the attacker is putting words in his opponent's mouth and attacking that position. Pointing out that this attack is a cowardly evasion might well help, depending on how high (or low)a regard you hold the attacker in.

THE FALSE DILEMMA FALLACY: The false dilemma is at the heart of the Creationist argument. The false dilemma supposes that there are only two possible solutions to a problem (his and his opponent's), ignoring anything else. The idea behind the false dilemma is to set up a system in which a disproof of the opponent's argument is automatic proof and support for the attacker's argument. Obviously, this is a completely irrational line of thinking. Just because there may be some error in my measured height doesn't make me a kilometer tall.

EXAMPLE

"There are only two solutions for the question of how the Universe was created: the Big Bang, which says that the Universe was formed out of nothing from random chance, or Biblical Creation, which gives us a loving, awesome, caring God who wants us to...[continue with mindless religious yammering ad infinitum]."

Obviously, Creationists love the false dilemma because it makes any hole they find in Evolutionary Theory an automatic proof of Biblical Creation. Of course, if we are to accept Biblical Creation as a viable view on how the Universe was created, then we must accept other religions' creation stories, as well. Creationists tend to ignore this fact, in favor of their quasi-masturbatory fantasies about a six-day creation timeframe and a Universe that is a paultry ten thousand years old.

If you look carefully, you'll also notice the strawman attack. The Big Bang Theory doesn't state that the Universe was formed from nothing. This would violate the Law of Conservation of Energy. Also, there's nothing in the Big Bang Theory that suggests random chance. It simply happened. We don't know why, but it did.

HOW TO SPOT

Whenever the attacker arbitrarily cuts the number of possible solutions down to only two, you should ask him why he does this. If there is a logical reasoning behind it (for example, there are only two solutions to x2+4x+4), then this is not a false dilemma, but a true one. If he cannot give you a logical explanation, he is setting up a false dilemma.

HOW TO COUNTER

Once you spot a false dilemma, just make it clear that the attacker is artificially narrowing the choices down the choices and trying to decieve everyone. This will go quite a ways to shatter his credibility.

THE APPEAL TO AUTHORITY: The appeal to authority is used when someone making an argument can't put any logical reasoning behind it. Instead of supporting an argument with evidence, the argument is supported by simply saying, "Because so-and-so said so." The argument may be correct, but the logic is still fallacious. For example, if someone said that the Earth's gravitational acceleration was 9.8m/s2 because physicists said so, the information would be correct, but they'd be basing it on false logic. Creationists especially love this type of fallacy because they have an authority that they can appeal to for anything that they want: God. Since God knows everything, anything they say can be "proven" correct by appealing to God. The other authority that they like to appeal to is the Bible. "Because Genesis said so, and Genesis was written by men inspired by God," it must be correct. This is known as a Biblical appeal to authority, while the former is known as a deistic appeal to authority. Either way, if there's no reasoning behind the argument, it is fradulant and illogical.

EXAMPLE

"Isaac Newton was a believer in Creation. He is one of the most legendary physicists of all time. Surely, you're not going to argue with him."

Exactly the kind of thing Creationists tend to say. Not only is this an appeal to authority, it is an appeal to an irrelevant authority. Newton was a physicist, which has nothing to do with biology, and he has been dead for a long time. He was not confronted with all the evidence for Evolution, thus his opinion is irrelevant. Even if a living biologist were cited as an authority, the argument would still be an appeal to authority and, thus, fallacious.

HOW TO SPOT

This one's not hard. When someone cites someone else as an authority and gives no argument, they are engaging in an appeal to authority.

HOW TO COUNTER

Simply point out the fallacy that the attacker is engaging in and demand that the argument be backed up by logic.

THE APPEAL TO FEAR: Creationists love this one. They like to make it seem that, if you don't accept their point of view, bad things will happen. This one is relatively simple. On a side note, this logical fallacy is, perhaps, the largest reason for the spread of Christianity. People didn't accept Christianity willfully, in the beginning. It was forced upon them, either with real threats ("If you don't convert, you'll be beheaded.") or imagined ones ("If you don't convert, you'll go to Hell."). Fear is no basis with which to accept an argument. The Catholic Church routinely engages in this fallacy by hammering the fear of God into youngsters at Sunday School and Catholic school. This becomes the driving force behind beliefs and actions, and it is a flawed one.

EXAMPLE

"To deny the truth of Creationism is to deny the Word of God Himself. If you don't accept God, you will be condemned to Hell to suffer for eternity."

No logic. No argument. No reason. No intelligence. Just bigotry and self-righteousness.

HOW TO SPOT

When someone threatens you with the dangerous consequences of not accepting their point of view, they are engaging in an appeal to fear. This is not a hard one to spot.

HOW TO COUNTER

Simply point out that your opponent is engaging in a logical fallacy, and obviously has no other recourse but to try and scare everyone into his point of view.

THE APPEAL TO THE MASSES: One is commiting this fallacy when he tries to justify a belief or action by the support base behind that action. Saying that Christianity is the right religion because it has a billion followers is an appeal to the masses. As with other logical fallacies, there is no logic behind this, just ignorance.

EXAMPLE

"There are more and more people converting to Creationism everyday. Even astrophysicists and biologists are seeing the light. This is God's work!"

Creationists often engage in an appeal to the masses in tandem with the appeal to authority, as you can see here. In this case, they use the appeal to an anonymous authority with the appeal to the masses. If all the physicists in the world suddenly said that they Earth pulled down at 1,000m/s2 without any proof, they'd still be wrong. If all the Creationists in the world jumped off a kilometer-high bridge, would you? If you said, "Yes," please proceed to the nearest bridge.

HOW TO SPOT

This is just like peer pressure. When someone mentions what everyone else thinks as evidence of his argument, he's appealing to the masses.

HOW TO COUNTER

Simply point out that the attacker is engaging in a logical fallacy. If it helps, give examples of where the masses have been wrong. Like the Spanish Inquisition, or the Crusades or the Holocaust.

THE ACHILLES' HEAL FALLACY: This is the belief that if you poke one hole in your opponent's argument, or find one thing wrong with it, that the entire argument is invalidated. Creationists love this one, because they like finding isolated incidents where, on the surface, it looks like evolution can't explain what happened. They also like to use it to invalidate carbon dating by citing isolated incidents in which carbon dating has been shown to be wrong (without pointing out the scientific explanations for these incidents). This can also be called the fallacy of hast generalization.

EXAMPLE

"They carbon-dated a snail and it turned out to be 25,000 years old! Carbon dating is totally unreliable!"

There are plenty of explanations for why this happened. Snails tend to abdorb minerals that they slide across. The snail in question probably picked up a 25,000 year-old piece of gravel. Furthermore, this doesn't address the fact that other, different dating methods (lke isochronic dating) confirm the majority of carbon-dating estimates. You can't just take one example and run with it.

HOW TO SPOT

If a widely-accepted practice is disputed by your opponent based on one or two examples, he is probably engaging in the Achilles' Heal fallacy. This may not be the case, though. It all depends on the scenario. If your someone attacks forensic evidence results by saying that the bullet tested was not the same type as the bullet used, then this is not a fallacy. Using a different type of bullet for the purpose of verification would skew the results of the tests. This is pointing out an error in the process which would affect the outcome. The Achilles' Heal fallacy is pointing out an error in merely one of many conclusions. The person would be guilty of the Achilles' Heal fallacy if he said that, because one forensic test turned out wrong, that all other tests must be wrong, as well.

HOW TO COUNTER

Once you know, for sure, that your opponent is engaging in an Achilles' Heal attack, simply demand that he explain why the majority of incidents which give correct outcomes should be ignored. For added fun, demand that he explain why, if the procedure in question is unreliable, a good deal of correct results were yielded.

THE AD HOMINEM ATTACK: The ad hominem simply means attacking the person making the argument, rather than the argument, itself. It is the last resort of Creationists whose arguments have been systematically annihilated. When used by a Creationist, these attacks will often incorporate religious bigotry and are almost always used with an appeal to fear.

EXAMPLE

"You have been blinded by Satan, and you are a creature of the devil. Neither you nor what you say can be trusted. You will rot in Hell for your ways."

Very simple. Notice the inclusion of the threat of Hell with the ad hominem. As said above, when a Creationist starts spouting crap like this, you know that you've won.

HOW TO SPOT

It is important to note the difference between an ad hominem and an insult. An ad hominem seeks to counter an argument based on the the person making it. An insult simply seeks to belittle someone. Insult can be added to a refutation, however. While impolite, the logic preceding the insult may be entirely true. Here is an example of an insult used with logical refutation:

TYPICAL CREATIONIST MORON (TCM): The Earth is only 6,500 years old.
ME: No, it's billions of years old [cites evidence]. Oh, and by the way, you smell of kitty litter, and your mother was a female dog of poor breeding.

See the difference? I cited evidence, made an argument, and then insulted the TCM. Of course, I'm not saying that insulting is right, but sometimes you just can't help calling a moron a moron.

HOW TO COUNTER

Inform any observers that your opponent is obviously at a loss to counter your arguments, and happily accept his concession on the point at hand.

SHIFTING THE ONUS OF PROOF: This is when your opponent makes a claim, provides no evidence for it, and then expects you to find evidence of it. Your opponent is making the claim, so he should logically have to provide evidence. Shifting the onus (or burden) of proof to you is a fallacy and a very low tactic to engage in. Often, a Creationist will make phantom claims and, then, act like they are common knowledge and he shouldn't have to back them up.

EXAMPLE

"The Earth was created in seven days by our loving father"
"Evidence?"
"Oh, come on! Everyone knows this, go look it up, if you don't."

That is an example of shifting the onus of proof. The opponent wrongfully forces you to do his research for him. He is obviously too lazy to do it, himself.

HOW TO SPOT

When your opponent starts treating a claim that isn't common knowledge like it is something everyone should know, and you demand proof, only to have him put that task on you, you are having the onus of proof unjustly handed off to you.

HOW TO COUNTER

Point out that your opponent is the one making the claim, not you. Demand that he provide evidence or conceed the point on the basis of zero evidence provided.

THE RED HERRING: This isn't so much a fallacy as it is an evasion tactic. The red herring is similar to a "wild goose chase." When someone leads the debate off on a red herring, they are trying to divert attention away from a particular argument, and toward some inconsequential statement that you may have made, or inventing some tangent to go off on. Creationists often use this when they attack the Big Bang Theory to try and prove evolution wrong. The Big Bang and evolution are completely separate theories, and are not mutually inclusive. The Creationist trying to debate the Big Bang is a red herring.

EXAMPLE

"Evolution is impossible because the Big Bang is a totally unacceptable theory because it defies the word of our loving Creator, He who sent His only Son, our Lord to...[continue with mindless religious yammering ad infinitum]."

The Big Bang has nothing to do with evolution. If it was proven wrong tomorrow, it wouldn't change the fact that organisms evolve to adapt to their environment, or they die.

HOW TO SPOT

This one can often be tricky to spot, because your first instinct is to correct the moron's ranting about the Big Bang. Don't let him lead you off on his tangent. Make sure that your opponent has directly addressed your point before proceeding.

HOW TO COUNTER
Demand that your opponent address your argument. Inform him and all those watching that his response is a simple red herring, meant to divert attention away from arguments that he can't counter.


Full post... Related link

October 01, 2006

Prediction, determinism, and free will

[Books_] Imagine standing around in a train station when you notice a TV monitor hanging on the wall. You recognize your own face looking back at you from the screen. You think no big deal, it must be one of those closed circuit security monitors with a camera hidden someplace. But then the you on the screen starts walking and gets on a train you know that is not due for another five minutes. The monitor is connected to a magic camera that shows what is going to happen five minutes in the future! Well, do you have the freedom not to get on that train now? Or will you somehow get compelled to get on the train against your will? If you do have the freedom to betray the monitor, does that mean a future showing monitor is impossible to build? Maybe quantum uncertainty or chaos make future prediction at that scale technically infeasible. Even for God? What if the universe was deterministic? Would that help things?

I thought about this problem on and off for a number of years until one day I ran into a paper by Gary L. Drescher. I had met Drescher once at the AI lab, enjoyed his book Made Up Minds like most fellow grad students, admired his explanation of quantum mechanics, and puzzled over his refusal to get any support from DARPA. And here he was again, with the solution to the puzzle.

To avoid the complications of the real universe Gary's trick is to think of made up universes with simple rules. This prevents confusion and eliminates prejudice. So going back to my train station, imagine a universe simulated on a computer that has completely deterministic rules. A bit like the Matrix movies. You program the simulation and let it run until sentient beings evolve and start building train stations. It is your program, and it is deterministic, so you know what is going to happen at any point in time. When in doubt, you can just load the program on a second computer and fast forward to see the future. Do YOU have the power to place a monitor that shows the future at the train station in your simulation? Well of course, you might say, you wrote the program, you own the computer, you can do anything. Not quite, it turns out...

You can certainly put a monitor in the train station and pump images of five minutes in the future to it. But trouble starts as soon as one of your simulated creatures actually looks at the monitor and decides what to do based on it. To decide what to put on the monitor at that moment, you need to fast forward. To fast forward you need to simulate what the creature is going to do. What the creature is going to do depends on what it sees on the monitor. Hmm, we have a circular impasse. Well, you might say, why not run a bunch of simulations putting various future movies on the monitor to see how the creature is going to react - one movie shows the creature getting on the train, another shows not getting on the train, for example. You fast forward in each case, then choose the movie that actually turns out to be correct. The trouble is none of the movies are going to turn out to be correct if you have a particularly stubborn creature that keeps doing the opposite of what it sees on the screen. And that brings us to the crux of the matter - the "creature" does not even have to be a sentient being. It can be a very simple automaton with the only talent of doing the opposite of whatever it observes on the monitor. And you are helpless.

So there is nothing in principle against an omniscient creator who knows the future. He just can't share the information with the inhabitants. Unless of course he forcibly compels them to obey his prophecies, but that would be lame, interfering with their free will. Determinism and (somebody else's) knowledge of the future are not inconsistent with your free will, being forced into a particular future is.

The real universe has the added problems of quantum uncertainty and chaotic behavior which may make future prediction physically impossible. But our story shows that knowledge of your own future is logically impossible - as far as impossibilities go, that one is hard to beat ;)

Any errors and misunderstandings in the discussion above belong to me, and I acknowledge Drescher for the rest. I am looking forward to his new book.

Full post... Related link

September 03, 2006

J.B.S. Haldane

[Biology_] I first got to know J.B.S. Haldane as the author of one of my favorite quotes:

"I have come to the conclusion that my subjective account of my own motivation is largely mythical on almost all occasions. I don't know why I do things."

How prescient of him before we knew about Libet's half second delay and Gazzaniga's split brain patients.

It turns out he has very nice articles on the physics of animals and the future of science. What is it with these Scots?
On Being the Right Size

Also here are his predictions on the future of science written in 1923:
Daedalus, or, Science and the Future

With the exception of his pessimism on atomic power and optimism on the progress of biology and eugenics, I'd say he has quite a few accurate observations. On the evils of science I like how he turns the argument around and says the magnification of good and evil by science is what forces the common man to finally take action:

"I think then that the tendency of applied science is to magnify injustices until they become too intolerable to be borne, and the average man whom all the prophets and poets could not move, turns at least and extinguishes the evil at its source."


Full post... Related link

July 10, 2006

Poker thoughts

[Games_] In Von Neumann's analysis of a simplified poker game he considers the hands to be numbers between 0 and 1. The player with the higher number wins at the end if nobody folds. The real poker hands are different types of objects, however. For example in holdem you start with two cards, which can later develop into a variety of hands. Thus the most natural representation of a hand is not a number but a probability distribution of possible resulting hand values they can turn into.

Can't we just map these distributions into numbers based on which is better? How do we decide whose hand is better? Is it the one whose expected value is higher? It turns out the answer is not that simple. Probability distributions cannot be compared as easily as numbers. Specifically let X and Y be two independent random variables. E[X] > E[Y] does not imply X > Y with higher than 1/2 probability. In fact probability distributions cannot even be ordered. So the events X > Y and Y > Z each having Pr > 1/2 does not imply X > Z with Pr > 1/2. Here is an example:

X: 0.5=>20 0.5=>30
Y: 0.6=>10 0.4=>100

Here X beats Y, i.e. P(X>Y)=0.6 even though E[X]=25 and E[Y]=46. Well maybe the mean is misleading and it is the median which decides who's better. Let's add another variable to the example:

Z: 0.4=>0 0.6=>50

Compared to X, Z is better because it wins 0.6 of the time. Compared to Y, Z is worse because it wins 0.36 of the time. So we have three hands with X > Y, Y > Z but Z > X. This means in general distributions cannot be ordered and it is not possible to find a single number (mean median etc.) that will decide which hand beats which.

Also note that the real poker hand distributions are not independent in holdem. Since everybody shares the cards after the first two, the outcomes cannot be represented by independent distributions.

Whether these two facts really matter, or hands can be well represented with an order depends on the details of the poker deck. Must write program to see.


Full post...

June 01, 2006

Ray Solomonoff

Ray Solomonoff gave a nice series of lectures at Bilgi University this week and peaked my interest in algorithmic probability again. The link below contains some of his stuff. Should find out more about Levin's search (http://www.idsia.ch/~juergen/optimalsearch.html). Juergen's website contains more interesting stuff as well:

http://www.idsia.ch/~juergen/
Full post... Related link

May 31, 2006

Bayesian probability and quantum mechanics

[Math_] The Bayesian interpretation of probability - that probability represents our lack of knowledge, not some "real" randomness out there - would make a lot of confusing interpretation problems with quantum mechanics go away. This page has some discussion, but it doesn't answer the main question in my mind: how does an electron interfere with itself in the double slit experiment described by Feynman?

Also related:
http://math.ucr.edu/home/baez/bayes.html
http://plato.stanford.edu/archives/sum2003/entries/probability-interpret/
http://bayesrules.net/ast383.html
http://math.ucr.edu/home/baez/
http://math.ucr.edu/home/baez/questions.html
http://math.ucr.edu/home/baez/physics/
http://www.cs.uwaterloo.ca/~alopez-o/math-faq/math-faq.html



Full post... Related link

May 09, 2006

Amino acid codes and types

[Biology_]


The one-letter and three-letter abbreviation codes for amino acids for example, used in UniProtKB/Swiss-Prot are those adopted by the commission on Biochemical Nomenclature of the IUPAC-IUB and are as follows (numbers give frequencies):

A Ala 7.49 Alanine
R Arg 5.22 Arginine
N Asn 4.53 Asparagine
D Asp 5.22 Aspartic acid
C Cys 1.82 Cysteine
Q Gln 4.11 Glutamine
E Glu 6.26 Glutamic acid
G Gly 7.10 Glycine
H His 2.23 Histidine
I Ile 5.45 Isoleucine
L Leu 9.06 Leucine
K Lys 5.82 Lysine
M Met 2.27 Methionine
F Phe 3.91 Phenylalanine
P Pro 5.12 Proline
S Ser 7.34 Serine
T Thr 5.96 Threonine
W Trp 1.32 Tryptophan
Y Tyr 3.25 Tyrosine
V Val 6.48 Valine
B Asx Aspartic acid or Asparagine
Z Glx Glutamic acid or Glutamine
X Xaa Any amino acid



Amino Acid Properties and Substitutions

A substitution is more likely to occur between amino acids with similar biochemical properties. For example the hydrophobic amino acids Isoleucine(I) and valine(V) are more likely to substitute for one another than the hydrophilic amino acid cystine would with one of these. Amino acids come in the following types.

1. Amino acids with aliphatic hydrophobic side chains
The hydrophobic side chains of these amino acids will not form hydrogen bonds or ionic bonds with other groups. These hydrophobic amino acids tend to be buried in the centre of proteins away from the surrounding aqueous environment.
Ala, Val, Leu, lle, Met, Pro, Phe, Trp.

2. Amino acids with uncharged but polar side chains
The side chains of these amino acids are uncharged at physiological pH.
Ser, Tyr, Asp, Gln, Cys.

3. Amino acids with acidic side chains
These have a carboxylic acid group in their side chain and are very hydrophilic.
Asp, Glu.

4. Amino acids with basic side chains
The positive charge on these side chains makes them hydrophilic and they are likely to be found at the protein surface
Lys, Arg, His.

5. Neutral side chain
The single hydrogen atom side chain has no strong hydrophobic or hydrophilic properties.
Gly



Nucleotide Sequences

Nucleotide bases fall into two categories depending on the ring structure of the base. Purines (Adenine and Guanine) are two ring bases, pyrimidines (Cytosine and Thymine) are single ring bases. Mutations in DNA are changes in which one base is replaced by another. A mutation that conserves the ring number is called a transition (e.g., A -> G or C -> T) a mutation that changes the ring number are called transversions. (e.g. A -> C or A -> T and so on).

One-letter code Name Location
A Adenine DNA/RNA
G Guanine DNA/RNA
C Cytosine DNA/RNA
T Thymine DNA
U Uracil RNA



Nucleotide codes assigned by IUB

IUB Meaning Complement
A A T
C C G
G G C
T/U T A
M A/C K
R A/G Y
W A/T W
S C/G S
Y C/T R
K G/T M
V A/C/G B
H A/C/T D
D A/G/T H
B C/G/T V
X/N A/C/G/T X
. None .

Table of Standard Genetic Code

The genetic code in the table above has also been called "The Universal Genetic Code". It is known as "universal", because it is used by all known organisms as a code for DNA, mRNA, and tRNA. The universality of the genetic code encompases animals (including humans), plants, fungi, archaea, bacteria, and viruses. However, all rules have their exceptions, and such is the case with the genetic code; small variations in the code exist in mitochondria and certain microbes. Nonetheless, it should be emphasised that these variances represent only a small fraction of known cases, and that the genetic code applies quite broadly, certainly to all known nuclear genes.

Three of the codons do not specify the incorporation of any amino acids. These are known as the stop codons - UAA, UAG, UGA. They are found at the end of the mRNA coding sequence and they tell the ribosome to stop translating the message and release the protein. The mRNA is translated from the 5' end and read one codon at a time to the 3' end. Translation usually starts at a start codon (AUG) which codes for methionine.




Second Position of Codon



T C A G

F
i
r
s
t

P
o
s
i
t
i
o
n
T
TTT Phe [F]
TTC Phe [F]
TTA Leu [L]
TTG Leu [L]
TCT Ser [S]
TCC Ser [S]
TCA Ser [S]
TCG Ser [S]
TAT Tyr [Y]
TAC Tyr [Y]
TAA Ter [end]
TAG Ter [end]
TGT Cys [C]
TGC Cys [C]
TGA Ter [end]
TGG Trp [W]
T
C
A
G
T
h
i
r
d

P
o
s
i
t
i
o
n
C
CTT Leu [L]
CTC Leu [L]
CTA Leu [L]
CTG Leu [L]
CCT Pro [P]
CCC Pro [P]
CCA Pro [P]
CCG Pro [P]
CAT His [H]
CAC His [H]
CAA Gln [Q]
CAG Gln [Q]
CGT Arg [R]
CGC Arg [R]
CGA Arg [R]
CGG Arg [R]
T
C
A
G
A
ATT Ile [I]
ATC Ile [I]
ATA Ile [I]
ATG Met [M]
ACT Thr [T]
ACC Thr [T]
ACA Thr [T]
ACG Thr [T]
AAT Asn [N]
AAC Asn [N]
AAA Lys [K]
AAG Lys [K]
AGT Ser [S]
AGC Ser [S]
AGA Arg [R]
AGG Arg [R]
T
C
A
G
G
GTT Val [V]
GTC Val [V]
GTA Val [V]
GTG Val [V]
GCT Ala [A]
GCC Ala [A]
GCA Ala [A]
GCG Ala [A]
GAT Asp [D]
GAC Asp [D]
GAA Glu [E]
GAG Glu [E]
GGT Gly [G]
GGC Gly [G]
GGA Gly [G]
GGG Gly [G]
T
C
A
G



Full post... Related link

October 21, 2005

A different representation for integers

[Math_] The fundamental theorem of arithmetic states that every positive integer has a unique factorization into primes. Instead of the usual decimal notation where each position represents a multiple of powers of ten, we can represent each integer with a "primal" notation where each position is the power of a prime number. Here is what I mean:

2: (1)
3: (1 0)
4: (2)
5: (1 0 0)
6: (1 1)
7: (1 0 0 0)
8: (3)
9: (2 0)
10: (1 0 1)
11: (1 0 0 0 0)
12: (1 2)

The right-most position is power of two's, next to it is power of three's and so on. The intuition one gets from such a representation is remarkable. Let's prove a simple bound related to the prime number theorem (i.e. how many primes are there less than a given number?)

Let p(n) be the number of primes less than n where 2^k <= n < 2^(k+1). Now consider all the numbers smaller than n. Their primal representations are all distinct, can have at most p(n) elements, and none of the elements can be greater than k. This gives us the inequality:

k^p > n
p lg(k) > lg(n)
p > lg(n) / lg(lg(n))

Not a very tight bound, but could be used as an alternative to Euclid's proof of the infinity of the number of primes :)

One thing about our primal representation is bothering me. Namely the elements themselves are integers, but we are denoting them with regular decimal digits instead of the primal representation! The primal representation for 1 should be (). Zero is more of a problem. Let's keep it as 0 for now and see what we get:

1: ()
2: (())
3: (() 0)
4: ((()))
5: (() 0 0)
6: (() ())
7: (() 0 0 0)
8: ((() 0))
9: ((()) 0)
10: (() 0 ())
11: (() 0 0 0 0)
12: (() (()))

Much better. This representation gives us a one-to-one mapping between all integers and a certain subset of binary trees or s-expressions for those of you familiar with lisp jargon. Unfortunately not all possible binary trees or s-expressions with 0 are meaningful (for example (0)). There must be an even more elegant mapping, but I couldn't think of one so far!


Full post...

June 26, 2005

Mycoplasma genitalium

[Biology_] I was searching the net for any microarray data for mycoplasma genitalium. I found anything but... Here is a list of some useful links.

Cell Cycle Regulated Yeast Genes Spellman's yeast microarray paper and data.

SMD : Microarray Resources : Databases

EBI Databases - ArrayExpress Home Ebi microarray data. Contains some yeast.

ExpressDB Database of E.coli and yeast microarray data.

microarray data List of microarray data sources.

Expasy 191 out of 486 swiss-prot matches to M.G. are "hypothetical" proteins, i.e. we don't have a clue what they are doing...

PDB Query Result Only three M.G. proteins are found in PDB.

Swiss-Prot taxonomic query: Mycoplasma genitalium List of all genes in M.G. with descriptions. Only can get the first 100 for some reason...

the Gene Ontology website: Tries to organize gene functions.

2can Bioinformatics Educational Resource: Home Page great site that includes bioinformatics tutorials and a section on protein function.

Proteomics - Transcription Factors: some info on protein function

Saccharomyces cerevisiae

Genome Browser Need to figure out how to use this.

Genome Sizes:
E. coli 4,639,221 4,377 4,290 of these genes encode proteins; the rest RNAs
Mycoplasma genitalium 580,073 483 three of the smallest true organisms
Ureaplasma urealyticum 751,719 652
Mycoplasma pneumoniae 816,394 680
Saccharomyces cerevisiae 12,495,682 5,770 Budding yeast. A eukaryote.

Mycoplasma genitalium Background

Entrez PubMed: " The minimal gene complement of Mycoplasma genitalium.

Fraser CM, Gocayne JD, White O, Adams MD, Clayton RA, Fleischmann RD, Bult CJ, Kerlavage AR, Sutton G, Kelley JM, et al.

Institute for Genomic Research, Rockville, MD 20850, USA.

The complete nucleotide sequence (580,070 base pairs) of the Mycoplasma genitalium genome, the smallest known genome of any free-living organism, has been determined by whole-genome random sequencing and assembly. A total of only 470 predicted coding regions were identified that include genes required for DNA replication, transcription and translation, DNA repair, cellular transport, and energy metabolism. Comparison of this genome to that of Haemophilus influenzae suggests that differences in genome content are reflected as profound differences in physiology and metabolic capacity between these two organisms.

PMID: 7569993 [PubMed - indexed for MEDLINE]

"
Mycoplasma genitalium G-37 Information TIGR did the sequencing of MG, this is its homepage.

Bacteria
The DNA sequences of the complete genomes of seven mycoplasmas have been determined, including

* Mycoplasma genitalium has 580,073 base pairs of DNA encoding 517 genes (480 for proteins; the rest for RNAs).
* Mycoplasma urealyticum has 751,719 base pairs of DNA encoding 651 genes (613 for proteins; 39 for RNAs).
* Mycoplasma pneumoniae has 816,394 base pairs of DNA encoding 679 genes.

How many genes does it take to make an organism?
The scientists at The Institute for Genomic Research (TIGR) who determined the Mycoplasma genitalium sequence followed this work by systematically destroying its genes (by mutating them with insertions) to see which ones are essential to life and which are dispensable. Of the 480 protein-encoding genes, they conclude that only 265–350 of them are essential to life.

Genome Sizes Here is a page that has the sizes of the smallest genomes.

NCBI HomePage The site that I found the complete genome of mycoplasma genitalium.


Full post...