I roll a fair die and write the accrued sums,(e.g. (1,3,6,2,2...)=>(1,4,10,12,14...)) - after a while I let the software to continue generation of the series' members.
What is the probability that my 7-digit phone number makes the list?
The number of compositions of an integer N made up of exactly K integer parts, each of which is no greater than M, is as follows (I apologize in advance for the formatting, this won't be pretty):
Let [n,k] indicate "n choose k", i.e. the binomial coefficient.
sum from i = 0 to floor((N-K)/M):
(-1)^i * [N-1-iM,K-1] * [K,i]
Of course, for a given N you'd want to repeat this for all possible values of K from 1 to N, and for each of those values you'd want to multiply it by the value of (1/6)^K. Then you sum all of those values and you have the probability.
Easy, no? :)
Later tonight I'll try to write up a simple program to compute these values to make sure they agree with Charlie's... I can't imagine it would be easy to solve it in this form for a 7-digit number, though.
Posted by tomarken
on 2014-03-28 16:14:54