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

Home > Probability
Sum Digit Concern (Posted on 2010-03-13) Difficulty: 3 of 5
For a positive integer P drawn at random between 2 (base ten) and 2001 (base ten) inclusively, determine the probability that the sum of the digits in the base-P representation of 2009 (base ten) is equal to 11 (base ten).

See The Solution Submitted by K Sengupta    
Rating: 4.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution showing full program with base conversion Comment 2 of 2 |

DEFDBL A-Z
DIM dg(100)
FOR p = 2 TO 2001
  n = 2009
  sod = 0
  psn = 0
  DO
    d = n MOD p
    dg(psn) = d
    psn = psn + 1
    sod = sod + d
    n = n \ p
  LOOP UNTIL n = 0
 
  IF sod = 11 THEN
   PRINT p;
   FOR i = psn - 1 TO 0 STEP -1
     IF dg(i) = 10 THEN
      PRINT "X";
     ELSE
      PRINT LTRIM$(STR$(dg(i)));
     END IF
   NEXT
   PRINT
  END IF
NEXT

No higher digit than that with value ten is possible, so the program uses X (as in the roman numeral) to represent that digit. (2009 is not divisible by 11, so it can't be just a single value-eleven digit followed by zeros.)

base representation
4     133121
7       5600
10      2009
223       92
334       65
667       38
1000      29
1999      1X

(list reformatted manually)

That's 8 possible hits out of 2000 possible choices, for a probability of 1/250.


  Posted by Charlie on 2010-03-13 13:14:21
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
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