Predict if this is the larger number with a probability greater than half?

Alice and Bob are playing a game.

Alice has two slips of paper, on each of which she has written down a distinct real number. Bob reads one slip at random with the other slip hidden from him.

Bob then needs to decide if the number he read is the larger of the two. In the best strategy, what is his probability of getting it correct?

A half 0 A number strictly greater than a half but smaller than 1 1 A positive number strictly less than a half

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Kenny Lau
Feb 21, 2017

Pick any probability density function f f that is strictly positive anywhere. That is:

  • f : R ( 0.. ) \displaystyle f: \Bbb R \to (0..\infty)
  • R f ( x ) d x = 1 \displaystyle \int_\Bbb R f \left({x}\right) \ \mathrm dx = 1

Choose a number from R \Bbb R according to f f and name it x x . Denote the number that Bob read as y y .

If x < y x < y , decide that y y is the larger . If x > y x > y , decide that y y is the smaller. The case x = y x=y occurs with a probability zero and can be discarded.

Reference: Pick the largest number, Thomas M. Cover


Proof:

Denote the two numbers that Alice wrote as a a and b b , with a < b a < b .

y = a y = a y = b y = b
x < a x < a
a < x < b a < x < b
b < x b < x

Note that the left column and the right column occur with an equal probability, namely a half.

Therefore, the probability:

= 1 2 a f ( x ) d x + a b f ( x ) d x + 1 2 b f ( x ) d x = \displaystyle \frac 1 2 \int_{-\infty}^a f \left({x}\right) \ \mathrm dx + \int_a^b f \left({x}\right) \ \mathrm dx + \frac 1 2 \int_b^\infty f \left({x}\right) \ \mathrm dx

= 1 2 + 1 2 a b f ( x ) d x = \displaystyle \frac 1 2 + \frac 1 2 \int_a^b f \left({x}\right) \ \mathrm dx

> 1 2 > \displaystyle \frac 1 2

This actually leads to an interesting philosophical question. Can Bob choose a random number with a [strictly increasing] continuous distribution?

Obviously, if he can, then this strategy applies, but in practice we can only approximate continuous random numbers with discrete random variables.

Brian Moehring - 4 years, 3 months ago

Log in to reply

Since the cumulative density function is continuous and you're comparing against a number, yes you can. Roll a 10-sided die numbered 0-9 over and over. You're constructing a decimal number in the form 0. d 1 d 2 d 3 0.d_1 d_2 d_3 \ldots where d 1 , d 2 , d 3 , d_1, d_2, d_3, \ldots are your rolls in order. But you don't need to roll infinitely many times! Suppose you've rolled n n times, getting the number p = 0. d 1 d 2 d 3 d n p = 0.d_1 d_2 d_3 \ldots d_n . Now, since the cumulative density function f f is continuous, there exists a , b [ , ] a, b \in [-\infty, \infty] such that f ( a ) = p , f ( b ) = p + 1 0 n f(a) = p, f(b) = p + 10^{-n} . (Intermediate value theorem, and noting that p 1 1 0 n p \le 1 - 10^{-n} . If p = 0 p = 0 , take a = a = -\infty ; if p = 1 1 0 n p = 1 - 10^{-n} , take b = b = -\infty .)

The trick is that if y y is outside the range [ a , b ] [a,b] , then we're already sure where our generated number will fall to. The number x x that the solution above uses must be inside the range [ a , b ] [a,b] , since we know p f 1 ( x ) p + 1 0 n p \le f^{-1}(x) \le p+10^{-n} . Thus if y < a y < a , then we know whatever x x will be, we must have x < a x < a ; likewise, if y > b y > b , we know x > b x > b , so we don't need to roll more. If y [ a , b ] y \in [a,b] , then we do need to roll more; roll once more and repeat.

Yes, this has the chance of going indefinitely, but it occurs with zero probability. Almost surely you will stop, and for practical purposes you should stop well before, say, 100 rolls.

This is the same idea of generating a probability of, say, 1/3 using just a standard coin. A coin is a two-sided die with faces 0 and 1; generate a binary number. When your tosses form a binary number that, whatever the remaining digits will be, is guaranteed to fall on one side or another of 1/3, you can say you're done.

Ivan Koswara - 4 years, 3 months ago

Log in to reply

That's fairly interesting.

Since the stopping condition depends on y y , I would still argue that he can't choose such a random number, but I had obviously not noticed that the event X < y X < y can be determined by a discrete approximation for X X .

Thanks!

Brian Moehring - 4 years, 3 months ago

Log in to reply

@Brian Moehring

Yes, this has the chance of going indefinitely, but it occurs with zero probability

This is the idea of Kolmogorov Zero One Law (again in measure theory), which says that a tail event will either almost surely happen, or almost surely not happen.

Calvin Lin Staff - 4 years, 3 months ago

(This goes into measure theory.)

Technical note: Given a probability density function, it need not be true that "the case x = u x = u occurs with probability zero.

What you are describing is the pdf of a continuous random variable.

Calvin Lin Staff - 4 years, 3 months ago

Log in to reply

Hrmmm? In my experience, we only talk about "densities" (with no further specification) when the cumulative distribution function is differentiable in the classical sense, so it would automatically be a continuous random variable.

Is this notation not universal?

Brian Moehring - 4 years, 3 months ago

Log in to reply

It's unfortunate that the term "probability distribution function" applies to both discrete RV and continuous RV.

Though these concepts seem distinct, these ideas are combined in measure theory. Specifically, we use the dirac delta function , which allows for a point to have mass/area.

Calvin Lin Staff - 4 years, 3 months ago

Log in to reply

@Calvin Lin Certainly the concept of a Radon-Nikodym derivative allows us to define "densities" for continuous, discrete, and mixture distributions, but that's not really what I was saying. In my experience, when we talk about a density without mention of a measure, we mean a density with respect to the Lebesgue measure λ \lambda , so from this perspective, we can only talk about a distribution possibly having a density if the distribution is continuous.

On a completely unrelated note, perhaps it's my training speaking, but I've always been wary of calling the dirac delta a "function", since it's really only defined as a functional/measure ^_^.

Brian Moehring - 4 years, 3 months ago

Log in to reply

@Brian Moehring In part, it depends on what kind of person you talk to, and what kind of space they work in. For a simplistic example, physicists assume that everything is nice and smooth, till things obviously break


(This starts to go into advanced measure theory. Not everyone would be able to fully comprehend this part, so don't feel discouraged.)

Radon-Nikodym is useful for probabilists to be able to split up their measure theory into 1) "continuous", 2) "discrete" and 3) "singular-continuous" parts (and exactly these 3 types). Types 1 and 2 are familiar to you, and type 3 has the property that:

  • P ( { x } ) = 0 P(\{ x \} ) = 0 ("discrete probability density function" at any point is 0)
  • { x P ( X ) 0 } \{ x | P(X) \neq 0 \} has zero Lebesgue measure. (so if you take the integral of the "continuous probability density function", you still get 0)

An example of a singular-measure is the measure induced by the Cantor set. This is why we need the Dirac measure, which results in a "point mass", to help reconcile the probability density function of a singular-continuous probability.

Relating back to the start, for most people, treating these pdfs as continuous or discrete separately is sufficient, and they do not need the Dirac measure. For theoretical analysts (esp those that study PDE, discountinuous functions), the Dirac delta serves as a crutch to reconcile the familiar with the new. For example, to talk about introducing heat at a point, we model the heat equation with a boundary condition of the Dirac function.

Calvin Lin Staff - 4 years, 3 months ago

In the case where x = y x = y , throw a coin to decide.

Kenny Lau - 4 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...