If I have an instrument system with 4 components and can function of at least two of them are working. Each component independently works with probability of 0.9.
How I can compute the probability that the system will function, using Rstudio functions?
They're basically the same, except pbinom gives the cumulative probabilities. You're less likely to make mistakes using dbinom.
# probabilities of x = 0-4 successes out of size = 4
size = 4
prob = 0.9
x <- 0:size
set.seed(123)
# probability density
d <- dbinom(x = x, size = size, prob = prob)
plot(x, d, main = "Probability of x successes")
# cumulative probability density
p <- pbinom(q = x, size = size, prob = prob)
plot(x, p, main = "Probability of x successes or less")
# inverse function
q <- qbinom(p = (0:100)/100, size = size, prob = prob)
plot(q, (0:100)/100, main = "Inverse cumulative density function")
# generate random numbers
r <- rbinom(n = 10000, size = size, prob = prob)
hist(r, main = "10000 Samples")