bnct function

data from Exercise 7.7, p223