From the course: Programming Foundations: Discrete Mathematics

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Objects as sets

Objects as sets

From the course: Programming Foundations: Discrete Mathematics

Start my 1-month free trial

Objects as sets

- [Voiceover] Let's start with the building blocks for discrete mathematics, set theory. A set is a way to express a collection of objects. Sets can represent objects in the physical world such as a set of books, a set containing all the colors of the rainbow or even a set of numbers. All sets have a value for the number of items in the set. How many books? And, how many colors are in the rainbow? How many positive odd numbers? This is called the cardinality of a set. The books in this example would have a cardinality of 17. There are seven colors in the rainbow and there's an infinite number of positive odd numbers. Other examples occur all the time around us. How about a set containing the names of your favorite fruits? Or a set that contains a list of the names of all students in a class? Your favorite players on a basketball team? Or even the employees in a company? Let's take a quick review of some of the set properties. It's important to note that the order of elements in a set…

Contents