177Mathematics · Counting and probability

First Success: Exact and Cumulative Probabilities

First Success: Exact and Cumulative Probabilities

Enter the marked-token count S and unmarked-token count F separately. For uniform draws without replacement, find the probability of first success exactly at draw k and by draw k.

  • 181 bytes
  • COMP mode
01

Worked examples

Example 1

A box contains S marked and F unmarked tokens. Draw uniformly without replacement. T is the draw of the first marked token. Find P(T=k) and P(T≤k); explain any impossible event. Give exact fractions and four-place decimals. S=4; F=7; k=2.

Answer
P(T=k)=14/55≈0.2545; P(T≤k)=34/55≈0.6182
Standard solution (without a calculator)
  1. Build the mathematical model and substitute the data.
  2. P(T=2)=(7/11)(4/10)=14/55
  3. P(T≤2)=1−C(7,2)/C(11,2)=34/55
  4. Combine the preceding results to obtain the answer.
Do it on the calculator

Example 2

A box contains S marked and F unmarked tokens. Draw uniformly without replacement. T is the draw of the first marked token. Find P(T=k) and P(T≤k); explain any impossible event. Give exact fractions and four-place decimals. S=3; F=5; k=1.

Answer
P(T=k)=3/8≈0.3750; P(T≤k)=3/8≈0.3750
Standard solution (without a calculator)
  1. Build the mathematical model and substitute the data.
  2. P(T=1)=S/(S+F)=3/8=3/8
  3. P(T≤1)=P(T=1)=3/8
  4. Combine the preceding results to obtain the answer.
Do it on the calculator

Example 3

A box contains S marked and F unmarked tokens. Draw uniformly without replacement. T is the draw of the first marked token. Find P(T=k) and P(T≤k); explain any impossible event. Give exact fractions and four-place decimals. S=2; F=2; k=4.

Answer
P(T=k)=0≈0.0000; P(T≤k)=1≈1.0000
Standard solution (without a calculator)
  1. Build the mathematical model and substitute the data.
  2. T≤F+1=3<4
  3. P(T=4)=0; P(T≤4)=1
  4. Combine the preceding results to obtain the answer.
Do it on the calculator
02

When to use it

Enter the marked-token count S and unmarked-token count F separately. For uniform draws without replacement, find the probability of first success exactly at draw k and by draw k.

Input order

  • A=S
  • B=F
  • C=k
  • Enter every required value, including 0; blank EXE is not zero. Read each result in order; an error code is not a probability.

Output order

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

Conditions and limitations

  • S,F∈ℤ; 0≤S,F≤99; S+F>0
  • k∈ℤ; 1≤k≤S+F
  • S=0 ⇒ (0,0); (S>0)∧(k>F+1) ⇒ (0,1)
  • k>F ⇒ C(F,k)=0
  • All remaining tokens are equally likely at each draw. The target category stays fixed; there is no replacement.
  • Invalid, blank or noninteger input gives −9. With no marked token both probabilities are 0. Once k exceeds F+1 and S>0, the outputs are 0 and 1.
  • The angle unit does not affect these calculations; the illustrated runs use Deg.
  • All used registers and Ans may be overwritten. Enter every required value again for each run.
  • 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.