Wednesday, September 16, 2009

Recovery from Vision

The following article talks about recovery of vision from people who were blind from birth. A couple of things really jumped out at me.

1.

7316DF11-C08C-474C-81E3-786ECED034AF.jpg


S.K. could identify some shapes (triangles, squares, etc.) when they were side-by-side, but not when they overlapped. His brain was unable to distinguish the outlines of a whole shape; instead, he believed that each fragment of a shape was its own whole. For S.K. and other patients like him, "it seems like the world has been broken into many different pieces," says Sinha.


2.

However, if a square or triangle was put into motion, S.K. (and the other two patients) could much more easily identify it. (With motion, their success rates improved from close to zero to around 75 percent.) Furthermore, motility of objects greatly influenced the patients' ability to recognize them in images.



This is very easily interpreted using the HTM framework. It's very interesting!

Probability Problems and Simulation

There are a number of classic probability problems that challenge the intuition, both for students and for teachers. I have found that one way to overcome this intuition block is to write a quick simulation. A good example is the classic evil probability problem of the Monty Hall. The derivation of the solution is straightforward, but it is easy to convince yourself of the wrong answer. A quick simulation, like the one below, makes it clear: 1/3 of the time the host gets a choice with which door to open, and 2/3 of the time the host has no choice - with the other door having the prize. I find a numerical simulation helps to bolster my confidence in a mathematical analysis, especially when it is particularly unintuitive.


from random import randint
import random
turn=0
win=0
human=False

while turn<50:

prize=randint(1,3)
door_choices=[1,2,3]

if human:
your_first_answer=input('Which door %s? ' % str(door_choices))
else: # automatic
your_first_answer=random.choice(door_choices)

if prize==your_first_answer: # happens 1/3 of the time
door_choices.remove(your_first_answer) # get the other two
door_choices=sorted([your_first_answer,
random.choice(door_choices)])
else:
door_choices=sorted([prize,your_first_answer])

if human:
your_second_answer=input('Which door %s? ' % str(door_choices))
else: # automatic

# always switch
if door_choices[0]==your_first_answer:
your_second_answer=door_choices[1]
else:
your_second_answer=door_choices[0]

if your_second_answer==prize:
print "You win!"
win+=1
else:
print "You Lose!"

turn+=1


print "Winning percentage: ",float(win)/turn*100


Wednesday, September 9, 2009

Frequentist thinking, or just bad math?

In Steven Pinker's excellent book "How the Mind Works", he describes how people are bad at probability assessments, but are much better at frequency assessments (pg 348). It almost comes out and says that the brain is frequentist and not Bayesian, and it certainly implies it. He outlines how badly people do on the classic rare disease problem: "frequency of a disease is 0.01%, you take a test that is 99.99% accurate (false positives at 0.01%), you test positive. What is your chance of having the disease". People, even educated people (even in the medical fields) get this one wrong a lot.

Pinker contrasts this with "Think of 10,000 people, so we expect 1 to be infected and 9,999 to be not infected. You take the test, and the 1 person infected will almost certainly test positive, and we expect 1 person out of the 9,999 to test positive as well. We know that you tested positive, so what is your chance of having the disease?"

He claims that people are much better at getting the answer right. In my view, this is less about being good at calculating frequencies, and more about being bad at math. The second way of describing the problem pretty much sets up and carries out all of the "difficult" math, and then rounds so that all you have are small integer values. People do much better with that. If you want an example, not in probability, you can read my paper on "Teaching Energy Balance using Round Numbers: A Quantitative Approach to the Greenhouse Effect and Global Warming", which was motivated by the Weight Watchers system.

In the weight watchers system, counting calories (215+340+...) is replaced by dividing by 50 and rounding (4+7+...). Same result, but small numbers are easier to work with.

Wednesday, September 2, 2009

A nice series to look at

Bill Harris has a nice blog entry about Bayesian versus Classical stats. I'd like to go through the rest of these posts, because I think there is some great stuff in there.