I have a simple rule of thumb for what I am and am not allowed to say about Google. If I can find it said in some official-looking place from Google, then I think I'm allowed to say it. Otherwise not.
I was therefore very glad to run across this talk by Guido Van Rossum describing his code review tool named Mondrian, put on youtube by Google Tech Talks, and judging from the knowledge level of the audience, delivered to a non-Google audience. Confirming that this was not, in fact, accidentally open, I found an O'Reilly article confirming that it was public.
I therefore feel comfortable talking about anything and everything said in that video. So you can view this as my spin on the material in that video, and if you want the full version without the editorializing, feel free to take an hour and watch the video for the original source.
These days everyone who is competent has agreed that source control is a Good Thing to use. However opinions on how to use it vary widely. One argument in particular that I've seen in multiple organizations is on the value of using multiple branches versus having everyone develop in one branch, which is often called something like MAIN or HEAD. The issues involved are somewhat complex, and not obvious. So let me give a quick overview.
The primary argument for branching is that people can work on different features on different schedules without getting in each other's way. The primary argument for all developing on the same branch is that you discover conflicts immediately when they are easiest to resolve, rather than months later when people have moved on to different things and have lost context for the pieces of code that conflicts. The primary argument against branching is the pain of merging later. (Granted, distributed version control systems like git have done a lot to reduce this pain. But they have not eliminated it.) The primary argument against developing on HEAD is that it requires a constant level of diligence on the part of developers. When any developer can break all developers, you need to be careful in what you check in.
I've just kept this down to the primary arguments because the secondary back and forth arguments get long, involved, and heated. Also what I've described as two ways of working is really two families of working. There are a lot of ways to organizing multiple branches. And there are quite a few useful uses for branches in a software project even if everyone is developing on the same branch. None of this is made easier by the fact that (as with many religious wars) the people involved have imprinted on one way of doing things. That makes them hyper aware of the problems in other approaches, and they don't even notice potential pain points in their own.
Until I came to Google my personal position was that everyone working on HEAD was the best approach as long as your team was small enough that you could make it work. And I vaguely accepted that the pain of branching was a necessary evil on large software projects. Even when the pain reached the point of craziness, I was mostly willing to accept unsupported claims that it is necessary.
Then I came to Google. There are a lot of groups at Google, and they are free to do their own thing. Many do. However most groups develop out of one giant code base on HEAD. And it works as a development model. Google has made it scale.
Guido's talk describes many elements of what makes it scale. The first piece is having good developers. The second piece is an enforced policy of having every single patch go through a code review process before you check anything in. The third piece is a lot of proprietary infrastructure that Google has built up to make things work. And beyond that you have people paying attention to best practices such as consistent style, good unit testing, so on and so forth. (All of which are reinforced in the code review process.)
My opinion after seeing Google has changed. I freely admit that there are real process and tool challenges to making it possible for large teams to develop everything on HEAD and have it scale smoothly. However it is possible. I've seen it work. And, speaking personally, this is my preferred way to work.
Different organizations are different, have different capabilities, different needs, and different goals. Sight unseen I'm not going to tell anyone else that their organization should try to work like Google does. I simply don't have the facts about your situation. But if, like me not that long ago, you've accepted the claim that large development teams have no choice, you now know better.
Now admittedly most people can't go and see this first hand for themselves at Google. But if you want to watch a large successful project developing code to a high standard in this way, I recommend watching clang. And if you want to know more about what kinds of tool support you need to make this work, go listen to Guido. He's smarter than I am, has been doing it longer, and actually built some of the basic tool support for it.
Friday, February 5, 2010
Monday, February 1, 2010
What is intelligence?
Last September I posted on why hard sciences are different from soft ones. The subject of this blog post is a perfect illustration of the critical difference. In the hard sciences people mostly agree on basic definitions, broad agreement exists on key problems to solve, and in general there is agreement on a basic paradigm. Through no fault of their own, in the soft sciences, none of this exists.
Few things illustrate this better than getting a handle on what intelligence is. Here we have a subject that has been seriously studied for over a century. Yet researchers have not achieved agreement on whether they should focus on a single measure of intelligence called g, or multiple measures, or if multiple measures then how many there should be and how they should be divided. Note here that if you talk to individual researchers this fact does not worry them, because each researcher works in a community of other researchers who have achieved agreement on this. Each school of thought therefore churns out a stream of research, but they have failed to convert each other. And after a century the debate shows no sign of ending any time soon.
Please note that I am far from expert on any of this, so I'll try to summarize in broad terms my understanding, but my understanding could be incorrect. Also be aware that a lot of experts disagree with each other strongly, and therefore it is easy to find experts who will disagree with anything interesting that I can say. Please keep those caveats in mind as I try to flounder my way through the complications.
Let's start with the simplest approach, namely Spearman's g. What Spearman did in 1904 is take a number of things that one would think correlate to intelligence, such as grades, and found that they seemed correlated well with each other. He then looked for some linear combination which correlated better with each of the initial factors than any initial factor did. He found a very combination that did so, and found that it successfully predicted a very large part of the variation. In modern mathematical terms he did something called a Principal Component Analysis and looked for the most significant component. He then found that the most significant component really did capture a lot of the variability.
Spearman called this factor g for general intelligence.
Not long after the IQ test was invented. Before long people added IQ tests to the mix of factors, and found that a well-designed IQ test served as a fairly good predictor of g. Then g in turn served as a decent predictor for many things, including academic performance, and success in the workplace. Since IQ tests were fast and easy to administer, IQ tests and ability tests were on. (Ability tests such as the SAT and GRE exams actually are fairly directly comparable to IQ tests, and high-IQ societies such as MENSA are happy to accept them as proof that your IQ is high enough to belong.)
All of this begs many important questions. We got g out of a mathematical construct. But is it real? Is there really such a thing as general intelligence? Also even if there is such a thing as general intelligence, is it a stable attribute of a person? Does your general intelligence change over time? And the whole principal components analysis admits of the discovery of multiple components, how important are the lesser components? (The existence of a split between mathematical and verbal ability is obvious enough that most ability tests split those into separate sections.) Are there important factors which have been missed? Also how much of this is affected by heredity versus environment? How does race play into this? Can training change how you score on the test? Can it change your actual intelligence?
Believe you me, those questions have been researched. Extensively. And argued. More extensively. The only ones that there seems to be a decent consensus on is that to the extent that general intelligence makes sense, it seems to be fairly stable, and both hereditary and environmental factors affect it. Every other one is still under debate, though it is easy to find experts that make definitive claims that the matter has been completely settled one way or the other.
As one example of the ongoing debate, ETS, which puts out various tests including the SAT exams, claims that training cannot improve your performance. At the same time Kaplan makes money selling the claim that they can significantly improve your performance. Kaplan has enough evidence of effectiveness that I accept that they are right, but the debate continues. I suspect not the least because ability tests are just IQ tests under a different name, and so acceptance that Kaplan can teach an ability test is evidence that a key tool underlying a lot of research into psychology is fundamentally flawed, which opens up a can of worms that many don't want to look into.
For another example, I strongly suggest that mathematically inclined readers read g a Statistical Myth. It presents a toy statistical model which demonstrates how readily a large number of independent random factors with a small amount of interaction could give rise to all of the statistical evidence which underlies claims that such a thing as general intelligence exists. Given the fact that any hereditary effect on intelligence is the result of a large number of fairly independent random factors called genes, I think the point is an important one. The idea that we each have a huge number of different intellectual abilities at different degrees of competence accords very well with my understanding of how the brain works, and my experience of interacting with others.
However it is also true that a small number of factors have a major effect on many different kinds of mental activities. Thus some combination of the amount of things you can keep in your mind at the same time and speed of reasoning may be influential enough on enough things to deserve the name "general intelligence".
At this point I'd say that the jury is not just out; they are deadlocked and randomly fighting each other. And have been in this state for the better part of a century.
So what do I have to contribute to the discussion? I'd like to throw out a toy mathematical model for how IQ and intelligence relate. Please do not take this too seriously. After all it is not even agreed on at this point that general intelligence is a particularly well-defined concept. But what I'd like to show is that even if you do accept that general intelligence exists, and that IQ is reasonably well correlated with it, that IQ tests are not a particularly effective way to find the smartest people. (Whether or not any better way exists is a question I'd like to avoid. In fact, please forget this parenthetical point.)
Now suppose you sit down to take a test. You come prepared with many relevant abilities. You have your vocabulary, your polished reasoning ability, and a body of basic knowledge you're expected to have acquired about the world. We are generally prepared to accept these as components of intelligence, and the test will try to measure those. Let's call that INT. However you come prepared with other relevant abilities. There is how well you are feeling, how much sleep you got, any tricks you know about how to handle the types of questions that are likely to be asked, cultural cues you share with the test makers and how stressed you are. We are generally not prepared to accept these as components of intelligence, yet they affect how we do. Let us call these TST.
For my toy model let's say that INT and TST are independent random normals with a mean of 0 and a standard deviation of 10. That's math talk describing a particular bell curve. If you want the odds of it being less than a particular number you just have to divide the number by 10 to get the number of standard deviations you're out, and then look at a standard table and read off the probability.
Now let's say that the measured IQ will be 100+INT+TST. If you're a mathematician you'll know that IQ will have a normal distribution with mean 100 and a standard deviation of 10*sqrt(2) which is about 14.14. The correlation between IQ and INT turns out to be 70.7%. By comparison the Stanford-Binet is designed to have a mean of 100 and a standard deviation of 16, and its correlation with other measures of intelligence like academic performance is (depending on who measures it and how it is done) in the range of 70-80%. So while the model is pretty simple, it is not too far off from how a real IQ test behaves. And it captures the obvious observation that there are factors that affect test performance which we don't think of as intelligence.
Now the fun thing about a model like this is that we can play with it since we know exactly how it is set up. And are free to add any internal details we want. And while we can't necessarily believe the answers we get, we can gain valuable intuition about what kinds of answers we can expect to see if we understood a far more complex system. Such as real people with real brains.
To analyze this I'm going to complicate the model one more time by introducing two more random variables. Let's make them independent normal variables with mean 0 and standard deviation 10/sqrt(2), and call them AVG and DIF. It turns out that (AVG+DIF) and (AVG-DIF) are independent normal variables with mean 0 and standard deviation 10. So let's make (AVG+DIF) be INT, and (AVG-DIF) be TST. High-school algebra shows that AVG = (INT+TST)/2 and DIF = (INT-TST)/2. (Hence the names.)
What was the point of that? Well it is this. At this point IQ = 100+2*AVG. And INT = AVG+DIF. Which means that if you give me an IQ, I can calculate AVG then use the known distribution of DIF to calculate confidence intervals on INT.
For example, in this model how intelligent is a typical member of MENSA? Well MENSA accepts anyone whose IQ is in the top 2% of the population. So a typical member might have an IQ at the boundary of the top 1%. (If you haven't taken statistics these calculations may make you eyes gloss over. You'll have to just trust that I'm coming up with correct numbers.) That IQ is about 2.326 standard deviations out, which after multiplying by the 10*sqrt(2) and adding 100 is an IQ of 132.90. (Remember that our standard deviation is lower than the regular IQ test, so our purported IQ scores will be lower than a regular test.) Which means that AVG is 16.45. On average our INT will be the same as the AVG, which puts you 1.645 standard distributions out, which is right around the 95th percentile.
We can go farther and calculate a 95% confidence interval for what the real intelligence of this individual is. 95% of the time a normally distributed variable will be within 1.960 standard deviations of 0, so that means that DIF will be in the range +- 13.86. Which means that INT will be (2.59, 30.31). Which means that INT is anywhere from 0.0259 to 3.031 standard deviations out, which would put INT anywhere from the 51st percentile to almost the 99.9th percentile. Hmmm, we really haven't nailed down INT very closely, have we? A similar calculation shows that with 80% odds INT is between the 77th and 99.5th percentiles. And you can even do fun things like show that with about 78% odds, this individual is not in the top 2% of the population on INT, and therefore would not qualify for MENSA if they were able to measure INT directly instead of the more complicated IQ.
Let's reverse the question. Let's take someone at the boundary of the 99th percentile in INT, and ask what IQ we should expect on average. Well that INT is 2.326 standard deviations out, which is an INT of 16.44, for an IQ of 116.44, which is 1.1625 standard deviations out, which is at the 87.77th percentile. So sorry, you're probably not going to test as smart enough for MENSA even though you're probably smarter than most of the people in MENSA. How likely is this person to fail to meet MENSA's admission standards? Well the cutoff for MENSA is top 2% which is 2.0537 standard deviations out, which is an IQ of 129.04 (again remember that the toy model's IQs are not as spread out as real IQ tests), so we need TST to be 12.6, which is 1.26 standard deviations out, which gives a probability of 89.6% of not qualifying for MENSA.
The upshot? This model predicts that most members of MENSA are not in the top 2% on intelligence, and most people in the top 2% of intelligence would not qualify for membership in MENSA.
Now let's apply this to a question of more personal interest. According to this model, how intelligent am I likely to be? I bring this up because in my last blog post I used my GRE to discuss my likely IQ, and therefore likely intelligence, then used it as a benchmark to compare with the people I've met at Google. So if I believe that high IQs systemically overestimate INT, how badly is mine likely to be overestimated according to my model?
Well my scores were V: 760, Q: 780 and A: 800. Going to a handy IQ calculator I put in 1540 for my GRE V+Q and find that I am 3.625 standard deviations out and only 1/7143 people have an IQ that high. So on my toy model that is an IQ of 151.265... Which implies that AVG is 25.633. So on average you'd expect my INT to be 25.633, which is 2.5633 standard deviations out, which puts me around the 99.5th percentile, or about 1/200 on INT. (Incidentally the average person with an INT that high would fall in the 96% percentile on IQ, and therefore would not qualify for MENSA.) But let's go farther. 50% of the time a normal distribution falls within 0.67449 standard distributions of the mean, which means that DIF is half the time within the range -4.769 to 4.769. That makes a 50% confidence interval for my INT be the range (20.864, 30.402). Which would put me anywhere from the 98th percentile to the 99.9th percentile in INT. Which is in line with my claim in the previous blog post that I wouldn't be entirely surprised to find that I am at the 99.9th percentile in intelligence. According to this model the odds are that I'm not that smart, but it is possible.
Interestingly there is a symmetry in this model which means that all calculations that I've done for INT apply for TST as well. Which means that I am likely to have a number of characteristics that make me good at taking tests but which are not reflected in my general intelligence. This is actually true.
The vast majority of people when they are faced with a major test or interview get stressed. Now what does stress do to you? Well stress is caused by adrenaline. Adrenaline prepares you for a flight-or-fight reaction. This means decreased blood flow to things like your stomach and neocortex (which is where most of your higher reasoning happens), and increased blood flow to areas that are likely to see action, like your muscles. The result? Improved vision, hearing, faster reflexes, and increased strength. Also significant damage to your ability to carry out complex cognitive tasks. Needless to say this is about the worst possible physiological response to sitting in place for several hours and completing a series of complex cognitive tasks.
Apparently evolution didn't anticipate that millions of us would have our life courses depend on how we do on multiple choice exams. :-)
Very oddly, many members of my family, including me, have the exact opposite response. When I walk into a test the thought process I have is basically, "Well this is it. I've prepared all I'm going to, and now I've got a multiple-guess test which will overstate my abilities. Let's see how I do." And I relax. Comparing me to a normal person based on the resulting test score is like starting with two runners, taking one out back and beating on him for a while, then expecting them to run a fair race. No matter how objectively you measure the result, I have an unfair advantage.
Random note. I originally intended to just present the toy model and use it to provide mathematical support for my impression that a really high IQ score is decent evidence of intelligence, but the true intelligence of most intelligent people isn't actually reflected in their IQ. But to sanity test the model I needed to find the estimated correlation between a standard IQ test and g, the general intelligence factor. And reading up on that I realized how much more complicated the subject was than I realized. I also found myself convinced by g a Statistical Myth that g was probably a statistical artifact with no real meaning. Which is how this turned into 2 long and only tangentially related blog posts mushed into 1. I apologize for the length. I didn't intend it to turn out this way, but I hope it was an interesting read.
Few things illustrate this better than getting a handle on what intelligence is. Here we have a subject that has been seriously studied for over a century. Yet researchers have not achieved agreement on whether they should focus on a single measure of intelligence called g, or multiple measures, or if multiple measures then how many there should be and how they should be divided. Note here that if you talk to individual researchers this fact does not worry them, because each researcher works in a community of other researchers who have achieved agreement on this. Each school of thought therefore churns out a stream of research, but they have failed to convert each other. And after a century the debate shows no sign of ending any time soon.
Please note that I am far from expert on any of this, so I'll try to summarize in broad terms my understanding, but my understanding could be incorrect. Also be aware that a lot of experts disagree with each other strongly, and therefore it is easy to find experts who will disagree with anything interesting that I can say. Please keep those caveats in mind as I try to flounder my way through the complications.
Let's start with the simplest approach, namely Spearman's g. What Spearman did in 1904 is take a number of things that one would think correlate to intelligence, such as grades, and found that they seemed correlated well with each other. He then looked for some linear combination which correlated better with each of the initial factors than any initial factor did. He found a very combination that did so, and found that it successfully predicted a very large part of the variation. In modern mathematical terms he did something called a Principal Component Analysis and looked for the most significant component. He then found that the most significant component really did capture a lot of the variability.
Spearman called this factor g for general intelligence.
Not long after the IQ test was invented. Before long people added IQ tests to the mix of factors, and found that a well-designed IQ test served as a fairly good predictor of g. Then g in turn served as a decent predictor for many things, including academic performance, and success in the workplace. Since IQ tests were fast and easy to administer, IQ tests and ability tests were on. (Ability tests such as the SAT and GRE exams actually are fairly directly comparable to IQ tests, and high-IQ societies such as MENSA are happy to accept them as proof that your IQ is high enough to belong.)
All of this begs many important questions. We got g out of a mathematical construct. But is it real? Is there really such a thing as general intelligence? Also even if there is such a thing as general intelligence, is it a stable attribute of a person? Does your general intelligence change over time? And the whole principal components analysis admits of the discovery of multiple components, how important are the lesser components? (The existence of a split between mathematical and verbal ability is obvious enough that most ability tests split those into separate sections.) Are there important factors which have been missed? Also how much of this is affected by heredity versus environment? How does race play into this? Can training change how you score on the test? Can it change your actual intelligence?
Believe you me, those questions have been researched. Extensively. And argued. More extensively. The only ones that there seems to be a decent consensus on is that to the extent that general intelligence makes sense, it seems to be fairly stable, and both hereditary and environmental factors affect it. Every other one is still under debate, though it is easy to find experts that make definitive claims that the matter has been completely settled one way or the other.
As one example of the ongoing debate, ETS, which puts out various tests including the SAT exams, claims that training cannot improve your performance. At the same time Kaplan makes money selling the claim that they can significantly improve your performance. Kaplan has enough evidence of effectiveness that I accept that they are right, but the debate continues. I suspect not the least because ability tests are just IQ tests under a different name, and so acceptance that Kaplan can teach an ability test is evidence that a key tool underlying a lot of research into psychology is fundamentally flawed, which opens up a can of worms that many don't want to look into.
For another example, I strongly suggest that mathematically inclined readers read g a Statistical Myth. It presents a toy statistical model which demonstrates how readily a large number of independent random factors with a small amount of interaction could give rise to all of the statistical evidence which underlies claims that such a thing as general intelligence exists. Given the fact that any hereditary effect on intelligence is the result of a large number of fairly independent random factors called genes, I think the point is an important one. The idea that we each have a huge number of different intellectual abilities at different degrees of competence accords very well with my understanding of how the brain works, and my experience of interacting with others.
However it is also true that a small number of factors have a major effect on many different kinds of mental activities. Thus some combination of the amount of things you can keep in your mind at the same time and speed of reasoning may be influential enough on enough things to deserve the name "general intelligence".
At this point I'd say that the jury is not just out; they are deadlocked and randomly fighting each other. And have been in this state for the better part of a century.
So what do I have to contribute to the discussion? I'd like to throw out a toy mathematical model for how IQ and intelligence relate. Please do not take this too seriously. After all it is not even agreed on at this point that general intelligence is a particularly well-defined concept. But what I'd like to show is that even if you do accept that general intelligence exists, and that IQ is reasonably well correlated with it, that IQ tests are not a particularly effective way to find the smartest people. (Whether or not any better way exists is a question I'd like to avoid. In fact, please forget this parenthetical point.)
Now suppose you sit down to take a test. You come prepared with many relevant abilities. You have your vocabulary, your polished reasoning ability, and a body of basic knowledge you're expected to have acquired about the world. We are generally prepared to accept these as components of intelligence, and the test will try to measure those. Let's call that INT. However you come prepared with other relevant abilities. There is how well you are feeling, how much sleep you got, any tricks you know about how to handle the types of questions that are likely to be asked, cultural cues you share with the test makers and how stressed you are. We are generally not prepared to accept these as components of intelligence, yet they affect how we do. Let us call these TST.
For my toy model let's say that INT and TST are independent random normals with a mean of 0 and a standard deviation of 10. That's math talk describing a particular bell curve. If you want the odds of it being less than a particular number you just have to divide the number by 10 to get the number of standard deviations you're out, and then look at a standard table and read off the probability.
Now let's say that the measured IQ will be 100+INT+TST. If you're a mathematician you'll know that IQ will have a normal distribution with mean 100 and a standard deviation of 10*sqrt(2) which is about 14.14. The correlation between IQ and INT turns out to be 70.7%. By comparison the Stanford-Binet is designed to have a mean of 100 and a standard deviation of 16, and its correlation with other measures of intelligence like academic performance is (depending on who measures it and how it is done) in the range of 70-80%. So while the model is pretty simple, it is not too far off from how a real IQ test behaves. And it captures the obvious observation that there are factors that affect test performance which we don't think of as intelligence.
Now the fun thing about a model like this is that we can play with it since we know exactly how it is set up. And are free to add any internal details we want. And while we can't necessarily believe the answers we get, we can gain valuable intuition about what kinds of answers we can expect to see if we understood a far more complex system. Such as real people with real brains.
To analyze this I'm going to complicate the model one more time by introducing two more random variables. Let's make them independent normal variables with mean 0 and standard deviation 10/sqrt(2), and call them AVG and DIF. It turns out that (AVG+DIF) and (AVG-DIF) are independent normal variables with mean 0 and standard deviation 10. So let's make (AVG+DIF) be INT, and (AVG-DIF) be TST. High-school algebra shows that AVG = (INT+TST)/2 and DIF = (INT-TST)/2. (Hence the names.)
What was the point of that? Well it is this. At this point IQ = 100+2*AVG. And INT = AVG+DIF. Which means that if you give me an IQ, I can calculate AVG then use the known distribution of DIF to calculate confidence intervals on INT.
For example, in this model how intelligent is a typical member of MENSA? Well MENSA accepts anyone whose IQ is in the top 2% of the population. So a typical member might have an IQ at the boundary of the top 1%. (If you haven't taken statistics these calculations may make you eyes gloss over. You'll have to just trust that I'm coming up with correct numbers.) That IQ is about 2.326 standard deviations out, which after multiplying by the 10*sqrt(2) and adding 100 is an IQ of 132.90. (Remember that our standard deviation is lower than the regular IQ test, so our purported IQ scores will be lower than a regular test.) Which means that AVG is 16.45. On average our INT will be the same as the AVG, which puts you 1.645 standard distributions out, which is right around the 95th percentile.
We can go farther and calculate a 95% confidence interval for what the real intelligence of this individual is. 95% of the time a normally distributed variable will be within 1.960 standard deviations of 0, so that means that DIF will be in the range +- 13.86. Which means that INT will be (2.59, 30.31). Which means that INT is anywhere from 0.0259 to 3.031 standard deviations out, which would put INT anywhere from the 51st percentile to almost the 99.9th percentile. Hmmm, we really haven't nailed down INT very closely, have we? A similar calculation shows that with 80% odds INT is between the 77th and 99.5th percentiles. And you can even do fun things like show that with about 78% odds, this individual is not in the top 2% of the population on INT, and therefore would not qualify for MENSA if they were able to measure INT directly instead of the more complicated IQ.
Let's reverse the question. Let's take someone at the boundary of the 99th percentile in INT, and ask what IQ we should expect on average. Well that INT is 2.326 standard deviations out, which is an INT of 16.44, for an IQ of 116.44, which is 1.1625 standard deviations out, which is at the 87.77th percentile. So sorry, you're probably not going to test as smart enough for MENSA even though you're probably smarter than most of the people in MENSA. How likely is this person to fail to meet MENSA's admission standards? Well the cutoff for MENSA is top 2% which is 2.0537 standard deviations out, which is an IQ of 129.04 (again remember that the toy model's IQs are not as spread out as real IQ tests), so we need TST to be 12.6, which is 1.26 standard deviations out, which gives a probability of 89.6% of not qualifying for MENSA.
The upshot? This model predicts that most members of MENSA are not in the top 2% on intelligence, and most people in the top 2% of intelligence would not qualify for membership in MENSA.
Now let's apply this to a question of more personal interest. According to this model, how intelligent am I likely to be? I bring this up because in my last blog post I used my GRE to discuss my likely IQ, and therefore likely intelligence, then used it as a benchmark to compare with the people I've met at Google. So if I believe that high IQs systemically overestimate INT, how badly is mine likely to be overestimated according to my model?
Well my scores were V: 760, Q: 780 and A: 800. Going to a handy IQ calculator I put in 1540 for my GRE V+Q and find that I am 3.625 standard deviations out and only 1/7143 people have an IQ that high. So on my toy model that is an IQ of 151.265... Which implies that AVG is 25.633. So on average you'd expect my INT to be 25.633, which is 2.5633 standard deviations out, which puts me around the 99.5th percentile, or about 1/200 on INT. (Incidentally the average person with an INT that high would fall in the 96% percentile on IQ, and therefore would not qualify for MENSA.) But let's go farther. 50% of the time a normal distribution falls within 0.67449 standard distributions of the mean, which means that DIF is half the time within the range -4.769 to 4.769. That makes a 50% confidence interval for my INT be the range (20.864, 30.402). Which would put me anywhere from the 98th percentile to the 99.9th percentile in INT. Which is in line with my claim in the previous blog post that I wouldn't be entirely surprised to find that I am at the 99.9th percentile in intelligence. According to this model the odds are that I'm not that smart, but it is possible.
Interestingly there is a symmetry in this model which means that all calculations that I've done for INT apply for TST as well. Which means that I am likely to have a number of characteristics that make me good at taking tests but which are not reflected in my general intelligence. This is actually true.
The vast majority of people when they are faced with a major test or interview get stressed. Now what does stress do to you? Well stress is caused by adrenaline. Adrenaline prepares you for a flight-or-fight reaction. This means decreased blood flow to things like your stomach and neocortex (which is where most of your higher reasoning happens), and increased blood flow to areas that are likely to see action, like your muscles. The result? Improved vision, hearing, faster reflexes, and increased strength. Also significant damage to your ability to carry out complex cognitive tasks. Needless to say this is about the worst possible physiological response to sitting in place for several hours and completing a series of complex cognitive tasks.
Apparently evolution didn't anticipate that millions of us would have our life courses depend on how we do on multiple choice exams. :-)
Very oddly, many members of my family, including me, have the exact opposite response. When I walk into a test the thought process I have is basically, "Well this is it. I've prepared all I'm going to, and now I've got a multiple-guess test which will overstate my abilities. Let's see how I do." And I relax. Comparing me to a normal person based on the resulting test score is like starting with two runners, taking one out back and beating on him for a while, then expecting them to run a fair race. No matter how objectively you measure the result, I have an unfair advantage.
Random note. I originally intended to just present the toy model and use it to provide mathematical support for my impression that a really high IQ score is decent evidence of intelligence, but the true intelligence of most intelligent people isn't actually reflected in their IQ. But to sanity test the model I needed to find the estimated correlation between a standard IQ test and g, the general intelligence factor. And reading up on that I realized how much more complicated the subject was than I realized. I also found myself convinced by g a Statistical Myth that g was probably a statistical artifact with no real meaning. Which is how this turned into 2 long and only tangentially related blog posts mushed into 1. I apologize for the length. I didn't intend it to turn out this way, but I hope it was an interesting read.
Labels:
bell curve,
ETS,
g,
GRE,
intelligence,
IQ,
MENSA,
SAT,
statistics,
test taking
Sunday, January 31, 2010
Things I've learned at Google so far
Well I've been an employee at Google for about a month. So this seems like as good a place to reflect for a moment.
The first thing that I've learned is that internally Google is incredibly open, but externally there is a lot we can't say. I understand and support a lot of the reasons why it is so, but it can be frustrating. There is a lot of really cool technology at Google that people never hear about. The statistics of what Google deals with are astounding. The technology we use to deal with it is amazing. The way we scale is unbelievable. (I really wish I could go back and have a few discussions on software development methodology raising points about what has proven to scale at Google...) One random fact that I know I can say is that computations happen in our data centers with about half the power drawn for what is industry standard. I'm not allowed to say how we do it, but it is a rather amazing testimony to what smart people can accomplish when we put our minds to it.
Moving on, what about Google's culture? I would describe Google's culture as "creative chaos". There was some confusion about where I was supposed to be when I started. This resulted in the following phone call, "Hello?", "Hello Ben, this is Conner (that's my new manager), where are you?" "Mountain View." "Why are you there?" "Because this is where the recruiter said to go." "Good answer! Nice of them to tell me. Enjoy your week!" This caused me to ask an experienced Googler, "Is it always this chaotic?" The response I got was, "Yes! Isn't it wonderful?" That response sums up a lot about Google's culture. If you're unable to enjoy that kind of environment, then Google isn't the place for you.
Seriously, the corporate culture is based on hiring really smart people, giving them responsibilities, letting them know what problems the company thinks it should focus on, then letting them figure out how to tackle it. What management hierarchy there is is very flat. And people pay little attention to it unless there is a problem. You are expected to be a self-directed person, who solves problems by reaching out to whomever you need to and talking directly. Usually by email. The result is an organization which is in a constant state of flux as things are changing around you, usually for the better. With a permanent level of chaos and very large volumes of email. It is as if an entire company intuitively understood that defect rates are tied to distance on the corporate org-chart, and tried to solve it by eliminating all barriers to people communicating directly with whoever they need to communicate with. (Incidentally the point about defect rates and org charts is actually true, see Facts and Fallacies of Software Engineering for a citation.)
Speaking of email, working at Google you learn really fast how gmail is meant to be used. If you want to deal with a lot of email in gmail, here is what you need to do. Go into settings and turn keyboard shortcuts on. The ones you'll use a lot are j/k to move through email threads, n to skip to the next message, and the space bar to page through text. And m to hide any active thread that you're not interested in (direct emails to you will still show up). There are other shortcuts, but this is enough to let you skim through a lot of email fairly quickly without touching the mouse too much. Next go into labels and choose to show all labels. Your labels are basically what you'd call folders in another email client. (Unfortunately they are not hierarchical, but they do work.) Next as you get email, you need to be aggressive about deciding what you need to see, versus what is context specific. Anything that is context specific you should add a filter for, that adds a label, and skips the inbox. Nothing is lost, you can get to the emails through the list of labels on the left-hand side of your screen in gmail. But now various kinds of automated emails, lower priority mailing lists, and so on won't distract you from your main email until you go looking for them.
When you combine all of these options with gmail's auto-threading features, it is amazing how much more efficiently you can handle email. In fact this is exactly the problem that gmail was invented to handle. Because this was the problem that Paul Buchheit was trying to solve for himself when he started gmail. It is worth pointing out that Paul Buchheit was a software engineer at Google. He didn't need permission to write something like gmail. Corporate culture says that if you need something like that, you just go ahead and do it. In fact this is enshrined as an official corporate policy - engineers get 20% of their time to do with pretty much as they please, and are judged in part on how they use that time. I found a speech claiming that over half of Google's applications started as a 20% project. (I'm surprised that the figure is so low.) To get a sense of how much stuff people just do, visit Google Labs. No corporate decision. No central planning. People just do things like start putting up solar panels in the parking lot, and the next thing you know Google has one of the largest solar panel installations in the world and has decided to go carbon neutral. And the attitude that this is how you should operate is enshrined as official corporate policy!
You've got to love corporate policies like that. Speaking of nice corporate policies, Google has quite a few surprising ones. For instance they have benefits like heavily subsidized massage on site (I've still got to take my free hour massage for joining), free gym membership, and the like. Or take their attitude on dogs. Policy says that if your immediate co-workers don't object, you can bring your dog to work. Cats are different, however. Nothing against cats, but Google is a dog place and cats wouldn't be comfortable. (Yes, there are lots of dogs around the offices, and I've even seen people randomly wander over to find out if they can borrow someone else's dog for a while.) Hmmm. Sick day policy. Don't show up when you're sick and tell people why you're not showing up. Note what's missing. There is no limit to how much sick time you get if you need it. Oh, and food. Official Google policy is that at all times there shall be good, free food within 150 feet of every Googler. OK, admittedly the food quality does vary. That in Mountain View is better than anywhere else (the larger clientele base lets them have a much more varied selection). But you quickly learn why it is common for new Googlers to put on 15-20 pounds in their first year. (I'm trying to avoid that. We'll see if I succeed...)
But, you say, isn't this crazy? Doesn't it cost a fortune? The answer is that of course it does. But it provides value. People bond over food. Even if you're not bonding, having food close by makes short meals easier. And the temptation to continue working until dinnertime is very real. (Particularly if, as with me, you'd like to wait until rush hour is over before going home.) Obviously no normal CFO would crunch numbers and see things that way. But Google stands behind that decision, and the people who work there treasure the company for it.
Speaking of the people who work there, Google has amazing people. It is often said that engineers find working at Google a humbling experience. This is absolutely true. It took me less than a day to realize that the guy sitting next to me is clearly much smarter than I am, and he's nowhere near the top of the range of talent at Google. In fact, as best as I can tell, I'm pretty much average, though I'm trying hard to hold out a ray of hope that I'm slightly better than average.
Let me put that in context. The closest thing that I have to an estimate for my IQ is scoring 2340 on the GRE exam in 1991. Based on conversions that I've seen, that puts me at about the top 0.01% in IQ. Now I was really "on" that day, happen to believe that there are problems with the measurement of intelligence by an IQ test (a subject which I may devote a future blog post to), but without false modesty I wouldn't be surprised to find that I'm as high as being in the top 0.1% in general intelligence (however that could be measured). Which in most organizations means that I get thought of as being very smart.
However software development is a profession that selects for intelligence. By and large only good software developers bother applying to Google. And Google rejects the vast majority of their applicants. Granted the filtering process is far from perfect, but by the time you get through that many filters, someone like me is just average.
This leads to another point of interest. How astoundingly complex the company is. I believe that organizations naturally evolve until they are as complex as the people in them can handle. Well Google is tackling really big, complex problems, and is full of people who can handle a lot of complexity. The result? I've been told that I should expect that after 2 months I'll only be marginally useful. My initial learning curve should start to smooth out after about 6 months. And every year I should expect half of what I've learned to become obsolete. (Remember what I said about Google having a certain level of permanent chaos? If you're like me, it is exhilarating. But sometimes the line between exhilarating and terrifying can be hard to find...)
Oh, and what else did I learn? That we're hiring more people this year. :-)
The first thing that I've learned is that internally Google is incredibly open, but externally there is a lot we can't say. I understand and support a lot of the reasons why it is so, but it can be frustrating. There is a lot of really cool technology at Google that people never hear about. The statistics of what Google deals with are astounding. The technology we use to deal with it is amazing. The way we scale is unbelievable. (I really wish I could go back and have a few discussions on software development methodology raising points about what has proven to scale at Google...) One random fact that I know I can say is that computations happen in our data centers with about half the power drawn for what is industry standard. I'm not allowed to say how we do it, but it is a rather amazing testimony to what smart people can accomplish when we put our minds to it.
Moving on, what about Google's culture? I would describe Google's culture as "creative chaos". There was some confusion about where I was supposed to be when I started. This resulted in the following phone call, "Hello?", "Hello Ben, this is Conner (that's my new manager), where are you?" "Mountain View." "Why are you there?" "Because this is where the recruiter said to go." "Good answer! Nice of them to tell me. Enjoy your week!" This caused me to ask an experienced Googler, "Is it always this chaotic?" The response I got was, "Yes! Isn't it wonderful?" That response sums up a lot about Google's culture. If you're unable to enjoy that kind of environment, then Google isn't the place for you.
Seriously, the corporate culture is based on hiring really smart people, giving them responsibilities, letting them know what problems the company thinks it should focus on, then letting them figure out how to tackle it. What management hierarchy there is is very flat. And people pay little attention to it unless there is a problem. You are expected to be a self-directed person, who solves problems by reaching out to whomever you need to and talking directly. Usually by email. The result is an organization which is in a constant state of flux as things are changing around you, usually for the better. With a permanent level of chaos and very large volumes of email. It is as if an entire company intuitively understood that defect rates are tied to distance on the corporate org-chart, and tried to solve it by eliminating all barriers to people communicating directly with whoever they need to communicate with. (Incidentally the point about defect rates and org charts is actually true, see Facts and Fallacies of Software Engineering for a citation.)
Speaking of email, working at Google you learn really fast how gmail is meant to be used. If you want to deal with a lot of email in gmail, here is what you need to do. Go into settings and turn keyboard shortcuts on. The ones you'll use a lot are j/k to move through email threads, n to skip to the next message, and the space bar to page through text. And m to hide any active thread that you're not interested in (direct emails to you will still show up). There are other shortcuts, but this is enough to let you skim through a lot of email fairly quickly without touching the mouse too much. Next go into labels and choose to show all labels. Your labels are basically what you'd call folders in another email client. (Unfortunately they are not hierarchical, but they do work.) Next as you get email, you need to be aggressive about deciding what you need to see, versus what is context specific. Anything that is context specific you should add a filter for, that adds a label, and skips the inbox. Nothing is lost, you can get to the emails through the list of labels on the left-hand side of your screen in gmail. But now various kinds of automated emails, lower priority mailing lists, and so on won't distract you from your main email until you go looking for them.
When you combine all of these options with gmail's auto-threading features, it is amazing how much more efficiently you can handle email. In fact this is exactly the problem that gmail was invented to handle. Because this was the problem that Paul Buchheit was trying to solve for himself when he started gmail. It is worth pointing out that Paul Buchheit was a software engineer at Google. He didn't need permission to write something like gmail. Corporate culture says that if you need something like that, you just go ahead and do it. In fact this is enshrined as an official corporate policy - engineers get 20% of their time to do with pretty much as they please, and are judged in part on how they use that time. I found a speech claiming that over half of Google's applications started as a 20% project. (I'm surprised that the figure is so low.) To get a sense of how much stuff people just do, visit Google Labs. No corporate decision. No central planning. People just do things like start putting up solar panels in the parking lot, and the next thing you know Google has one of the largest solar panel installations in the world and has decided to go carbon neutral. And the attitude that this is how you should operate is enshrined as official corporate policy!
You've got to love corporate policies like that. Speaking of nice corporate policies, Google has quite a few surprising ones. For instance they have benefits like heavily subsidized massage on site (I've still got to take my free hour massage for joining), free gym membership, and the like. Or take their attitude on dogs. Policy says that if your immediate co-workers don't object, you can bring your dog to work. Cats are different, however. Nothing against cats, but Google is a dog place and cats wouldn't be comfortable. (Yes, there are lots of dogs around the offices, and I've even seen people randomly wander over to find out if they can borrow someone else's dog for a while.) Hmmm. Sick day policy. Don't show up when you're sick and tell people why you're not showing up. Note what's missing. There is no limit to how much sick time you get if you need it. Oh, and food. Official Google policy is that at all times there shall be good, free food within 150 feet of every Googler. OK, admittedly the food quality does vary. That in Mountain View is better than anywhere else (the larger clientele base lets them have a much more varied selection). But you quickly learn why it is common for new Googlers to put on 15-20 pounds in their first year. (I'm trying to avoid that. We'll see if I succeed...)
But, you say, isn't this crazy? Doesn't it cost a fortune? The answer is that of course it does. But it provides value. People bond over food. Even if you're not bonding, having food close by makes short meals easier. And the temptation to continue working until dinnertime is very real. (Particularly if, as with me, you'd like to wait until rush hour is over before going home.) Obviously no normal CFO would crunch numbers and see things that way. But Google stands behind that decision, and the people who work there treasure the company for it.
Speaking of the people who work there, Google has amazing people. It is often said that engineers find working at Google a humbling experience. This is absolutely true. It took me less than a day to realize that the guy sitting next to me is clearly much smarter than I am, and he's nowhere near the top of the range of talent at Google. In fact, as best as I can tell, I'm pretty much average, though I'm trying hard to hold out a ray of hope that I'm slightly better than average.
Let me put that in context. The closest thing that I have to an estimate for my IQ is scoring 2340 on the GRE exam in 1991. Based on conversions that I've seen, that puts me at about the top 0.01% in IQ. Now I was really "on" that day, happen to believe that there are problems with the measurement of intelligence by an IQ test (a subject which I may devote a future blog post to), but without false modesty I wouldn't be surprised to find that I'm as high as being in the top 0.1% in general intelligence (however that could be measured). Which in most organizations means that I get thought of as being very smart.
However software development is a profession that selects for intelligence. By and large only good software developers bother applying to Google. And Google rejects the vast majority of their applicants. Granted the filtering process is far from perfect, but by the time you get through that many filters, someone like me is just average.
This leads to another point of interest. How astoundingly complex the company is. I believe that organizations naturally evolve until they are as complex as the people in them can handle. Well Google is tackling really big, complex problems, and is full of people who can handle a lot of complexity. The result? I've been told that I should expect that after 2 months I'll only be marginally useful. My initial learning curve should start to smooth out after about 6 months. And every year I should expect half of what I've learned to become obsolete. (Remember what I said about Google having a certain level of permanent chaos? If you're like me, it is exhilarating. But sometimes the line between exhilarating and terrifying can be hard to find...)
Oh, and what else did I learn? That we're hiring more people this year. :-)
Labels:
20% time,
chaos,
creative chaos,
dogs at work,
free food,
gmail,
Google,
hiring,
intelligent,
jobs,
scaling,
software development,
technology
Thursday, January 28, 2010
On jokes
When I was in grad school I had the interesting problem of being a socially inept extrovert. Being an extrovert is OK. Being socially inept is survivable. But a socially inept extrovert is going to wind up being embarrassed. Repeatedly.
So I decided to do something about it. I decided that I'd learn to tell jokes. So I began following rec.humor.funny and would regularly inflict what I thought the funniest jokes were on people around me.
At first my delivery sucked and they wouldn't laugh, or would only laugh politely. Over time my delivery improved and people began laughing for real. Eventually I gained enough social skills to realize that telling bad jokes wasn't the best way towards a normal social life improve my social skills, but kept on doing it anyways because it was fun.
So why are jokes funny? Why do we laugh? When I reflect on it, I don't really know the answer. What I do know is that the structure of a joke inevitably sets up some tension, then relieves it in an unexpected way, and then people laugh. If you can't set up the tension, and then release it, people won't laugh. And once people have started laughing, it is easier to keep them laughing.
To see this in a simple example, consider the lowly pun:
As soon as you hear the question, you know what is coming. And you try to figure it out. Then you hear the answer, see how it connects, and (hopefully) laugh.
Many jokes rely on cultural references, often topical:
If I tell those jokes to the right people I am guaranteed a good laugh. If I tell them to the wrong person I'll get a blank look. Unless you're up on current scandals, have lived somewhere where opossums are common road kill, know that area of NJ or are familiar with stereotypes about NY and LA, those jokes won't cause a laugh.
Those jokes actually work with reasonably broad audiences. Some jokes only work with niche audiences. For example this only works with anglophones who know a little French. (I have great luck with Canadians on this one.)
What is interesting about this is that I find it is the act of having to translate it that makes it funny. Living in Southern California I've tried to switch to Spanish, but it simply doesn't work. People hear "No problemo, mate!" as English instead of Spanish, so don't find it funny. But the French version forces the mental translation. For different reasons francophones who speak some English don't find it funny for the simple reason that they don't understand the cultural reference about Australians.
Now many people have told me that they can't remember jokes. Let me give a longish joke to illustrate the problems people encounter.
(Incidentally that is one of my wife's favorites.)
Now the first problem people have in remembering a joke like this is that by the time they've heard the end of it, they've forgotten most of it. Memory is an odd thing. We don't realize it, but anything you remember 30 seconds is actually in long term memory. However we've got many levels of long term memory. So just because you've remembered something for 30 seconds doesn't mean that you'll remember it 5 minutes later. If you're going to remember something, you have to work for it. What you're going to need to do is remind yourself on a schedule until it really sticks. My minimal effective schedule is about 30 seconds later, 5 minutes later, again that day, then again the next day, then again sometime in the next week.
And that leads into the second problem. When people hear a joke like this, the most memorable thing is what sticks in your mind. So people remember, "Thith ith cwap, want a toothbwuth?" and then have no referent from which to remember how to start the joke. Or if they start the joke, they keep on jumping directly to the punch line. But it doesn't work without the build-up.
What you've therefore got to do is learn that, "Joke ___ starts with ___". And then you need to practice telling it. And every time you go off track, you've got to back up just slightly, and start telling it, correctly, from before you make the error. This is a subtle and important point that people miss. If you practice telling it, mess up, then start right at the error then you're practicing making the error. And you'll never stop making the error. You've got to practice leading up to the potential error without making the error to get it right. (This is something I learned in choir, but it works for jokes as well as it does for songs.)
And then the third problem is that no matter how many jokes you tell, and how well you tell them, you will forget jokes. I've told hundreds of different jokes. At no point do I remember most of them. Or even most of the good ones. But as long as you have some good ones, that doesn't matter.
Enough on telling jokes, what makes them funny?
As I said, I've noticed that the sudden release of tension is an element. The corollary of this is that it is easier for a joke to be funny when it's about something we have tension about. For instance if you want to make a pre-school child laugh, talk about poop.
Of course grown-ups don't have so much tension around potty training, but we do around sex. Which is why most of us remember and like dirty jokes. Like these.
And to finish, here is the dirtiest joke that I am willing to repeat in public:
So I decided to do something about it. I decided that I'd learn to tell jokes. So I began following rec.humor.funny and would regularly inflict what I thought the funniest jokes were on people around me.
At first my delivery sucked and they wouldn't laugh, or would only laugh politely. Over time my delivery improved and people began laughing for real. Eventually I gained enough social skills to realize that telling bad jokes wasn't the best way towards a normal social life improve my social skills, but kept on doing it anyways because it was fun.
So why are jokes funny? Why do we laugh? When I reflect on it, I don't really know the answer. What I do know is that the structure of a joke inevitably sets up some tension, then relieves it in an unexpected way, and then people laugh. If you can't set up the tension, and then release it, people won't laugh. And once people have started laughing, it is easier to keep them laughing.
To see this in a simple example, consider the lowly pun:
Q: What is the difference between bird flu and swine flu?
A: One requires tweetment while the other requires oinkment!
As soon as you hear the question, you know what is coming. And you try to figure it out. Then you hear the answer, see how it connects, and (hopefully) laugh.
Many jokes rely on cultural references, often topical:
Q: What is the difference between Santa Claus and Tiger Woods?
A: Santa stopped at three hos.
Q: Why did the possum cross the road?
A: There was a car coming.
Q: Why are New Yorker's so cynical?
A: The light at the end of the tunnel is New Jersey!
Q: What is the difference between NY and LA?
A: In NY people say, "Fuck you!" and just mean, "Have a nice day!" In LA people say, "Have a nice day!" and mean "Fuck you!"
If I tell those jokes to the right people I am guaranteed a good laugh. If I tell them to the wrong person I'll get a blank look. Unless you're up on current scandals, have lived somewhere where opossums are common road kill, know that area of NJ or are familiar with stereotypes about NY and LA, those jokes won't cause a laugh.
Those jokes actually work with reasonably broad audiences. Some jokes only work with niche audiences. For example this only works with anglophones who know a little French. (I have great luck with Canadians on this one.)
Q: How do Australians say, "You're welcome" in French?
A: (in your best Australian accent) "Pas de probleme, mate!"
What is interesting about this is that I find it is the act of having to translate it that makes it funny. Living in Southern California I've tried to switch to Spanish, but it simply doesn't work. People hear "No problemo, mate!" as English instead of Spanish, so don't find it funny. But the French version forces the mental translation. For different reasons francophones who speak some English don't find it funny for the simple reason that they don't understand the cultural reference about Australians.
Now many people have told me that they can't remember jokes. Let me give a longish joke to illustrate the problems people encounter.
A little girl decided that she wanted to sell toothbrushes. So she went to a manager at a manufacturer and convinced him that, even though she was young, there was no harm in giving her a try. So he gave her her chance.
The first day she showed up, took her sample, went out, and came back. He asked, "How did you do today?" She said, "I thold ONE toothbwuth!" He said, "I'm sorry, but you're going to have to do better than that if this is going to work out."
The second day she showed up, took her sample, went out, and came back. He asked, "How did you do today?" She said, "I thold TWO toothbwutheth!" He said, "I'm sorry, but you're going to have to do a lot better than that if this is going to work out."
The third day she showed up, took her sample, went out, and came back. He asked, "How did you do today?" She said, "I thold THREE THOUTHAND toothbwutheth!" He said, "Three thousand? Wow! How did you do that?" She said, "Well, I went to the mall and offered people chipth and dip. They thaid, 'Thith tathtth like cwap!' I thaid, 'Thith ith cwap, want a toothbwuth?'"
(Incidentally that is one of my wife's favorites.)
Now the first problem people have in remembering a joke like this is that by the time they've heard the end of it, they've forgotten most of it. Memory is an odd thing. We don't realize it, but anything you remember 30 seconds is actually in long term memory. However we've got many levels of long term memory. So just because you've remembered something for 30 seconds doesn't mean that you'll remember it 5 minutes later. If you're going to remember something, you have to work for it. What you're going to need to do is remind yourself on a schedule until it really sticks. My minimal effective schedule is about 30 seconds later, 5 minutes later, again that day, then again the next day, then again sometime in the next week.
And that leads into the second problem. When people hear a joke like this, the most memorable thing is what sticks in your mind. So people remember, "Thith ith cwap, want a toothbwuth?" and then have no referent from which to remember how to start the joke. Or if they start the joke, they keep on jumping directly to the punch line. But it doesn't work without the build-up.
What you've therefore got to do is learn that, "Joke ___ starts with ___". And then you need to practice telling it. And every time you go off track, you've got to back up just slightly, and start telling it, correctly, from before you make the error. This is a subtle and important point that people miss. If you practice telling it, mess up, then start right at the error then you're practicing making the error. And you'll never stop making the error. You've got to practice leading up to the potential error without making the error to get it right. (This is something I learned in choir, but it works for jokes as well as it does for songs.)
And then the third problem is that no matter how many jokes you tell, and how well you tell them, you will forget jokes. I've told hundreds of different jokes. At no point do I remember most of them. Or even most of the good ones. But as long as you have some good ones, that doesn't matter.
Enough on telling jokes, what makes them funny?
As I said, I've noticed that the sudden release of tension is an element. The corollary of this is that it is easier for a joke to be funny when it's about something we have tension about. For instance if you want to make a pre-school child laugh, talk about poop.
Of course grown-ups don't have so much tension around potty training, but we do around sex. Which is why most of us remember and like dirty jokes. Like these.
Micky Mouse and his lawyer were talking. "I'm sorry Mr. Mouse, but the fact that your wife is crazy is not grounds for divorce." "I didn't say she was crazy, I said she was fucking Goofy!"
Q: What is the difference between good, very good, and showing off?
A: Spitting, swallowing, and gargling.
A little girl asked her dad for a GI Joe doll. He said, "Why do you want a GI Joe doll?" "For Barbie to play with." "I thought Barbie came with Ken?" "No, Barbie comes with GI Joe. She fakes it with Ken."
And to finish, here is the dirtiest joke that I am willing to repeat in public:
A businessman was going on a trip. So he decided to get his wife a special present to keep her happy while he was gone. Knowing her tastes, he decided to go to a sex shop.
Looking around the shop, nothing caught his eye. Sure they had a good selection of dildos, vibrators, and what not, but his wife was pretty experienced and nothing was really special. So he asked the woman who ran it.
She said, "Well I do have the voodoo penis, but I'm not sure I really want to sell it." "The what?" "Voodoo penis." Even though it was not really for sale, his curiosity was up and he convinced her to bring it out.
She went in back and came out with a weird wooden box. She opened it up and there was a wooden dildo with all sorts of strange occult symbols on it. He said, "Well that looks weird, but it's basically just a dildo." She said, "That's because you haven't seen what it can do."
Then she said, "Voodoo penis, the door!" And the voodoo penis flew out of the box, flew up to the door and began banging on it. Then she said, "Voodoo penis, the table!" It went over and began banging on the table. Then she said, "Voodoo penis, the box!" and it went back into the box.
When he saw this, he knew his wife had to have it. A thousand bucks later she was convinced to sell it, and he took it home. And he gave it to his wife with the instructions, "If you get bored while I'm gone, just lie back, get comfy, open the box and say, 'Voodoo penis, my crotch!' and you'll have an interesting experience."
She thought it was odd, but she accepted the present. And while he was away on his trip she decided that she would give it a try. Despite how silly she felt about it she took her clothing off, laid back, opened the box, and said, "Voodoo penis, my crotch!"
Of course the voodoo penis flew out and began fucking her! It was amazing! Soon she had a wonderful orgasm. But it wasn't all brute strength, because before long it had brought her back to a peak and she had a second! After her third, she decided that this was a good thing but she'd had enough for now. Besides, she was getting sore.
So she said, "Voodoo penis, stop!" It didn't. She tried grabbing it and pulling it out. She wasn't strong enough. Desperate she decided to throw on a dress and go to the hospital. Unfortunately, halfway to the hospital, she went off the road during yet another orgasm and hit a tree.
As she was lying there in her car the policeman came up and asked why she hit the tree. She said, "Because (pant) I'm being (ooh) fucked by (pant) a voodoo penis!" "You're what?" "Being (oooh) fucked (gasp) by a voodoo penis! (pant)" "Yeah, right. Voodoo penis, my ass!"
Labels:
dirty jokes,
funny,
humor,
jokes,
laughing,
puns,
remembering jokes,
tension
Tuesday, January 26, 2010
Pictures
A couple of weeks ago my family had a good photographer come in for a photo shoot with me, my wife, her parents, and our children Sam and Claire.
Today you can see both photos my father-in-law took and the professional photographer's favorites.
This was money well spent. :-)
For anyone in Southern California, I would highly recommend Leo Flores as a photographer.
Today you can see both photos my father-in-law took and the professional photographer's favorites.
This was money well spent. :-)
For anyone in Southern California, I would highly recommend Leo Flores as a photographer.
Friday, January 22, 2010
More random stuff on the sexes
A couple of posts ago I discussed some complications in relations between the sexes. Nobody seemed too offended or disagreed too much, so I'll tackle the topic again, in a more haphazard way. (I touched on a somewhat related topic lst year when I claimed that males may have started as parasites.)
But as before, if you think you'll be offended you should stop reading now. Unlike before I'll actually touch on something interesting that applies to homosexuals at the end, though most of this is not about homosexuality.
My last blog reminded me of a book I read years ago that I wanted to re-read. So now I've bought it and am re-reading it. The book is Shadows of Forgotten Ancestors. It starts off slowly, with a basic overview of the history of the Earth, the history of life, how genes work, and so on. All pretty basic if you're conversant with science, though at some point it is likely to get detailed enough that you'll probably to find yourself in unfamiliar territory.
But what I like about it is the second half. This is where we encounter a discussion of the documented effects of testosterone on personality, an analysis of the social lives of our near primate relatives, and so on. I won't try to summarize, so much as to hit the some high points. Anyone who believes that women are basically men without the penis who can have babies should read through the effects of testosterone on personality. Anyone who has wondered why we say, "Fuck you!" when we're mad should read through accounts of how sex and dominance are intertwined in different primates. I'm not sure what lessons we should be drawn from a comparisons of militaristic chimpanzees with the free love bonobos, both of whom are very closely related to us, but I certainly saw strong parallels between both societies and human groups. All in all I rank this book as being one of of the strongest challenges to my preconceptions of how I want to see the world.
Moving on, a friend told me that a lot of what I said in my previous post is echoed in more detail, at longer length, and more amusingly in Sperm are from Men, Eggs are from Women. I haven't read the book, but the reviews look promising.
If I'm guessing right from the reviews it touches on one of my favorite pieces of evolutionary trivia: that there is good evidence that humans have significant sexual selection for large penises. That such selection exists is not surprising in light of all of the jokes and obvious sexual interest. (I will never forget having it pointed out to me 15 years ago women could estimate the size of a guy's penis from looking at the bulge in his pants. I was quickly assured that I had nothing to worry about in that department, which did absolutely nothing to lessen my self-awareness of people potentially looking at my crotch for the next couple of weeks...) However the actual concrete evidence is the simple fact that the human penis is about 3 times the size that would be expected based on estimates made from our size and the proportions of our close relatives the chimpanzees and gorillas.
Moving on, by coincidence this week on NPR I heard an interview with the authors of Why Women Have Sex: Understanding Sexual Motivations from Adventure to Revenge (and Everything in Between). It sounded interesting in the interview, and at some point I suspect I'll buy it as well.
I don't know if it is in the book, but there was an interesting piece of trivia that came up in the interview. It turns out that if you take a man and dress him up in a Burger King outfit, he's much less attractive to women than if you dress him up in a suit. By contrast men don't care about the clothing on a woman. In comparisons they'll judge her equally attractive in a Burger King outfit and in a nice cocktail dress. This ties very well with what I said in my last post about how women are looking for a good provider (status helps) while men are looking for evidence of fertility (status doesn't matter). Which helps explain why women remember what people wear while most men I know, including me, can't really remember what someone was wearing 30 seconds after they leave.
Moving on to men noticing signs of fertility, how sensitive are we? The answer is more than you'd think. For instance research has found that men react to how fertile a stripper is. It turns out that when you analyze how much strippers make in tips per night, the closer she is to ovulation, the more she makes, with income varying by a factor of 2. By contrast strippers who are on the pill permanently make about what strippers who are not on the pill would make during their period.
How do men notice? I don't know whether the full story is known, but at least some of it is behavioral. Women who are ovulating have been demonstrated to dress more provocatively, act more provocatively, put down the appearance of other women more, and show an increased attraction to men, particularly ones with masculine appearances. All of these behavioral cues reverse during her period. Even when strippers are trying to be provocative, perhaps the ones who are ovulating have a slight edge. Perhaps there are as yet unknown pheromones that men react to. Whatever the cause, men do react.
Moving on, the point about men with a masculine appearance is interesting to me. When researchers examined the subject, both men and women rank feminized faces as more attractive. But when push comes to shove, women are interested in other traits more than appearance, which gives a definite edge to men with masculine features. (Masculine is here defined by things such as a big jaw, square face, prow nose, and heavy brow. More on why it is defined that way shortly.)
Interestingly researchers in other studies have found that people form a variety of first impressions on men based on how masculine or feminine their faces are. For instance fathers are more likely to trust their teenage daughter's with a man whose face is feminine. But what can appearance tell you?
More than you'd think. It turns out that all of the characteristics that are linked with a masculine face are tied to testosterone exposure. Men who are judged as having masculine faces do turn out to have higher testosterone levels in their saliva. And the various personality judgments that are made based on this trait have a surprisingly good grounding in the known personality effects of testosterone.
Speaking personally, I am the kind of man who is more likely to be described as "beautiful" than "rugged". As much as I don't like it, this is concrete evidence of somewhat low testosterone levels when I was growing up, and it affects how people interact with me. In ways that most people don't even notice.
Moving on, the whole masculine/feminine thing leads to an odd piece of trivia that is not too widely known. Most people assume that gay men must be responsible for homosexual abuse. Not so fast. The little data that exists says that heterosexual men are far more likely to engage in homosexual abuse of boys than homosexual men! Now let's be clear, once a boy passes puberty, homosexual men may develop an interest. Legally an adult man and a 16 year old teenager might be child abuse. But that teen has sexually matured. Those examples notwithstanding, homosexual men do not seem to be attracted to sexually immature boys.
Why? Well when you ask adult heterosexuals who abuse boys why they are attracted to boys, all of the answers have to do with the feminine characteristics that boys have. By contrast when gay men are asked what they like about other men they cite masculine characteristics which boys don't have. It seems that attraction is tied to perceptions of masculinity/femininity in a very direct way that leaves little to no room for someone to be a gay pedophile. (I know of no research on the topic, but I have to wonder if this connects in any way to the fact that pedophilia appears to be very rare among women.)
As always I could ramble on, but this is enough for this post.
But as before, if you think you'll be offended you should stop reading now. Unlike before I'll actually touch on something interesting that applies to homosexuals at the end, though most of this is not about homosexuality.
My last blog reminded me of a book I read years ago that I wanted to re-read. So now I've bought it and am re-reading it. The book is Shadows of Forgotten Ancestors. It starts off slowly, with a basic overview of the history of the Earth, the history of life, how genes work, and so on. All pretty basic if you're conversant with science, though at some point it is likely to get detailed enough that you'll probably to find yourself in unfamiliar territory.
But what I like about it is the second half. This is where we encounter a discussion of the documented effects of testosterone on personality, an analysis of the social lives of our near primate relatives, and so on. I won't try to summarize, so much as to hit the some high points. Anyone who believes that women are basically men without the penis who can have babies should read through the effects of testosterone on personality. Anyone who has wondered why we say, "Fuck you!" when we're mad should read through accounts of how sex and dominance are intertwined in different primates. I'm not sure what lessons we should be drawn from a comparisons of militaristic chimpanzees with the free love bonobos, both of whom are very closely related to us, but I certainly saw strong parallels between both societies and human groups. All in all I rank this book as being one of of the strongest challenges to my preconceptions of how I want to see the world.
Moving on, a friend told me that a lot of what I said in my previous post is echoed in more detail, at longer length, and more amusingly in Sperm are from Men, Eggs are from Women. I haven't read the book, but the reviews look promising.
If I'm guessing right from the reviews it touches on one of my favorite pieces of evolutionary trivia: that there is good evidence that humans have significant sexual selection for large penises. That such selection exists is not surprising in light of all of the jokes and obvious sexual interest. (I will never forget having it pointed out to me 15 years ago women could estimate the size of a guy's penis from looking at the bulge in his pants. I was quickly assured that I had nothing to worry about in that department, which did absolutely nothing to lessen my self-awareness of people potentially looking at my crotch for the next couple of weeks...) However the actual concrete evidence is the simple fact that the human penis is about 3 times the size that would be expected based on estimates made from our size and the proportions of our close relatives the chimpanzees and gorillas.
Moving on, by coincidence this week on NPR I heard an interview with the authors of Why Women Have Sex: Understanding Sexual Motivations from Adventure to Revenge (and Everything in Between). It sounded interesting in the interview, and at some point I suspect I'll buy it as well.
I don't know if it is in the book, but there was an interesting piece of trivia that came up in the interview. It turns out that if you take a man and dress him up in a Burger King outfit, he's much less attractive to women than if you dress him up in a suit. By contrast men don't care about the clothing on a woman. In comparisons they'll judge her equally attractive in a Burger King outfit and in a nice cocktail dress. This ties very well with what I said in my last post about how women are looking for a good provider (status helps) while men are looking for evidence of fertility (status doesn't matter). Which helps explain why women remember what people wear while most men I know, including me, can't really remember what someone was wearing 30 seconds after they leave.
Moving on to men noticing signs of fertility, how sensitive are we? The answer is more than you'd think. For instance research has found that men react to how fertile a stripper is. It turns out that when you analyze how much strippers make in tips per night, the closer she is to ovulation, the more she makes, with income varying by a factor of 2. By contrast strippers who are on the pill permanently make about what strippers who are not on the pill would make during their period.
How do men notice? I don't know whether the full story is known, but at least some of it is behavioral. Women who are ovulating have been demonstrated to dress more provocatively, act more provocatively, put down the appearance of other women more, and show an increased attraction to men, particularly ones with masculine appearances. All of these behavioral cues reverse during her period. Even when strippers are trying to be provocative, perhaps the ones who are ovulating have a slight edge. Perhaps there are as yet unknown pheromones that men react to. Whatever the cause, men do react.
Moving on, the point about men with a masculine appearance is interesting to me. When researchers examined the subject, both men and women rank feminized faces as more attractive. But when push comes to shove, women are interested in other traits more than appearance, which gives a definite edge to men with masculine features. (Masculine is here defined by things such as a big jaw, square face, prow nose, and heavy brow. More on why it is defined that way shortly.)
Interestingly researchers in other studies have found that people form a variety of first impressions on men based on how masculine or feminine their faces are. For instance fathers are more likely to trust their teenage daughter's with a man whose face is feminine. But what can appearance tell you?
More than you'd think. It turns out that all of the characteristics that are linked with a masculine face are tied to testosterone exposure. Men who are judged as having masculine faces do turn out to have higher testosterone levels in their saliva. And the various personality judgments that are made based on this trait have a surprisingly good grounding in the known personality effects of testosterone.
Speaking personally, I am the kind of man who is more likely to be described as "beautiful" than "rugged". As much as I don't like it, this is concrete evidence of somewhat low testosterone levels when I was growing up, and it affects how people interact with me. In ways that most people don't even notice.
Moving on, the whole masculine/feminine thing leads to an odd piece of trivia that is not too widely known. Most people assume that gay men must be responsible for homosexual abuse. Not so fast. The little data that exists says that heterosexual men are far more likely to engage in homosexual abuse of boys than homosexual men! Now let's be clear, once a boy passes puberty, homosexual men may develop an interest. Legally an adult man and a 16 year old teenager might be child abuse. But that teen has sexually matured. Those examples notwithstanding, homosexual men do not seem to be attracted to sexually immature boys.
Why? Well when you ask adult heterosexuals who abuse boys why they are attracted to boys, all of the answers have to do with the feminine characteristics that boys have. By contrast when gay men are asked what they like about other men they cite masculine characteristics which boys don't have. It seems that attraction is tied to perceptions of masculinity/femininity in a very direct way that leaves little to no room for someone to be a gay pedophile. (I know of no research on the topic, but I have to wonder if this connects in any way to the fact that pedophilia appears to be very rare among women.)
As always I could ramble on, but this is enough for this post.
Monday, January 18, 2010
Solving Project Euler problems
Late last year I got into Project Euler in my spare time for a couple of months. I solved over 150 of the problems, then I lost interest and have only sporadically solved any since. However I know I could do many more if I put some more time into it. I also contributed P240 which a number of people liked.
That's not a great track record, but it is not a bad one either.
This post is my advice for people who can solve basic Project Euler problems but want to get better at solving them. I happened to use Perl to solve problems, but the advice should work in a variety of languages. The techniques I used use closures a lot, but that's because that's the kind of guy I am.
First if you are unable to solve the first 5 then I would suggest that you're missing some basic background. I would suggest learning a programming language first, then some math. Only after that should you try Project Euler.
If you're going to tackle Project Euler problems, there are some things that come up over and over again. In particular I would recommend learning how to use dynamic programming to solve problems. That comes up a lot. Secondly I would recommend learning how to handle infinite streams of data. Thirdly do not be afraid of attempting brute force techniques with clever bucketing and pruning. If your program runs in a minute, you've found what they were looking for.
With those basic techniques out of the way, as you solve problems you'll develop a library of functions you use over and over again. Here are the functions in my library, in no particular order, with no particular attempt at good design (after all PE is just one throw away program after another...):
Now on to the Pythagorean triple iterator. How do I iterate through them? Well first I use Euler's formula to generate all primitive triples in the order that I want, and then I merge together all of the multiples of that stream to get all triples. To understand how that merging works, it would be good to go back to the infinite streams article and actually read it.
This sounds simple in theory. But in practice you have a problem. I'm merging a lot of data. I do that by maintaining a partially sorted pool of things I want to merge in, and then always taking the least next element. There is a data structure for that. It is called a heap. A heap is a tree, which has the heap property that each node is less than or equal to its children. This makes the top node at the root of the tree the smallest element. (Why do CS people always draw trees upside down so that the root is at the top? Really it would make more sense to call it a "root system" or else to draw it the other way around. Oh well, that's the convention.)
Luckily CPAN has multiple heap implementations. Unfortunately the one named Heap sucks, and I couldn't be bothered to look through the rest to find one that met my needs. So I took pointers from an implementation by Abigail, and implemented my own. The clever (and standard) trick in that implementation is that arrays can be used to represent a tree. The two nodes below the n'th element in the tree are at 2n+1 and 2n+2. So you can take an array of data, turn it into a heap, and then manipulate it as if it was a tree.
Writing your own heap implementation is a good exercise, so I'll just give the methods in my heap implementation for anyone who wants to duplicate it.
Hopefully this helps others who are trying to tackle Project Euler problems and haven't made much headway yet.
That's not a great track record, but it is not a bad one either.
This post is my advice for people who can solve basic Project Euler problems but want to get better at solving them. I happened to use Perl to solve problems, but the advice should work in a variety of languages. The techniques I used use closures a lot, but that's because that's the kind of guy I am.
First if you are unable to solve the first 5 then I would suggest that you're missing some basic background. I would suggest learning a programming language first, then some math. Only after that should you try Project Euler.
If you're going to tackle Project Euler problems, there are some things that come up over and over again. In particular I would recommend learning how to use dynamic programming to solve problems. That comes up a lot. Secondly I would recommend learning how to handle infinite streams of data. Thirdly do not be afraid of attempting brute force techniques with clever bucketing and pruning. If your program runs in a minute, you've found what they were looking for.
With those basic techniques out of the way, as you solve problems you'll develop a library of functions you use over and over again. Here are the functions in my library, in no particular order, with no particular attempt at good design (after all PE is just one throw away program after another...):
- gcd Calculates the GCD using the Euclidean Algorithm
- prime_iterator Returns a function which, every time it is called, will return the next prime. Internally I use the Sieve of Eratosthenes to generate this list. Note that in this code an "iterator" is always a function which iterates through some (possibly infinite) set as you call it.
- is_prime Takes a number, makes sure I've generated all of the primes up to that number, then checks whether it is prime.
- is_prime2 Takes a number, generates all of the primes up to the square root of that number, then uses trial division to check whether it is prime. This routine is slower than the previous if you're going to check a lot of primes, but uses much less memory. P118 is a good example of where you would use this version.
- ith_prime Access the list of primes as if it were an array. (I had ith_prime(0) return 2, ith_prime(1) return 3, and so on. Remember what I said about not being carefully designed?)
- factor Takes a number, returns a hash of prime factors and multiplicities. Trial division by primes up to the square root was efficient enough for all of the PE problems that I tackled.
- factors Returns the prime factors of a number as an array with duplication to represent multiplicity.
- n_pow_m_mod_k What the name says. I used it for P133 and stuck it in my library because I wanted to reuse it for P66 but it didn't work for the second one. (Search for Pell's Equation for how to handle that problem.)
- minimal_divisible_repunit See P129 and P130 for what this is about. Internally this reuses the n_pow_m_mod_k function in its calculations.
- pythagorean_triple_iterator Iterates through all Pythagorean triples ordered by the lengths of their sides. I'll have more to say on the algorithm in a bit.
- generate_stream A promise is a function which, every time it is called, will return some set of future values you haven't reached yet, returning nothing when it runs out. This function takes a promise and lets you treat it like an infinite array, ask for the 1st, 5th or 500th element and it will generate the promise until it has enough stuff then return the value.
- generate_memoryless_stream Like the previous but instead of accessing it like an array you access it like an iterator. This is useful for cases where it is convenient to calculate a block of values at a time. A perfect and pertinent example is the Sieve of Eratosthenes, which calculates blocks of primes at a time.
Now on to the Pythagorean triple iterator. How do I iterate through them? Well first I use Euler's formula to generate all primitive triples in the order that I want, and then I merge together all of the multiples of that stream to get all triples. To understand how that merging works, it would be good to go back to the infinite streams article and actually read it.
This sounds simple in theory. But in practice you have a problem. I'm merging a lot of data. I do that by maintaining a partially sorted pool of things I want to merge in, and then always taking the least next element. There is a data structure for that. It is called a heap. A heap is a tree, which has the heap property that each node is less than or equal to its children. This makes the top node at the root of the tree the smallest element. (Why do CS people always draw trees upside down so that the root is at the top? Really it would make more sense to call it a "root system" or else to draw it the other way around. Oh well, that's the convention.)
Luckily CPAN has multiple heap implementations. Unfortunately the one named Heap sucks, and I couldn't be bothered to look through the rest to find one that met my needs. So I took pointers from an implementation by Abigail, and implemented my own. The clever (and standard) trick in that implementation is that arrays can be used to represent a tree. The two nodes below the n'th element in the tree are at 2n+1 and 2n+2. So you can take an array of data, turn it into a heap, and then manipulate it as if it was a tree.
Writing your own heap implementation is a good exercise, so I'll just give the methods in my heap implementation for anyone who wants to duplicate it.
- new Construct a new Heap. There is one optional argument, which is the comparison function. (Which is passed in as a closure, as you might expect.)
- append Push a new element on the end, then let it "bubble up" to its natural position. Here is what I mean by "bubbling up". If it is currently at position $n > 0 then its parent is at position int(($n-1)/2). If it is greater than or equal to its parent you're done. Otherwise you need to swap with its parent and continue until it either has a smaller parent or reaches the root.
- top Peek at the root element.
- swap_top Take the root element out, replace it with something else, and let the something else "fall down" to its natural level. Returns the previous top.
- extract First pop the last element off of the array, then call swap_top. This trick gives you the least element in the heap and makes everything else be represented in an array that is 1 smaller than the previous.
Hopefully this helps others who are trying to tackle Project Euler problems and haven't made much headway yet.
Subscribe to:
Posts (Atom)