#NEWLINE# def correlation( X , Y , condition = None , **kwargs ) : #NEWLINE# #INDENT# "\n    Correlation of two random expressions, also known as correlation\n    coefficient or Pearson's correlation\n\n    The normalized expectation that the two variables will rise\n    and fall together\n\n    Correlation(X,Y) = E( (X-E(X)) * (Y-E(Y)) / (sigma(X) * sigma(Y)) )\n\n    Examples\n    ========\n\n    >>> from sympy.stats import Exponential, correlation\n    >>> from sympy import Symbol\n\n    >>> rate = Symbol('lambda', positive=True, real=True, finite=True)\n    >>> X = Exponential('X', rate)\n    >>> Y = Exponential('Y', rate)\n\n    >>> correlation(X, X)\n    1\n    >>> correlation(X, Y)\n    0\n    >>> correlation(X, Y + rate*X)\n    1/sqrt(1 + lambda**(-2))\n    " #NEWLINE# return ( covariance ( X , Y , condition , ** kwargs ) / ( std ( X , condition , ** kwargs ) * std ( Y , condition , ** kwargs ) ) )