Combine more lists in stages
For four collections A, B, C and D, one method is to intersect A with B, then the result with C, then that result with D. Another method computes A ∩ B and C ∩ D independently, then intersects those two intermediate results. Both give the same membership for set-style inputs.
AB = Intersect(A, B)
ABC = Intersect(AB, C)
ABCD = Intersect(ABC, D)
# Another grouping:
AB = Intersect(A, B)
CD = Intersect(C, D)
ABCD = Intersect(AB, CD)The lecture extends this idea to eight lists by combining pairs, then pairs of intermediate results. It is a reusable pattern: break a many-collection task into a sequence of two-collection operations. This need not mean all operations are running at the same time.
The amount of work depends on intermediate sizes. An intersection with few survivors can make later steps smaller. If an intermediate intersection is empty, no element can satisfy all remaining conditions. You can stop an all-lists membership search at that point. Do not make the same inference for a union.
The new fourth subject in the lecture is hypothetical. Our supplied score cards contain Mathematics, Physics and Chemistry; we do not invent Biology marks. The extra-list example explains the algorithm pattern, not a new field in the dataset.
Try it yourself
If A ∩ B is [], can intersecting it with C create a common member?
Show explained answer
No. Intersecting an empty collection with anything remains empty.
Try it yourself
Must eight input lists be handled by eight nested loops?
Show explained answer
No. Repeated pairwise intersections can reuse stored intermediate results.
Try it yourself
Does changing grouping always leave list order identical?
Show explained answer
Not necessarily. Set membership is unchanged under correct intersection, but output sequence depends on the implementation and duplicate policy.
