139Mathematics · Counting and probability

Binomial interval probability

Binomial interval probability

There are n independent trials, each with the same success probability p. Let X count successes. Find P(L≤X≤U), including both endpoints.

  • 158 bytes
  • COMP mode
01

Worked examples

Example 1

Original exercise 1. There are n independent trials, each with the same success probability p. Let X count successes. Find P(L≤X≤U), including both endpoints. Data: A=n, count = 4; B=p, probability = 0.7; C=L, lower bound = 0; D=U, upper bound = 3.

  1. (a)Calculate all requested quantities in the stated order. Output order: P(L≤X≤U).
Answer
P(0≤X≤3)=7599/10000=0.7599.
Standard solution (without a calculator)
  1. Build the mathematical model and substitute the data. X∼Bin(n,p).
  2. Written solution: X∼Bin(4,7/10); 1−p=3/10.
  3. P(X=0)=C(4,0)(7/10)^0(3/10)^4=81/10000; P(X=1)=C(4,1)(7/10)^1(3/10)^3=189/2500; P(X=2)=C(4,2)(7/10)^2(3/10)^2=1323/5000; P(X=3)=C(4,3)(7/10)^3(3/10)^1=1029/2500.
  4. P(0≤X≤3)=(81/10000)+(189/2500)+(1323/5000)+(1029/2500)=7599/10000.
  5. Retain exact fractions in written work; round only the final answer.
Do it on the calculator

Example 2

Original exercise 2. There are n independent trials, each with the same success probability p. Let X count successes. Find P(L≤X≤U), including both endpoints. Data: A=n, count = 4; B=p, probability = 0.6; C=L, lower bound = 2; D=U, upper bound = 4.

  1. (a)Calculate all requested quantities in the stated order. Output order: P(L≤X≤U).
Answer
P(2≤X≤4)=513/625=0.8208.
Standard solution (without a calculator)
  1. Build the mathematical model and substitute the data. X∼Bin(n,p).
  2. Written solution: X∼Bin(4,3/5); 1−p=2/5.
  3. P(X=2)=C(4,2)(3/5)^2(2/5)^2=216/625; P(X=3)=C(4,3)(3/5)^3(2/5)^1=216/625; P(X=4)=C(4,4)(3/5)^4(2/5)^0=81/625.
  4. P(2≤X≤4)=(216/625)+(216/625)+(81/625)=513/625.
  5. Retain exact fractions in written work; round only the final answer.
Do it on the calculator

Example 3

Original exercise 3. There are n independent trials, each with the same success probability p. Let X count successes. Find P(L≤X≤U), including both endpoints. Data: A=n, count = 5; B=p, probability = 0.4; C=L, lower bound = 2; D=U, upper bound = 4.

  1. (a)Calculate all requested quantities in the stated order. Output order: P(L≤X≤U).
Answer
P(2≤X≤4)=408/625=0.6528.
Standard solution (without a calculator)
  1. Build the mathematical model and substitute the data. X∼Bin(n,p).
  2. Written solution: X∼Bin(5,2/5); 1−p=3/5.
  3. P(X=2)=C(5,2)(2/5)^2(3/5)^3=216/625; P(X=3)=C(5,3)(2/5)^3(3/5)^2=144/625; P(X=4)=C(5,4)(2/5)^4(3/5)^1=48/625.
  4. P(2≤X≤4)=(216/625)+(144/625)+(48/625)=408/625.
  5. Retain exact fractions in written work; round only the final answer.
Do it on the calculator
02

When to use it

There are n independent trials, each with the same success probability p. Let X count successes. Find P(L≤X≤U), including both endpoints.

Input order

  • A=n, count
  • B=p, probability
  • C=L, lower bound
  • D=U, upper bound
  • Every displayed input is required unless a blank is explicitly specified. Empty EXE keeps a stored value, whereas typing 0 replaces it with zero. The listed domain conditions must be checked even when the program does not test all of them.

Output order

  • P(L≤X≤U)
  • Record the value and press EXE.
  • The program has ended. Press AC to leave; EXE runs it again.

Conditions and limitations

  • n,L,U∈ℤ; 0≤L≤U≤n≤20; 0≤p≤1.
  • n=0 ⇒ L=U=0 ⇒ P=1.
  • p=0 ⇒ P=[L=0]; p=1 ⇒ P=[U=n].
  • Math ERROR: n,L,U∉ℤ / n>20 / L>U / U>n / p∉[0,1].
  • Every displayed input is required unless a blank is explicitly specified. Empty EXE keeps a stored value, whereas typing 0 replaces it with zero. The listed domain conditions must be checked even when the program does not test all of them.
  • Use consistent units throughout.
  • Finite precision can lose small differences between large numbers or probabilities extremely near 0 or 1. An error marker is never a valid answer.

Sign in to unlock the full programme

Checking access…

The programme code and appendix unlock together.

Checking access…

Sign in to unlock the full programme

Checking access…

The programme code and appendix unlock together.