I looked around a few questions on the site and examples from my textbooks and couldn't really understand how the expected value of something is calculated. I'm a student of computer science and for some reason they decided to teach us tons of probability subjects in less than a week cause we need it to analyze running time of code.
So i would like a (simple words, im slow) explanation of the idea if Expected value and help regarding this specific question:
Let us have a Chocolate bar of the size n (1 to n). Let us choose some index k and split the bar at that index. We give one part to our friend and leave the other to ourselves. We LOVE chocolate so we always take the bigger part of the bar for ourselves. What is the Expected size of the piece we will get? (You may approximate when confronted with non integers).
(NOTES): We learned of basic probabilty and ONLY the definition of probability space. We learned of Expected value generally, and specifically about its linearity and about the face that when the random indicator variables X, Y are independent this occurs: E(XY)=E(X)E(Y)
The expected value is simply the average size of the piece we will get over a large number of trials. In this case
If $k<=\frac{n}{2}$ then you get the other piece ((n-k) of the chocolate)
If $k>=\frac{n}{2}$ then you get that piece (k of the chocolate)
We are assuming k is evenly distributed, so both the possibilities are equally likely. Thus, the average cut will be made halfway in the middle of the interval.
We must then add up the overall expected value as follows:
E(k) = 0.5 * (average value of k in the first interval) + 0.5 * (1-average value of k in the second interval)
(The 0.5 is because both are equally likely)
Since the average values of k are $\frac{n}{4}$ and $\frac{3n}{4}$ in the two intervals, the resulting average (expected) size of chocolate is $\frac{3n}{4}$