Let X be the number of matches in your iCloud library. Assuming each photo's probability of a match is independent of other photos in the library (shaky assumption), then X ~ Binomial(n, p), where n is the number of photos in the library, and p is the probability of match.
The free plan, which gives 5GB, will store up to 2500 photos taken on a 5 megapixel camera. Assuming that's the most common library size, n = 2500.
So we need to solve for p given P(X ≥ 30) = 1/trillion and X ~ Binomial(2500, p). Notice P(X ≥ 30) = 1 - P(X ≤ 29), and we can use the CDF formula to get 1 - P(X ≤ 29) = 1 - sum_{k=0}^{29} of (2500 choose k) (1 - p)^k p^(2500 - k).
Set that equal to 1/trillion and solve for p. I don't have an easy way to compute that, unfortunately.
[0]: https://en.wikipedia.org/wiki/Binomial_distribution#Cumulati...