Suppose we draw a sample of $k$ out of $n$ numbered balls without replacement and get a sample of $N_1$ (unique) balls. We then replace all the balls in the urn and repeat the drawing a second time to get again $N_2$ (unique) balls.
We are interested in the set of balls that end up being drawn exactly once (over the course of the two experiments). It's clear that the probability, for one of the balls, of the event "being drawn exactly once" is
$$2k/n(1-k/n)$$
which is maximized at $k^*=n/2$.
Now consider the same experiment but with replacement and we look again for the value of $k$ (denoted now $\bar{k}^*$) that maximizes the frequency of the event "being drawn exactly once". Now, the expected number of distinct balls in each draw is $1-e^{-1}\approx0.632n$ and so I would have expected $\bar{k}^*=k^*/(1-e^{-1})\approx0.79n$. Running some simulations I get that the actual location of $\bar{k}^*$ seems to be much lower, probably between $0.65n$ and $0.7n$. I have a hard time understanding where is my mistake.
More generally (second question) I'm wondering what is the distribution function of the proportion of balls that are drawn exactly once in the second experiment (the one with replacements) as a function of $k$? Through numerical experimentations, I get the following curve ($n=100$):
EDIT
here is the R code to reproduce the example above:
fx02<-function(ll,n,k){
a1<-matrix(0,n,2)
a1[sample(1:n,k,replace=TRUE),1]<-1
a1[sample(1:n,k,replace=TRUE),2]<-1
sum(rowSums(a1)==1)/n
}
ss<-(1:60)*5 #The grid of values of k for which we'll compute the probability.
a4<-matrix(NA,length(ss),2)
for(i in 1:length(ss)){
a2<-ss[i]
a3<-c(lapply(1:1000,fx02,n=100,k=a2),recursive=TRUE);
a4[i,]<-c(a2,mean(a3))
}
plot(a4,xlab="k",ylab="frequency of distinct draw")