083Mathematics · Counting and probability

Group selection with count bounds

Group selection with count bounds

Group selection with count bounds · W

  • 107 bytes
  • COMP mode
01

Worked examples

Example 1

A school environmental team has 3 girls and 5 boys. A group of 4 distinct students is chosen for a contest. At least 2 must be girls. How many different teams can be formed?

  1. A.20
  2. B.30
  3. C.35
  4. D.70
Answer
C — W=35 teams.
Standard solution (without a calculator)
  1. Identify the categories: Let A=3 girls and B=5 boys; choose C=4 with D=2 and X=3 girls.
  2. List feasible cases: The girl count r can be 2 or 3. The cases do not overlap.
  3. Count each case: For r=2, C(3,2)C(5,2)=3×10=30; for r=3, C(3,3)C(5,1)=1×5=5.
  4. Add and choose: W=30+5=35 teams, option C.
Do it on the calculator

Example 2

A delegation has 4 teachers and 6 students. A group of 3 distinct representatives is chosen, with at most 1 teacher. How many selections are possible?

  1. A.60
  2. B.80
  3. C.100
  4. D.120
Answer
B — W=80 selections.
Standard solution (without a calculator)
  1. Set the bound: The teachers are category A=4 and students B=6. Choose C=3, with D=0 and X=1 teacher.
  2. Count no teacher: C(4,0)C(6,3)=1×20=20.
  3. Count one teacher: C(4,1)C(6,2)=4×15=60.
  4. Add and choose: W=20+60=80 selections, option B.
Do it on the calculator

Example 3

A centre has 4 staff and 8 volunteers, all distinct. A group of 5 people is selected with exactly 2 staff. Find the number of valid groups and, if all five-person groups are equally likely, the probability of exactly 2 staff.

Answer
W=336 groups; p=14/33.
Standard solution (without a calculator)
  1. Apply the exact bound: Let A=4 staff, B=8 volunteers and C=5. Exactly 2 staff means D=X=2.
  2. Count valid groups: Choose C(4,2)=6 staff pairs and C(8,3)=56 volunteer triples, giving W=6×56=336.
  3. Count all groups: C(12,5)=792 equally likely groups of five can be formed.
  4. Find the probability separately: p=336/792=14/33≈0.424242424. The program displays W=336; the denominator and probability require separate work.
Do it on the calculator
02

When to use it

For A distinct members in a target category and B in the other, selecting C without order gives W=Σ C(A,r)C(B,C−r) over the permitted target counts r. The program clips the entered bounds to feasible counts and totals the combinations.

Enter the two categories and bounds

  • At A?, enter the size of the category whose selected count is restricted; at B?, enter the other category size. At C?, enter the total group size, at D? the minimum target count, and at X? the maximum. All are counts, with each person or object distinct.
  • For “at least L”, enter D=L and X=A; for “at most U”, enter D=0 and X=U; for “exactly r”, enter D=X=r. Type 0 explicitly: a blank EXE may reuse an earlier variable value.

Read the group count

  • The single final display is W, the number of valid unordered groups. It is not a probability. If the question asks for probability and every group of size C is equally likely, divide W separately by C(A+B,C).
  • The program limits r to max(0,D,C−B) through min(A,X,C). If no r is feasible, W=0; the empty group gives W=1 only when the bounds permit r=0. Record W and press AC.

Question types

  • Original HKDSE Mathematics Compulsory Part counting practice: teams with at least, at most or exactly a stated number from one category, and a separate probability calculation from equally likely selections.

Before you start

  • Use COMP and an empty P1 with at least 107 bytes; P1–P4 share 680 bytes. The program can overwrite A,B,C,D,X,M,Y and Ans. Save needed stored values first. No special angle setting is needed.
  • A,B,C must be nonnegative whole-number counts. D and X must be whole-number bounds; their absolute values must stay below 10^10 for the nCr validity checks. Invalid counts cause Math ERROR rather than a legitimate answer of 0.
  • The method counts only two categories of distinct people or objects and ignores selection order. It does not count arrangements, repeated picks or simultaneous restrictions on more than one category.
  • D can be negative or X can exceed A or C: the program clips the effective range. An empty valid range has W=0. If C=0 and the bounds include 0, the empty group counts as one selection.
  • The LCD shows at most ten significant digits. A displayed large count, particularly 10,000,000,000 or more, must not be assumed to be an exact integer; very large combinations may cause Math ERROR.
  • The program displays only W. For an equally likely random group, calculate W/C(A+B,C) outside this program and give a simplified fraction when possible.

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.