覓語豢豌: [http]伎 覯伎 糾(Think Bayes), B. れ磯 讌 | 蟠覩 蟾 | 觜覩碁(http://www.kyobobook.co.kr/product/detailViewKor.laf?ejkGb=KOR&mallGb=KOR&barcode=9788968481147&orderClick=LAG&Kc=) p.21

蠏碁1 覦殊 30螳 豐貊貎 10螳螳 れ伎螻, 蠏碁2 覦殊れ 豐貊貎り 螳螳 20螳 れ . 襦 貎るゼ 讌 覦 貎れ. 蠏碁1 螳レ煙?

R code
prior <- c(0.5, 0.5)
names(prior) <- c("Bowl1", "Bowl2")
Bowl1 <- c(30, 10)
Bowl2 <- c(20, 20)
names(Bowl1) <- c("B", "C")
names(Bowl2) <- c("B", "C")

Lik <- c(Bowl1["B"]/sum(Bowl1), Bowl2["B"]/sum(Bowl2))
names(Lik) <- c("Bowl1", "Bowl2")

p1 <- (Lik["Bowl1"] * prior["Bowl1"]) / ((Bowl1["B"] + Bowl2["B"]) / sum(Bowl1 + Bowl2))
p2 <- (Lik["Bowl2"] * prior["Bowl2"]) / ((Bowl1["B"] + Bowl2["B"]) / sum(Bowl1 + Bowl2))
posterior <- c(p1, p2)
names(posterior) <- c("Bowl1", "Bowl2")

print(posterior)