Testwiki:Reference desk/Archives/Mathematics/2012 February 1

From testwiki
Jump to navigation Jump to search

Template:Error:not substituted

{| width = "100%"

|- ! colspan="3" align="center" | Mathematics desk |- ! width="20%" align="left" | < January 31 ! width="25%" align="center"|<< Jan | February | Mar >> ! width="20%" align="right" |Current desk > |}

Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


February 1

Determining probability quickly

I've got a binomial distribution with unknown probability p (if it matters, it's somewhere around 0.01). If I estimate the value of p the obvious way by running a bunch of trials and dividing the number of successes by the number of trials, it takes a while: the quality of the estimate increases as the square of the number of trials. Is there a way to speed things up? --Carnildo (talk) 21:35, 1 February 2012 (UTC)

I don't think there's a general way. However, depending on what you are measuring the probability of, there may indeed be a short cut. Let's say you were finding the probability of tossing heads seven times in a row. You could figure that as 7 independent events each with a 0.5 probability, or P = (1/2)7 = 1/128. StuRat (talk) 21:55, 1 February 2012 (UTC)
... but that wouldn't change the number of trials needed to reach a given confidence in the conclusion unless there is some assumption you can reasonably make about the distribution that narrows down the possibilities. Dbfirs 23:14, 1 February 2012 (UTC)

See Bayesian inference#Posterior distribution of the binomial parameter. The mean value of p is not the number of successes i divided by the number of trials n, but rather μ=(i+1)/(n+2), and the standard deviation is σ=√(μ(1−μ)/(n+3)). So if n=7 and i=0 you get p ≈ μ±σ = 0.111111±0.0947559. This may also be written p=0.11(9), see concise notation#Measurements. Bo Jacoby (talk) 11:49, 2 February 2012 (UTC).

That...doesn't change my numbers very much. With the data I've got so far, it gives a p of 0.0106(26) rather than 0.0100(25), and better values are still O(n^2). --Carnildo (talk) 03:00, 3 February 2012 (UTC)

Yes, but why not use the correct formula? The case n=i=0 gives p=0.5000(2887), which makes sense, while your formula, p=i/n=0/0, does not make sense. Solving the equations μ=i+1n+2 and σ=μ(1μ)n+3 gives n=μ(1μ)σ23 and i=μ2(1μ)σ2μ1. Neither 0.0106(26) nor 0.0100(25) give integer values of n and i. There is no way to speed things up. Bo Jacoby (talk) 15:05, 3 February 2012 (UTC).