<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Recursive Algorithm
Step1:  This let's us derive a recurisve form.
$Y = \Theta X$ 
$Y X^T = \Theta X X^T$
We accumulate $Y X^T$ and $X X^T$ since they are of fixed size
and there is a recursion relation as shown below.
At the end we perform the inverse. This is the same as a pseuod-inverse
solution but done recursively.
$\Theta = Y X^T (X X^T)^{-1}$
<ASSISTANT_TASK:>
Python Code:
import sympy
sympy.init_printing()
Theta = sympy.Matrix(sympy.symbols(
    'theta_0:3_0:4')).reshape(3,4)
def Y(n):
    return sympy.Matrix(sympy.symbols(
        'G_x:z_0:{:d}'.format(n+1))).T.reshape(3, n+1)
def C(n):
    return sympy.ones(n+1, 1)
def T(n):
    return sympy.Matrix(sympy.symbols('T_0:{:d}'.format(n+1)))
def T2(n):
    return T(n).multiply_elementwise(T(n))
def T3(n):
    return T2(n).multiply_elementwise(T(n))
def X(n):
    return C(n).row_join(T(n)).row_join(T2(n)).row_join(T3(n)).T
Explanation: Recursive Algorithm
End of explanation
X(0)*X(0).T
X(1)*X(1).T
dX = X(1)*X(1).T - X(0)*X(0).T
dX
Y(0)*X(0).T
Y(1)*X(1).T
dYXT = Y(1)*X(1).T - Y(0)*X(0).T
dYXT
Explanation: This let's us derive a recurisve form.
$Y = \Theta X$ 
$Y X^T = \Theta X X^T$
We accumulate $Y X^T$ and $X X^T$ since they are of fixed size
and there is a recursion relation as shown below.
At the end we perform the inverse. This is the same as a pseuod-inverse
solution but done recursively.
$\Theta = Y X^T (X X^T)^{-1}$
End of explanation
<END_TASK>