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.

Sets from Cartesian products

Sets from Cartesian products

From the course: Programming Foundations: Discrete Mathematics

Start my 1-month free trial

Sets from Cartesian products

- [Voiceover] Creating sets from Cartesian products. Cartesian products are a result of taking two sets, such as sets A and B, and creating a list of ordered pairs. A more formal definition looks like this. A cross B is equal to the ordered pairs of a comma b, such that little A is an element of set A, and little B is an element of set B. Using this formula, if we have sets A a set of all students at a college, and B, a set of all courses at the college, A times B would be the set of all student and course combinations. To predetermine the number of ordered pairs we can take the cardinality of set A times the cardinality of set B. That gives us the number of ordered pairs. In this example, we will keep it simple and say that we have two students and three possible courses. The cardinality of A is two, the cardinality of B is three, so we will end up with six ordered pairs. To find the Cartesian product of these two sets we start by taking a value from the first set, such as s1, and we…

Contents