The Exact Inference of Beta Process and Beta Bernoulli Process From Finite Observations