We play a game where a sequence of $n$ numbers is drawn uniformly from $[0,1]$, and we need to set a threshold $0\leq a\leq 1$. For every number that is at least our threshold, we get $a$ points, otherwise we get nothing.
If we need to set a threshold before seeing the numbers, we will set $a=1/2$ to maximize the expected value of our score, since this expected value is $a(1-a)$. This gives expected score $n/4$, and average expected score $1/4$.
However, if we can set the threshold after seeing the numbers, we may set something different depending on what numbers we see. (For example, if all numbers are $1$ we will set $a=1$.)
Question: As $n\rightarrow\infty$, does the average expected score approach $1/4$? My intuition is that it should, because as the sequence gets longer it gets closer to random.
(I originally also asked for the expected value for any $n$, but I think that is less interesting.)
Update: zhoraster has provided an answer using a formula involving Brownian bridge. What about this slightly modified version, where such formula doesn't seem to apply?
The average does approach $1/4$, moreover, the rate of convergence is $O(1/\sqrt{n})$ (and the constant can be estimated).
Indeed, let $U_1,\dots,U_n$ be the numbers. We are interested in $$ M_n = \frac1n \mathsf E\left[\max_{t\in[0,1]} t\cdot \#\{k: U_k\ge t\} \right] = \mathsf E\left[\max_{t\in[0,1]} t\cdot \left(1-\frac1n\cdot \#\{k: U_k< t\} \right)\right]\\ = \mathsf E\left[\max_{t\in[0,1]} t\cdot \left(1- \hat F_n(t) \right)\right], $$ where $\hat{F}_n(t) = \frac1n\cdot \#\{k: U_k< t\}$ is the (Russian-style) empirical cdf of the sample $U_1,\dots, U_k$. In particular, $$ M_n\ge \mathsf E\left[\frac12 \cdot \left(1- \hat F_n\left(\frac12\right) \right)\right] = \frac 14, $$ since $\mathsf E\left[\hat F_n(t)\right] = t$.
On the other hand, it is well known that $$ \hat F_n(t) \approx t + \frac1{\sqrt{n}}B_t^0, $$ where $B^0$ is the standard Brownian bridge on $[0,1]$. So $$ M_n\lesssim \mathsf E\left[\max_{t\in[0,1]} \big\{t (1- t )\big\} + \frac{1}{\sqrt{n}}\max_{t\in[0,1]} \{-t B_t^0\} \right] = \frac 14 + O\left(\frac1{\sqrt{n}}\right). $$