# Sampling with replacement- or slightly different?

#### Peter1900

##### New Member
Hi, I'm looking for a probability distribution that describes a problem I have.

If I have a bag of blank paper slips of number N.
I choose one at random

If it is blank I colour it red and replace.
If it is already coloured I just replace it.

How form does the number of red slips (n) as a function of number of picks (as it approaches N)?
Obviously it grows fastest at the start when all the slips are blank and slows down as you try to get the few remaining.

It seems similar to sampling without replacement but in some sense there is a 'replacement'. or alteration.

Eventually I want to generalize to include three colours per round with an additional rule that I only colour with a certain probability which is different for the three colours.

Thanks for any help
Peter

#### fed2

##### Active Member
flavor is that of an urn model...see if that sparks you in some direction.
Urn problem - Wikipedia

(PS i don't know alot about urn models, just tellin' you what you gots here)

#### fed2

##### Active Member
I think coupons is darn close. 'cept you sort of have some coupons already selected from the get go, ie there are already some red balls=selected coupons.

#### katxt

##### Well-Known Member
The original problem started with all blanks... Even if that wasn't true, you could probably convert it to a smaller problem.

#### fed2

##### Active Member
oh it did start with all blank paper slips, for some reason thought it was mix. well i think it is case closed then pretty much.

#### Peter1900

##### New Member
Hi, thanks for the input. It does seem to be similar to Urn problems- I wasn't familiar with the term.

This Urn model with switching and replacement is the same
https://math.stackexchange.com/ques...rn-model-with-replacement-and-color-switching

You start with an urn of white balls and whenever you draw a white ball you switch it with a black ball and replace it. Should be possible to generalize to switching to three colours.

#### katxt

##### Well-Known Member
If you are into a little programming, it should be reasonably easy to write a recursive function P(a,b,c,n) where a, b and c are the number of colours A, B and C after n draws
P(a,b,c,n)=P(a-1,b,c,n-1)*p(choosing a at turn n-1)+P(a,b-1,c,n-1)*p(choosing b at turn n-1)+P(a,b,c-1,n-1)*p(choosing c at turn n-1)+P(a,b,c,n-1)*p(blank at turn n-1) with some suitable stopping points

#### katxt

##### Well-Known Member
On reflection, although the last post will work, each call call itself 4 times on the level below so the stack will be enormous. It will take forever when you get n up near 20.
It should be ok for just one colour.