You could set this up in symbolic form as a bivariate distribution with pmf $f(x,y)$:

Then, using the mathStatica add-on to Mathematica, the correlation you seek is:
Corr[{x, y}, f]
$\frac{607}{\sqrt{1467199}}$
Note that this is slightly different to the solution you posted,as the numerical value is: 0.501123... (not 0.0501).
You can make Mma do this operation too, by itself, as per:
dist = ProbabilityDistribution[f, {x, 0, 1, 1}, {y, 0, 1, 1}]
where f
is the piecewise function above, and then evaluate:
Correlation[dist]
The problem with your use of Correlation[{{0.30, 0.17}, {0.08, 0.45}}]
is this ... You could use Correlation[xdata, ydata]
to find the sample correlation between xdata
and ydata
... but (a) you are not seeking a sample correlation ... you are seeking the population correlation, and (b) {{0.30, 0.17}, {0.08, 0.45}}
is not your data ... it represents the pmf or distribution of the population data.