rm(list=ls(all=TRUE))
setwd("C:/Book01")
cat("\014")
options(digits=10)
options(scipen=99)

# s = number of success
# f = number of failure
# d = sample size
x=seq(0,6,by=1)
Prob=function(a,b,s,f,d) phyper(b,s,f,d)-phyper(a-1,s,f,d)
Prob(1,2,10,8,6)
Prob(1,3,10,8,6)
Prob(2,4,10,8,6)
Prob(1,6,10,8,6)
