Post Reply 
(11C) Probability of No Repetitions
01-11-2020, 01:46 AM (This post was last modified: 01-11-2020 09:02 PM by Albert Chan.)
Post: #2
RE: (11C) Probability of No Repetitions
(01-10-2020 12:42 PM)Gamo Wrote:  Probability of No Repetitions in a Sample

Suppose a sample of size n is drawn with replacement from population
containing m different objects. Let P be the probability that there are no
repetitions in the sample, then

P = [1- (1/m)][1- (2/m)]....[1- (n-1)/m]

This is similar to thread (42S) Probability of Same Birthday Day

We can do approximation the same way: products of terms = exp of sum of ln(term)
Sum is approximated by integral with correction (bolded expression below)

If we let u = 1-x/m, we have x = m-m*u

XCas> f := ln(1-x/m)
XCas> expand(subst(int(f) - f/2 + diff(f)/12, x = m-m*u))   → m*u - 1/(12*m*u) - ln(u)/2 - m*u*ln(u)
XCas> g(m,u) := -1/(12*m*u) - ln(u)*(0.5 + m*u) + m*u       // ≈ sum formula
XCas> p(m,n) := exp(g(m, 1.-n/m) - g(m, 1.-1/m))                 // ≈ product(1-x/m, x=1 .. n-1)

XCas> p(365, 4)       → 0.9836440875
XCas> p(365,23)      → 0.4927027657
XCas> p(365,48)      → 0.03940202712
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(11C) Probability of No Repetitions - Gamo - 01-10-2020, 12:42 PM
RE: (11C) Probability of No Repetitions - Albert Chan - 01-11-2020 01:46 AM



User(s) browsing this thread: 1 Guest(s)