wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> medium >> zeroless number
(Message started by: Christine on Aug 19th, 2012, 1:04pm)

Title: zeroless number
Post by Christine on Aug 19th, 2012, 1:04pm
What is the probability that a n-digit number will not have the digit 0 ?

Is it (9/10)^(n-1) ?

Title: Re: zeroless number
Post by towr on Aug 19th, 2012, 10:44pm
It is if n > 1 and you don't allow leading zeroes; it's not true for single digit numbers because there the probability is 9/10 instead of 1.

Title: Re: zeroless number
Post by playful on Aug 20th, 2012, 2:12pm
Unless I'm missing something, the exponent is n (rather than n-1).
1 digit => p = 0.9 ^ 1
2 digits => p = 0.9 ^ 2

Title: Re: zeroless number
Post by peoplepower on Aug 20th, 2012, 4:44pm

on 08/20/12 at 14:12:10, playful wrote:
Unless I'm missing something, the exponent is n (rather than n-1).
1 digit => p = 0.9 ^ 1
2 digits => p = 0.9 ^ 2

If we were counting occurrences of any other digit than 0, then you would be correct. But, as towr pointed out, if we do not have leading zeros in our number then the first digit is certainly nonzero and the remaining n-1 digits have the 1/10 probability of being zero. The exception is the convention that the single digit number zero is written 0 rather than being treated as a zero-digit number, which is why when n=1 the probability is 9/10.

Title: Re: zeroless number
Post by playful on Aug 20th, 2012, 5:18pm
Ah... Yes, of course. We won't allow 07 etc.
Thanks for waking me up.  ;D



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board