Buscar

Using the binomial distribution in Python, what is the probability of having more than 2 successes in 12 trials with a success rate of 0.05? The p...

Using the binomial distribution in Python, what is the probability of having more than 2 successes in 12 trials with a success rate of 0.05?

The problem involves a binomial distribution with parameters n=12 and p=0.05.
The probability of having more than 2 successes is equivalent to P(X > 2), where X is the number of successes.
The function binom.sf(x, n, p) can be used to calculate the probability of having more than x successes in n trials with a success rate of p.

Essa pergunta também está no material:

Exercicios Distriuicao Binomial
4 pág.

Probabilidade e Estatística Universidade Estácio de SáUniversidade Estácio de Sá

💡 1 Resposta

User badge image

Ed Verified user icon

Para calcular a probabilidade de ter mais de 2 sucessos em 12 tentativas com uma taxa de sucesso de 0,05 usando a distribuição binomial em Python, você pode usar a função `binom.sf(x, n, p)` do pacote `scipy.stats`. Nesse caso, você precisa calcular `1 - binom.sf(2, 12, 0.05)`. Aqui está um exemplo de código: ```python from scipy.stats import binom n = 12 p = 0.05 x = 2 probabilidade = 1 - binom.sf(x, n, p) print(f"A probabilidade de ter mais de 2 sucessos em 12 tentativas é de aproximadamente {probabilidade:.4f}") ``` Isso retornará a probabilidade de ter mais de 2 sucessos em 12 tentativas com uma taxa de sucesso de 0,05.

0
Dislike0

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais