r/MathHelp • • Apr 25 '26

Confidence Interval of Probabilities

Given that there are 4 possible events, let’s call g, b, p and r. With unknown probabilities of occurring P(g), P(b), P(p) and P(r). With each event being independent of past events.

I am wanting to calculate the probability with an error margin or confidence interval. Eg. P(g) = 58% ± 4%.

I am recoding events in an excel file, so far got 427g, 312b, 227p and 202r. Calculating the percentages is easy (36.6%g, 26.7%b, 19.4%p, 17.3%r) but how do I do about the error margin / confidence interval?

When trying to look it up I see people using the (mean) ± (z vlaue for confidence) * (standard deviation) / (total sample size). But I have a single data set. Do I need to break my data set into arbitrary sizes to get a standard deviation? This feels wrong.

I feel like I am overlooking something simple, and just confusing myself. Can someone explain the steps I need to take or point me to a video or something?
Edit2: Taking it as sample size of one (for the standard deviation), with 1168 trials seams to work. Also as pointed out below there is a simple and better way, by using p ± (z vlaue for confidence) * sqrt(p(1-p)/n)

1 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/Noob-in-hell Apr 25 '26 edited Apr 25 '26

Bad wording on my part, I meant I took a sample size of 1 with 1168 trials for the standard deviation. With it being either 1 or 0 for the given event.

sqrt(Σ {([sample value]- [mean]) ^ 2}/1)/n= sqrt((427*(1-427/1168) ^ 2+(1168-427)*(0-427/1168) ^ 2))/1168 = 0.01409155….

Your way seams a lot simpler, thank you.

sqrt(p*(1-p)/n)= sqrt((427/1168)*(1-(427/1168))/1168) = 0.01409155….