Lambdia

Two Random Numbers, One Hyperbola, and 15.3 Percent

Draw X and Y uniformly from the unit interval and their product beats a half with probability (1 - ln 2)/2, about 15.3 percent. The reflex answer of a quarter counts a condition that is genuinely necessary and treats it as sufficient, which is why 0.8 times 0.6 sits inside the quarter square and still loses. The hyperbola y = 1/(2x) cuts the winners down to a sliver, and one integral measures it.

Draw two numbers at random from the interval [0,1][0,1], independently and with no part of the interval favoured over another. Multiply them. How often does the product come out above a half?

The reflex answer is a quarter. It is wrong, and it is wrong for an interesting reason rather than a sloppy one. The true figure is (1ln2)/2(1 - \ln 2)/2, which is 0.153426409720.15342640972\ldots, so about 15.3 percent. Getting there needs one integral and one honest look at a region in the plane.

Why a quarter is the right shape of a wrong answer

The reasoning behind a quarter goes like this. For the product to beat a half, neither factor can be at or below a half, because a factor of at most 12\tfrac12 multiplied by anything in [0,1][0,1] gives at most 12\tfrac12. Each factor clears a half with probability 12\tfrac12, and the draws are independent, so

1212=14\tfrac{1}{2}\cdot\tfrac{1}{2} = \tfrac{1}{4}
(1)

Every step of that is correct except the last inference. Both factors clearing a half is a genuine requirement, so the quarter-square really does contain every winning pair. It just contains a great many losing pairs as well. Take x=0.8x = 0.8 and y=0.6y = 0.6. Both clear a half comfortably, and 0.80.6=0.480.8 \cdot 0.6 = 0.48, which loses. The condition is necessary and it is not sufficient, and equation (1) quietly treats it as both.

The region that actually wins

Because the two draws are independent and each is uniform, the pair (X,Y)(X, Y) is uniform on the unit square. Its joint density is 1 there and 0 elsewhere, which means every probability in this problem is an area and nothing more. So the question becomes a question about a shape.

The winning set is {(x,y):xy>12}\{(x,y) : xy > \tfrac12\} intersected with the square. Its boundary is the curve xy=12xy = \tfrac12, that is y=1/(2x)y = 1/(2x), a branch of a hyperbola. Inside the square that curve exists only for x12x \ge \tfrac12, since for smaller xx it would demand y>1y > 1. It enters the square at (12,1)(\tfrac12, 1) and leaves it at (1,12)(1, \tfrac12), cutting the top right quarter into a piece that wins and a piece that does not.

Fig. 1 — The dashed quarter is what equation (1) counts. The darker sliver above the hyperbola is what actually wins, and the marked point shows the difference is not empty.

The picture already settles the direction of the error. The winning region sits strictly inside the quarter-square, so the answer has to come out below 14\tfrac14. Anyone who guessed a quarter has at least bounded the truth from above.

The area, by slicing

Slice the region vertically. Fix an xx between 12\tfrac12 and 1. The winning values of yy are those above 1/(2x)1/(2x) and below 1, so the slice has length 11/(2x)1 - 1/(2x). For x12x \le \tfrac12 the slice is empty. Integrating the slice length over the range where it is positive,

1/21(112x)dx=[x12lnx]1/21=1212ln2\int_{1/2}^{1}\Bigl(1 - \frac{1}{2x}\Bigr)\,dx = \Bigl[\,x - \tfrac{1}{2}\ln x\,\Bigr]_{1/2}^{1} = \tfrac{1}{2} - \tfrac{1}{2}\ln 2
(2)

The logarithm arrives because the boundary is a hyperbola, and the area under 1/x1/x is the one integral that produces a logarithm rather than a power. Collecting the two terms,

P(XY>12)=1ln22=0.1534264097P(XY > \tfrac12) = \frac{1 - \ln 2}{2} = 0.1534264097\ldots
(3)

Rounded to the nearest percent that is 15 percent, which is honest to within 0.00350.0035. Rounded a digit further it is 15.3 percent. You will also meet the same number written 12(1+ln12)\tfrac12\bigl(1 + \ln \tfrac12\bigr), which looks different and is not. Since ln12=ln2\ln\tfrac12 = -\ln 2, the two forms are the same real number, so a reader who finds one of them elsewhere has not found a contradiction.

The same number without drawing anything

Geometry is the fastest route here, but it is worth having a version that does not depend on seeing the shape. Condition on XX. Given X=xX = x, the event XY>12XY > \tfrac12 is the event Y>1/(2x)Y > 1/(2x), and since YY is uniform on [0,1][0,1] its conditional probability is 11/(2x)1 - 1/(2x) when x>12x > \tfrac12 and zero otherwise. Averaging over XX,

