Computing probability involving the addition rule using a two-way frequency