In [11]:
import numpy as np
#from __future__ import division
import theano.tensor as T
from theano import function
from matplotlib import pyplot as plt
%matplotlib inline

In [21]:
from sympy import *
# discrete random variables

A = symbols('A')
_A = symbols('_A')

def p(E):
    p = 0
    if E == A:
        return 1
    if E == _A:
        return (1 - p(A))
    
print p(A)
#p = Function('p')(E)
#
#p(A)
print p(_A)


1
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-21-ed8c59deefc2> in <module>()
     16 #
     17 #p(A)
---> 18 print p(_A)

<ipython-input-21-ed8c59deefc2> in p(E)
     10         return 1
     11     if E == _A:
---> 12         return (1 - p(A))
     13 
     14 print p(A)

TypeError: 'int' object is not callable

In [ ]: