Answer it
Set operations on two clubs
5 marksYou mark it yourself against the marking points
A school keeps the members of two clubs as sets of names.
chess = {Ana, Ben, Cal, Dev}
robotics = {Cal, Dev, Eli}
(a) State the result of each operation. [3]
- (i) the union of chess and robotics
- (ii) the intersection of chess and robotics
- (iii) chess minus robotics (the difference)
(b) Explain why a set is a better choice than a list for recording who has signed up for a trip, when the program must check whether each new name is already signed up. [2]
[5]