# --- Paso 1: indices de capacidad ---
EI <- 19.8; ES <- 20.2; xbar <- 19.9; s <- 0.1
Cp <- (ES - EI) / (6 * s)
Cps <- (ES - xbar) / (3 * s)
Cpi <- (xbar - EI) / (3 * s)
Cpk <- min(Cps, Cpi)
cat("Cp =", Cp, "\nCpk =", Cpk, "\n")
# --- Paso 2: limites reales ---
LR <- c(xbar - 3*s, xbar + 3*s)
cat("Limites reales:", LR, "\n")
# --- Paso 3: grafico de capacidad ---
x <- seq(xbar - 4*s, xbar + 4*s, length.out = 400)
y <- dnorm(x, xbar, s)
plot(x, y, type = "l", lwd = 2, col = "steelblue",
main = "Capacidad del proceso - Bomba de gasolina",
xlab = "Volumen dispensado (l)", ylab = "Densidad")
abline(v = c(EI, ES), col = "red", lwd = 2, lty = 2)
abline(v = xbar, col = "darkgreen", lwd = 2)
legend("topright", legend = c("EI/ES", "x̄"), col = c("red","darkgreen"), lty = c(2,1), lwd = 2)
To embed this project on your website, copy the following code and paste it into your website's HTML: