Posted March 16, 2014 Inspired by BMAD's puzzle, consider choosing four random numbers on [0,1]. If you sort them lowest to highest, what is the expected value of the third number? -1 Share this post Link to post Share on other sites

0 Posted March 22, 2014 If we continue to consider the question to be asking "what value for the third (or Nth) number from smallest to largest is most likely to occur" thenby symmetry from the previous answer, the most likely value for the second number from largest to smallest would be 1/3. The most likely value for the smallest number would be zero -- it's the only value where you can be guaranteed that none of the other random numbers will be smaller -- and the most likely value for the largest number would be one. So they would all be equidistant. If we instead use the definition of "expected value" as the average value after a large number of trials thenMy previous formula showed that if one of the four random numbers, N, is set to a specific value then the probability that it's the third number from smallest to largest is 3 * N^{2} * (1-N) = 3N^{2} - 3N^{3} Remember that there's only a 1/4 chance that N will be the third smallest number out of the four random numbers, so if you integrate that function over N=0 to N=1 you get Int [3N^{2} - 3N^{3}] = N^{3} - 3/4 N^{4} -> 1 - 3/4 = 1/4 So if you multiply that function by four, you get a probability density function that integrates to one as it should if you're trying to find the probability that a value N (not a specific one of the four variables) is the third smallest. To find the expected value for the third smallest number if "expected value" is defined as the average value if you were to perform a large number of trials, simply integrate that function (the probability that N is the third smallest number) times the value N over N=0 to N=1. Int [(12N^{2} - 12N^{3}) * N] = 3N^{4} - 12/5 N^{5} Over N=0 to 1, that's 3 - 12/5 = 3/5 = 0.6 By symmetry, the expected value for the second from the smallest would be 0.4. By using the formula in the second paragraph in the spoiler of my previous post, the probability of a value N being largest of the four numbers would be N^{3} and multiplying that by 4 to turn it into the probability density function that the value N is the largest of the four random numbers gives 4N^{3} Integrating the product of (the probability density function) times (the value N) over N=0 to N=1 Int[4N^{3} * N] = Int[4N^{4}] = 4/5 N^{5} Over N=0 to 1, that ends up being 4/5, or 0.8 Symmetry makes the expected value for the smallest number be 0.2. So again, the four expected values are equidistant. 0 Share this post Link to post Share on other sites

0 Posted March 17, 2014 Hi santhu, welcome to the Den. Your answer is close but not quite it. 0 Share this post Link to post Share on other sites

0 Posted March 19, 2014 .625 Yeah i gave a crude - well approximate answer. The answer will be 2*(x/4) + 2*(x/4^{2}) +2*(x/4^{3})+ ..... where here x=1, so the answer is 2/3=.666 0 Share this post Link to post Share on other sites

0 Posted March 20, 2014 I agree with your answer (if the problem is asking "what value is most likely to occur for the third number", which might be different from the expected value if it's defined as "the average outcome if you were to run a large number of trials") but that formula makes me think you took a different approach than I did. I'll posit (without really proving for now) that this problem is identical to picking four random numbers, with N being one of those numbers, and asking what value for N would make it most likely to be the third number from lowest to highest. The probability that N is larger than any of the other random numbers is simply N, the probability that N is smaller than any of them is (1-N), and in general the probability that N is larger than P of them and smaller than Q of them is _{(P+Q)}C_{P} N^{P} (1-N)^{Q}. That last part might not be obvious, but you can consider the case posed in the OP: Call the three other random numbers X, Y, and Z, and the probability that N is larger than any two of them and smaller than the other is [P(N>X)*P(N>Y)*P(N<Z)] + [P(N>X)*P(N<Y)*P(N>Z)] + [P(N<X)*P(N>Y)*P(N>Z)] = 3 * [N*N*(1-N)] To find the value of N that will make that probability highest, set the derivative equal to zero. d/dN [3N^{2}*(1-N)] = d/dN [3N^{2} - 3N^{3}] = 6N - 9N^{2} Solving 6N - 9N^{2} = 0 gives the solution N = 2/3How'd you solve it to end up with that formula? 0 Share this post Link to post Share on other sites

0 Posted March 20, 2014 Are the four expected values equally spaced? 0 Share this post Link to post Share on other sites

0 Posted March 24, 2014 Your second answer is the one I was looking for. It's a result that was interesting to me. 0 Share this post Link to post Share on other sites

Posted

Inspired by BMAD's puzzle, consider choosing four random numbers on [0,1].

If you sort them lowest to highest, what is the expected value of the third number?

## Share this post

## Link to post

## Share on other sites