Whose your daddy?

Attachments

  • IMG_1876.jpeg
    IMG_1876.jpeg
    350.8 KB · Views: 32
Thus, the probability of achieving at least one occurrence of 10 consecutive successes in 100 trials with a success probability of 0.3 is approximately 0.000537, or 0.0537%.

See, AI really is good for something.
Looks like another AI hallucination. Calculating the value directly and running a Monte Carlo simulation both provide approximately the same answer, different from what your queried AI provided.

Estimate from Monte Carlo simulation (10,000,000 reps): 0.0003647, or 0.03647%.
Calculated directly, as a Markov process: 0.0003778577, or 0.03778577%.

That being said, I messed up when I asked the question. I meant to ask the probability of stringing together five, not ten, break and runs. The methodology to find the solution is the same, but it's more interesting with five, because the probability of success is much higher than the probability of stringing together ten break and runs.

Here is the R code to use a Markov process to calculate the probability of achieving five consecutive break and runs:
Code:
# Solve as Markov process

# create function to raise a matrix to nth power
mat2pow = function( mat, pow ) {
    # Verify mat is square matrix
    if (nrow( mat ) != ncol( mat )) return( "Error: Specified matrix is not a square matrix.")
    # Verify pow is an integer
    if (as.integer( pow ) != pow) return( "Error: Specified power not an integer." )
 
    pow = as.integer( pow )
 
    # Zeroth power of a square matrix is the identity matrix of the same dimensions.
    if (pow == 0L) return( diag( 1, nrow = nrow( mat ) ) )
 
    # First power of a square matrix is that square matrix.
    if (pow == 1L) return( mat )
 
    # Raise matrix to non-trivial power:
    pmat = mat
    for (i in 2:pow) pmat = pmat %*% mat
    return( pmat )
}

# Create variables for generalization
attempts = 100L
target = 5L
probOfSuccess = 0.3

probOfFailure = 1 - probOfSuccess


# Create probability matrix
probMat = matrix( 0, nrow = target + 1L, ncol = target + 1L )
probMat[ 1:target, 1 ] = probOfFailure
probMat[ target+1L, target+1L ] = 1
for (i in 1:target) {
    probMat[ i, i+1 ] = probOfSuccess
}

# Raise probability matrix to appropriate power,
# where the appropriate power is number of attempts:
inMaxAttempts = mat2pow( probMat, attempts )

# Print probability
print( inMaxAttempts[ 1, target+1 ] )


Here's the R code to run a Monte Carlo simulation to estimate the probability:
Code:
# Using Monte Carlo Simulation:

attempts = 100L
target = 5L
probOfSuccess = 0.30
numSim = 10000000L

probOfFailure = 1 - probSuccess

simulateTrial = function() {
    streak = 0L
    for (shot in 1:attempts) {
        if (runif( 1 ) > probOfFailure) {
            streak = streak + 1L
            if (streak >= target)
            return( TRUE )
        } else streak = 0L
    }
    return( FALSE )
}

set.seed( 3141592 )

estimate = mean( replicate( numSim, simulateTrial() ) )
print( estimate )

Both blocks of code have been generalized, so only the starting value attempts needs to be changed in each block to calculate the probability of a 10-pack. The probability of success (probOfSuccess) and total number of racks (attempts) can be similarly changed.

For what it's worth, it's a deceptively difficult problem to solve.

Edit: For the 5-pack version of the problem the solution is
Bob strings together a 5-pack with about 15.26% probability, so buying into the action would cost about -600/+500, give or take.
.
 
Last edited:
learn to it it on a piece of paper. or on a calculator. then you know how to do probability.

give a man a fish and he eats for a day.

teach him how to fish and he starves:) or eats for his lifetime..
 
learn to it it on a piece of paper. or on a calculator. then you know how to do probability.

give a man a fish and he eats for a day.

teach him how to fish and he starves:) or eats for his lifetime..
No one is solving that problem on paper. :rolleyes:

For the 5-pack version, there are 3168 individual binary operations that must be performed perfectly. A single mistake ruins the calculation. For the 10-pack version, that number jumps to 20,328 individual binary operations, all of which must be perfect. (I'm assuming an algorithm more efficient than the one I wrote, which does over 12x as many calculations as necessary, but was faster to write.) Matrix multiplication is extremely tedious. That means when using pencil and paper, the whole process has to be repeated (at least once) to make sure the final results are identical.

When it comes to statistics, fluency in the R programming language is the equivalent of knowing how to fish. It was designed by statisticians, for statisticians working on statistics problems. :geek:
 
Last edited:
Define intelligent
I’m amused? The dictionary initial AI response is
Oh no! I probably won't get no more than 8 or 9 hours
sleep tonight because of this news. :sleep:
I apologize, if you lose sleep, please let me know. I’ll record a rendition of a lullaby over “Helter Skelter” to bring you relief. That is if you can find a memorex tape player? I’m into those new Laser Discs, no VHS or CD’s for Me. Betamax, far superior product, porn could produce VHS cheaper. Priorities!,
 
Back
Top