First success without replacement
First success without replacement
N objects include K targets. Draw uniformly without replacement until the first target. For the given t, find both P(T=t) and P(T≤t), where T is the first successful draw.
- 119 bytes
- COMP mode
Worked examples
Example 1
Original exercise 1. N objects include K targets. Draw uniformly without replacement until the first target. For the given t, find both P(T=t) and P(T≤t), where T is the first successful draw. Data: A=N, total count = 10; B=K, target count = 4; C=t, index = 3.
- (a)Calculate all requested quantities in the stated order. Output order: P(T=t); P(T≤t).
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. P(T=t)=C(N−t,K−1)/C(N,K).
- Written solution: |Ω|=C(10,4)=210.
- P(T=3)=C(7,3)/210=1/6.
- P(T≤3)=1−C(7,4)/210=1−(1/6)=5/6.
- Retain exact fractions in written work; round only the final answer.
Example 2
Original exercise 2. N objects include K targets. Draw uniformly without replacement until the first target. For the given t, find both P(T=t) and P(T≤t), where T is the first successful draw. Data: A=N, total count = 12; B=K, target count = 2; C=t, index = 4.
- (a)Calculate all requested quantities in the stated order. Output order: P(T=t); P(T≤t).
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. P(T=t)=C(N−t,K−1)/C(N,K).
- Written solution: |Ω|=C(12,2)=66.
- P(T=4)=C(8,1)/66=4/33.
- P(T≤4)=1−C(8,2)/66=1−(14/33)=19/33.
- Retain exact fractions in written work; round only the final answer.
Example 3
Original exercise 3. N objects include K targets. Draw uniformly without replacement until the first target. For the given t, find both P(T=t) and P(T≤t), where T is the first successful draw. Data: A=N, total count = 8; B=K, target count = 3; C=t, index = 6.
- (a)Calculate all requested quantities in the stated order. Output order: P(T=t); P(T≤t).
Answer
Standard solution (without a calculator)
- Build the mathematical model and substitute the data. P(T=t)=C(N−t,K−1)/C(N,K).
- Written solution: |Ω|=C(8,3)=56.
- P(T=6)=C(2,2)/56=1/56.
- P(T≤6)=1−C(2,3)/56=1−(0)=1.
- Retain exact fractions in written work; round only the final answer.
When to use it
N objects include K targets. Draw uniformly without replacement until the first target. For the given t, find both P(T=t) and P(T≤t), where T is the first successful draw.
Input order
- A=N, total count
- B=K, target count
- C=t, index
- 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(T=t)
- P(T≤t)
- Record the value and press EXE.
- The program has ended. Press AC to leave; EXE runs it again.
Conditions and limitations
- N,K,t∈ℤ; 1≤K≤N; 1≤t≤N.
- t>N−K+1 ⇒ P(T=t)=0; P(T≤t)=1.
- K=N ⇒ P(T=1)=1.
- −1: N<1 / K<1 / K>N / t<1 / t>N.
- 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.
Checking access…