Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: Testing random Date: Wed, 17 Jun 2015 07:41:20 +0300 Organization: A noiseless patient Spider Lines: 25 Message-ID: References: <87oaksowwg.fsf@Equus.decebal.nl> <1451048.pW9z17ilMA@PointedEars.de> <3158703.Lr4HFMbMOd@PointedEars.de> <1656356.OjxBvjpJ5d@PointedEars.de> <5515034.V7dcXEWAvK@PointedEars.de> <88ba163e-74f4-40fa-ab3e-1feeb051b961@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="10297"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186bJFV8yf7lCvTTmv5vByUYwQBqUCJY6A=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:apHmcjeAl60JFtFUhT1WqAZPT/o= sha1:ThbDgb2et0YLDQLjZh1g2CLy5ww= Xref: csiph.com comp.lang.python:92724 Ned Batchelder writes: > Thomas: let's say I generate streams of N digits drawn randomly from > 0-9. I then consider the probability of a zero *never appearing once* > in my stream. Let's call that P(N). Do you agree that as N > increases, P(N) decreases? In probability theory, that could be phrased as the probability that N unknown digits d_1, ..., d_N are all positive, assuming the digits are independent (so learning one digit doesn't reveal anything about any other digit), and for each d_k, the probability p_k of having a positive digit is the same. Mathematicians often abbreviate these assumptions as "i.i.d" for "independent" and "identically distributed". Also assuming uniform distributions, p_1 = p_2 = ... = p_N = 9/10. P(d_k > 0 for k = 1, ..., N) = P(d_1 > 0 and d_2 > 0 and ... and d_N > 0) = (by independence) P(d_1 > 0) * P(d_2 > 0) * ... * P(d_N > 0) = p_1 * p_2 * ... * p_N = (by identical uniform distribution) (9/10)^N In mathematics, (9/10)^N decreases as N increases, so one should indeed agree. Using more impressive notation and terminology correctly will not change the analysis.