A committee of 5 is to be chosen from a group of 9 people.
Determine the total number of ways this can be accomplished, given that:
(i) Harold and Warren must serve together or not at all, and:
(ii) Lucy and Deanna refuse to serve with each other.
There are six possibilities for the specific four people mentioned: either none on a given committee or one of the following sets: HW, L, D, HWL, HWD. The remaining committee members must come from the other 5 members. The numbers are as follows:
None: C(5,5) = 1
HW: C(5,3) = 10
L: C(5,4) = 5
D: C(5,4) = 5
HWL: C(5,2) = 10
HWD: C(5,2) = 10
So there are 41 possible committees.
Members are designated by 1 thru 5 and HWDL.
DECLARE SUB choose (psn!)
DIM SHARED memb$, cmtee$, ct
memb$ = "12345HWLD"
SUB choose (psn)
IF psn = 1 THEN st = 1
IF psn > 1 THEN
ix = INSTR(memb$, RIGHT$(cmtee$, 1))
st = ix + 1
FOR choice = st TO 9
good = 1
ch$ = MID$(memb$, choice, 1)
IF ch$ = "L" AND INSTR(cmtee$, "D") > 0 THEN good = 0
IF ch$ = "D" AND INSTR(cmtee$, "L") > 0 THEN good = 0
IF good THEN
cmtee$ = cmtee$ + ch$
IF psn = 5 THEN
IF INSTR(cmtee$, "H") > 0 AND INSTR(cmtee$, "W") = 0 THEN good = 0
IF INSTR(cmtee$, "W") > 0 AND INSTR(cmtee$, "H") = 0 THEN good = 0
IF good THEN PRINT cmtee$: ct = ct + 1
choose psn + 1
cmtee$ = LEFT$(cmtee$, psn - 1)
Posted by Charlie
on 2010-05-17 14:51:59