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

Home > Probability
Delicate Divisibility (Posted on 2010-10-19) Difficulty: 3 of 5
For a positive base ten integer of the form ABCD drawn at random between 1111 and 9999 inclusively, determine the probability that ABCD is divisible by each of AB, AC, AD, BD and CD; but, not divisible by BC.

Note: Each of the letters in bold represents a digit from 1 to 9, whether same or different.

No Solution Yet Submitted by K Sengupta    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution by computer | Comment 3 of 7 |

FOR a = 1 TO 9
FOR b = 1 TO 9
 ab = a * 10 + b
FOR c = 1 TO 9
 ac = a * 10 + c
 bc = b * 10 + c
FOR d = 1 TO 9
 ad = a * 10 + d
 bd = b * 10 + d
 cd = c * 10 + d

 abcd = ab * 100 + cd
 IF abcd MOD ab = 0 THEN
 IF abcd MOD ac = 0 THEN
 IF abcd MOD ad = 0 THEN
 IF abcd MOD bd = 0 THEN
 IF abcd MOD cd = 0 THEN
 
  IF abcd MOD bc <> 0 THEN
    PRINT abcd
    hitCt = hitCt + 1
  END IF

 END IF
 END IF
 END IF
 END IF
 END IF

 ct = ct + 1

NEXT
NEXT
NEXT
NEXT

PRINT hitCt; "/"; ct; "="; hitCt / ct

finds

 1995
 2184
 3774

and
 3 / 6561 = 4.572474E-04

as there are 9^4 = 6561 numbers tested of which only 3 satisfy the criteria, and 3/6561 = 1/2187 ~= .0004572474.


  Posted by Charlie on 2010-10-19 19:07:05
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (17)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information