All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Random +, - or / Random (Posted on 2009-08-24)
Let A and B each be random real numbers chosen from the uniform interval (0,1).

Call X the first nonzero digit of A+B.
Call Y the first nonzero digit of A-B.
Call Z the first nonzero digit of A/B.

Find the probability distribution of each random variable.

 See The Solution Submitted by Jer No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 Division solution Comment 2 of 2 |

Division (/):

The two triangles making up the unit square, separated by the line A=B, must be treated separately.

Consider first the easier: A<B:

The triangle between A = B and A = 0.9 B has the same area as the triangle between A = 0.9 B and A = 0.8 B, as in either case the base is 0.1 and the height is 1. The same is true for each of the fractions 0.8 to 0.7, etc. Likewise, when we get down to 0.1 to 0.09, being equal to the triangle between 0.09 and 0.08 and between 0.08 and 0.07, etc.  Within each set of leading zero length, the digits themselves share equal areas. So whenever A < B, each digit has equal likelihood, contributing an overall probability of (1/9)*(1/2) = 1/18 to each of the nine digits.

The other half of the cases, when A > B, have unequal triangles. The height is always 1, but the base varies. From A = B to A = 2*B, assigned to the digit 1, takes up fully half of triangle above A = B, and so 1/4 of the whole square. From A = 2*B to A = 3*B is only 1/6 of the 1/2 square and thus contributes only 1/12 to the overall probability for its assigned digit, 2. The 1/6 comes from 2/3 - 1/2.

`1    1/2 * 1/2           1/42    (2/3 - 1/2) * 1/2   1/123    (3/4 - 2/3) * 1/2   1/244    (4/5 - 3/4) * 1/2   1/405    (5/6 - 4/5) * 1/2   1/606    (6/7 - 5/6) * 1/2   1/847    (7/8 - 6/7) * 1/2   1/1128    (8/9 - 7/8) * 1/2   1/1449    (9/10 - 8/9) * 1/2  1/180`

But the next set for the same digits would not seem to be in proportion to these (but see below, in actuality):

My original thought was that the numeric sequence continued for the second set, such as 1 accounting for (10/11 - 9/10) / 2 = 1/220, with the second set (for 2) accounting for (11/12 - 10/11) / 2 = 1/264, etc. These probabilities added up to 1, as expected, but the prediction for the digit 1 was about 0.314, taking into consideration the additional 1/18 from the other half of the square, while simulation insisted on 0.333 as the probability of beginning with a 1 (see below).

Then I realized that the next 10 items on the list all applied to the digit 1, not just the next one, as the next ten were for 10, 11, ..., 19, all beginning with the digit 1.

So the table continues:

`10-19 (19/20 - 9/10) * 1/2    1/4020-29 (29/30 - 19/20) * 1/2   1/120...`
`100-199  (199/200 - 99/100) * 1/2    1/400200-299  (299/300 - 199/200) * 1/2   1/1200...`

So it does indeed seem that each digit has a geometric series with ratio 1/10, so the numbers in the first table need only be multiplied by 10/9. For the digit 1, for example, 1/4 * 10/9 = 10/36 = 5/18, to which 1/18 is added from the other half of the square, making a total of 3/18 = 1/3, in agreement with the simulation.

The formula, then, for a given digit d is

10(d/(d+1) - (d-1)/d)/18 + 1/18

and is tabulated as

`1  1/3         0.33333333333333333332  4/27        0.14814814814814814813  11/108      0.10185185185185185184  1/12        0.08333333333333333335  2/27        0.0740740740740740746  13/189      0.0687830687830687837  11/168      0.06547619047619047618  41/648      0.06327160493827160489  5/81        0.061728395061728395`

Simulation verification:

`188534  84231  57470  47003  42277  38795  36750  35554  34930565544 trials0.33337 0.14894 0.10162 0.08311 0.07475 0.06860 0.06498 0.06287 0.06176`

 Posted by Charlie on 2009-08-24 19:16:12

 Search: Search body:
Forums (0)