P(XY>12)=E[P(Y>12XX)]=1/21(112x)dxP(XY > \tfrac12) = \mathbb{E}\Bigl[\,P\bigl(Y > \tfrac{1}{2X} \,\big|\, X\bigr)\Bigr] = \int_{1/2}^{1}\Bigl(1 - \frac{1}{2x}\Bigr)dx
(4)

Identical integrand, reached by conditioning instead of by cutting up a square. Two routes that share no step and land on the same number is the kind of agreement worth stating out loud, because it is what separates a result you believe from a result you happen to have written down.

The whole distribution of the product

Nothing in the calculation cared that the threshold was a half. Replacing 12\tfrac12 by any tt in (0,1](0,1] and repeating the slice gives the distribution function of the product, which is worth having in closed form.

Theorem — distribution of a product of two independent standard uniforms

If XX and YY are independent and uniform on [0,1][0,1], then for every t(0,1]t \in (0,1], P(XYt)=t(1lnt)P(XY \le t) = t\,(1 - \ln t), and consequently P(XY>t)=1t+tlntP(XY > t) = 1 - t + t\ln t. The density of XYXY on (0,1)(0,1) is lnt-\ln t, which is unbounded as t0+t \to 0^{+}.

Checking it at the threshold this article started from, P(XY12)=12(1+ln2)=0.8466P(XY \le \tfrac12) = \tfrac12\bigl(1 + \ln 2\bigr) = 0.8466\ldots, so the complement is 0.15340.1534\ldots and matches equation (3) exactly.

Fig. 2 — The threshold version. The one-half case marked here is a single point on a curve that starts at 1 and lands on 0.

The shape explains something the single number hides. Near t=0t = 0 the function behaves like 1t1 - t up to the small correction tlntt \ln t, so a low bar is cleared almost always, exactly as you would hope. Near t=1t = 1 it goes to zero, since demanding the product be close to 1 demands both factors be close to 1. And the density lnt-\ln t blowing up at the origin says the product piles up near zero, which is the real reason products of numbers below 1 feel so much smaller than their factors.

A different wrong route, which lands somewhere else

There is a second mistake in circulation and it is worth separating from the first, because confusing the two makes the problem harder to teach. That second route argues that since 1212=12\tfrac{1}{\sqrt 2} \cdot \tfrac{1}{\sqrt 2} = \tfrac12, both factors must exceed 1/21/\sqrt 2. Each does so with probability 11/21 - 1/\sqrt 2, so the route gives

(112)2=0.0858\bigl(1 - \tfrac{1}{\sqrt 2}\bigr)^{2} = 0.0858\ldots
(5)

That is neither the answer nor the quarter. It is a different error with a different sign: the condition it imposes is sufficient and not necessary, so it undercounts, and it produces the square drawn from (1/2,1/2)(1/\sqrt2, 1/\sqrt2) to the corner, which sits strictly inside the true region. Two wrong answers bracketing the right one, 0.08580.0858 below and 0.250.25 above, is a decent sanity check on the answer in between.

Boundaries and edge cases

Whether the inequality is strict changes nothing. The boundary set {xy=12}\{xy = \tfrac12\} is a curve in the plane, so it has area zero, and P(XY>12)P(XY > \tfrac12) equals P(XY12)P(XY \ge \tfrac12). That is a convenience of the continuous setting and it fails immediately if the draws are discretised. Round both factors to two decimal places and pairs sitting exactly on the boundary acquire real probability.

Independence, on the other hand, is load-bearing. If Y=XY = X then XY>12XY > \tfrac12 means X>1/2X > 1/\sqrt2, and the probability is 11/20.2931 - 1/\sqrt 2 \approx 0.293, nearly double the answer. If Y=1XY = 1 - X the product never exceeds 14\tfrac14 and the probability is zero. The uniform marginals are the same in all three cases, so nothing about the answer can be read off the marginals alone.

The formula for the threshold also stops at the ends of the unit interval for a plain reason. For t1t \ge 1 the event is impossible and for t0t \le 0 it is certain, so 1t+tlnt1 - t + t\ln t is only the answer on (0,1)(0,1); at t=0t = 0 the expression is undefined while the probability is 1.

Sources and further reading

Four independent estimates were computed before publication and they agree. Symbolic integration gives (1ln2)/2(1-\ln 2)/2 both as the one-dimensional integral of equation (2) and as the double integral over the square. Composite Simpson quadrature returns 0.1534264097200.153426409720. A midpoint grid of 4000×40004000 \times 4000 cells, which uses no calculus at all and simply counts, returns 0.1534270.153427. Four million sampled pairs return 0.1534920.153492, about a third of a standard error away. The same sampling run measured the quarter-square at 0.2500370.250037 and found no winning pair anywhere outside it, which is the numerical version of the claim that the quarter-square condition is necessary.

Comments · 0

Be the first to comment.