fix some bugs in compute_data_sparseness
first some functions to compute conditional probability