import math
import statistics as st
def correlation(list1, list2):
    n = min(len(list1), len(list2))
    x = list1[:n]
    y = list2[:n]

    Xsr = st.mean(x)
    Ysr = st.mean(y)

    cov = st.covariance(x,y)

    Xso = st.stdev(x)
    Yso = st.stdev(y)

    R_paired = cov / ( Xso*Yso)
    return R_paired
