From the course: Programming Foundations: Discrete Mathematics
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Set operations
From the course: Programming Foundations: Discrete Mathematics
Set operations
- [Voiceover] Now that we've defined a set and reviewed the set notation, we can move on to Set Operations. In the Exercises file, there is a folder that contains several reference materials, including a list of all the set operations and laws used in this movie. Use that as a reference when you try the challenge for this section. In set theory, we'll use the following operations: Set Intersection. It's written as A intersects B and the formal notation says that the result of the intersection of sets A and B is the set of all values X such that X is an element of A, and X is an element of B. Set Union is A union B. And this definition says the set of all values X, where X is an element of A, or X is an element of B, or both. Next, we have Set Difference, which takes the elements in set A minus the elements in set B. The formal definition says the set of all values X such that X is an element of A, and X is not an element of B. Set Complement. Set Complement is written as A with a line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.