I want to understand the expected running time and the worse-case expected running time.
I got confused when I saw this figure (source),
where $I$ is the input and $S$ is the sequence of random numbers.
What I don't understand from the above equation is why the expected running time is given for one particular input $I$?
I always thought that for a problem $\pi$, $E(\pi) = \sum_{input \in Inputs}(Pr(input)*T(input))$ , isn't this correct?
So, let's assume Pr(x) is the uniform distribution, and we are to find the expected running time of the problem of searching an element in a $n$ element array using linear search.
Isn't the expected running time for linear search,
$$E(LinearSearch) = \frac{1}{n}\sum_1^ni $$
And what about the worst case expected running time, isn't it the time complexity of having the worst behavior? Like the figure below,
I would highly appreciate if someone can help me understand the two figures above.
Thank you in advance.