Why smart people are loners

I was thinking about an article (in french) a friend of mine sent me. Basically the article is saying that the correlation between happiness and social-life depends on your IQ: the smarter you are, the less your happiness is correlated to how much time you spend with friends.

At the same time, somewhere on Quora, someone had suggested that people who are significantly smarter than average are less likely to meet like-minded people.

This led me to wonder about the average distance between two points inside a disk (notice the smooth transition). I’m sure this question has been asked before (see here for example), and I’m sure one could integrate their way to the answer, but hey I’m not about to pass an opportunity to rdoodle!

(Before looking at the result below, try to guess what the average distance, as a function of the radius, should look like – linear, polynomial..? To be honest I had no clue)


N = 1000

distances = function(rmax){

  r = runif(N, 0 ,rmax)
  theta = runif(N, 0, 2*pi)
  x = r * cos(theta)
  y = r * sin(theta)

  distances = sqrt(outer(x, x, function(x1, x2) (x1-x2)^2) + outer(y, y, function(y1, y2) (y1 - y2)^2))

  #plot(x, y, xlim=c(-rmax, rmax), ylim=c(-rmax, rmax), col="blue", pch=19, cex=0.75)

  mean(distances)
}

r = seq(1,10,0.25)

means = sapply(r, distances)

plot(r, means, col="blue", type="l")

Rplot01.png

Looks like the relationship is linear.
Let’s get the value of the coefficient:

#linear regression with 0 intercept
lm(means ~ -1 + r)

#Call:
#lm(formula = means ~ -1 + r)

#Coefficients:
#     r
#0.7223  

There you go. Average distance = 0.7223r

Which is the right answer to the wrong question, because what I really wanted to compute is the average distance between a person on the edge of the disk (i.e. a smart person) and all the others – how about now, still linear ?

The adjustment to the code is actually very small (love you R!):

N = 1000

distances = function(rmax){

  r = runif(N, 0 ,rmax)
  theta = runif(N, 0, 2*pi)
  x = r * cos(theta)
  y = r * sin(theta)

  #the exact position of the person on the edge doesnt matter due to symmetry
  x0 = 0
  y0 = rmax

  distances = sqrt(outer(x0, x, function(x1, x2) (x1-x2)^2) + outer(y0, y, function(y1, y2) (y1 - y2)^2))

  mean(distances)
}

r = seq(1,10,0.25)

means = sapply(r, distances)

lm(means ~ -1 + r)

#Call:
#lm(formula = means ~ -1 + r)

#Coefficients:
#    r
#1.087

Average distance = 1.087
See? I told you smart people were less gregarious…

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s