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

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

Call X the first nonzero digit of A+B+C.

Find the probability distribution of X.

 See The Solution Submitted by Jer No Rating

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

The sample space is a unit cube in A-B-C space. Probabilities are the totals of the volumes of the cube taken up.

The plane A+B+C=2 cuts off a pyramidal corner of the cube, with vertex at (1,1,1), in which the total exceeds 2, and since it never exceeds 3, the first digit is 2. (Ignore probability zero points and planes representing the total being exactly 3 or 2, or .9, etc.) The base of the pyramid is an equilateral triangle with sides of length sqrt(2), as being diagonals of three of the cube's faces. The edges leading to the vertex of the pyramid are of length 1.  The height of this pyramid is 1/3 the major diagonal of the cube, as the whole diagonal consists of equal segments going from (0,0,0) to the plane A+B+C=1, and then to the plane A+B+C=2 and finally to the plane A+B+C=3. Since the major diagonal of the cube is sqrt(3), the height of the pyramid is sqrt(3)/3. The area of the base is sqrt(3)/2. The volume of the pyramid is therefore (3/6)/3 = 1/6, this then being the probability that A+B+C > 2, and is therefore one of the volumes belonging to leading digit 2. (Remember that the probability of being exactly 2 or 3 is zero.)

The probability that A+B+C < 1 is equal to the volume of a congruent pyramid, this time with the vertex at (0,0,0).  As its volume is also 1/6, this leaves the probability that A+B+C lies between 1 and 2 as 1 - 2/6 = 2/3, which is thus part of the overall probability that the first significant digit is 1.

This leaves the pyramid of A+B+C<1 to be divided up by leading digit.

Again, the pyramid has an equilateral triangle of side length sqrt(2) as the base, and has a height of sqrt(3)/3, and volume of 1/6.

The slice of this pyramid representing .9 (that is, the first of the slices that represent the digit 9) is a frustum of height sqrt(3)/30 (i.e., 1/10 the pyramid's height). The frustums for .8, .7, ... .1, are also of height sqrt(3)/30, but of decreasing base area.

The volume of that full pyramid is, as mentioned, 1/6. Without the slice representing .9, it's a similar pyramid, but with all linear dimensions equalling only 9/10 that of the original, so its volume is (9/10)^3 / 6, so the frustum representing .9 has volume (1 - (9/10)^3) / 6 = 271/6000.

`.9    ((10/10)^3 - (9/10)^3) / 6 = 271/6000.8    ((9/10)^3 - (8/10)^3) / 6 = 217/6000.7    ((8/10)^3 - (7/10)^3) / 6 = 169/6000.6    ((7/10)^3 - (6/10)^3) / 6 = 127/6000.5    ((6/10)^3 - (5/10)^3) / 6 = 91/6000.4    ((5/10)^3 - (4/10)^3) / 6 = 61/6000.3    ((4/10)^3 - (3/10)^3) / 6 = 37/6000.2    ((3/10)^3 - (2/10)^3) / 6 = 19/6000.1    ((2/10)^3 - (1/10)^3) / 6 = 7/6000`

This leaves a volume of 1/6000 (i.e., 1/1000 of the original pyramid) for the next iteration of the nine leading digits.

Each successive round then has 1/1000 the volume in the preceding round, applicable to each of the digits. So to account for successive 1/10 values (such as .09, .009, .0009, etc. for the digit 9), the values above need to be multiplied by 1000/999. This simply changes the denominators from 6000 to 5994. And we need to add 1/3 to the value for 2 to account for totals above 2 and 1/6 to the value for 1 to account for the totals between 1 and 2.

`9   271/5994             271/5994        0.04521187854521187858   217/5994             217/5994        0.03620286953620286957   169/5994             169/5994        0.02819486152819486146   127/5994             127/5994        0.02118785452118785445   91/5994              91/5994         0.01518184851518184844   61/5994              61/5994         0.01017684351017684343   37/5994              37/5994         0.00617283950617283942   19/5994      + 1/6 = 509/2997        0.1698365031698365031   7/5994       + 2/3 = 4003/5994       0.6678345011678345011`

Verification by simulation:

DEFDBL A-Z
DO
a = RND(1) * 10: a = a - INT(a)
b = RND(1) * 10: b = b - INT(b)
c = RND(1) * 10: c = c - INT(c)
p = a + b + c
ps\$ = STR\$(p)
FOR i = 1 TO LEN(ps\$)
ix = INSTR("123456789", MID\$(ps\$, i, 1))
IF ix > 0 THEN EXIT FOR
NEXT
hit(ix) = hit(ix) + 1
ct = ct + 1
FOR i = 1 TO 9
PRINT hit(i);
NEXT: PRINT
PRINT ct
FOR i = 1 TO 9
PRINT USING " #.#####"; hit(i) / ct;
NEXT: PRINT
LOOP

`189382  48246  1729  2886  4380  6080  7984  10328  12808283823 trials0.66725 0.16999 0.00609 0.01017 0.01543 0.02142 0.02813 0.03639 0.04513`

 Posted by Charlie on 2009-08-28 17:59:35

 Search: Search body:
Forums (0)