Recurrence relation for this is
$T\left ( n \right )=\left\{\begin{array} {lcl} T(n -1)+T(1)+1 & \text{if} \; n>0\\1 & \text{if}\; n=0 \end{array}\right. $
In the worst case, the random function gives $0 \text { or } n$ in each call.
So, time complexity of this recurrence is $T(n) = \Theta (n)$