Arthur D. answered 06/20/15
Forty Year Educator: Classroom, Summer School, Substitute, Tutor
Arthur D.
06/21/15
David W.
As you wrote, “… there are 9^7=4,782,969 7-digit numbers with repetition.” These numbers have digits from the set {1,2,3,4,5,6,7,8,9} [ note: no zeros included; repetition allowed]. I easily can think of this as a base-9 number system using !@#$%^&*( as the digits. So, numbers range from !,!!!,!!! to (,(((,((( and there are (,(((,((( [base 9] or 4,782,969 [base 10] of them. Also, my computer program had variables going from 1 to 9 in 7 nested loops [no zeros] and then checked whether the sum of the digits was evenly divisible by 9 [all in decimal].
THE REST WAS EASY! Thinking about your comment, I realize that the value of (NUMBER MOD 9) cycles repeatedly and forms a uniform probability distribution. [p.s., also for fun, my computer verified it as 9 sets of 531,441 in only a few seconds.] There are 1/base of these values with a frequency of netrange/base for each remainder.
--d.w.
06/21/15
David W.
06/21/15
David W.
1 0
2 0
3 0
4 0
5 0
6 0
7 1
8 7
9 28
10 84
11 210
12 462
13 924
14 1716
15 3003
16 4998
17 7959
18 12180
19 17976
20 25662
21 35526
22 47796
23 62601
24 79926
25 99582
26 121191
27 144186
28 167826
29 191226
30 213402
31 233331
32 250026
33 262626
34 270466
35 273127
36 270466
37 262626
38 250026
39 233331
40 213402
41 191226
42 167826
43 144186
44 121191
45 99582
46 79926
47 62601
48 47796
49 35526
50 25662
51 17976
52 12180
53 7959
54 4998
55 3003
56 1716
57 924
58 462
59 210
60 84
61 28
62 7
63 1
64 0
The probability is 531441 / 4782969 is still 1/9. So, the counters were o.k., but the rationale needs revision.
06/20/15