probability computation, P(n|d) and P(d|n)