educative.io

Educative

Empty set description is confusing

I really can’t wrap my head around a phrase “0’ sum can always be found through an empty set”. Why do we have T for all sets when sum is 0? I do understand that it’s necessary for correct solution, but can’t get it intuitively.


Course: Grokking the Coding Interview: Patterns for Coding Questions - Learn Interactively
Lesson: https://www.educative.io/courses/grokking-the-coding-interview/g7QYlD8RwRr

Hi @Artem, thank you for contacting us.

From the definition of sets, we know that an empty set is a subset of each set, and the sum of the empty set is zero. That is why when the sum is zero then the value is set to True because no matter the number of elements in the set, an empty set will be its subset whose sum will be zero. Thus the condition will be satisfied and the result is set to True.

I hope Educative has helped you in your learning :slight_smile: