My Digital Garden

Sets Basics

Membership

A set is made up of elements.

e.g.

A={dog,cat,hamster}A = \lbrace dog, cat, hamster \rbrace

dogAdog \enspace\in\enspace A

elephantAelephant \enspace\notin\enspace A

Cardinality

The cardinality of a set is the number of elements

e.g. A=3|A| = 3

Intersection

The elements that are in both sets

e.g.

A={dog,cat,hamster}A = \lbrace dog, cat, hamster \rbrace

B={dog,helicopter,dinosaur}B = \lbrace dog, helicopter, dinosaur \rbrace

AB={dog}A \enspace\cap\enspace B = \lbrace dog \rbrace

Union

All the elements that are in either set
e.g.

A={dog,cat,hamster}A = \lbrace dog, cat, hamster \rbrace

B={dog,helicopter,dinosaur}B = \lbrace dog, helicopter, dinosaur \rbrace

AB={dog,cat,hamster,helicopter,dinosaur}A \enspace\cup\enspace B = \lbrace dog, cat, hamster, helicopter, dinosaur \rbrace

Inclusion-Exclusion formula

AB=A+BAB|A \enspace\cup\enspace B| = |A| + |B| - |A \enspace\cap\enspace B|

Based on course material by Paul Bendich and Daniel Egger from Data Science Maths Skills

Referred in


Copyright

Unless otherwise noted all content on this site is (c) copyright Julian Elve 2020 onwards, released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International licence.

Sets Basics