Take a gamble

Let S S be the set of all 21-digit positive integers that can be composed from the digits 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 1,2,3,4,5,6,7,8,9 (repetition is of course allowed, but not all digits must necessarily appear). Let N N be an element of S S chosen uniformly at random, and let A A be the product of all the digits of N N .

If P P is the probability that A A is divisible by 21 21 , then find 1000 P \lfloor 1000P \rfloor .


The answer is 915.

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

For the product A A to be divisible by 21 21 at least one of the 21 digits must be divisible by 3 3 , i.e., must be one of 3 , 6 , 9 3,6,9 , and at least one of the digits must be 7 7 . It will be easier though to first count the number of elements of S S that are n o t not divisible by 21 21 .

There are 5 21 5^{21} elements of S S that have no digits that are 7 7 or are divisible by 3 3 , (i.e., those 21-digit integers formed using the digits 1 , 2 , 4 , 5 , 8 1,2,4,5,8 ).

Next, as there are 8 21 8^{21} elements that do not have 7 7 as a digit, there are 8 21 5 21 8^{21} - 5^{21} elements that have at least one digit that is a multiple of 3 3 but have no 7 7 .

Finally, as there are 6 21 6^{21} elements that have none of 3 , 6 , 9 3,6,9 as digits, there are 6 21 5 21 6^{21} - 5^{21} elements that have none of 3 , 6 , 9 3,6,9 as digits but do have at least one 7 7 .

Thus there are 5 21 + ( 8 21 5 21 ) + ( 6 21 5 21 ) = 8 21 + 6 21 5 21 5^{21} + (8^{21} - 5^{21}) + (6^{21} - 5^{21}) = 8^{21} + 6^{21} - 5^{21} elements of S S that are not divisible by 21 21 . As S S has 9 21 9^{21} elements in total, the probability P P that the product A A associated with a randomly chosen elements N N of S S is divisible by 21 21 is

P = 9 21 ( 8 21 + 6 21 5 21 ) 9 21 = 0.915509802... P = \dfrac{9^{21} - (8^{21} + 6^{21} - 5^{21})}{9^{21}} = 0.915509802... , and so 1000 P = 915 \lfloor 1000P \rfloor = \boxed{915} .

Why u give 21.it becomes too big

Kushal Bose - 4 years, 1 month ago

Log in to reply

Well, I guess I could have gone with, say, 10-digit numbers, but that would still require a calculator at the end. I just liked the repetition of 21, i.e., 21-digit numbers whose digit product is divisible by 21.

Brian Charlesworth - 4 years, 1 month ago

Log in to reply

Yeah that's a matching

Kushal Bose - 4 years, 1 month ago

Log in to reply

@Kushal Bose For N N -digit numbers the probability is P = 1 ( 8 9 ) N ( 2 3 ) N + ( 5 9 ) N P \; = \;1 - \big(\tfrac89\big)^N - \big(\tfrac23\big)^N + \big(\tfrac59\big)^N and we can work this out for much larger values of N N than 21 21 .

Mark Hennings - 4 years, 1 month ago

Log in to reply

@Mark Hennings We have to use calculators .Without using how it can be done ?

Kushal Bose - 4 years, 1 month ago

Log in to reply

@Kushal Bose So what is wrong with using a calculator? I thought you were concerned because numbers like 9 N 9^N were getting large - 9 105 9^{105} causes a math overflow on most calculators, but there is no problem calculating ( 8 9 ) 105 \big(\tfrac89\big)^{105} .

Mark Hennings - 4 years, 1 month ago

Log in to reply

@Mark Hennings Yes calculating fractions is not a problem at all

Kushal Bose - 4 years, 1 month ago

I used a c++ program to evaluate that expression for P ;)

Sriram G - 4 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...