In general you will need the multinomial distribution.

Let be the number of times you have ridden in for the -th cab, .

Then

You want to calculate

Now you have two ways to count this. First is to use De Morgan's law:

Then for the latter probability, you know you just need to consider only.

To enumerate that, note that in , there must be

2's, 1's and 0's,

Therefore we have:

and can calculate accordingly.

Second way is to use inclusive-exclusive principle, which allow you to obtain an alternating series, and you may truncate the series as an upper/lower bound when you have calculate enough precision.