# How surprised am I by N events in T trials, given a probability p?

My hypothesis is that the probability of an event occurring is p. What is the probability that my hypothesis is correct, given that it occurred N times in T independent trials? Or, put another way, how surprised am I that it occurred N times in T independent trials?

The reason I want to know is that I have several data series (1000s of products), with N (complaints) given for each month. p (number of complaints / complaints gathered) is supposed to be constant for each series, so I want to detect when this might not be the case by estimating p from the previous months and sorting them by how surprised I am for the N for the latest month. Going from 1 to 2 is not as surprising as going from 100 to 200.

I belive this is related to the binomial distribution or possibly the beta-binomial distribution, but it was a long time since I studied math.

If you have a better suggestion for how to do the "surprise-measurement" for my series, I would love to hear that too.

• Will you (or do you want to) also be surprised by N going down? Commented Mar 25, 2013 at 12:11
• Nah, that does not matter Commented Mar 25, 2013 at 12:26
• Are you aware of the two main approaches to this question, based either on likelihood functions or on Bayesian priors?
– Did
Commented Mar 25, 2013 at 13:20
• I know how I could do a discrete computational Bayesian estimate, by giving a prior of what I think the probability is for the "true p" being 0.01, 0.02, etc. I could then update these 100 probabilities for each binary trial and get a new distribution for what p should be. I think I can do this analytically instead of discretely, using the Beta(?) function as my prior. Is this what you mean? I don't remember how you use likelihood functions, but I will look it up! Commented Mar 25, 2013 at 14:00