Covariance tells you the direction of a relationship but its size depends on the units. Pearson correlation divides that away, landing on a fixed scale from -1 to 1:
1 Σ (x - mean_x)(y - mean_y)2r = ---------------------------------------------3 sqrt(Σ (x - mean_x)² * Σ (y - mean_y)²)
Task: write pearson_correlation(x_values, y_values) returning r, rounded to 4 decimal places.
1.0 is a perfect increasing straight line, -1.0 a perfect decreasing one, 0.0 no linear relationship.0.0.It only measures linear association. Points on a perfect parabola have an exact, deterministic relationship and can still score near zero — which is the standard argument for looking at a scatter plot before trusting any single correlation number.