Calculate the correlation coefficient Given a series of numbers for events X and Y, calculate Pearson's correlation coefficient. The probability of each event is equal, so expected values can be calculated by simply summing each series and dividing by the number of trials.

Input

1   6.86
2   5.92
3   6.08
4   8.34
5   8.7
6   8.16
7   8.22
8   7.68
9   12.04
10  8.6
11  10.96


Output

0.769


Shortest code wins. Input can be by stdin or arg. Output will be by stdout.

Edit: Builtin functions should not be allowed (ie calculated expected value, variance, deviation, etc) to allow more diversity in solutions. However, feel free to demonstrate a language that is well suited for the task using builtins (for exhibition).

Based on David's idea for input for Mathematica (86 char using builtin mean)

m=Mean;x=d[[All,1]];y=d[[All,2]];(m@(x*y)-m@x*m@y)/Sqrt[(m@(x^2)-m@x^2)(m@(y^2)-m@y^2)]

m = Mean;
x = d[[All,1]];
y = d[[All,2]];
(m@(x*y) - m@x*m@y)/((m@(x^2) - m@x^2)(m@(y^2) - m@y^2))^.5


Skirting by using our own mean (101 char)

m=Total[#]/Length[#]&amp;;x=d[[All,1]];y=d[[All,2]];(m@(x*y)-m@x*m@y)/((m@(x^2)-m@x^2)(m@(y^2)-m@y^2))^.5

m = Total[#]/Length[#]&amp;;
x = d[[All,1]];
y = d[[All,2]];
(m@(x*y)-m@x*m@y)/((m@(x^2)-m@x^2)(m@(y^2)-m@y^2))^.5
Mathematica 34 bytes
Here are a few ways to obtain the Pearson product moment correlation.  They all produce the same result.
From Dr. belisarius: 34 bytes
Dot@@Normalize/@(#-Mean@#&amp;)/@{x,y}


Built-in Correlation function I: 15 chars
This assumes that x and y are lists corresponding to each variable.
x~Correlation~y


0.76909


Built-in Correlation function II: 31 chars
This assumes d is a list of ordered pairs.
d[[;;,1]]~Correlation~d[[;;,2]]


0.76909

The use of ;; for All thanks to A Simmons.

Relying on the Standard Deviation function: 118 115 chars
The correlation can be determined by:
s=StandardDeviation;
m=Mean;
n=Length@d;
x=d[[;;,1]];
y=d[[;;,2]];
Sum[((x[[i]]-m@x)/s@x)((y[[i]]-m@y)/s@y),{i,n}]/(n-1)


0.76909


Hand-rolled Correlation: 119 chars
Assuming x and y are lists...
s=Sum;n=Length@d;m@p_:=Tr@p/n;
(s[(x[[i]]-m@x)(y[[i]]-m@y),{i,n}]/Sqrt@(s[(x[[i]]-m@x)^2,{i,n}] s[(y[[i]] - m@y)^2,{i,n}]))


0.76909