# Thread: Expectancy of number of trials

1. ## Re: Expectancy of number of trials

Here is some R code to run random samples. It gives pretty close to your formula in post # 12.

triesToGetAllQuartets <- function() {
quartets <- rep(1L,13)
index <- 0
while ( any(quartets) ) {
index <- index + 1
hand <- sample(deck,5) %% 13
hand <- sort(hand)
if ( hand[1] == hand[4] ) quartets[hand[1]+1] <- FALSE
if ( hand[2] == hand[5] ) quartets[hand[2]+1] <- FALSE
}
return (index)
}

2. ## Re: Expectancy of number of trials

Originally Posted by Plato
No help from here. I simply have no idea what you all have been doing.
Because the question seems to me to be asking the same as the coupon collector problem.
Therefore, I must not understand the setup.
Looks like you understood it better than I did because that post gives the same solution that the OP did in post #12.

3. ## Re: Expectancy of number of trials

Just getting ONE poker 5card hand with 4same has very low probability;
now imagine this "monster" !!

Page 2 of 2 First 12