Did I find the right examples for you? yes no

# sympy.stats.independent

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
```Independence of two random expressions

Two expressions are independent if knowledge of one does not change
computations on the other.

Examples
========

>>> from sympy.stats import Normal, independent, given
>>> from sympy import Tuple, Eq(more...)
```

```        def independent(a, b):
"""
Independence of two random expressions

Two expressions are independent if knowledge of one does not change
computations on the other.

Examples
========

>>> from sympy.stats import Normal, independent, given
>>> from sympy import Tuple, Eq

>>> X, Y = Normal('X', 0, 1), Normal('Y', 0, 1)
>>> independent(X, Y)
True
>>> independent(2*X + Y, -Y)
False
>>> X, Y = given(Tuple(X, Y), Eq(X+Y,3))
>>> independent(X, Y)
False

========
dependent
"""
return not dependent(a, b)
```

```from sympy import (EmptySet, FiniteSet, S, Symbol, Interval, exp, erf, sqrt,
symbols, simplify, Eq, cos, And, Tuple, integrate, oo, sin, Sum, Basic,
DiracDelta)
from sympy.stats import (Die, Normal, Exponential, P, E, variance, covariance,
skewness, density, given, independent, dependent, where, pspace,
```
```def test_dependence():
X, Y = Die('X'), Die('Y')
assert independent(X, 2*Y)
assert not dependent(X, 2*Y)

X, Y = Normal('X', 0, 1), Normal('Y', 0, 1)
assert independent(X, Y)
```

```from sympy import (EmptySet, FiniteSet, S, Symbol, Interval, exp, erf, sqrt,