If the probability that an event will occur is p and the probability that it…