場景:
問題:
GNU R:
# 供應商供料率
VendorSupplyRate <- c(0.65, 0.35)
# 供應商不良率
VendorDefectRate <- c(0.2, 0.5)
# 供應商供料率-不良率積
VendorSupplyDefectRate <- VendorSupplyRate * VendorDefectRate
# 供應商供料率-不良率和
VendorSupplyDefectRateTotal <- sum(VendorSupplyDefectRate)
# 供應商整體不良率
VendorSupplyDefectRateOfAll <- VendorSupplyDefectRate / VendorSupplyDefectRateTotal
print(VendorSupplyDefectRateOfAll)