Your notations are too complicated and make it harder to see a solution. Your problems mix problems known as: The Birthday Paradox The Classical Occupancy Problem Ion Saliu’s Paradox of N Trials You can find solutions and also SOFTWARE here: http://saliu.com/monty-paradox.html http://saliu.com/birthday.html http://saliu.com/theory-of-probability.html