 All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars  perplexus dot info  Hexadecimal Hinder (Posted on 2016-06-19) x is a randomly chosen hexadecimal real number on the interval (0, (10)16)

Determine the probability of each of the following:

(i) x and 3x have the same first digit.

(ii) x and x3 have the same first digit.

(iii) x3 and 3x have the same first digit.

(iv) x, x3 and 3x have the same first digit.

*** “First digit” denotes the first nonzero digit of the number when expressed in hexadecimal form.

 No Solution Yet Submitted by K Sengupta Rating: 5.0000 (1 votes) Comments: ( Back to comment list | You must be logged in to post comments.) part (i) solution | Comment 1 of 6
(i)
The difficult part is the interval (0,1). The value of 3^x will be that of some root of 3 and so will begin with either 1 or 2, the changeover happening at log{base-3} (2). That's  .6309297535714573 in decimal or .A1849C... in hex. What fraction of real numbers lower than that hex fraction begin with 1? What fraction of real numbers between there and 1 begin with 2? We can't really use Benford's law as segment size is dependent on the number here, so it doesn't really scale up.

In fact, simulation shows that in a uniformly probable interval each digit is equally likely. However in the situation of numbers below .A1849C... hex, the position immediately after the hexadecimal point is not equally distributed. The digits zero through 9 would all have equal probability, and A would have less.  The digit zero of course does not count, but within that digit, all the other digits would be equally probable to be the first non-zero.

The situation from x being .A1849C... to 1 is more straightforward: none of these start with a 2 as all start with anywhere from A through F (as there's zero probability of x actually being 1 itself). That entire range of x has zero probability of a match.

In keeping track of the numbers it will be helpful to consider the probability times 16, since the unit 0 to 1 is 1/16 of the entire range. This corresponds to keeping track of how many units of the 16-unit number line are occupied by numbers meeting the criterion.

We know to discount entirely the portion above .6309297535714573 in decimal (but below 1, as that's the part we're considering first). Below that but above 10/16, or .625, is digit A. The digit 1, right after the hexadecimal point, accounts for 1/16 of the first unit, all within the length where 3^x begins with 1. So does the digit 0, and 1/16 of that 1/16, or 1/256 will have 1 as the first digit.

(The below paragraph has been corrected in a later post.)

So the total length of number line from 0 to 1 that satisfies condition (i) is 1/16 + 1/256 = .06640625. (It contributes 1/16 of that to the overall probability, as that interval is only 1/16 of the overall range.)

OK, now what about 1 through 16 (10 in hex)?

x                      3^x

1                      3
2                      9
3                      1B
4                      51
5                      F3
6                      2D9
7                      88B
8                      19A1
9                      4CE3
A                      E6A9
B                      2B3FB
C                      81BF1
D                      1853D3
E                      48FB79
F                      DAF26B
10                     290D741

When x is 1 plus a fraction, 3^x begins with a 3 through an 8 in hex.
When x is 2 plus a fraction, 3^x begins with 9 or 1.
When x is 3 plus a fraction, 3^x begins with 1 through 5, a range that includes 3.

The portion that has 3 at the beginning of 3^x has its decimal version of 3^x as 3*16 upward. We need the base-3 logs of these values to subtract one from the other to see the length of the (3,4) range occupied by a match:

3.785578521428744 -  3.52371901428583 = .261859507142914

which becomes the next piece of the probability multiplied by 16.

When x is 4 plus a fraction, 3^x begins with 5 through F.
When x is 5 plus a fraction, 3^x begins with F, 1 or 2.
When x is 6 plus a fraction, 3^x begins with 2 through 8.

(log(7*16^2) - log(6*16^2)) / log(3) = .14031399558998

(The 16's are squared as we're now in the 3-hex-digit territory for 3^x.)

So the .14031399558998 becomes the next addend.

When x is 7 plus a fraction, 3^x begins with 8 through F or 1.
When x is 8 plus a fraction, 3^x begins with 1 through 4.
When x is 9 plus a fraction, 3^x begins with 4 through E.

(log(10) - log(9)) / log(3) = .0959032742893844, the next addend.

(Actually the powers of 16 cancel out via the subtraction of the logs.)

As you can see, the next one will be for digit C:

(log(13) - log(12)) / log(3) = .0728580123298948

and finally F:

(log(16) - log(15)) / log(3) = .058745493567895

.06640625
.261859507142914
.14031399558998
.0959032742893844
.07285801232989481
.058745493567895

Remember we must divide by 16 as this is the total length, on a number line of length 16, occupied by valid real numbers, x.

The probability for part (i) comes out to  .04350540830750427.

See the reply to this post as a correction to the above.

Edited on June 20, 2016, 9:58 pm
 Posted by Charlie on 2016-06-19 15:07:44 Please log in:

 Search: Search body:
Forums (4)