I was presented with the following algorithm. As input the algorithm gets an array of length $n \geq 0$. If $n \geq 2$ then for each $k \in \{1, 2, ..., n\}$ the algorithm calls itself recursively with the probability $\frac{1}{2}$ with the array of length $k$. Using generating functions I have to get to the formula which estimates the average number of calls depending on $n$. I have checked analysis of QuickSort algorithm that was performed in similar terms. My proposition for recursive equation, regarding my problem, is as follows: $q_n = 1 + \frac{1}{2}\sum_{k=1}^nq_k$.
Is proposed recursive equation correct (will it estimate the number of calls correctly)? If so, then how, using generating functions, can I get the closed-form expression for the $q_n$?