model {
theta ~ dbeta(3, 27) # prior distribution
Y ~ dbin(theta, 20) # sampling distribution
P6 <- step(Y - 5.5) # =1 if y >= 6, 0 otherwise
}

   node   mean   sd   MC error   2.5%   median   97.5%   start   sample
   P6   0.04058   0.1973   6.578E-4   0.0   0.0   1.0   1   100000
   Y   1.998   1.708   0.005216   0.0   2.0   6.0   1   100000
   theta   0.1001   0.05416   1.716E-4   0.0218   0.09115   0.2289   1   100000